diff --git a/.golangci.yml b/.golangci.yml index aaa8a198a98..7eebeb4578e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -26,6 +26,8 @@ linters: - typecheck - tenv - unconvert + # Prefer unparam over revive's unused param. It is more thorough in its checking. + - unparam - unused - misspell @@ -100,6 +102,9 @@ linters-settings: disabled: true - name: defer disabled: true + # Disabled in favour of unparam. + - name: unused-parameter + disabled: true - name: unhandled-error disabled: false arguments: diff --git a/modules/core/02-client/migrations/v7/store.go b/modules/core/02-client/migrations/v7/store.go index cc6086e206a..d4a86b51841 100644 --- a/modules/core/02-client/migrations/v7/store.go +++ b/modules/core/02-client/migrations/v7/store.go @@ -36,11 +36,11 @@ func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Binar return err } - if err := handleTendermintMigration(ctx, store, cdc, clientKeeper); err != nil { + if err := handleTendermintMigration(ctx, store, clientKeeper); err != nil { return err } - return handleLocalhostMigration(ctx, store, cdc, clientKeeper) + return handleLocalhostMigration(ctx, store, clientKeeper) } // handleSolomachineMigration iterates over the solo machine clients and migrates client state from @@ -82,7 +82,7 @@ func handleSolomachineMigration(ctx sdk.Context, store storetypes.KVStore, cdc c // handlerTendermintMigration asserts that the tendermint client in state can be decoded properly. // This ensures the upgrading chain properly registered the tendermint client types on the chain codec. -func handleTendermintMigration(ctx sdk.Context, store storetypes.KVStore, cdc codec.BinaryCodec, clientKeeper ClientKeeper) error { +func handleTendermintMigration(ctx sdk.Context, store storetypes.KVStore, clientKeeper ClientKeeper) error { clients, err := collectClients(ctx, store, exported.Tendermint) if err != nil { return err @@ -114,7 +114,7 @@ func handleTendermintMigration(ctx sdk.Context, store storetypes.KVStore, cdc co } // handleLocalhostMigration removes all client and consensus states associated with the localhost client type. -func handleLocalhostMigration(ctx sdk.Context, store storetypes.KVStore, cdc codec.BinaryCodec, clientKeeper ClientKeeper) error { +func handleLocalhostMigration(ctx sdk.Context, store storetypes.KVStore, clientKeeper ClientKeeper) error { clients, err := collectClients(ctx, store, Localhost) if err != nil { return err diff --git a/modules/light-clients/06-solomachine/misbehaviour_handle.go b/modules/light-clients/06-solomachine/misbehaviour_handle.go index b840135987c..77175adf729 100644 --- a/modules/light-clients/06-solomachine/misbehaviour_handle.go +++ b/modules/light-clients/06-solomachine/misbehaviour_handle.go @@ -20,7 +20,7 @@ func (ClientState) CheckForMisbehaviour(_ sdk.Context, _ codec.BinaryCodec, _ st return false } -func (cs ClientState) verifyMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, misbehaviour *Misbehaviour) error { +func (cs ClientState) verifyMisbehaviour(cdc codec.BinaryCodec, misbehaviour *Misbehaviour) error { // NOTE: a check that the misbehaviour message data are not equal is done by // misbehaviour.ValidateBasic which is called by the 02-client keeper. // verify first signature diff --git a/modules/light-clients/06-solomachine/update.go b/modules/light-clients/06-solomachine/update.go index 1e5a78fbe01..6fd76f292a3 100644 --- a/modules/light-clients/06-solomachine/update.go +++ b/modules/light-clients/06-solomachine/update.go @@ -19,15 +19,15 @@ import ( func (cs ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) error { switch msg := clientMsg.(type) { case *Header: - return cs.verifyHeader(ctx, cdc, clientStore, msg) + return cs.verifyHeader(cdc, msg) case *Misbehaviour: - return cs.verifyMisbehaviour(ctx, cdc, clientStore, msg) + return cs.verifyMisbehaviour(cdc, msg) default: return errorsmod.Wrapf(clienttypes.ErrInvalidClientType, "expected type of %T or %T, got type %T", Header{}, Misbehaviour{}, msg) } } -func (cs ClientState) verifyHeader(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, header *Header) error { +func (cs ClientState) verifyHeader(cdc codec.BinaryCodec, header *Header) error { // assert update timestamp is not less than current consensus state timestamp if header.Timestamp < cs.ConsensusState.Timestamp { return errorsmod.Wrapf(