comment getContextForAnte(), rename applyTxMode()
This commit is contained in:
parent
47d55bd572
commit
e959478e61
|
@ -493,6 +493,8 @@ func validateBasicTxMsgs(msgs []sdk.Msg) sdk.Error {
|
||||||
return nil
|
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) {
|
func (app *BaseApp) getContextForAnte(mode runTxMode, txBytes []byte) (ctx sdk.Context) {
|
||||||
// Get the context
|
// Get the context
|
||||||
ctx = getState(app, mode).ctx.WithTxBytes(txBytes)
|
ctx = getState(app, mode).ctx.WithTxBytes(txBytes)
|
||||||
|
@ -565,7 +567,7 @@ func getState(app *BaseApp, mode runTxMode) *state {
|
||||||
return app.deliverState
|
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 {
|
if mode != runTxModeSimulate {
|
||||||
return ctx
|
return ctx
|
||||||
}
|
}
|
||||||
|
@ -582,7 +584,7 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte, tx sdk.Tx) (result sdk
|
||||||
var gasWanted int64
|
var gasWanted int64
|
||||||
var msCache sdk.CacheMultiStore
|
var msCache sdk.CacheMultiStore
|
||||||
ctx := app.getContextForAnte(mode, txBytes)
|
ctx := app.getContextForAnte(mode, txBytes)
|
||||||
ctx = app.applyTxMode(ctx, mode)
|
ctx = app.initializeContext(ctx, mode)
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
|
|
Loading…
Reference in New Issue