mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-25 09:24:30 +00:00
TxResult includes Tx. /tx only works if indexer active
This commit is contained in:
@@ -160,13 +160,11 @@ func (c *HTTP) Commit(height int) (*ctypes.ResultCommit, error) {
|
||||
return (*tmResult).(*ctypes.ResultCommit), nil
|
||||
}
|
||||
|
||||
func (c *HTTP) Tx(hash []byte, height, index int, prove bool) (*ctypes.ResultTx, error) {
|
||||
func (c *HTTP) Tx(hash []byte, prove bool) (*ctypes.ResultTx, error) {
|
||||
tmResult := new(ctypes.TMResult)
|
||||
query := map[string]interface{}{
|
||||
"height": height,
|
||||
"index": index,
|
||||
"hash": hash,
|
||||
"prove": prove,
|
||||
"hash": hash,
|
||||
"prove": prove,
|
||||
}
|
||||
_, err := c.rpc.Call("tx", query, tmResult)
|
||||
if err != nil {
|
||||
|
||||
@@ -44,7 +44,7 @@ type SignClient interface {
|
||||
Block(height int) (*ctypes.ResultBlock, error)
|
||||
Commit(height int) (*ctypes.ResultCommit, error)
|
||||
Validators() (*ctypes.ResultValidators, error)
|
||||
Tx(hash []byte, height, index int, prove bool) (*ctypes.ResultTx, error)
|
||||
Tx(hash []byte, prove bool) (*ctypes.ResultTx, error)
|
||||
}
|
||||
|
||||
// HistoryClient shows us data from genesis to now in large chunks.
|
||||
|
||||
@@ -104,6 +104,6 @@ func (c Local) Validators() (*ctypes.ResultValidators, error) {
|
||||
return core.Validators()
|
||||
}
|
||||
|
||||
func (c Local) Tx(hash []byte, height, index int, prove bool) (*ctypes.ResultTx, error) {
|
||||
return core.Tx(hash, height, index, prove)
|
||||
func (c Local) Tx(hash []byte, prove bool) (*ctypes.ResultTx, error) {
|
||||
return core.Tx(hash, prove)
|
||||
}
|
||||
|
||||
@@ -133,8 +133,8 @@ func TestAppCalls(t *testing.T) {
|
||||
}
|
||||
|
||||
// make sure we can lookup the tx with proof
|
||||
// ptx, err := c.Tx(bres.TxID, txh, 0, true)
|
||||
ptx, err := c.Tx(bres.TxID, 0, 0, true)
|
||||
// ptx, err := c.Tx(bres.TxID, true)
|
||||
ptx, err := c.Tx(bres.TxID, true)
|
||||
require.Nil(err, "%d: %+v", i, err)
|
||||
assert.Equal(txh, ptx.Height)
|
||||
assert.Equal(types.Tx(tx), ptx.Tx)
|
||||
|
||||
Reference in New Issue
Block a user