Skip to content

Commit

Permalink
unused-rec
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Jun 19, 2023
1 parent 92f0227 commit 0d7037c
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 38 deletions.
10 changes: 5 additions & 5 deletions modules/apps/27-interchain-accounts/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (AppModuleBasic) Name() string {
}

// RegisterLegacyAminoCodec implements AppModuleBasic.
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {}
func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {}

// RegisterInterfaces registers module concrete types into protobuf Any
func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {
Expand All @@ -61,7 +61,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
}

// ValidateGenesis performs genesis state validation for the IBC interchain acounts module
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error {
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error {
var gs genesistypes.GenesisState
if err := cdc.UnmarshalJSON(bz, &gs); err != nil {
return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err)
Expand Down Expand Up @@ -129,7 +129,7 @@ func (am AppModule) InitModule(ctx sdk.Context, controllerParams controllertypes
}

// RegisterInvariants implements the AppModule interface
func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
}

// RegisterServices registers module services
Expand Down Expand Up @@ -201,11 +201,11 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw
func (AppModule) ConsensusVersion() uint64 { return 3 }

// BeginBlock implements the AppModule interface
func (AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {
}

// EndBlock implements the AppModule interface
func (AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate {
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return []abci.ValidatorUpdate{}
}

Expand Down
4 changes: 2 additions & 2 deletions modules/apps/27-interchain-accounts/types/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ func NewInterchainAccount(ba *authtypes.BaseAccount, accountOwner string) *Inter
}

// SetPubKey implements the authtypes.AccountI interface
func (InterchainAccount) SetPubKey(pubKey crypto.PubKey) error {
func (InterchainAccount) SetPubKey(_ crypto.PubKey) error {
return errorsmod.Wrap(ErrUnsupported, "cannot set public key for interchain account")
}

// SetSequence implements the authtypes.AccountI interface
func (InterchainAccount) SetSequence(seq uint64) error {
func (InterchainAccount) SetSequence(_ uint64) error {
return errorsmod.Wrap(ErrUnsupported, "cannot set sequence number for interchain account")
}

Expand Down
2 changes: 1 addition & 1 deletion modules/apps/29-fee/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {
}

// EndBlock implements the AppModule interface
func (AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate {
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return []abci.ValidatorUpdate{}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/core/03-connection/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (k Keeper) ConnectionConsensusState(c context.Context, req *types.QueryConn
}

// ConnectionParams implements the Query/ConnectionParams gRPC method.
func (k Keeper) ConnectionParams(c context.Context, req *types.QueryConnectionParamsRequest) (*types.QueryConnectionParamsResponse, error) {
func (k Keeper) ConnectionParams(c context.Context, _ *types.QueryConnectionParamsRequest) (*types.QueryConnectionParamsResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
params := k.GetParams(ctx)

Expand Down
2 changes: 1 addition & 1 deletion modules/core/03-connection/types/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (qccsr QueryConnectionClientStateResponse) UnpackInterfaces(unpacker codect
}

// NewQueryConnectionConsensusStateResponse creates a newQueryConnectionConsensusStateResponse instance
func NewQueryConnectionConsensusStateResponse(clientID string, anyConsensusState *codectypes.Any, consensusStateHeight exported.Height, proof []byte, height clienttypes.Height) *QueryConnectionConsensusStateResponse {
func NewQueryConnectionConsensusStateResponse(clientID string, anyConsensusState *codectypes.Any, _ exported.Height, proof []byte, height clienttypes.Height) *QueryConnectionConsensusStateResponse {
return &QueryConnectionConsensusStateResponse{
ConsensusState: anyConsensusState,
ClientId: clientID,
Expand Down
4 changes: 2 additions & 2 deletions modules/core/04-channel/keeper/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func (k Keeper) ChanOpenInit(
connectionHops []string,
portID string,
portCap *capabilitytypes.Capability,
counterparty types.Counterparty,
version string,
_ types.Counterparty,
_ string,
) (string, *capabilitytypes.Capability, error) {
// connection hop length checked on msg.ValidateBasic()
connectionEnd, found := k.connectionKeeper.GetConnection(ctx, connectionHops[0])
Expand Down
2 changes: 1 addition & 1 deletion modules/core/04-channel/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (ps PacketSequence) Validate() error {

// NewGenesisState creates a GenesisState instance.
func NewGenesisState(
channels []IdentifiedChannel, acks, receipts, commitments []PacketState,
channels []IdentifiedChannel, acks, _, commitments []PacketState,
sendSeqs, recvSeqs, ackSeqs []PacketSequence, nextChannelSequence uint64,
) GenesisState {
return GenesisState{
Expand Down
2 changes: 1 addition & 1 deletion modules/core/04-channel/types/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// sha256_hash(timeout_timestamp + timeout_height.RevisionNumber + timeout_height.RevisionHeight + sha256_hash(data))
// from a given packet. This results in a fixed length preimage.
// NOTE: sdk.Uint64ToBigEndian sets the uint64 to a slice of length 8.
func CommitPacket(cdc codec.BinaryCodec, packet exported.PacketI) []byte {
func CommitPacket(_ codec.BinaryCodec, packet exported.PacketI) []byte {
timeoutHeight := packet.GetTimeoutHeight()

buf := sdk.Uint64ToBigEndian(packet.GetTimeoutTimestamp())
Expand Down
2 changes: 1 addition & 1 deletion modules/core/04-channel/types/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (qccsr QueryChannelClientStateResponse) UnpackInterfaces(unpacker codectype
}

// NewQueryChannelConsensusStateResponse creates a newQueryChannelConsensusStateResponse instance
func NewQueryChannelConsensusStateResponse(clientID string, anyConsensusState *codectypes.Any, consensusStateHeight exported.Height, proof []byte, height clienttypes.Height) *QueryChannelConsensusStateResponse {
func NewQueryChannelConsensusStateResponse(clientID string, anyConsensusState *codectypes.Any, _ exported.Height, proof []byte, height clienttypes.Height) *QueryChannelConsensusStateResponse {
return &QueryChannelConsensusStateResponse{
ConsensusState: anyConsensusState,
ClientId: clientID,
Expand Down
4 changes: 2 additions & 2 deletions modules/core/23-commitment/types/merkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ func (proof MerkleProof) VerifyNonMembership(specs []*ics23.ProofSpec, root expo

// BatchVerifyMembership verifies a group of key value pairs against the given root
// NOTE: Currently left unimplemented as it is unused
func (MerkleProof) BatchVerifyMembership(specs []*ics23.ProofSpec, root exported.Root, path exported.Path, items map[string][]byte) error {
func (MerkleProof) BatchVerifyMembership(_ []*ics23.ProofSpec, _ exported.Root, _ exported.Path, _ map[string][]byte) error {
return errorsmod.Wrap(ErrInvalidProof, "batch proofs are currently unsupported")
}

// BatchVerifyNonMembership verifies absence of a group of keys against the given root
// NOTE: Currently left unimplemented as it is unused
func (MerkleProof) BatchVerifyNonMembership(specs []*ics23.ProofSpec, root exported.Root, path exported.Path, items [][]byte) error {
func (MerkleProof) BatchVerifyNonMembership(_ []*ics23.ProofSpec, _ exported.Root, _ exported.Path, _ [][]byte) error {
return errorsmod.Wrap(ErrInvalidProof, "batch proofs are currently unsupported")
}

Expand Down
4 changes: 2 additions & 2 deletions modules/core/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ type MockStakingKeeper struct {
mockField string
}

func (MockStakingKeeper) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool) {
func (MockStakingKeeper) GetHistoricalInfo(_ sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool) {
return stakingtypes.HistoricalInfo{}, true
}

func (MockStakingKeeper) UnbondingTime(ctx sdk.Context) time.Duration {
func (MockStakingKeeper) UnbondingTime(_ sdk.Context) time.Duration {
return 0
}

Expand Down
8 changes: 4 additions & 4 deletions modules/core/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
}

// ValidateGenesis performs genesis state validation for the ibc module.
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error {
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error {
var gs types.GenesisState
if err := cdc.UnmarshalJSON(bz, &gs); err != nil {
return fmt.Errorf("failed to unmarshal %s genesis state: %w", exported.ModuleName, err)
Expand Down Expand Up @@ -111,7 +111,7 @@ func (AppModule) Name() string {
}

// RegisterInvariants registers the ibc module invariants.
func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
// TODO:
}

Expand Down Expand Up @@ -171,13 +171,13 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw
func (AppModule) ConsensusVersion() uint64 { return 5 }

// BeginBlock returns the begin blocker for the ibc module.
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
ibcclient.BeginBlocker(ctx, am.keeper.ClientKeeper)
}

// EndBlock returns the end blocker for the ibc module. It returns no validator
// updates.
func (AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate {
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return []abci.ValidatorUpdate{}
}

Expand Down
18 changes: 9 additions & 9 deletions modules/light-clients/06-solomachine/client_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ func (cs ClientState) GetLatestHeight() exported.Height {
// GetTimestampAtHeight returns the timestamp in nanoseconds of the consensus state at the given height.
func (cs ClientState) GetTimestampAtHeight(
_ sdk.Context,
clientStore sdk.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
_ sdk.KVStore,
_ codec.BinaryCodec,
_ exported.Height,
) (uint64, error) {
return cs.ConsensusState.Timestamp, nil
}
Expand Down Expand Up @@ -106,12 +106,12 @@ func (ClientState) VerifyUpgradeAndUpdateState(
// VerifyMembership is a generic proof verification method which verifies a proof of the existence of a value at a given CommitmentPath at the latest sequence.
// The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24).
func (cs *ClientState) VerifyMembership(
ctx sdk.Context,
_ sdk.Context,
clientStore sdk.KVStore,
cdc codec.BinaryCodec,
_ exported.Height,
delayTimePeriod uint64,
delayBlockPeriod uint64,
_ uint64,
_ uint64,
proof []byte,
path exported.Path,
value []byte,
Expand Down Expand Up @@ -157,12 +157,12 @@ func (cs *ClientState) VerifyMembership(
// VerifyNonMembership is a generic proof verification method which verifies the absence of a given CommitmentPath at the latest sequence.
// The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24).
func (cs *ClientState) VerifyNonMembership(
ctx sdk.Context,
_ sdk.Context,
clientStore sdk.KVStore,
cdc codec.BinaryCodec,
_ exported.Height,
delayTimePeriod uint64,
delayBlockPeriod uint64,
_ uint64,
_ uint64,
proof []byte,
path exported.Path,
) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (ClientState) CheckForMisbehaviour(_ sdk.Context, _ codec.BinaryCodec, _ sd
return false
}

func (cs ClientState) verifyMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, misbehaviour *Misbehaviour) error {
func (cs ClientState) verifyMisbehaviour(_ sdk.Context, cdc codec.BinaryCodec, _ sdk.KVStore, _ *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
Expand Down
6 changes: 3 additions & 3 deletions modules/light-clients/06-solomachine/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
}

// DefaultGenesis performs a no-op. Genesis is not supported for solo machine.
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
func (AppModuleBasic) DefaultGenesis(_ codec.JSONCodec) json.RawMessage {
return nil
}

// ValidateGenesis performs a no-op. Genesis is not supported for solo machine.
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error {
func (AppModuleBasic) ValidateGenesis(_ codec.JSONCodec, _ client.TxEncodingConfig, _ json.RawMessage) error {
return nil
}

// RegisterGRPCGatewayRoutes performs a no-op.
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {}
func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) {}

// GetTxCmd performs a no-op. Please see the 02-client cli commands.
func (AppModuleBasic) GetTxCmd() *cobra.Command {
Expand Down
2 changes: 1 addition & 1 deletion modules/light-clients/06-solomachine/proposal_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
// the substitute is not a solo machine, or the current public key equals
// the new public key.
func (cs ClientState) CheckSubstituteAndUpdateState(
ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore,
_ sdk.Context, cdc codec.BinaryCodec, subjectClientStore,
_ sdk.KVStore, substituteClient exported.ClientState,
) error {
substituteClientState, ok := substituteClient.(*ClientState)
Expand Down
2 changes: 1 addition & 1 deletion modules/light-clients/06-solomachine/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (cs ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec
}
}

func (cs ClientState) verifyHeader(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, header *Header) error {
func (cs ClientState) verifyHeader(_ sdk.Context, cdc codec.BinaryCodec, _ sdk.KVStore, header *Header) error {
// assert update timestamp is not less than current consensus state timestamp
if header.Timestamp < cs.ConsensusState.Timestamp {
return errorsmod.Wrapf(
Expand Down

0 comments on commit 0d7037c

Please sign in to comment.