add Height to ResultBroadcastTxCommit and EventDataTx

This commit is contained in:
Ethan Buchman
2017-04-12 18:33:48 -04:00
parent 2a59cda77e
commit ffe6d58a58
4 changed files with 15 additions and 11 deletions

View File

@ -89,6 +89,7 @@ func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) {
CheckTx: checkTxR, CheckTx: checkTxR,
DeliverTx: deliverTxR, DeliverTx: deliverTxR,
TxID: tx.Hash(), TxID: tx.Hash(),
Height: deliverTxRes.Height,
}, nil }, nil
case <-timer.C: case <-timer.C:
log.Error("failed to include tx") log.Error("failed to include tx")

View File

@ -75,6 +75,7 @@ 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"` TxID []byte `json:"tx_id"`
Height int `json:"height"`
} }
type ResultTx struct { type ResultTx struct {

View File

@ -90,6 +90,7 @@ func execBlockOnProxyApp(eventCache types.Fireable, proxyAppConn proxy.AppConnCo
// NOTE: if we count we can access the tx from the block instead of // NOTE: if we count we can access the tx from the block instead of
// pulling it from the req // pulling it from the req
event := types.EventDataTx{ event := types.EventDataTx{
Height: block.Height,
Tx: types.Tx(req.GetDeliverTx().Tx), Tx: types.Tx(req.GetDeliverTx().Tx),
Data: txResult.Data, Data: txResult.Data,
Code: txResult.Code, Code: txResult.Code,

View File

@ -2,10 +2,10 @@ package types
import ( import (
// for registering TMEventData as events.EventData // for registering TMEventData as events.EventData
abci "github.com/tendermint/abci/types"
. "github.com/tendermint/go-common" . "github.com/tendermint/go-common"
"github.com/tendermint/go-events" "github.com/tendermint/go-events"
"github.com/tendermint/go-wire" "github.com/tendermint/go-wire"
abci "github.com/tendermint/abci/types"
) )
// Functions to generate eventId strings // Functions to generate eventId strings
@ -73,6 +73,7 @@ type EventDataNewBlockHeader struct {
// All txs fire EventDataTx // All txs fire EventDataTx
type EventDataTx struct { type EventDataTx struct {
Height int `json:"height"`
Tx Tx `json:"tx"` Tx Tx `json:"tx"`
Data []byte `json:"data"` Data []byte `json:"data"`
Log string `json:"log"` Log string `json:"log"`