From a41152521bf8f76acd50c6909c5eb4bceaefa32f Mon Sep 17 00:00:00 2001 From: kien6034 Date: Thu, 5 Dec 2024 23:50:53 +0700 Subject: [PATCH] fix lint --- app/app.go | 2 +- app/upgrades/v11/constants.go | 1 - server/middleware_test.go | 2 +- tests/e2e/configurer/base.go | 6 +----- tests/e2e/configurer/chain/node.go | 6 +----- tests/e2e/configurer/setup.go | 11 ++--------- tests/e2e/containers/containers.go | 5 +---- x/tax/handlers/wasm_msg_server.go | 2 +- x/tax/types/genesis.go | 5 +---- x/treasury/keeper/test_utils.go | 1 - 10 files changed, 9 insertions(+), 32 deletions(-) diff --git a/app/app.go b/app/app.go index 919399941..0a6278bc8 100644 --- a/app/app.go +++ b/app/app.go @@ -145,7 +145,7 @@ func init() { // NewTerraApp returns a reference to an initialized TerraApp. func NewTerraApp( - logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, + logger log.Logger, db dbm.DB, _ io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, encodingConfig terraappparams.EncodingConfig, appOpts servertypes.AppOptions, wasmOpts []wasmkeeper.Option, baseAppOptions ...func(*baseapp.BaseApp), ) *TerraApp { diff --git a/app/upgrades/v11/constants.go b/app/upgrades/v11/constants.go index 568995a71..1123e26be 100644 --- a/app/upgrades/v11/constants.go +++ b/app/upgrades/v11/constants.go @@ -1,4 +1,3 @@ -//nolint:revive package v11 import ( diff --git a/server/middleware_test.go b/server/middleware_test.go index 7a37825c3..e1eed7347 100644 --- a/server/middleware_test.go +++ b/server/middleware_test.go @@ -11,7 +11,7 @@ import ( ) // Dummy handler for testing -func dummyHandler(w http.ResponseWriter, r *http.Request) { +func dummyHandler(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusOK) w.Write([]byte("OK")) } diff --git a/tests/e2e/configurer/base.go b/tests/e2e/configurer/base.go index fb61f17a8..6dd496983 100644 --- a/tests/e2e/configurer/base.go +++ b/tests/e2e/configurer/base.go @@ -76,11 +76,7 @@ func (bc *baseConfigurer) RunIBC() error { return err } bc.t.Log("Run relayer 2 between chain b and chain a") - if err := bc.runIBCRelayer(bc.chainConfigs[1], bc.chainConfigs[0], containers.HermesContainerName2); err != nil { - return err - } - - return nil + return bc.runIBCRelayer(bc.chainConfigs[1], bc.chainConfigs[0], containers.HermesContainerName2) } func (bc *baseConfigurer) runIBCRelayer(chainConfigA *chain.Config, chainConfigB *chain.Config, hermesContainerName string) error { diff --git a/tests/e2e/configurer/chain/node.go b/tests/e2e/configurer/chain/node.go index 584318e90..ef4f6c83f 100644 --- a/tests/e2e/configurer/chain/node.go +++ b/tests/e2e/configurer/chain/node.go @@ -76,11 +76,7 @@ func (n *NodeConfig) Run() error { "Terra node failed to produce blocks", ) - if err := n.extractOperatorAddressIfValidator(); err != nil { - return err - } - - return nil + return n.extractOperatorAddressIfValidator() } // Stop stops the node from running and removes its container. diff --git a/tests/e2e/configurer/setup.go b/tests/e2e/configurer/setup.go index 4eea29e7d..0de6f1d25 100644 --- a/tests/e2e/configurer/setup.go +++ b/tests/e2e/configurer/setup.go @@ -3,10 +3,7 @@ package configurer type setupFn func(configurer Configurer) error func baseSetup(configurer Configurer) error { - if err := configurer.RunValidators(); err != nil { - return err - } - return nil + return configurer.RunValidators() } func withIBC(setupHandler setupFn) setupFn { @@ -15,10 +12,6 @@ func withIBC(setupHandler setupFn) setupFn { return err } - if err := configurer.RunIBC(); err != nil { - return err - } - - return nil + return configurer.RunIBC() } } diff --git a/tests/e2e/containers/containers.go b/tests/e2e/containers/containers.go index 8ffbbbd80..1e817646d 100644 --- a/tests/e2e/containers/containers.go +++ b/tests/e2e/containers/containers.go @@ -451,10 +451,7 @@ func (m *Manager) ClearResources() error { } } - if err := m.pool.RemoveNetwork(m.network); err != nil { - return err - } - return nil + return m.pool.RemoveNetwork(m.network) } func noRestart(config *docker.HostConfig) { diff --git a/x/tax/handlers/wasm_msg_server.go b/x/tax/handlers/wasm_msg_server.go index 2dd2f2ccc..f77a7d3af 100644 --- a/x/tax/handlers/wasm_msg_server.go +++ b/x/tax/handlers/wasm_msg_server.go @@ -23,7 +23,7 @@ type WasmMsgServer struct { messageServer wasmtypes.MsgServer } -func NewWasmMsgServer(wasmKeeper wasmkeeper.Keeper, treasuryKeeper treasurykeeper.Keeper, taxKeeper taxkeeper.Keeper, bankKeeper bankkeeper.Keeper, messageServer wasmtypes.MsgServer) wasmtypes.MsgServer { +func NewWasmMsgServer(wasmKeeper wasmkeeper.Keeper, treasuryKeeper treasurykeeper.Keeper, taxKeeper taxkeeper.Keeper, bankKeeper bankkeeper.Keeper, _ wasmtypes.MsgServer) wasmtypes.MsgServer { return &WasmMsgServer{ taxKeeper: taxKeeper, wasmKeeper: wasmKeeper, diff --git a/x/tax/types/genesis.go b/x/tax/types/genesis.go index 9fe5618a8..afb880e05 100644 --- a/x/tax/types/genesis.go +++ b/x/tax/types/genesis.go @@ -10,8 +10,5 @@ func DefaultGenesisState() *GenesisState { // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - if err := gs.Params.Validate(); err != nil { - return err - } - return nil + return gs.Params.Validate() } diff --git a/x/treasury/keeper/test_utils.go b/x/treasury/keeper/test_utils.go index bd9d64863..4ad7b4796 100644 --- a/x/treasury/keeper/test_utils.go +++ b/x/treasury/keeper/test_utils.go @@ -334,7 +334,6 @@ func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey cryptotypes.PubKey return msg } -// nolint: unused func setupValidators(t *testing.T) (TestInput, stakingtypes.MsgServer) { input := CreateTestInput(t) stakingMsgSvr := stakingkeeper.NewMsgServerImpl(input.StakingKeeper)