/tx can take height+index or hash

This commit is contained in:
Ethan Buchman
2017-04-13 13:47:48 -04:00
parent 23dbd0c8c3
commit df35989742
2 changed files with 32 additions and 16 deletions

View File

@ -19,7 +19,7 @@ var Routes = map[string]*rpc.RPCFunc{
"genesis": rpc.NewRPCFunc(GenesisResult, ""),
"block": rpc.NewRPCFunc(BlockResult, "height"),
"commit": rpc.NewRPCFunc(CommitResult, "height"),
"tx": rpc.NewRPCFunc(TxResult, "hash,prove"),
"tx": rpc.NewRPCFunc(TxResult, "hash,height,index,prove"),
"validators": rpc.NewRPCFunc(ValidatorsResult, ""),
"dump_consensus_state": rpc.NewRPCFunc(DumpConsensusStateResult, ""),
"unconfirmed_txs": rpc.NewRPCFunc(UnconfirmedTxsResult, ""),
@ -100,8 +100,8 @@ func NumUnconfirmedTxsResult() (ctypes.TMResult, error) {
// Tx allow user to query the transaction results. `nil` could mean the
// transaction is in the mempool, invalidated, or was not send in the first
// place.
func TxResult(hash []byte, prove bool) (ctypes.TMResult, error) {
return Tx(hash, prove)
func TxResult(hash []byte, height, index int, prove bool) (ctypes.TMResult, error) {
return Tx(hash, height, index, prove)
}
func BroadcastTxCommitResult(tx []byte) (ctypes.TMResult, error) {