feat!: Comet v0.38 Integration (#15519)
Co-authored-by: marbar3778 <marbar3778@yahoo.com> Co-authored-by: cool-developer <51834436+cool-develope@users.noreply.github.com> Co-authored-by: Aaron Craelius <aaron@regen.network> Co-authored-by: Matt Kocubinski <mkocubinski@gmail.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
co-authored by
marbar3778
cool-developer
Aaron Craelius
Matt Kocubinski
Julien Robert
parent
166be3766b
commit
6cee22df52
@@ -16,6 +16,20 @@ import (
|
||||
"cosmossdk.io/core/header"
|
||||
)
|
||||
|
||||
// ExecMode defines the execution mode which can be set on a Context.
|
||||
type ExecMode uint8
|
||||
|
||||
// All possible execution modes.
|
||||
const (
|
||||
ExecModeCheck ExecMode = iota
|
||||
ExecModeReCheck
|
||||
ExecModeSimulate
|
||||
ExecModePrepareProposal
|
||||
ExecModeProcessProposal
|
||||
ExecModeVoteExtension
|
||||
ExecModeFinalize
|
||||
)
|
||||
|
||||
/*
|
||||
Context is an immutable object contains all information needed to
|
||||
process a request.
|
||||
@@ -40,6 +54,7 @@ type Context struct {
|
||||
blockGasMeter storetypes.GasMeter
|
||||
checkTx bool
|
||||
recheckTx bool // if recheckTx == true, then checkTx must also be true
|
||||
execMode ExecMode
|
||||
minGasPrice DecCoins
|
||||
consParams cmtproto.ConsensusParams
|
||||
eventManager EventManagerI
|
||||
@@ -67,6 +82,7 @@ func (c Context) GasMeter() storetypes.GasMeter { return c.gasMe
|
||||
func (c Context) BlockGasMeter() storetypes.GasMeter { return c.blockGasMeter }
|
||||
func (c Context) IsCheckTx() bool { return c.checkTx }
|
||||
func (c Context) IsReCheckTx() bool { return c.recheckTx }
|
||||
func (c Context) ExecMode() ExecMode { return c.execMode }
|
||||
func (c Context) MinGasPrices() DecCoins { return c.minGasPrice }
|
||||
func (c Context) EventManager() EventManagerI { return c.eventManager }
|
||||
func (c Context) Priority() int64 { return c.priority }
|
||||
@@ -229,6 +245,7 @@ func (c Context) WithTransientKVGasConfig(gasConfig storetypes.GasConfig) Contex
|
||||
// WithIsCheckTx enables or disables CheckTx value for verifying transactions and returns an updated Context
|
||||
func (c Context) WithIsCheckTx(isCheckTx bool) Context {
|
||||
c.checkTx = isCheckTx
|
||||
c.execMode = ExecModeCheck
|
||||
return c
|
||||
}
|
||||
|
||||
@@ -239,6 +256,13 @@ func (c Context) WithIsReCheckTx(isRecheckTx bool) Context {
|
||||
c.checkTx = true
|
||||
}
|
||||
c.recheckTx = isRecheckTx
|
||||
c.execMode = ExecModeReCheck
|
||||
return c
|
||||
}
|
||||
|
||||
// WithExecMode returns a Context with an updated ExecMode.
|
||||
func (c Context) WithExecMode(m ExecMode) Context {
|
||||
c.execMode = m
|
||||
return c
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user