diff --git a/app/ante.go b/app/ante.go index 7f4afcaf..098f62ac 100644 --- a/app/ante.go +++ b/app/ante.go @@ -28,7 +28,8 @@ type HandlerOptions struct { IBCKeeper *ibckeeper.Keeper BankKeeper bankkeeper.Keeper TxCounterStoreKey storetypes.StoreKey - WasmConfig wasmtypes.WasmConfig + WasmConfig *wasmtypes.WasmConfig + WasmKeeper *wasmkeeper.Keeper Cdc codec.BinaryCodec StakingKeeper stakingkeeper.Keeper @@ -50,6 +51,10 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") } + if options.WasmConfig == nil { + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder") + } + sigGasConsumer := options.SigGasConsumer if sigGasConsumer == nil { sigGasConsumer = ante.DefaultSigVerificationGasConsumer @@ -60,11 +65,13 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), wasmkeeper.NewCountTXDecorator(options.TxCounterStoreKey), + wasmkeeper.NewGasRegisterDecorator(options.WasmKeeper.GetGasRegister()), ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker), ante.NewValidateBasicDecorator(), ante.NewTxTimeoutHeightDecorator(), ante.NewValidateMemoDecorator(options.AccountKeeper), ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), + ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker), // SetPubKeyDecorator must be called before all signature verification decorators ante.NewSetPubKeyDecorator(options.AccountKeeper), diff --git a/app/app.go b/app/app.go index 8217e740..982c34b7 100644 --- a/app/app.go +++ b/app/app.go @@ -255,7 +255,8 @@ func NewSgeApp( IBCKeeper: app.AppKeepers.IBCKeeper, BankKeeper: app.AppKeepers.BankKeeper, TxCounterStoreKey: app.AppKeepers.GetKey(wasmtypes.StoreKey), - WasmConfig: wasmConfig, + WasmConfig: &wasmConfig, + WasmKeeper: &app.WasmKeeper, Cdc: appCodec, StakingKeeper: *app.AppKeepers.StakingKeeper, diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 5b9728a8..c2a05ba8 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -440,7 +440,7 @@ func NewAppKeeper( ContractDebugMode: false, } - wasmCapabilities := "iterator,staking,stargate" + wasmCapabilities := "iterator,staking,stargate,cosmwasm_1_1" appKeepers.WasmKeeper = wasmkeeper.NewKeeper( appCodec, diff --git a/app/modules.go b/app/modules.go index e3aa6c99..e426a7dd 100644 --- a/app/modules.go +++ b/app/modules.go @@ -90,7 +90,7 @@ var mAccPerms = map[string][]string{ icatypes.ModuleName: nil, // cosmwasm - wasmtypes.ModuleName: {}, + wasmtypes.ModuleName: {authtypes.Burner}, // sge betmoduletypes.BetFeeCollectorFunder{}.GetModuleAcc(): nil, @@ -199,7 +199,15 @@ func appModules( app.BankKeeper, app.interfaceRegistry, ), - wasm.NewAppModule(appCodec, &app.AppKeepers.WasmKeeper, app.AppKeepers.StakingKeeper, app.AppKeepers.AccountKeeper, app.AppKeepers.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), + wasm.NewAppModule( + appCodec, + &app.AppKeepers.WasmKeeper, + app.AppKeepers.StakingKeeper, + app.AppKeepers.AccountKeeper, + app.AppKeepers.BankKeeper, + app.MsgServiceRouter(), + app.GetSubspace(wasmtypes.ModuleName), + ), app.IBCModule, params.NewAppModule(app.ParamsKeeper), app.TransferModule,