diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 10d73f5b35..548239186e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,7 +32,7 @@ jobs: - uses: golangci/golangci-lint-action@v3 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.45 + version: v1.50.0 args: --timeout 10m github-token: ${{ secrets.GITHUB_TOKEN }} # Check only if there are differences in the source code diff --git a/.golangci.yml b/.golangci.yml index 1007bcfa59..e5b8c80765 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,83 +1,66 @@ run: - tests: false - # timeout for analysis, e.g. 30s, 5m, default is 1m - # timeout: 5m + tests: true + timeout: 10m + sort-results: true + allow-parallel-runners: true + exclude-dir: testutil/testdata_pulsar + concurrency: 4 linters: + disable-all: true enable: - # - bodyclose - - deadcode - depguard - dogsled - - dupl - - errcheck + - exportloopref - goconst - gocritic - - gofmt - - goimports - - revive + - gofumpt - gosec - gosimple - govet - ineffassign - # - lll TODO: enable - misspell - nakedret - - prealloc - - exportloopref + - nolintlint - staticcheck - # - structcheck + - revive - stylecheck - # - typecheck #TODO: enable + - typecheck - unconvert - # - unparam - unused - - varcheck - - nolintlint - - asciicheck - # - exhaustive - - exportloopref - - gofumpt - - gomodguard - # - nestif - # - nlreturn - # - noctx - # - rowserrcheck - # - whitespace - # - wsl issues: exclude-rules: - - path: _test\.go + - text: "Use of weak random number generator" linters: - gosec - - linters: - - lll - source: "https://" - max-same-issues: 50 + - text: "ST1003:" + linters: + - stylecheck + # FIXME: Disabled until golangci-lint updates stylecheck with this fix: + # https://github.com/dominikh/go-tools/issues/389 + - text: "ST1016:" + linters: + - stylecheck + - path: "migrations" + text: "SA1019:" + linters: + - staticcheck + - text: "leading space" + linters: + - nolintlint + + max-issues-per-linter: 10000 + max-same-issues: 10000 linters-settings: dogsled: max-blank-identifiers: 3 - golint: - min-confidence: 0 maligned: + # print struct with more effective memory layout or not, false by default suggest-new: true - misspell: - locale: US nolintlint: allow-unused: false allow-leading-space: true require-explanation: false require-specific: false - gofumpt: - lang-version: "1.18" - gomodguard: - blocked: - versions: # List of blocked module version constraints - - https://github.com/etcd-io/etcd: # Blocked module with version constraint - version: ">= 3.4.10 || ~3.3.23" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons - reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional) - - https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint - version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons - reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional) diff --git a/app/export.go b/app/export.go index 68ff758232..342c1270fd 100644 --- a/app/export.go +++ b/app/export.go @@ -46,7 +46,8 @@ func (app *App) ExportAppStateAndValidators( // prepare for fresh start at zero height // NOTE zero height genesis is a temporary feature which will be deprecated -// in favor of export at a block height +// +// in favor of export at a block height func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { applyAllowedAddrs := false diff --git a/app/state.go b/app/state.go index 43e35453e0..b20306a03a 100644 --- a/app/state.go +++ b/app/state.go @@ -4,8 +4,8 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "math/rand" + "os" "time" sdkmath "cosmossdk.io/math" @@ -58,7 +58,7 @@ func StateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simtypes case config.ParamsFile != "": appParams := make(simtypes.AppParams) - bz, err := ioutil.ReadFile(config.ParamsFile) + bz, err := os.ReadFile(config.ParamsFile) if err != nil { panic(err) } @@ -217,7 +217,7 @@ func StateRandomizedFn( // StateFromGenesisFileFn util function to generate the genesis AppState // from a genesis.json file. func StateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile string) (tmtypes.GenesisDoc, []simtypes.Account) { - bytes, err := ioutil.ReadFile(genesisFile) + bytes, err := os.ReadFile(genesisFile) if err != nil { panic(err) } diff --git a/flake.lock b/flake.lock index d7b951f614..840eab85b7 100644 --- a/flake.lock +++ b/flake.lock @@ -25,15 +25,15 @@ ] }, "locked": { - "lastModified": 1658289959, - "narHash": "sha256-XESwZF/QUFai+qoBRr6fIZVFO6cxjZkf/m6jnqULy20=", - "owner": "yihuang", + "lastModified": 1662501203, + "narHash": "sha256-4BKeqCX2zwgBiTdlc2DjGQ0CttKm0vSw0r/bdFdM/PQ=", + "owner": "nix-community", "repo": "gomod2nix", - "rev": "598c5ab1a677eee3c799e09d23bab8cecb9b1e2f", + "rev": "89cd0675b96775aa3ee86e7c0cf5bc238dd27976", "type": "github" }, "original": { - "owner": "yihuang", + "owner": "nix-community", "repo": "gomod2nix", "type": "github" } @@ -56,16 +56,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1665995262, - "narHash": "sha256-lQb+XKsU/8YAErd7GH4XdxzFUa5TyMG1Bkhhn5O1pFk=", + "lastModified": 1672898480, + "narHash": "sha256-RUgH+9pZJdsxESl6dZrER90O3rH5CwzRH6B5ELUsrCw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ea2c6a6dda1aa35a80139a512a9dee375b0946e7", + "rev": "333feefeae8ecb703180c650f8071efb21cfd7ec", "type": "github" }, "original": { "owner": "NixOS", - "ref": "master", + "ref": "release-22.11", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index cdcda9b081..318eeabbda 100644 --- a/flake.nix +++ b/flake.nix @@ -1,13 +1,13 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/master"; + nixpkgs.url = "github:NixOS/nixpkgs/release-22.11"; flake-utils.url = "github:numtide/flake-utils"; nix-bundle-exe = { url = "github:3noch/nix-bundle-exe"; flake = false; }; gomod2nix = { - url = "github:yihuang/gomod2nix"; + url = "github:nix-community/gomod2nix"; inputs.nixpkgs.follows = "nixpkgs"; inputs.utils.follows = "flake-utils"; }; diff --git a/nix/default.nix b/nix/default.nix index 67b8b784e7..c840c5ce3b 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -17,7 +17,7 @@ import sources.nixpkgs { go-ethereum = pkgs.callPackage ./go-ethereum.nix { inherit (pkgs.darwin) libobjc; inherit (pkgs.darwin.apple_sdk.frameworks) IOKit; - buildGoModule = pkgs.buildGo117Module; + buildGoModule = pkgs.buildGo118Module; }; flake-compat = import sources.flake-compat; chain-maind = pkgs.callPackage sources.chain-main { }; @@ -59,7 +59,7 @@ import sources.nixpkgs { }); }) (_: pkgs: { - cosmovisor = pkgs.buildGo117Module rec { + cosmovisor = pkgs.buildGo118Module rec { name = "cosmovisor"; src = sources.cosmos-sdk + "/cosmovisor"; subPackages = [ "./cmd/cosmovisor" ]; diff --git a/nix/sources.json b/nix/sources.json index 1780045128..bfdc565240 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -52,12 +52,12 @@ "branch": "master", "description": "Convert applications using Go modules to Nix expressions", "homepage": null, - "owner": "yihuang", + "owner": "nix-community", "repo": "gomod2nix", - "rev": "598c5ab1a677eee3c799e09d23bab8cecb9b1e2f", - "sha256": "0vfb1fjrx8vfzqgrk39ilwxlb591kyz4c0dazai5cl6hbxjb0i2w", + "rev": "89cd0675b96775aa3ee86e7c0cf5bc238dd27976", + "sha256": "1x7w9ibp9nxzsaqg9lm6sav0438rwdh76r9pi40hikzn4nl9w4p0", "type": "tarball", - "url": "https://github.com/yihuang/gomod2nix/archive/598c5ab1a677eee3c799e09d23bab8cecb9b1e2f.tar.gz", + "url": "https://github.com/nix-community/gomod2nix/archive/89cd0675b96775aa3ee86e7c0cf5bc238dd27976.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "gravity-bridge": { @@ -97,15 +97,15 @@ "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs": { - "branch": "master", + "branch": "release-22.11", "description": "Nix Packages collection", "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ea2c6a6dda1aa35a80139a512a9dee375b0946e7", - "sha256": "0nd4nn9ryqa80ssw3j2kmr8wa73p2xz1hyxp280cdzqlmdfgw1lm", + "rev": "333feefeae8ecb703180c650f8071efb21cfd7ec", + "sha256": "0b5c5jsi0yd03z8hq2zrn7g0xpa7qjd7ayi924qxn9arvbxhfj25", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/ea2c6a6dda1aa35a80139a512a9dee375b0946e7.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/333feefeae8ecb703180c650f8071efb21cfd7ec.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "rocksdb": { diff --git a/x/cronos/client/cli/tx.go b/x/cronos/client/cli/tx.go index 5ffe969698..8d19826886 100644 --- a/x/cronos/client/cli/tx.go +++ b/x/cronos/client/cli/tx.go @@ -138,12 +138,12 @@ $ %s tx gov submit-legacy-proposal token-mapping-change gravity0x0000...0000 0x0 return err } - title, err := cmd.Flags().GetString(govcli.FlagTitle) + title, err := cmd.Flags().GetString(govcli.FlagTitle) //nolint:staticcheck if err != nil { return err } - description, err := cmd.Flags().GetString(govcli.FlagDescription) + description, err := cmd.Flags().GetString(govcli.FlagDescription) //nolint:staticcheck if err != nil { return err } @@ -197,8 +197,8 @@ $ %s tx gov submit-legacy-proposal token-mapping-change gravity0x0000...0000 0x0 return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } - cmd.Flags().String(govcli.FlagTitle, "", "The proposal title") - cmd.Flags().String(govcli.FlagDescription, "", "The proposal description") + cmd.Flags().String(govcli.FlagTitle, "", "The proposal title") //nolint:staticcheck + cmd.Flags().String(govcli.FlagDescription, "", "The proposal description") //nolint:staticcheck cmd.Flags().String(govcli.FlagDeposit, "", "The proposal deposit") cmd.Flags().String(FlagSymbol, "", "The coin symbol") cmd.Flags().Uint(FlagDecimals, 0, "The coin decimal") diff --git a/x/cronos/keeper/evm_hooks_test.go b/x/cronos/keeper/evm_hooks_test.go index 41ca05b588..908a26aff3 100644 --- a/x/cronos/keeper/evm_hooks_test.go +++ b/x/cronos/keeper/evm_hooks_test.go @@ -26,7 +26,6 @@ func (suite *KeeperTestSuite) TestEvmHooks() { contract := common.BigToAddress(big.NewInt(1)) recipient := common.BigToAddress(big.NewInt(3)) sender := common.BigToAddress(big.NewInt(4)) - denom := "testdenom" testCases := []struct { msg string @@ -148,7 +147,7 @@ func (suite *KeeperTestSuite) TestEvmHooks() { "success send to evm chain", func() { suite.SetupTest() - denom := "gravity0x0000000000000000000000000000000000000000" + denom := denomGravity suite.app.CronosKeeper.SetExternalContractForDenom(suite.ctx, denom, contract) coin := sdk.NewCoin(denom, sdk.NewInt(100)) @@ -186,7 +185,7 @@ func (suite *KeeperTestSuite) TestEvmHooks() { balance = suite.app.BankKeeper.GetBalance(suite.ctx, sdk.AccAddress(contract.Bytes()), denom) suite.Require().Equal(sdk.NewCoin(denom, sdk.NewInt(0)), balance) // query unbatched SendToEthereum message exist - rsp, err := suite.app.GravityKeeper.UnbatchedSendToEthereums(sdk.WrapSDKContext(suite.ctx), &gravitytypes.UnbatchedSendToEthereumsRequest{ + rsp, _ := suite.app.GravityKeeper.UnbatchedSendToEthereums(sdk.WrapSDKContext(suite.ctx), &gravitytypes.UnbatchedSendToEthereumsRequest{ SenderAddress: sdk.AccAddress(sender.Bytes()).String(), }) suite.Require().Equal(1, len(rsp.SendToEthereums)) diff --git a/x/cronos/keeper/evm_test.go b/x/cronos/keeper/evm_test.go index 404eaa58e6..efbd165199 100644 --- a/x/cronos/keeper/evm_test.go +++ b/x/cronos/keeper/evm_test.go @@ -1,9 +1,10 @@ package keeper_test import ( - "github.com/crypto-org-chain/cronos/x/cronos/types" "math/big" + "github.com/crypto-org-chain/cronos/x/cronos/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/evmos/ethermint/crypto/ethsecp256k1" diff --git a/x/cronos/keeper/evmhandlers_test.go b/x/cronos/keeper/evmhandlers_test.go index cfd77f2d8a..03092eda1c 100644 --- a/x/cronos/keeper/evmhandlers_test.go +++ b/x/cronos/keeper/evmhandlers_test.go @@ -21,7 +21,6 @@ import ( func (suite *KeeperTestSuite) TestSendToAccountHandler() { contract := common.BigToAddress(big.NewInt(1)) recipient := common.BigToAddress(big.NewInt(3)) - denom := "testdenom" var data []byte var topics []common.Hash @@ -111,8 +110,8 @@ func (suite *KeeperTestSuite) TestSendToEvmChainHandler() { contract := common.BigToAddress(big.NewInt(1)) sender := common.BigToAddress(big.NewInt(2)) recipient := common.BigToAddress(big.NewInt(3)) - invalidDenom := "testdenom" - validDenom := "gravity0x0000000000000000000000000000000000000000" + invalidDenom := denom + validDenom := denomGravity var data []byte var topics []common.Hash @@ -140,7 +139,7 @@ func (suite *KeeperTestSuite) TestSendToEvmChainHandler() { common.BytesToHash(big.NewInt(1).Bytes()), } - input, err := evmhandlers.SendToEvmChainEvent.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.SendToEvmChainEvent.Inputs.NonIndexed().Pack( coin.Amount.BigInt(), big.NewInt(0), []byte{}, @@ -168,7 +167,7 @@ func (suite *KeeperTestSuite) TestSendToEvmChainHandler() { common.BytesToHash(big.NewInt(100).Bytes()), } - input, err := evmhandlers.SendToEvmChainEvent.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.SendToEvmChainEvent.Inputs.NonIndexed().Pack( coin.Amount.BigInt(), big.NewInt(0), []byte{}, @@ -195,7 +194,7 @@ func (suite *KeeperTestSuite) TestSendToEvmChainHandler() { common.BytesToHash(big.NewInt(1).Bytes()), } - input, err := evmhandlers.SendToEvmChainEvent.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.SendToEvmChainEvent.Inputs.NonIndexed().Pack( coin.Amount.BigInt(), big.NewInt(0), []byte{}, @@ -223,7 +222,7 @@ func (suite *KeeperTestSuite) TestSendToEvmChainHandler() { common.BytesToHash(big.NewInt(1).Bytes()), } - input, err := evmhandlers.SendToEvmChainEvent.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.SendToEvmChainEvent.Inputs.NonIndexed().Pack( coin.Amount.BigInt(), big.NewInt(0), []byte{}, @@ -266,7 +265,7 @@ func (suite *KeeperTestSuite) TestSendToEvmChainHandler() { func (suite *KeeperTestSuite) TestSendToIbcHandler() { contract := common.BigToAddress(big.NewInt(1)) sender := common.BigToAddress(big.NewInt(2)) - invalidDenom := "testdenom" + invalidDenom := denom validDenom := CorrectIbcDenom var data []byte var topics []common.Hash @@ -290,7 +289,7 @@ func (suite *KeeperTestSuite) TestSendToIbcHandler() { topics = []common.Hash{ evmhandlers.SendToIbcEvent.ID, } - input, err := evmhandlers.SendToIbcEvent.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.SendToIbcEvent.Inputs.NonIndexed().Pack( sender, "recipient", coin.Amount.BigInt(), @@ -314,7 +313,7 @@ func (suite *KeeperTestSuite) TestSendToIbcHandler() { topics = []common.Hash{ evmhandlers.SendToIbcEvent.ID, } - input, err := evmhandlers.SendToIbcEvent.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.SendToIbcEvent.Inputs.NonIndexed().Pack( sender, "recipient", coin.Amount.BigInt(), @@ -338,7 +337,7 @@ func (suite *KeeperTestSuite) TestSendToIbcHandler() { topics = []common.Hash{ evmhandlers.SendToIbcEvent.ID, } - input, err := evmhandlers.SendToIbcEvent.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.SendToIbcEvent.Inputs.NonIndexed().Pack( sender, "recipient", coin.Amount.BigInt(), @@ -382,7 +381,7 @@ func (suite *KeeperTestSuite) TestSendToIbcV2Handler() { contract := common.BigToAddress(big.NewInt(1)) sender := common.BigToAddress(big.NewInt(2)) recipient := "recipient" - invalidDenom := "testdenom" + invalidDenom := denom validDenom := CorrectIbcDenom var data []byte var topics []common.Hash @@ -408,7 +407,7 @@ func (suite *KeeperTestSuite) TestSendToIbcV2Handler() { sender.Hash(), common.BytesToHash(big.NewInt(0).Bytes()), } - input, err := evmhandlers.SendToIbcEventV2.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.SendToIbcEventV2.Inputs.NonIndexed().Pack( recipient, coin.Amount.BigInt(), []byte{}, @@ -434,7 +433,7 @@ func (suite *KeeperTestSuite) TestSendToIbcV2Handler() { sender.Hash(), common.BytesToHash(big.NewInt(0).Bytes()), } - input, err := evmhandlers.SendToIbcEventV2.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.SendToIbcEventV2.Inputs.NonIndexed().Pack( recipient, coin.Amount.BigInt(), []byte{}, @@ -460,7 +459,7 @@ func (suite *KeeperTestSuite) TestSendToIbcV2Handler() { sender.Hash(), common.BytesToHash(big.NewInt(0).Bytes()), } - input, err := evmhandlers.SendToIbcEventV2.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.SendToIbcEventV2.Inputs.NonIndexed().Pack( recipient, coin.Amount.BigInt(), []byte{}, @@ -545,7 +544,7 @@ func (suite *KeeperTestSuite) TestSendCroToIbcHandler() { topics = []common.Hash{ evmhandlers.SendCroToIbcEvent.ID, } - input, err := evmhandlers.SendToIbcEvent.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.SendToIbcEvent.Inputs.NonIndexed().Pack( sender, "recipient", coin.Amount.BigInt(), @@ -602,7 +601,7 @@ func (suite *KeeperTestSuite) TestCancelSendToEvmChainHandler() { contract := common.BigToAddress(big.NewInt(1)) sender := common.BigToAddress(big.NewInt(2)) - validDenom := "gravity0x0000000000000000000000000000000000000000" + validDenom := denomGravity var data []byte var topics []common.Hash @@ -627,7 +626,7 @@ func (suite *KeeperTestSuite) TestCancelSendToEvmChainHandler() { evmhandlers.CancelSendToEvmChainEvent.ID, sender.Hash(), } - input, err := evmhandlers.CancelSendToEvmChainEvent.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.CancelSendToEvmChainEvent.Inputs.NonIndexed().Pack( big.NewInt(1), ) data = input @@ -667,7 +666,7 @@ func (suite *KeeperTestSuite) TestCancelSendToEvmChainHandler() { evmhandlers.CancelSendToEvmChainEvent.ID, sender.Hash(), } - input, err := evmhandlers.CancelSendToEvmChainEvent.Inputs.NonIndexed().Pack( + input, _ := evmhandlers.CancelSendToEvmChainEvent.Inputs.NonIndexed().Pack( big.NewInt(int64(resp.Id)), ) data = input diff --git a/x/cronos/keeper/keeper_test.go b/x/cronos/keeper/keeper_test.go index b3adfd2a78..17455f377e 100644 --- a/x/cronos/keeper/keeper_test.go +++ b/x/cronos/keeper/keeper_test.go @@ -30,6 +30,11 @@ import ( "github.com/crypto-org-chain/cronos/app" ) +const ( + denom = "testdenom" + denomGravity = "gravity0x0000000000000000000000000000000000000000" +) + func TestKeeperTestSuite(t *testing.T) { suite.Run(t, new(KeeperTestSuite)) } @@ -92,6 +97,7 @@ func (suite *KeeperTestSuite) DoSetupTest(t *testing.T) { valAddr := sdk.ValAddress(suite.address.Bytes()) validator, err := stakingtypes.NewValidator(valAddr, priv.PubKey(), stakingtypes.Description{}) + require.NoError(t, err) err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) require.NoError(t, err) err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) @@ -118,7 +124,8 @@ func (suite *KeeperTestSuite) MintCoins(address sdk.AccAddress, coins sdk.Coins) } func (suite *KeeperTestSuite) RegisterSourceToken( - contractAddress, symbol string, decimal uint32) error { + contractAddress, symbol string, decimal uint32, +) error { denom := "cronos" + contractAddress msg := types.MsgUpdateTokenMapping{ Denom: denom, @@ -130,8 +137,8 @@ func (suite *KeeperTestSuite) RegisterSourceToken( } func (suite *KeeperTestSuite) TestDenomContractMap() { - denom1 := "testdenom1" - denom2 := "testdenom2" + denom1 := denom + "1" + denom2 := denom + "2" autoContract := common.BigToAddress(big.NewInt(1)) externalContract := common.BigToAddress(big.NewInt(2)) @@ -145,12 +152,12 @@ func (suite *KeeperTestSuite) TestDenomContractMap() { func() { keeper := suite.app.CronosKeeper - contract, found := keeper.GetContractByDenom(suite.ctx, denom1) + _, found := keeper.GetContractByDenom(suite.ctx, denom1) suite.Require().False(found) keeper.SetAutoContractForDenom(suite.ctx, denom1, autoContract) - contract, found = keeper.GetContractByDenom(suite.ctx, denom1) + contract, found := keeper.GetContractByDenom(suite.ctx, denom1) suite.Require().True(found) suite.Require().Equal(autoContract, contract) diff --git a/x/cronos/keeper/params_test.go b/x/cronos/keeper/params_test.go index fcb315fa32..a7cacf94e0 100644 --- a/x/cronos/keeper/params_test.go +++ b/x/cronos/keeper/params_test.go @@ -51,12 +51,12 @@ func (suite *KeeperTestSuite) TestGetSourceChannelID() { ) suite.app.CronosKeeper = cronosKeeper - channelId, err := suite.app.CronosKeeper.GetSourceChannelID(suite.ctx, tc.ibcDenom) + channelID, err := suite.app.CronosKeeper.GetSourceChannelID(suite.ctx, tc.ibcDenom) if tc.expectedError != nil { suite.Require().EqualError(err, tc.expectedError.Error()) } else { suite.Require().NoError(err) - tc.postCheck(channelId) + tc.postCheck(channelID) } }) }