mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-23 17:51:39 +00:00
add optional 'prove' flag to /tx
This commit is contained in:
@ -4,9 +4,10 @@ import (
|
||||
"fmt"
|
||||
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
func Tx(hash []byte) (*ctypes.ResultTx, error) {
|
||||
func Tx(hash []byte, prove bool) (*ctypes.ResultTx, error) {
|
||||
r, err := txIndexer.Tx(hash)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -19,10 +20,16 @@ func Tx(hash []byte) (*ctypes.ResultTx, error) {
|
||||
block := blockStore.LoadBlock(int(r.Height))
|
||||
tx := block.Data.Txs[int(r.Index)]
|
||||
|
||||
var proof types.TxProof
|
||||
if prove {
|
||||
proof = block.Data.Txs.Proof(int(r.Index))
|
||||
}
|
||||
|
||||
return &ctypes.ResultTx{
|
||||
Height: r.Height,
|
||||
Index: r.Index,
|
||||
DeliverTx: r.DeliverTx,
|
||||
Tx: tx,
|
||||
Proof: proof,
|
||||
}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user