Skip to content

Commit

Permalink
feat!: add baseapp method to create a safe context for `ProcessPropos…
Browse files Browse the repository at this point in the history
…al` (#296)

* feat!: new baseapp method to return a branched version of the state that we can use to query in processproposal

* fix!: use existing query context functionalit and re
  • Loading branch information
evan-forbes authored Jan 26, 2023
1 parent 472f7a7 commit eaa987e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,12 @@ func (app *BaseApp) getState(mode runTxMode) *state {
return app.checkState
}

// NewProcessProposalContext returns a context with a branched version of the
// DeliverTx state that is safe to query during ProcessProposal.
func (app *BaseApp) NewProcessProposalQueryContext() (sdk.Context, error) {
return app.createQueryContext(app.cms.LatestVersion(), false)
}

// retrieve the context for the tx w/ txBytes and other memoized values.
func (app *BaseApp) getContextForTx(mode runTxMode, txBytes []byte) sdk.Context {
ctx := app.getState(mode).ctx.
Expand Down

0 comments on commit eaa987e

Please sign in to comment.