Browse Source

Merge pull request #453 from tendermint/feature/rename-txid-to-hash

Rename txid to hash
pull/451/head
Ethan Buchman 8 years ago
committed by GitHub
parent
commit
62860e4919
4 changed files with 10 additions and 10 deletions
  1. +1
    -1
      CHANGELOG.md
  2. +2
    -2
      rpc/client/rpc_test.go
  3. +5
    -5
      rpc/core/mempool.go
  4. +2
    -2
      rpc/core/types/responses.go

+ 1
- 1
CHANGELOG.md View File

@ -12,7 +12,7 @@ IMPROVEMENTS:
- CLI now uses Cobra framework - CLI now uses Cobra framework
- TMROOT is now TMHOME (TMROOT will stop working in 0.10.0) - 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 - `/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 - 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) - WAL uses #ENDHEIGHT instead of #HEIGHT (#HEIGHT will stop working in 0.10.0)


+ 2
- 2
rpc/client/rpc_test.go View File

@ -133,8 +133,8 @@ func TestAppCalls(t *testing.T) {
} }
// make sure we can lookup the tx with proof // 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) require.Nil(err, "%d: %+v", i, err)
assert.Equal(txh, ptx.Height) assert.Equal(txh, ptx.Height)
assert.Equal(types.Tx(tx), ptx.Tx) assert.Equal(types.Tx(tx), ptx.Tx)


+ 5
- 5
rpc/core/mempool.go View File

@ -18,7 +18,7 @@ func BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) {
if err != nil { if err != nil {
return nil, fmt.Errorf("Error broadcasting transaction: %v", err) 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 // Returns with the response from CheckTx
@ -36,7 +36,7 @@ func BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) {
Code: r.Code, Code: r.Code,
Data: r.Data, Data: r.Data,
Log: r.Log, Log: r.Log,
TxID: tx.Hash(),
Hash: tx.Hash(),
}, nil }, nil
} }
@ -68,7 +68,7 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) {
return &ctypes.ResultBroadcastTxCommit{ return &ctypes.ResultBroadcastTxCommit{
CheckTx: checkTxR, CheckTx: checkTxR,
DeliverTx: nil, DeliverTx: nil,
TxID: tx.Hash(),
Hash: tx.Hash(),
}, nil }, nil
} }
@ -88,7 +88,7 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) {
return &ctypes.ResultBroadcastTxCommit{ return &ctypes.ResultBroadcastTxCommit{
CheckTx: checkTxR, CheckTx: checkTxR,
DeliverTx: deliverTxR, DeliverTx: deliverTxR,
TxID: tx.Hash(),
Hash: tx.Hash(),
Height: deliverTxRes.Height, Height: deliverTxRes.Height,
}, nil }, nil
case <-timer.C: case <-timer.C:
@ -96,7 +96,7 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) {
return &ctypes.ResultBroadcastTxCommit{ return &ctypes.ResultBroadcastTxCommit{
CheckTx: checkTxR, CheckTx: checkTxR,
DeliverTx: nil, DeliverTx: nil,
TxID: tx.Hash(),
Hash: tx.Hash(),
}, fmt.Errorf("Timed out waiting for transaction to be included in a block") }, fmt.Errorf("Timed out waiting for transaction to be included in a block")
} }


+ 2
- 2
rpc/core/types/responses.go View File

@ -84,13 +84,13 @@ type ResultBroadcastTx struct {
Data []byte `json:"data"` Data []byte `json:"data"`
Log string `json:"log"` Log string `json:"log"`
TxID []byte `json:"tx_id"`
Hash []byte `json:"hash"`
} }
type ResultBroadcastTxCommit struct { type ResultBroadcastTxCommit struct {
CheckTx *abci.ResponseCheckTx `json:"check_tx"` CheckTx *abci.ResponseCheckTx `json:"check_tx"`
DeliverTx *abci.ResponseDeliverTx `json:"deliver_tx"` DeliverTx *abci.ResponseDeliverTx `json:"deliver_tx"`
TxID []byte `json:"tx_id"`
Hash []byte `json:"hash"`
Height int `json:"height"` Height int `json:"height"`
} }


Loading…
Cancel
Save