@@ -14,6 +14,14 @@ import (
1414 wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
1515)
1616
17+ var (
18+ DefaultIsAppSimulation = false
19+ )
20+
21+ func updateAppSimulationFlag (flag bool ) {
22+ DefaultIsAppSimulation = flag
23+ }
24+
1725// HandlerOptions extends the SDK's AnteHandler options by requiring the IBC
1826// channel keeper.
1927type HandlerOptions struct {
@@ -23,23 +31,21 @@ type HandlerOptions struct {
2331 TxCounterStoreKey sdk.StoreKey
2432 WasmConfig wasmTypes.WasmConfig
2533 Cdc codec.BinaryCodec
26- IsSims bool
2734}
2835
2936type MinCommissionDecorator struct {
30- cdc codec.BinaryCodec
31- isSims bool
37+ cdc codec.BinaryCodec
3238}
3339
34- func NewMinCommissionDecorator (cdc codec.BinaryCodec , isSims bool ) MinCommissionDecorator {
35- return MinCommissionDecorator {cdc , isSims }
40+ func NewMinCommissionDecorator (cdc codec.BinaryCodec ) MinCommissionDecorator {
41+ return MinCommissionDecorator {cdc }
3642}
3743
3844func (min MinCommissionDecorator ) AnteHandle (
3945 ctx sdk.Context , tx sdk.Tx ,
4046 simulate bool , next sdk.AnteHandler ,
4147) (newCtx sdk.Context , err error ) {
42- if min . isSims {
48+ if DefaultIsAppSimulation {
4349 return next (ctx , tx , simulate )
4450 }
4551
@@ -127,7 +133,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
127133
128134 anteDecorators := []sdk.AnteDecorator {
129135 ante .NewSetUpContextDecorator (), // outermost AnteDecorator. SetUpContext must be called first
130- NewMinCommissionDecorator (options .Cdc , options . IsSims ),
136+ NewMinCommissionDecorator (options .Cdc ),
131137 wasmkeeper .NewLimitSimulationGasDecorator (options .WasmConfig .SimulationGasLimit ),
132138 wasmkeeper .NewCountTXDecorator (options .TxCounterStoreKey ),
133139 ante .NewRejectExtensionOptionsDecorator (),
0 commit comments