diff --git a/rpc/core/mempool.go b/rpc/core/mempool.go index f78f9d8b0..c4fc3b1a1 100644 --- a/rpc/core/mempool.go +++ b/rpc/core/mempool.go @@ -89,6 +89,7 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { CheckTx: checkTxR, DeliverTx: deliverTxR, TxID: tx.Hash(), + Height: deliverTxRes.Height, }, nil case <-timer.C: log.Error("failed to include tx") diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index 8f6fb0ab7..f5dc5f1d7 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -75,6 +75,7 @@ type ResultBroadcastTxCommit struct { CheckTx *abci.ResponseCheckTx `json:"check_tx"` DeliverTx *abci.ResponseDeliverTx `json:"deliver_tx"` TxID []byte `json:"tx_id"` + Height int `json:"height"` } type ResultTx struct { diff --git a/state/execution.go b/state/execution.go index 75903d402..802d12c49 100644 --- a/state/execution.go +++ b/state/execution.go @@ -90,11 +90,12 @@ func execBlockOnProxyApp(eventCache types.Fireable, proxyAppConn proxy.AppConnCo // NOTE: if we count we can access the tx from the block instead of // pulling it from the req event := types.EventDataTx{ - Tx: types.Tx(req.GetDeliverTx().Tx), - Data: txResult.Data, - Code: txResult.Code, - Log: txResult.Log, - Error: txError, + Height: block.Height, + Tx: types.Tx(req.GetDeliverTx().Tx), + Data: txResult.Data, + Code: txResult.Code, + Log: txResult.Log, + Error: txError, } types.FireEventTx(eventCache, event) } diff --git a/types/events.go b/types/events.go index aa5896e9b..114979047 100644 --- a/types/events.go +++ b/types/events.go @@ -2,10 +2,10 @@ package types import ( // for registering TMEventData as events.EventData + abci "github.com/tendermint/abci/types" . "github.com/tendermint/go-common" "github.com/tendermint/go-events" "github.com/tendermint/go-wire" - abci "github.com/tendermint/abci/types" ) // Functions to generate eventId strings @@ -73,11 +73,12 @@ type EventDataNewBlockHeader struct { // All txs fire EventDataTx type EventDataTx struct { - Tx Tx `json:"tx"` - Data []byte `json:"data"` - Log string `json:"log"` - Code abci.CodeType `json:"code"` - Error string `json:"error"` // this is redundant information for now + Height int `json:"height"` + Tx Tx `json:"tx"` + Data []byte `json:"data"` + Log string `json:"log"` + Code abci.CodeType `json:"code"` + Error string `json:"error"` // this is redundant information for now } // NOTE: This goes into the replay WAL