From 79b8b250b737f51986a319b17df8da4674f1d5e7 Mon Sep 17 00:00:00 2001 From: StrathCole Date: Sat, 12 Oct 2024 00:30:33 +0200 Subject: [PATCH] - use upstream wasm message server - use empty gas prices for sim tests --- app/modules.go | 3 +-- x/tax/handlers/wasm_msg_server.go | 4 ++++ x/tax/module/module.go | 2 +- x/tax/modules/wasm/wasm_module.go | 5 ++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/modules.go b/app/modules.go index db41590b..90d1fe40 100644 --- a/app/modules.go +++ b/app/modules.go @@ -80,7 +80,6 @@ import ( taxbank "github.com/classic-terra/core/v3/x/tax/modules/bank" taxmarket "github.com/classic-terra/core/v3/x/tax/modules/market" - taxwasm "github.com/classic-terra/core/v3/x/tax/modules/wasm" taxtypes "github.com/classic-terra/core/v3/x/tax/types" // unnamed import of statik for swagger UI support @@ -188,7 +187,7 @@ func appModules( taxmarket.NewAppModule(appCodec, app.MarketKeeper, app.AccountKeeper, app.TreasuryKeeper, app.BankKeeper, app.OracleKeeper, app.TaxKeeper), oracle.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper), treasury.NewAppModule(appCodec, app.TreasuryKeeper), - taxwasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.AccountKeeper, app.TreasuryKeeper, app.TaxKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), + wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), dyncomm.NewAppModule(appCodec, app.DyncommKeeper, app.StakingKeeper), ibchooks.NewAppModule(app.AccountKeeper), consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), diff --git a/x/tax/handlers/wasm_msg_server.go b/x/tax/handlers/wasm_msg_server.go index 243fdc1f..b8e57496 100644 --- a/x/tax/handlers/wasm_msg_server.go +++ b/x/tax/handlers/wasm_msg_server.go @@ -13,6 +13,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +// THIS FILE IS NOT USED CURRENTLY IN THE TAX MODULE +// this is due to the fact that it would cause issues with contracts +// the handling is done in the wasm module / the message handlers a contract executes + type WasmMsgServer struct { wasmtypes.UnimplementedMsgServer taxKeeper taxkeeper.Keeper diff --git a/x/tax/module/module.go b/x/tax/module/module.go index 8f4e9289..5bb6c84e 100644 --- a/x/tax/module/module.go +++ b/x/tax/module/module.go @@ -100,7 +100,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { taxGenesis := types.DefaultGenesis() params := types.DefaultParams() params.BurnTaxRate = sdk.NewDecWithPrec(1, 2) - params.GasPrices = sdk.NewDecCoins(sdk.NewDecCoinFromDec("uluna", sdk.NewDecWithPrec(28325, 4))) + params.GasPrices = sdk.NewDecCoins() // no gas prices because tests always rely on 0 min gas price taxGenesis.Params = params bz, err := json.MarshalIndent(&taxGenesis, "", " ") if err != nil { diff --git a/x/tax/modules/wasm/wasm_module.go b/x/tax/modules/wasm/wasm_module.go index 9777074b..352c54c2 100644 --- a/x/tax/modules/wasm/wasm_module.go +++ b/x/tax/modules/wasm/wasm_module.go @@ -46,7 +46,6 @@ func NewAppModule( cdc codec.Codec, keeper *keeper.Keeper, validatorSetSource keeper.ValidatorSetSource, - ak types.AccountKeeper, accountKeeper types.AccountKeeper, treasuryKeeper treasurykeeper.Keeper, taxKeeper taxkeeper.Keeper, @@ -54,11 +53,11 @@ func NewAppModule( router *baseapp.MsgServiceRouter, ss exported.Subspace, ) AppModule { - bm := wasm.NewAppModule(cdc, keeper, validatorSetSource, ak, bankKeeper, router, ss) + bm := wasm.NewAppModule(cdc, keeper, validatorSetSource, accountKeeper, bankKeeper, router, ss) return AppModule{ AppModule: &bm, keeper: keeper, - accountKeeper: ak, + accountKeeper: accountKeeper, treasuryKeeper: treasuryKeeper, taxKeeper: taxKeeper, bankKeeper: bankKeeper,