@@ -770,11 +770,11 @@ func (app *BaseApp) beginBlock(_ *abci.RequestFinalizeBlock) (sdk.BeginBlock, er
770
770
return resp , nil
771
771
}
772
772
773
- func (app * BaseApp ) deliverTx (tx []byte , txIndex int ) * abci.ExecTxResult {
774
- return app .deliverTxWithMultiStore (tx , txIndex , nil , nil )
773
+ func (app * BaseApp ) deliverTx (tx []byte , memTx sdk. Tx , txIndex int ) * abci.ExecTxResult {
774
+ return app .deliverTxWithMultiStore (tx , memTx , txIndex , nil , nil )
775
775
}
776
776
777
- func (app * BaseApp ) deliverTxWithMultiStore (tx []byte , txIndex int , txMultiStore storetypes.MultiStore , incarnationCache map [string ]any ) * abci.ExecTxResult {
777
+ func (app * BaseApp ) deliverTxWithMultiStore (tx []byte , memTx sdk. Tx , txIndex int , txMultiStore storetypes.MultiStore , incarnationCache map [string ]any ) * abci.ExecTxResult {
778
778
gInfo := sdk.GasInfo {}
779
779
resultStr := "successful"
780
780
@@ -787,7 +787,7 @@ func (app *BaseApp) deliverTxWithMultiStore(tx []byte, txIndex int, txMultiStore
787
787
telemetry .SetGauge (float32 (gInfo .GasWanted ), "tx" , "gas" , "wanted" )
788
788
}()
789
789
790
- gInfo , result , anteEvents , err := app .runTxWithMultiStore (execModeFinalize , tx , txIndex , txMultiStore , incarnationCache )
790
+ gInfo , result , anteEvents , err := app .runTxWithMultiStore (execModeFinalize , tx , memTx , txIndex , txMultiStore , incarnationCache )
791
791
if err != nil {
792
792
resultStr = "failed"
793
793
resp = sdkerrors .ResponseExecTxResultWithEvents (
@@ -845,10 +845,17 @@ func (app *BaseApp) endBlock(_ context.Context) (sdk.EndBlock, error) {
845
845
// returned if the tx does not run out of gas and if all the messages are valid
846
846
// and execute successfully. An error is returned otherwise.
847
847
func (app * BaseApp ) runTx (mode execMode , txBytes []byte ) (gInfo sdk.GasInfo , result * sdk.Result , anteEvents []abci.Event , err error ) {
848
- return app .runTxWithMultiStore (mode , txBytes , - 1 , nil , nil )
848
+ return app .runTxWithMultiStore (mode , txBytes , nil , - 1 , nil , nil )
849
849
}
850
850
851
- func (app * BaseApp ) runTxWithMultiStore (mode execMode , txBytes []byte , txIndex int , txMultiStore storetypes.MultiStore , incarnationCache map [string ]any ) (gInfo sdk.GasInfo , result * sdk.Result , anteEvents []abci.Event , err error ) {
851
+ func (app * BaseApp ) runTxWithMultiStore (
852
+ mode execMode ,
853
+ txBytes []byte ,
854
+ tx sdk.Tx ,
855
+ txIndex int ,
856
+ txMultiStore storetypes.MultiStore ,
857
+ incarnationCache map [string ]any ,
858
+ ) (gInfo sdk.GasInfo , result * sdk.Result , anteEvents []abci.Event , err error ) {
852
859
// NOTE: GasWanted should be returned by the AnteHandler. GasUsed is
853
860
// determined by the GasMeter. We need access to the context to get the gas
854
861
// meter, so we initialize upfront.
@@ -900,9 +907,11 @@ func (app *BaseApp) runTxWithMultiStore(mode execMode, txBytes []byte, txIndex i
900
907
defer consumeBlockGas ()
901
908
}
902
909
903
- tx , err := app .txDecoder (txBytes )
904
- if err != nil {
905
- return sdk.GasInfo {}, nil , nil , err
910
+ if tx == nil {
911
+ tx , err = app .txDecoder (txBytes )
912
+ if err != nil {
913
+ return sdk.GasInfo {}, nil , nil , err
914
+ }
906
915
}
907
916
908
917
msgs := tx .GetMsgs ()
0 commit comments