diff --git a/app/app.go b/app/app.go index 060bcd86..2d7a0cd3 100644 --- a/app/app.go +++ b/app/app.go @@ -22,7 +22,6 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -38,7 +37,6 @@ import ( servertypes "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth/ante" @@ -429,14 +427,3 @@ type EmptyAppOptions struct{} func (ao EmptyAppOptions) Get(_ string) interface{} { return nil } - -// noOpTxFeeChecker is an ante TxFeeChecker for the DeductFeeDecorator, see x/auth/ante/fee.go, -// it performs a no-op by not checking tx fees and always returns a zero tx priority -func noOpTxFeeChecker(_ sdk.Context, tx sdk.Tx) (sdk.Coins, int64, error) { - feeTx, ok := tx.(sdk.FeeTx) - if !ok { - return nil, 0, errorsmod.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx") - } - - return feeTx.GetFee(), 0, nil -} diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 3953c389..7f42de2c 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -284,12 +284,12 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino //nolint: staticcheck // SA1019: moduletypes.ParamKeyTable is deprecated paramsKeeper.Subspace(authtypes.ModuleName).WithKeyTable(authtypes.ParamKeyTable()) paramsKeeper.Subspace(stakingtypes.ModuleName).WithKeyTable(stakingtypes.ParamKeyTable()) - paramsKeeper.Subspace(banktypes.ModuleName).WithKeyTable(banktypes.ParamKeyTable()) //nolint: staticcheck // SA1019 - paramsKeeper.Subspace(minttypes.ModuleName).WithKeyTable(minttypes.ParamKeyTable()) //nolint: staticcheck // SA1019 - paramsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable()) //nolint: staticcheck // SA1019 - paramsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()) //nolint: staticcheck // SA1019 - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint: staticcheck // SA1019 - paramsKeeper.Subspace(crisistypes.ModuleName).WithKeyTable(crisistypes.ParamKeyTable()) //nolint: staticcheck // SA1019 + paramsKeeper.Subspace(banktypes.ModuleName).WithKeyTable(banktypes.ParamKeyTable()) //nolint:staticcheck // SA1019 + paramsKeeper.Subspace(minttypes.ModuleName).WithKeyTable(minttypes.ParamKeyTable()) //nolint:staticcheck // SA1019 + paramsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable()) //nolint:staticcheck // SA1019 + paramsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()) //nolint:staticcheck // SA1019 + paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint:staticcheck // SA1019 + paramsKeeper.Subspace(crisistypes.ModuleName).WithKeyTable(crisistypes.ParamKeyTable()) //nolint:staticcheck // SA1019 return paramsKeeper } diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index 672d0815..f419495e 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -322,7 +322,7 @@ func (s *IntegrationTestSuite) execBankMultiSend( s.executeAtomoneTxCommand(ctx, c, atomoneCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) } -type txBankSend struct { +type txBankSend struct { //nolint:unused from string to string amt string @@ -331,9 +331,9 @@ type txBankSend struct { expectErr bool } -func (s *IntegrationTestSuite) execBankSendBatch( +func (s *IntegrationTestSuite) execBankSendBatch( //nolint:unused c *chain, - valIdx int, //nolint:unparam + valIdx int, txs ...txBankSend, ) int { sucessBankSendCount := 0 @@ -352,7 +352,7 @@ func (s *IntegrationTestSuite) execBankSendBatch( return sucessBankSendCount } -func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, payee, fees string, expectErr bool) { +func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, payee, fees string, expectErr bool) { //nolint:unused ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -760,7 +760,7 @@ func (s *IntegrationTestSuite) defaultExecValidation(chain *chain, valIdx int) f } } -func (s *IntegrationTestSuite) executeValidatorBond(c *chain, valIdx int, valOperAddress, delegatorAddr, home, delegateFees string) { +func (s *IntegrationTestSuite) executeValidatorBond(c *chain, valIdx int, valOperAddress, delegatorAddr, home, delegateFees string) { //nolint:unused ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -785,86 +785,6 @@ func (s *IntegrationTestSuite) executeValidatorBond(c *chain, valIdx int, valOpe s.T().Logf("%s successfully executed validator bond tx to %s", delegatorAddr, valOperAddress) } -func (s *IntegrationTestSuite) executeTokenizeShares(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("Executing atomoned tx staking tokenize-share %s", c.id) - - atomoneCommand := []string{ - atomonedBinary, - txCommand, - stakingtypes.ModuleName, - "tokenize-share", - valOperAddress, - amount, - delegatorAddr, - fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), - fmt.Sprintf("--%s=%d", flags.FlagGas, 1000000), - "--keyring-backend=test", - fmt.Sprintf("--%s=%s", flags.FlagHome, home), - "--output=json", - "-y", - } - - s.executeAtomoneTxCommand(ctx, c, atomoneCommand, valIdx, s.defaultExecValidation(c, valIdx)) - s.T().Logf("%s successfully executed tokenize share tx from %s", delegatorAddr, valOperAddress) -} - -func (s *IntegrationTestSuite) executeRedeemShares(c *chain, valIdx int, amount, delegatorAddr, home, delegateFees string) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("Executing atomoned tx staking redeem-tokens %s", c.id) - - atomoneCommand := []string{ - atomonedBinary, - txCommand, - stakingtypes.ModuleName, - "redeem-tokens", - amount, - fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), - fmt.Sprintf("--%s=%d", flags.FlagGas, 1000000), - "--keyring-backend=test", - fmt.Sprintf("--%s=%s", flags.FlagHome, home), - "--output=json", - "-y", - } - - s.executeAtomoneTxCommand(ctx, c, atomoneCommand, valIdx, s.defaultExecValidation(c, valIdx)) - s.T().Logf("%s successfully executed redeem share tx for %s", delegatorAddr, amount) -} - -func (s *IntegrationTestSuite) executeTransferTokenizeShareRecord(c *chain, valIdx int, recordID, owner, newOwner, home, txFees string) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("Executing atomoned tx staking transfer-tokenize-share-record %s", c.id) - - atomoneCommand := []string{ - atomonedBinary, - txCommand, - stakingtypes.ModuleName, - "transfer-tokenize-share-record", - recordID, - newOwner, - fmt.Sprintf("--%s=%s", flags.FlagFrom, owner), - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagGasPrices, txFees), - "--keyring-backend=test", - fmt.Sprintf("--%s=%s", flags.FlagHome, home), - "--output=json", - "-y", - } - - s.executeAtomoneTxCommand(ctx, c, atomoneCommand, valIdx, s.defaultExecValidation(c, valIdx)) - s.T().Logf("%s successfully executed transfer tokenize share record for %s", owner, recordID) -} - // signTxFileOnline signs a transaction file using the atomoned tx sign command // the from flag is used to specify the keyring account to sign the transaction // the from account must be registered in the keyring and exist on chain (have a balance or be a genesis account) diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index f36d84b3..0ea05c08 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -620,7 +620,7 @@ func (s *IntegrationTestSuite) writeGovLegProposal(c *chain, height int64, name s.Require().NoError(err) } -func (s *IntegrationTestSuite) writeLiquidStakingParamsUpdateProposal(c *chain, oldParams stakingtypes.Params) { +func (s *IntegrationTestSuite) writeLiquidStakingParamsUpdateProposal(c *chain, oldParams stakingtypes.Params) { //nolint:unused template := ` { "messages": [ diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index f4361a7c..e17b1e86 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -4,7 +4,6 @@ import "fmt" var ( runBankTest = true - runBypassMinFeeTest = true runEncodeTest = true runEvidenceTest = true runFeeGrantTest = true diff --git a/tests/e2e/io.go b/tests/e2e/io.go index 80353bd5..c52e302b 100644 --- a/tests/e2e/io.go +++ b/tests/e2e/io.go @@ -7,7 +7,7 @@ import ( ) // copyFile copy file from src to dst -func copyFile(src, dst string) (int64, error) { //nolint:unparam +func copyFile(src, dst string) (int64, error) { sourceFileStat, err := os.Stat(src) if err != nil { return 0, err diff --git a/tests/e2e/query.go b/tests/e2e/query.go index 45860b80..40c04eea 100644 --- a/tests/e2e/query.go +++ b/tests/e2e/query.go @@ -71,7 +71,7 @@ func queryAtomOneAllBalances(endpoint, addr string) (sdk.Coins, error) { return balancesResp.Balances, nil } -func queryStakingParams(endpoint string) (stakingtypes.QueryParamsResponse, error) { +func queryStakingParams(endpoint string) (stakingtypes.QueryParamsResponse, error) { //nolint:unused body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/params", endpoint)) if err != nil { return stakingtypes.QueryParamsResponse{}, fmt.Errorf("failed to execute HTTP request: %w", err) @@ -126,7 +126,7 @@ func queryDelegatorWithdrawalAddress(endpoint string, delegatorAddr string) (dis return res, nil } -func queryDelegatorTotalRewards(endpoint, delegatorAddr string) (disttypes.QueryDelegationTotalRewardsResponse, error) { +func queryDelegatorTotalRewards(endpoint, delegatorAddr string) (disttypes.QueryDelegationTotalRewardsResponse, error) { //nolint:unused var res disttypes.QueryDelegationTotalRewardsResponse body, err := httpGet(fmt.Sprintf("%s/cosmos/distribution/v1beta1/delegators/%s/rewards", endpoint, delegatorAddr))