cosmos-sdk/baseapp/context.go

24 lines
479 B
Go
Raw Normal View History

2018-01-24 11:47:51 -08:00
package baseapp
import sdk "github.com/cosmos/cosmos-sdk/types"
// NOTE: Unstable.
// Returns a new Context suitable for AnteHandler (and indirectly Handler) processing.
func (app *BaseApp) NewContext(isCheckTx bool, txBytes []byte) sdk.Context {
var store sdk.MultiStore
if isCheckTx {
store = app.msCheck
} else {
store = app.msDeliver
}
// Initialize arguments to Handler.
var ctx = sdk.NewContext(
store,
app.header,
isCheckTx,
txBytes,
)
return ctx
}