mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-25 18:51:39 +00:00
add Height to ResultBroadcastTxCommit and EventDataTx
This commit is contained in:
@ -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")
|
||||||
|
@ -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 {
|
||||||
|
@ -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
|
// 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{
|
||||||
Tx: types.Tx(req.GetDeliverTx().Tx),
|
Height: block.Height,
|
||||||
Data: txResult.Data,
|
Tx: types.Tx(req.GetDeliverTx().Tx),
|
||||||
Code: txResult.Code,
|
Data: txResult.Data,
|
||||||
Log: txResult.Log,
|
Code: txResult.Code,
|
||||||
Error: txError,
|
Log: txResult.Log,
|
||||||
|
Error: txError,
|
||||||
}
|
}
|
||||||
types.FireEventTx(eventCache, event)
|
types.FireEventTx(eventCache, event)
|
||||||
}
|
}
|
||||||
|
@ -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,11 +73,12 @@ type EventDataNewBlockHeader struct {
|
|||||||
|
|
||||||
// All txs fire EventDataTx
|
// All txs fire EventDataTx
|
||||||
type EventDataTx struct {
|
type EventDataTx struct {
|
||||||
Tx Tx `json:"tx"`
|
Height int `json:"height"`
|
||||||
Data []byte `json:"data"`
|
Tx Tx `json:"tx"`
|
||||||
Log string `json:"log"`
|
Data []byte `json:"data"`
|
||||||
Code abci.CodeType `json:"code"`
|
Log string `json:"log"`
|
||||||
Error string `json:"error"` // this is redundant information for now
|
Code abci.CodeType `json:"code"`
|
||||||
|
Error string `json:"error"` // this is redundant information for now
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: This goes into the replay WAL
|
// NOTE: This goes into the replay WAL
|
||||||
|
Reference in New Issue
Block a user