From e959478e61697a446762bf7863bb0fff438f6eca Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 24 Aug 2018 07:34:24 +0100 Subject: [PATCH] comment getContextForAnte(), rename applyTxMode() --- baseapp/baseapp.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 2669aa9f30..2a52b7179f 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -493,6 +493,8 @@ func validateBasicTxMsgs(msgs []sdk.Msg) sdk.Error { return nil } +// retrieve the context for the ante handler and store the tx bytes; store +// the signing validators if the tx runs within the deliverTx() state. func (app *BaseApp) getContextForAnte(mode runTxMode, txBytes []byte) (ctx sdk.Context) { // Get the context ctx = getState(app, mode).ctx.WithTxBytes(txBytes) @@ -565,7 +567,7 @@ func getState(app *BaseApp, mode runTxMode) *state { return app.deliverState } -func (app *BaseApp) applyTxMode(ctx sdk.Context, mode runTxMode) sdk.Context { +func (app *BaseApp) initializeContext(ctx sdk.Context, mode runTxMode) sdk.Context { if mode != runTxModeSimulate { return ctx } @@ -582,7 +584,7 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte, tx sdk.Tx) (result sdk var gasWanted int64 var msCache sdk.CacheMultiStore ctx := app.getContextForAnte(mode, txBytes) - ctx = app.applyTxMode(ctx, mode) + ctx = app.initializeContext(ctx, mode) defer func() { if r := recover(); r != nil {