diff --git a/app/ante.go b/app/ante.go index 34549f245..29e2ed5b6 100644 --- a/app/ante.go +++ b/app/ante.go @@ -1,7 +1,6 @@ package odin import ( - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types" ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" @@ -121,25 +120,47 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { sigGasConsumer = ante.DefaultSigVerificationGasConsumer } + // anteDecorators := []sdk.AnteDecorator{ + // ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first + // NewMinCommissionDecorator(options.Cdc), + // wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), + // wasmkeeper.NewCountTXDecorator(options.TxCounterStoreKey), + // ante.NewRejectExtensionOptionsDecorator(), + // ante.NewMempoolFeeDecorator(), + // ante.NewValidateBasicDecorator(), + // ante.NewTxTimeoutHeightDecorator(), + // ante.NewValidateMemoDecorator(options.AccountKeeper), + // ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), + // ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper), + // // SetPubKeyDecorator must be called before all signature verification decorators + // ante.NewSetPubKeyDecorator(options.AccountKeeper), + // ante.NewValidateSigCountDecorator(options.AccountKeeper), + // ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer), + // ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), + // ante.NewIncrementSequenceDecorator(options.AccountKeeper), + // ibcante.NewAnteDecorator(options.IBCKeeper), + // } + anteDecorators := []sdk.AnteDecorator{ - ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first - NewMinCommissionDecorator(options.Cdc), - wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), - wasmkeeper.NewCountTXDecorator(options.TxCounterStoreKey), - ante.NewRejectExtensionOptionsDecorator(), - ante.NewMempoolFeeDecorator(), + ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first(), + ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker), ante.NewValidateBasicDecorator(), ante.NewTxTimeoutHeightDecorator(), ante.NewValidateMemoDecorator(options.AccountKeeper), ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), - ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper), + ante.NewDeductFeeDecorator( + options.AccountKeeper, + options.BankKeeper, + options.FeegrantKeeper, + options.TxFeeChecker, + ), // SetPubKeyDecorator must be called before all signature verification decorators ante.NewSetPubKeyDecorator(options.AccountKeeper), ante.NewValidateSigCountDecorator(options.AccountKeeper), ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer), ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), ante.NewIncrementSequenceDecorator(options.AccountKeeper), - ibcante.NewAnteDecorator(options.IBCKeeper), + ibcante.NewRedundantRelayDecorator(options.IBCKeeper), } return sdk.ChainAnteDecorators(anteDecorators...), nil diff --git a/app/genesis.go b/app/genesis.go index c2e2a915b..066ff8708 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -13,7 +13,7 @@ import ( icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" ibctypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibchost "github.com/cosmos/ibc-go/v7/modules/core/24-host" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" @@ -42,6 +42,7 @@ import ( coinswaptypes "github.com/ODIN-PROTOCOL/odin-core/x/coinswap/types" minttypes "github.com/ODIN-PROTOCOL/odin-core/x/mint/types" oracletypes "github.com/ODIN-PROTOCOL/odin-core/x/oracle/types" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) // GenesisState defines a type alias for the Odin genesis application state. @@ -56,7 +57,7 @@ func NewDefaultGenesisState() GenesisState { stakingGenesis := stakingtypes.DefaultGenesisState() distrGenesis := distrtypes.DefaultGenesisState() mintGenesis := minttypes.DefaultGenesisState() - govGenesis := govtypes.DefaultGenesisState() + govGenesis := govv1.DefaultGenesisState() crisisGenesis := crisistypes.DefaultGenesisState() slashingGenesis := slashingtypes.DefaultGenesisState() oracleGenesis := oracletypes.DefaultGenesisState() @@ -71,7 +72,9 @@ func NewDefaultGenesisState() GenesisState { mintGenesis.Params.MintDenom = denom mintGenesis.Params.MintAir = true - govGenesis.DepositParams.MinDeposit = sdk.NewCoins(sdk.NewCoin(denom, sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction))) + govGenesis.Params.MinDeposit = sdk.NewCoins( + sdk.NewCoin(denom, sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction)), + ) crisisGenesis.ConstantFee = sdk.NewCoin(denom, sdk.TokensFromConsensusPower(10000, sdk.DefaultPowerReduction)) slashingGenesis.Params.SignedBlocksWindow = 30000 // approximately 1 day slashingGenesis.Params.MinSignedPerWindow = sdk.NewDecWithPrec(5, 2) // 5% @@ -91,7 +94,7 @@ func NewDefaultGenesisState() GenesisState { govtypes.ModuleName: cdc.MustMarshalJSON(govGenesis), crisistypes.ModuleName: cdc.MustMarshalJSON(crisisGenesis), slashingtypes.ModuleName: cdc.MustMarshalJSON(slashingGenesis), - ibchost.ModuleName: ibc.AppModuleBasic{}.DefaultGenesis(cdc), + ibcexported.ModuleName: ibc.AppModuleBasic{}.DefaultGenesis(cdc), upgradetypes.ModuleName: upgrade.AppModuleBasic{}.DefaultGenesis(cdc), evidencetypes.ModuleName: evidence.AppModuleBasic{}.DefaultGenesis(cdc), authz.ModuleName: authzmodule.AppModuleBasic{}.DefaultGenesis(cdc), diff --git a/app/wasm_config.go b/app/wasm_config.go index 3c8d237aa..07862a224 100644 --- a/app/wasm_config.go +++ b/app/wasm_config.go @@ -1,7 +1,7 @@ package odin import ( - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" ) const ( @@ -12,14 +12,14 @@ const ( ) // GasRegisterConfig is defaults plus a custom compile amount -func GasRegisterConfig() wasmkeeper.WasmGasRegisterConfig { - gasConfig := wasmkeeper.DefaultGasRegisterConfig() +func GasRegisterConfig() wasmtypes.WasmGasRegisterConfig { + gasConfig := wasmtypes.DefaultGasRegisterConfig() gasConfig.InstanceCost = DefaultInstanceCost gasConfig.CompileCost = DefaultCompileCost return gasConfig } -func NewWasmGasRegister() wasmkeeper.WasmGasRegister { - return wasmkeeper.NewWasmGasRegister(GasRegisterConfig()) +func NewWasmGasRegister() wasmtypes.WasmGasRegister { + return wasmtypes.NewWasmGasRegister(GasRegisterConfig()) }