From ca1824b4150410e968b68bcac9a543c36b5fecb7 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Fri, 11 Mar 2022 17:24:02 -0500 Subject: [PATCH] update substPrepareTx --- abci/example/kvstore/kvstore.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index 1bc102cf4..66c2dbaf6 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -430,8 +430,9 @@ func (app *Application) execPrepareTx(tx []byte) *types.ExecTxResult { return &types.ExecTxResult{} } -// substPrepareTx subst all the preparetx in the blockdata -// to null string(could be any arbitrary string). +// substPrepareTx substitutes all the transactions prefixed with 'prepare' in the +// proposal for transactions with . It marks all of the substituted transactions as 'REMOVED' so that +// Tendermint will remove them from its mempool. func (app *Application) substPrepareTx(blockData [][]byte) []*types.TxRecord { trs := make([]*types.TxRecord, len(blockData)) for i, tx := range blockData { @@ -441,7 +442,7 @@ func (app *Application) substPrepareTx(blockData [][]byte) []*types.TxRecord { Action: types.TxRecord_REMOVED, }) trs[i] = &types.TxRecord{ - Tx: make([]byte, len(tx)), + Tx: tx[:0], Action: types.TxRecord_ADDED, } continue