diff --git a/CHANGELOG.md b/CHANGELOG.md index 7be3fbc6b..e3d2bfbcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ IMPROVEMENTS: - CLI now uses Cobra framework - TMROOT is now TMHOME (TMROOT will stop working in 0.10.0) -- `/broadcast_tx_XXX` also returns the TxID (can be used to query for the tx) +- `/broadcast_tx_XXX` also returns the Hash (can be used to query for the tx) - `/broadcast_tx_commit` also returns the height the block was committed in - ABCIResponses struct persisted to disk before calling Commit; makes handshake replay much cleaner - WAL uses #ENDHEIGHT instead of #HEIGHT (#HEIGHT will stop working in 0.10.0) diff --git a/rpc/client/rpc_test.go b/rpc/client/rpc_test.go index 18f0f1aab..d9f5d3796 100644 --- a/rpc/client/rpc_test.go +++ b/rpc/client/rpc_test.go @@ -133,8 +133,8 @@ func TestAppCalls(t *testing.T) { } // make sure we can lookup the tx with proof - // ptx, err := c.Tx(bres.TxID, true) - ptx, err := c.Tx(bres.TxID, true) + // ptx, err := c.Tx(bres.Hash, true) + ptx, err := c.Tx(bres.Hash, true) require.Nil(err, "%d: %+v", i, err) assert.Equal(txh, ptx.Height) assert.Equal(types.Tx(tx), ptx.Tx) diff --git a/rpc/core/mempool.go b/rpc/core/mempool.go index c4fc3b1a1..4da83a1f6 100644 --- a/rpc/core/mempool.go +++ b/rpc/core/mempool.go @@ -18,7 +18,7 @@ func BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) { if err != nil { return nil, fmt.Errorf("Error broadcasting transaction: %v", err) } - return &ctypes.ResultBroadcastTx{TxID: tx.Hash()}, nil + return &ctypes.ResultBroadcastTx{Hash: tx.Hash()}, nil } // Returns with the response from CheckTx @@ -36,7 +36,7 @@ func BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) { Code: r.Code, Data: r.Data, Log: r.Log, - TxID: tx.Hash(), + Hash: tx.Hash(), }, nil } @@ -68,7 +68,7 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { return &ctypes.ResultBroadcastTxCommit{ CheckTx: checkTxR, DeliverTx: nil, - TxID: tx.Hash(), + Hash: tx.Hash(), }, nil } @@ -88,7 +88,7 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { return &ctypes.ResultBroadcastTxCommit{ CheckTx: checkTxR, DeliverTx: deliverTxR, - TxID: tx.Hash(), + Hash: tx.Hash(), Height: deliverTxRes.Height, }, nil case <-timer.C: @@ -96,7 +96,7 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { return &ctypes.ResultBroadcastTxCommit{ CheckTx: checkTxR, DeliverTx: nil, - TxID: tx.Hash(), + Hash: tx.Hash(), }, fmt.Errorf("Timed out waiting for transaction to be included in a block") } diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index 940aa433f..7cab8535d 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -84,13 +84,13 @@ type ResultBroadcastTx struct { Data []byte `json:"data"` Log string `json:"log"` - TxID []byte `json:"tx_id"` + Hash []byte `json:"hash"` } type ResultBroadcastTxCommit struct { CheckTx *abci.ResponseCheckTx `json:"check_tx"` DeliverTx *abci.ResponseDeliverTx `json:"deliver_tx"` - TxID []byte `json:"tx_id"` + Hash []byte `json:"hash"` Height int `json:"height"` }