diff --git a/app/app.go b/app/app.go index 132aa6a7..09dbe731 100644 --- a/app/app.go +++ b/app/app.go @@ -43,8 +43,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - - feeburnkeeper "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/x/feeburn/keeper" distr "github.com/cosmos/cosmos-sdk/x/distribution" govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" solomachine "github.com/cosmos/ibc-go/v7/modules/light-clients/06-solomachine" @@ -169,9 +167,7 @@ const ( MockFeePort string = ibcmock.ModuleName + ibcfeetypes.ModuleName ) -var ( - NodeDir = ".migalood" -) +var NodeDir = ".migalood" // These constants are derived from the above variables. // These are the ones we will want to use in the code, based on @@ -293,7 +289,7 @@ type MigalooApp struct { RouterKeeper routerkeeper.Keeper ContractKeeper *wasmkeeper.PermissionedKeeper ConsensusParamsKeeper consensusparamkeeper.Keeper - FeeBurnKeeper feeburnkeeper.Keeper + FeeBurnKeeper feeburnmodulekeeper.Keeper // IBC hooks IBCHooksKeeper *ibchookskeeper.Keeper @@ -928,7 +924,7 @@ func NewMigalooApp( BankKeeper: app.BankKeeper, FeeburnKeeper: &app.FeeBurnKeeper, WasmConfig: &wasmConfig, - TXCounterStoreKey: keys[wasm.StoreKey], + TXCounterStoreKey: keys[wasmtypes.StoreKey], }, ) if err != nil { @@ -1162,14 +1158,11 @@ func (app *MigalooApp) setupUpgradeHandlers() { return } - var storeUpgrades *storetypes.StoreUpgrades - - switch upgradeInfo.Name { - case v4.UpgradeName: + if upgradeInfo.Name == v4.UpgradeName { // !! ATTENTION !! // !! WHEN UPGRADING TO SDK v0.47 MAKE SURE TO INCLUDE THIS // source: https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/UPGRADING.md - storeUpgrades = &storetypes.StoreUpgrades{ + storeUpgrades := &storetypes.StoreUpgrades{ Added: []string{ consensusparamtypes.StoreKey, crisistypes.StoreKey, @@ -1180,9 +1173,6 @@ func (app *MigalooApp) setupUpgradeHandlers() { "intertx", }, } - } - - if storeUpgrades != nil { // configure store loader that checks if version == upgradeHeight and applies store upgrades app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, storeUpgrades)) } @@ -1207,6 +1197,8 @@ func stringMapKeys(m map[string][]string) []string { } // initParamsKeeper init params keeper and its subspaces +// +//nolint:staticcheck // ParamsKeyTable is deprecated but used here for migration func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper { paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) diff --git a/app/sim_test.go b/app/sim_test.go index 478ca50d..2db4ddd5 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -9,7 +9,6 @@ import ( "time" "cosmossdk.io/simapp" - "github.com/CosmWasm/wasmd/x/wasm" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" dbm "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" @@ -192,13 +191,13 @@ func TestAppImportExport(t *testing.T) { {app.keys[ibctransfertypes.StoreKey], newApp.keys[ibctransfertypes.StoreKey], [][]byte{}}, {app.keys[authzkeeper.StoreKey], newApp.keys[authzkeeper.StoreKey], [][]byte{}}, {app.keys[feegrant.StoreKey], newApp.keys[feegrant.StoreKey], [][]byte{}}, - {app.keys[wasm.StoreKey], newApp.keys[wasm.StoreKey], [][]byte{}}, + {app.keys[wasmtypes.StoreKey], newApp.keys[wasmtypes.StoreKey], [][]byte{}}, {app.keys[consensusparamtypes.StoreKey], newApp.keys[consensusparamtypes.StoreKey], [][]byte{}}, {app.keys[crisistypes.StoreKey], newApp.keys[crisistypes.StoreKey], [][]byte{}}, } // delete persistent tx counter value - ctxA.KVStore(app.keys[wasm.StoreKey]).Delete(wasmtypes.TXCounterPrefix) + ctxA.KVStore(app.keys[wasmtypes.StoreKey]).Delete(wasmtypes.TXCounterPrefix) // diff both stores for _, skp := range storeKeysPrefixes { diff --git a/app/test_helpers.go b/app/test_helpers.go index 70e2bbd9..4fda7cb0 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -5,7 +5,6 @@ import ( "testing" "time" - "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" config "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/app/params" dbm "github.com/cometbft/cometbft-db" @@ -34,8 +33,6 @@ const ( SimAppChainID = "" ) -var emptyWasmOpts []wasm.Option - type KeeperTestHelper struct { suite.Suite diff --git a/cmd/migalood/cmd/genaccounts_test.go b/cmd/migalood/cmd/genaccounts_test.go index e356bb9e..a0d3cb92 100644 --- a/cmd/migalood/cmd/genaccounts_test.go +++ b/cmd/migalood/cmd/genaccounts_test.go @@ -3,9 +3,10 @@ package cmd_test import ( "context" "fmt" + "testing" + "github.com/terra-money/alliance/app" alliancecmd "github.com/terra-money/alliance/cmd/allianced/cmd" - "testing" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" diff --git a/cmd/migalood/cmd/root.go b/cmd/migalood/cmd/root.go index 9d798519..1511ca59 100644 --- a/cmd/migalood/cmd/root.go +++ b/cmd/migalood/cmd/root.go @@ -2,13 +2,14 @@ package cmd import ( "errors" - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "io" "os" "path/filepath" + tmtypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + rosettaCmd "cosmossdk.io/tools/rosetta/cmd" "github.com/prometheus/client_golang/prometheus" "github.com/spf13/cast" diff --git a/cmd/migalood/cmd/testnet.go b/cmd/migalood/cmd/testnet.go index e85c3797..2411fe87 100644 --- a/cmd/migalood/cmd/testnet.go +++ b/cmd/migalood/cmd/testnet.go @@ -6,11 +6,12 @@ import ( "bufio" "encoding/json" "fmt" - "github.com/CosmWasm/wasmd/app" "net" "os" "path/filepath" + "github.com/CosmWasm/wasmd/app" + tmconfig "github.com/cometbft/cometbft/config" tmos "github.com/cometbft/cometbft/libs/os" tmrand "github.com/cometbft/cometbft/libs/rand" @@ -103,7 +104,8 @@ func NewTestnetCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBala // testnetInitFilesCmd returns a cmd to initialize all files for tendermint testnet and application func testnetInitFilesCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator, - validator genutiltypes.MessageValidator) *cobra.Command { + validator genutiltypes.MessageValidator, +) *cobra.Command { cmd := &cobra.Command{ Use: "init-files", Short: "Initialize config directories & files for a multi-validator testnet running locally via separate processes (e.g. Docker Compose or similar)", @@ -425,7 +427,6 @@ func collectGenFiles( } nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, *genDoc, genBalIterator, validator) - if err != nil { return err } diff --git a/cmd/migalood/cmd/testnet_test.go b/cmd/migalood/cmd/testnet_test.go index ccce35b8..e333e18d 100644 --- a/cmd/migalood/cmd/testnet_test.go +++ b/cmd/migalood/cmd/testnet_test.go @@ -3,9 +3,10 @@ package cmd import ( "context" "fmt" - "github.com/terra-money/alliance/app" "testing" + "github.com/terra-money/alliance/app" + "github.com/cometbft/cometbft/libs/log" "github.com/spf13/viper" "github.com/stretchr/testify/require" diff --git a/x/feeburn/ante/ante_test.go b/x/feeburn/ante/ante_test.go index 69f1da1d..a8ebb42f 100644 --- a/x/feeburn/ante/ante_test.go +++ b/x/feeburn/ante/ante_test.go @@ -2,21 +2,22 @@ package ante_test import ( "fmt" + "math" + "strconv" + config "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/app/params" "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/x/feeburn/ante" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "math" - "strconv" ) func (suite *AnteTestSuite) TestFeeBurnDecorator() { listTxFeeBurnPercent := []string{"0", "10", "40", "50", "80", "100"} for _, percent := range listTxFeeBurnPercent { fmt.Println("tx fee burn percent", percent) - suite.SetupTest(false) // reset + suite.SetupTest() // reset err1 := suite.App.FeeBurnKeeper.UpdateTxFeeBurnPercent(suite.Ctx, percent) suite.Require().NoError(err1) @@ -24,10 +25,10 @@ func (suite *AnteTestSuite) TestFeeBurnDecorator() { suite.App.FeeBurnKeeper) antehandler := sdk.ChainAnteDecorators(fbd) - priv := ed25519.GenPrivKey() + priv := secp256k1.GenPrivKey() addr := getAddr(priv) accountAddress := sdk.AccAddress(priv.PubKey().Address().Bytes()) - privNew := ed25519.GenPrivKey() + privNew := secp256k1.GenPrivKey() addrRecv := getAddr(privNew) accBalance := sdk.Coins{{Denom: config.BaseDenom, Amount: sdk.NewInt(int64(math.Pow10(18) * 2))}} @@ -56,13 +57,13 @@ func (suite *AnteTestSuite) TestFeeBurnDecorator() { } func (suite *AnteTestSuite) TestFeeBurnDecoratorWhenTxNull() { - suite.SetupTest(false) // reset + suite.SetupTest() // reset fbd := ante.NewDeductFeeDecorator(suite.App.AccountKeeper, suite.App.BankKeeper, suite.App.FeeGrantKeeper, nil, suite.App.FeeBurnKeeper) antehandler := sdk.ChainAnteDecorators(fbd) - priv := ed25519.GenPrivKey() + priv := secp256k1.GenPrivKey() addr := getAddr(priv) accBalance := sdk.Coins{{Denom: config.BaseDenom, Amount: sdk.NewInt(int64(math.Pow10(18) * 2))}} err := suite.FundAccount(suite.Ctx, addr, accBalance) diff --git a/x/feeburn/ante/utils_test.go b/x/feeburn/ante/utils_test.go index ffae622e..b2b80113 100644 --- a/x/feeburn/ante/utils_test.go +++ b/x/feeburn/ante/utils_test.go @@ -1,15 +1,16 @@ package ante_test import ( + "testing" + apptesting "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/app" config "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/app/params" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/ibc-go/v7/testing/simapp" - "testing" "github.com/stretchr/testify/suite" @@ -20,20 +21,19 @@ import ( ) var ( - DEFAULT_FEE int64 = 1000000000000 + DefaultFee int64 = 1000000000000 + s *AnteTestSuite ) -var s *AnteTestSuite // AnteTestSuite is a test suite to be used with ante handler tests. type AnteTestSuite struct { apptesting.KeeperTestHelper anteHandler sdk.AnteHandler clientCtx client.Context - txBuilder client.TxBuilder } // SetupTest setups a new test, with new app, context, and anteHandler. -func (suite *AnteTestSuite) SetupTest(isCheckTx bool) { +func (suite *AnteTestSuite) SetupTest() { suite.Setup(suite.T(), apptesting.SimAppChainID) // Set up TxConfig. @@ -57,13 +57,6 @@ func (suite *AnteTestSuite) SetupTest(isCheckTx bool) { suite.Require().NoError(err) suite.anteHandler = anteHandler - // - //feePoolBalance := sdk.Coins{{Denom: config.BaseDenom, Amount: sdk.NewInt(int64(math.Pow10(18) * 2))}} - // - //err = suite.App.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, feePoolBalance) - //suite.Require().NoError(err) - //err = suite.App.BankKeeper.SendCoinsFromModuleToModule(suite.ctx, minttypes.ModuleName, authtypes.FeeCollectorName, feePoolBalance) - //suite.Require().NoError(err) } func TestAnteTestSuite(t *testing.T) { @@ -71,11 +64,11 @@ func TestAnteTestSuite(t *testing.T) { suite.Run(t, s) } -func getAddr(priv *ed25519.PrivKey) sdk.AccAddress { +func getAddr(priv cryptotypes.PrivKey) sdk.AccAddress { return priv.PubKey().Address().Bytes() } -func prepareCosmosTx(priv *ed25519.PrivKey, msgs ...sdk.Msg) client.TxBuilder { +func prepareCosmosTx(priv cryptotypes.PrivKey, msgs ...sdk.Msg) client.TxBuilder { encodingConfig := config.MakeEncodingConfig() accountAddress := sdk.AccAddress(priv.PubKey().Address().Bytes()) @@ -83,7 +76,7 @@ func prepareCosmosTx(priv *ed25519.PrivKey, msgs ...sdk.Msg) client.TxBuilder { txBuilder.SetGasLimit(1000000) gasPrice := sdk.NewInt(1) - fees := &sdk.Coins{{Denom: config.BaseDenom, Amount: gasPrice.MulRaw(DEFAULT_FEE)}} + fees := &sdk.Coins{{Denom: config.BaseDenom, Amount: gasPrice.MulRaw(DefaultFee)}} txBuilder.SetFeeAmount(*fees) err := txBuilder.SetMsgs(msgs...) s.Require().NoError(err) diff --git a/x/feeburn/client/cli/tx.go b/x/feeburn/client/cli/tx.go index 10aa56b5..ef70eae4 100644 --- a/x/feeburn/client/cli/tx.go +++ b/x/feeburn/client/cli/tx.go @@ -2,6 +2,7 @@ package cli import ( "fmt" + "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" @@ -46,7 +47,7 @@ func NewUpdateTxFeeBurnPercentProposalHandler() *cobra.Command { return err } - description, err := cmd.Flags().GetString(cli.FlagDescription) + description, err := cmd.Flags().GetString(cli.FlagDescription) //nolint:staticcheck // SA1019: govcli.FlagDescription is deprecated if err != nil { return err } diff --git a/x/feeburn/client/proposal_handler.go b/x/feeburn/client/proposal_handler.go index 11135916..b8099426 100644 --- a/x/feeburn/client/proposal_handler.go +++ b/x/feeburn/client/proposal_handler.go @@ -5,6 +5,4 @@ import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" ) -var ( - UpdateTxFeeBurnPercentProposalHandler = govclient.NewProposalHandler(cli.NewUpdateTxFeeBurnPercentProposalHandler) -) +var UpdateTxFeeBurnPercentProposalHandler = govclient.NewProposalHandler(cli.NewUpdateTxFeeBurnPercentProposalHandler) diff --git a/x/feeburn/keeper/grpc_query_test.go b/x/feeburn/keeper/grpc_query_test.go index 424aaa4c..ac0b8d03 100644 --- a/x/feeburn/keeper/grpc_query_test.go +++ b/x/feeburn/keeper/grpc_query_test.go @@ -14,7 +14,8 @@ func TestParamsQuery(t *testing.T) { keeper, ctx := testkeeper.FeeburnKeeper(t) wctx := sdk.WrapSDKContext(ctx) params := types.DefaultParams() - keeper.SetParams(ctx, params) + err := keeper.SetParams(ctx, params) + require.NoError(t, err) response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) require.NoError(t, err) diff --git a/x/feeburn/keeper/integration_test.go b/x/feeburn/keeper/integration_test.go index 0133d943..969a4af4 100644 --- a/x/feeburn/keeper/integration_test.go +++ b/x/feeburn/keeper/integration_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "fmt" + config "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/app/params" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -11,7 +12,7 @@ import ( ) func (suite *KeeperTestSuite) TestBurnFeeCosmosTxDelegate() { - suite.SetupTest(false) + suite.SetupTest() priv0 := secp256k1.GenPrivKey() addr := sdk.AccAddress(priv0.PubKey().Address()) accBalance := sdk.Coins{{Denom: config.BaseDenom, Amount: sdk.NewInt(10000000000000)}} @@ -27,7 +28,6 @@ func (suite *KeeperTestSuite) TestBurnFeeCosmosTxDelegate() { expectAmount := totalSupplyAfter.Amount.Sub(totalSupplyBefore.Amount) expectAmount = mintedCoin.Amount.Sub(expectAmount) fmt.Println("expectAmount", expectAmount) - //s.Require().Equal(getExpectTotalFeeBurn(1), expectAmount) } func delegate(priv cryptotypes.PrivKey, delegateAmount sdk.Coin) { @@ -48,6 +48,7 @@ func deliverTx(priv cryptotypes.PrivKey, msgs ...sdk.Msg) abci.ResponseDeliverTx res := s.App.BaseApp.DeliverTx(req) return res } + func getMintedCoin() sdk.Coin { mintParams := s.App.MintKeeper.GetParams(s.Ctx) return s.App.MintKeeper.GetMinter(s.Ctx).BlockProvision(mintParams) diff --git a/x/feeburn/keeper/keeper.go b/x/feeburn/keeper/keeper.go index 4b5f7a76..77827bdd 100644 --- a/x/feeburn/keeper/keeper.go +++ b/x/feeburn/keeper/keeper.go @@ -43,6 +43,7 @@ func NewKeeper( func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } + func (k Keeper) GetAuthority() string { return k.authority.String() } diff --git a/x/feeburn/keeper/keeper_test.go b/x/feeburn/keeper/keeper_test.go index b42cd5bb..cb3d5859 100644 --- a/x/feeburn/keeper/keeper_test.go +++ b/x/feeburn/keeper/keeper_test.go @@ -1,9 +1,10 @@ package keeper_test import ( + "testing" + apptesting "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/app" config "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/app/params" - "github.com/cometbft/cometbft/crypto/ed25519" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -14,24 +15,22 @@ import ( authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/stretchr/testify/suite" - "testing" ) var ( - DEFAULT_FEE int64 = 1000000000000 + DefaultFee int64 = 1000000000000 + s *KeeperTestSuite ) -var s *KeeperTestSuite // AnteTestSuite is a test suite to be used with ante handler tests. type KeeperTestSuite struct { apptesting.KeeperTestHelper anteHandler sdk.AnteHandler clientCtx client.Context - txBuilder client.TxBuilder } // SetupTest setups a new test, with new app, context, and anteHandler. -func (suite *KeeperTestSuite) SetupTest(isCheckTx bool) { +func (suite *KeeperTestSuite) SetupTest() { suite.Setup(suite.T(), apptesting.SimAppChainID) // Set up TxConfig. @@ -62,10 +61,6 @@ func TestKeeperTestSuite(t *testing.T) { suite.Run(t, s) } -func getAddr(priv *ed25519.PrivKey) sdk.AccAddress { - return priv.PubKey().Address().Bytes() -} - func prepareCosmosTx(priv cryptotypes.PrivKey, msgs ...sdk.Msg) []byte { encodingConfig := config.MakeEncodingConfig() accountAddress := sdk.AccAddress(priv.PubKey().Address().Bytes()) @@ -74,7 +69,7 @@ func prepareCosmosTx(priv cryptotypes.PrivKey, msgs ...sdk.Msg) []byte { txBuilder.SetGasLimit(1000000) gasPrice := sdk.NewInt(1) - fees := &sdk.Coins{{Denom: config.BaseDenom, Amount: gasPrice.MulRaw(DEFAULT_FEE)}} + fees := &sdk.Coins{{Denom: config.BaseDenom, Amount: gasPrice.MulRaw(DefaultFee)}} txBuilder.SetFeeAmount(*fees) err := txBuilder.SetMsgs(msgs...) s.Require().NoError(err) diff --git a/x/feeburn/keeper/msg_server_test.go b/x/feeburn/keeper/msg_server_test.go deleted file mode 100644 index 135792d1..00000000 --- a/x/feeburn/keeper/msg_server_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package keeper_test - -import ( - "context" - "testing" - - keepertest "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/testutil/keeper" - - "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/x/feeburn/keeper" - "github.com/White-Whale-Defi-Platform/migaloo-chain/v3/x/feeburn/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { - k, ctx := keepertest.FeeburnKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) -} diff --git a/x/feeburn/keeper/params_test.go b/x/feeburn/keeper/params_test.go index 8f925733..9a4bcaa0 100644 --- a/x/feeburn/keeper/params_test.go +++ b/x/feeburn/keeper/params_test.go @@ -13,7 +13,7 @@ func TestGetParams(t *testing.T) { k, ctx := testkeeper.FeeburnKeeper(t) params := types.DefaultParams() - k.SetParams(ctx, params) - + err := k.SetParams(ctx, params) + require.NoError(t, err) require.EqualValues(t, params, k.GetParams(ctx)) } diff --git a/x/feeburn/keeper/proposal.go b/x/feeburn/keeper/proposal.go index e19425cb..5370cf09 100644 --- a/x/feeburn/keeper/proposal.go +++ b/x/feeburn/keeper/proposal.go @@ -18,5 +18,4 @@ func (k Keeper) UpdateTxFeeBurnPercent(ctx sdk.Context, newTxFeeBurnPercent stri Params: newParams, }) return err - } diff --git a/x/feeburn/keeper/proposal_test.go b/x/feeburn/keeper/proposal_test.go index 7da29378..f7d014d2 100644 --- a/x/feeburn/keeper/proposal_test.go +++ b/x/feeburn/keeper/proposal_test.go @@ -20,14 +20,14 @@ func (suite *KeeperTestSuite) TestUpdateTxFeeBurnPercent() { for _, tt := range tests { suite.Run(tt.name, func() { - suite.SetupTest(false) + suite.SetupTest() err := suite.App.FeeBurnKeeper.UpdateTxFeeBurnPercent(suite.Ctx, tt.fee) if tt.wantErr { - suite.NotNil(err) + suite.Require().Error(err) } else { - suite.Nil(err) + suite.Require().NoError(err) params := suite.App.FeeBurnKeeper.GetParams(suite.Ctx) - suite.Equal(tt.fee, params.GetTxFeeBurnPercent()) + suite.Require().Equal(tt.fee, params.GetTxFeeBurnPercent()) } }) } diff --git a/x/feeburn/types/proposal.go b/x/feeburn/types/proposal.go index c69b9074..1031da77 100644 --- a/x/feeburn/types/proposal.go +++ b/x/feeburn/types/proposal.go @@ -2,8 +2,9 @@ package types import ( "fmt" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "strconv" + + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) const (