diff --git a/scripts/main.go b/scripts/main.go index a8c1cf7f..270718c9 100644 --- a/scripts/main.go +++ b/scripts/main.go @@ -12,7 +12,7 @@ func main() { rootCmd := &cobra.Command{ Use: "gendoc", Short: "Simple CLI to generate documentation for the project", - PersistentPreRun: func(cmd *cobra.Command, args []string) { + PersistentPreRun: func(cmd *cobra.Command, _ []string) { cmd.SetOut(cmd.OutOrStdout()) cmd.SetErr(cmd.ErrOrStderr()) }, @@ -31,7 +31,7 @@ func generateCommandDocumentationCommand() *cobra.Command { cmd := &cobra.Command{ Use: "command", Short: "Generate command documentation", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { return GenerateCommandDocumentation() }, } @@ -42,7 +42,7 @@ func generatePredicateDocumentationCommand() *cobra.Command { cmd := &cobra.Command{ Use: "predicate", Short: "Generate predicate documentation", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { return GeneratePredicateDocumentation() }, } diff --git a/x/logic/keeper/grpc_query_ask_test.go b/x/logic/keeper/grpc_query_ask_test.go index 26b47be4..0ca7f650 100644 --- a/x/logic/keeper/grpc_query_ask_test.go +++ b/x/logic/keeper/grpc_query_ask_test.go @@ -211,7 +211,7 @@ func TestGRPCAsk(t *testing.T) { authtypes.NewModuleAddress(govtypes.ModuleName), accountKeeper, bankKeeper, - func(ctx gocontext.Context) fs.FS { + func(_ gocontext.Context) fs.FS { return fsProvider }, ) diff --git a/x/logic/keeper/grpc_query_params_test.go b/x/logic/keeper/grpc_query_params_test.go index 75020b85..4ec9d25f 100644 --- a/x/logic/keeper/grpc_query_params_test.go +++ b/x/logic/keeper/grpc_query_params_test.go @@ -69,7 +69,7 @@ func TestGRPCParams(t *testing.T) { authtypes.NewModuleAddress(govtypes.ModuleName), accountKeeper, bankKeeper, - func(ctx gocontext.Context) fs.FS { + func(_ gocontext.Context) fs.FS { return fsProvider }, ) diff --git a/x/logic/keeper/interpreter.go b/x/logic/keeper/interpreter.go index 4d95349e..641cbd71 100644 --- a/x/logic/keeper/interpreter.go +++ b/x/logic/keeper/interpreter.go @@ -130,7 +130,7 @@ func (k Keeper) newInterpreter(ctx context.Context) (*prolog.Interpreter, *util. toPredicate( nonNilNorZeroOrDefaultUint64(gasPolicy.DefaultPredicateCost, defaultPredicateCost), gasPolicy.GetPredicateCosts())), - func(agg interpreter.Predicates, item lo.Tuple2[string, uint64], index int) interpreter.Predicates { + func(agg interpreter.Predicates, item lo.Tuple2[string, uint64], _ int) interpreter.Predicates { agg[item.A] = item.B return agg }, diff --git a/x/logic/keeper/msg_server_test.go b/x/logic/keeper/msg_server_test.go index ac34db84..5d90238b 100644 --- a/x/logic/keeper/msg_server_test.go +++ b/x/logic/keeper/msg_server_test.go @@ -67,7 +67,7 @@ func TestUpdateParams(t *testing.T) { authtypes.NewModuleAddress(govtypes.ModuleName), accountKeeper, bankKeeper, - func(ctx gocontext.Context) fs.FS { + func(_ gocontext.Context) fs.FS { return fsProvider }, ) diff --git a/x/logic/predicate/address.go b/x/logic/predicate/address.go index 3318c141..4f9a30e3 100644 --- a/x/logic/predicate/address.go +++ b/x/logic/predicate/address.go @@ -34,7 +34,7 @@ import ( // [bech32]: https://docs.cosmos.network/main/build/spec/addresses/bech32#hrp-table // [base64]: https://fr.wikipedia.org/wiki/Base64 func Bech32Address(_ *engine.VM, address, bech32 engine.Term, cont engine.Cont, env *engine.Env) *engine.Promise { - forwardConverter := func(value []engine.Term, options engine.Term, env *engine.Env) ([]engine.Term, error) { + forwardConverter := func(value []engine.Term, _ engine.Term, env *engine.Env) ([]engine.Term, error) { hrpTerm, dataTerm, err := prolog.AssertPair(env, value[0]) if err != nil { return nil, err @@ -55,7 +55,7 @@ func Bech32Address(_ *engine.VM, address, bech32 engine.Term, cont engine.Cont, return []engine.Term{engine.NewAtom(b)}, nil } - backwardConverter := func(value []engine.Term, options engine.Term, env *engine.Env) ([]engine.Term, error) { + backwardConverter := func(value []engine.Term, _ engine.Term, env *engine.Env) ([]engine.Term, error) { b, err := prolog.AssertAtom(env, value[0]) if err != nil { return nil, err diff --git a/x/logic/predicate/bank.go b/x/logic/predicate/bank.go index 8cccfc33..3db2f13e 100644 --- a/x/logic/predicate/bank.go +++ b/x/logic/predicate/bank.go @@ -73,7 +73,7 @@ func BankSpendableBalances(vm *engine.VM, account, balances engine.Term, cont en vm, env, cont, - func(ctx sdk.Context, bankKeeper types.BankKeeper, coins sdk.Coins, address sdk.AccAddress) sdk.Coins { + func(ctx sdk.Context, bankKeeper types.BankKeeper, _ sdk.Coins, address sdk.AccAddress) sdk.Coins { return SpendableCoinsSorted(ctx, bankKeeper, address) }) } @@ -105,7 +105,7 @@ func BankLockedBalances(vm *engine.VM, account, balances engine.Term, cont engin vm, env, cont, - func(ctx sdk.Context, bankKeeper types.BankKeeper, coins sdk.Coins, address sdk.AccAddress) sdk.Coins { + func(ctx sdk.Context, bankKeeper types.BankKeeper, _ sdk.Coins, address sdk.AccAddress) sdk.Coins { return LockedCoinsSorted(ctx, bankKeeper, address) }) } @@ -161,7 +161,7 @@ func fetchBalances( promises = append( promises, - func(ctx context.Context) *engine.Promise { + func(_ context.Context) *engine.Promise { return engine.Unify( vm, prolog.Tuple(engine.NewAtom(address), CoinsToTerm(coins)), diff --git a/x/logic/predicate/file.go b/x/logic/predicate/file.go index a4a344e0..e24ffc98 100644 --- a/x/logic/predicate/file.go +++ b/x/logic/predicate/file.go @@ -38,7 +38,7 @@ func SourceFile(vm *engine.VM, file engine.Term, cont engine.Cont, env *engine.E term := engine.NewAtom(sortedSource[i]) promises = append( promises, - func(ctx context.Context) *engine.Promise { + func(_ context.Context) *engine.Promise { return engine.Unify( vm, file, diff --git a/x/logic/predicate/string.go b/x/logic/predicate/string.go index dc811eee..727376fb 100644 --- a/x/logic/predicate/string.go +++ b/x/logic/predicate/string.go @@ -110,7 +110,7 @@ func StringBytes( if err != nil { return engine.Error(err) } - forwardConverter := func(value []engine.Term, options engine.Term, env *engine.Env) ([]engine.Term, error) { + forwardConverter := func(value []engine.Term, _ engine.Term, env *engine.Env) ([]engine.Term, error) { str, err := prolog.TextTermToString(value[0], env) if err != nil { return nil, err @@ -134,7 +134,7 @@ func StringBytes( return []engine.Term{prolog.BytesToByteListTerm(bs)}, nil } } - backwardConverter := func(value []engine.Term, options engine.Term, env *engine.Env) ([]engine.Term, error) { + backwardConverter := func(value []engine.Term, _ engine.Term, env *engine.Env) ([]engine.Term, error) { var result string switch encoding { case prolog.AtomText: diff --git a/x/logic/predicate/uri.go b/x/logic/predicate/uri.go index a53907d3..68d7e0a6 100644 --- a/x/logic/predicate/uri.go +++ b/x/logic/predicate/uri.go @@ -39,7 +39,7 @@ func URIEncoded(_ *engine.VM, component, decoded, encoded engine.Term, cont engi if err != nil { return engine.Error(err) } - forwardConverter := func(value []engine.Term, options engine.Term, env *engine.Env) ([]engine.Term, error) { + forwardConverter := func(value []engine.Term, _ engine.Term, env *engine.Env) ([]engine.Term, error) { in, err := prolog.TextTermToString(value[0], env) if err != nil { return nil, err @@ -47,7 +47,7 @@ func URIEncoded(_ *engine.VM, component, decoded, encoded engine.Term, cont engi out := uriComponent.Escape(in) return []engine.Term{engine.NewAtom(out)}, nil } - backwardConverter := func(value []engine.Term, options engine.Term, env *engine.Env) ([]engine.Term, error) { + backwardConverter := func(value []engine.Term, _ engine.Term, env *engine.Env) ([]engine.Term, error) { in, err := prolog.TextTermToString(value[0], env) if err != nil { return nil, err diff --git a/x/logic/testutil/logic.go b/x/logic/testutil/logic.go index 3418de11..f83aeb01 100644 --- a/x/logic/testutil/logic.go +++ b/x/logic/testutil/logic.go @@ -84,7 +84,7 @@ func CompileMust(ctx context.Context, i *prolog.Interpreter, s string, args ...i func ReindexUnknownVariables(s prolog.TermString) prolog.TermString { re := regexp.MustCompile("_([0-9]+)") var index int - return prolog.TermString(re.ReplaceAllStringFunc(string(s), func(m string) string { + return prolog.TermString(re.ReplaceAllStringFunc(string(s), func(_ string) string { index++ return fmt.Sprintf("_%d", index) })) diff --git a/x/mint/client/cli/query.go b/x/mint/client/cli/query.go index 6b07308c..1352f5b1 100644 --- a/x/mint/client/cli/query.go +++ b/x/mint/client/cli/query.go @@ -37,7 +37,7 @@ func GetCmdQueryParams() *cobra.Command { Use: "params", Short: "Query the current minting parameters", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err @@ -66,7 +66,7 @@ func GetCmdQueryInflation() *cobra.Command { Use: "inflation", Short: "Query the current minting inflation value", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err @@ -95,7 +95,7 @@ func GetCmdQueryAnnualProvisions() *cobra.Command { Use: "annual-provisions", Short: "Query the current minting annual provisions value", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err diff --git a/x/vesting/client/cli/tx.go b/x/vesting/client/cli/tx.go index 5f589605..61be654c 100644 --- a/x/vesting/client/cli/tx.go +++ b/x/vesting/client/cli/tx.go @@ -129,8 +129,8 @@ type VestingData struct { } type InputPeriod struct { - Coins string `json:"coins"` - Length int64 `json:"length_seconds"` + Coins string `json:"coins"` + LengthSeconds int64 `json:"length_seconds"` } // NewMsgCreatePeriodicVestingAccountCmd returns a CLI command handler for creating a @@ -190,10 +190,10 @@ func NewMsgCreatePeriodicVestingAccountCmd() *cobra.Command { return err } - if p.Length < 0 { - return fmt.Errorf("invalid period length of %d in period %d, length must be greater than 0", p.Length, i) + if p.LengthSeconds < 0 { + return fmt.Errorf("invalid period length of %d in period %d, length must be greater than 0", p.LengthSeconds, i) } - period := types.Period{Length: p.Length, Amount: amount} + period := types.Period{Length: p.LengthSeconds, Amount: amount} periods = append(periods, period) } diff --git a/x/vesting/types/vesting_account.go b/x/vesting/types/vesting_account.go index bdded34b..64cd4de8 100644 --- a/x/vesting/types/vesting_account.go +++ b/x/vesting/types/vesting_account.go @@ -157,7 +157,7 @@ func (bva BaseVestingAccount) Validate() error { type vestingAccountYAML struct { Address sdk.AccAddress `json:"address"` - PubKey string `json:"public_key"` + PublicKey string `json:"public_key"` AccountNumber uint64 `json:"account_number"` Sequence uint64 `json:"sequence"` OriginalVesting sdk.Coins `json:"original_vesting"` @@ -186,7 +186,7 @@ func (bva BaseVestingAccount) MarshalYAML() (interface{}, error) { out := vestingAccountYAML{ Address: accAddr, AccountNumber: bva.AccountNumber, - PubKey: getPKString(bva), + PublicKey: getPKString(bva), Sequence: bva.Sequence, OriginalVesting: bva.OriginalVesting, DelegatedFree: bva.DelegatedFree, @@ -304,7 +304,7 @@ func (cva ContinuousVestingAccount) MarshalYAML() (interface{}, error) { out := vestingAccountYAML{ Address: accAddr, AccountNumber: cva.AccountNumber, - PubKey: getPKString(cva), + PublicKey: getPKString(cva), Sequence: cva.Sequence, OriginalVesting: cva.OriginalVesting, DelegatedFree: cva.DelegatedFree, @@ -453,7 +453,7 @@ func (pva PeriodicVestingAccount) MarshalYAML() (interface{}, error) { out := vestingAccountYAML{ Address: accAddr, AccountNumber: pva.AccountNumber, - PubKey: getPKString(pva), + PublicKey: getPKString(pva), Sequence: pva.Sequence, OriginalVesting: pva.OriginalVesting, DelegatedFree: pva.DelegatedFree, @@ -725,7 +725,7 @@ func (cva CliffVestingAccount) MarshalYAML() (interface{}, error) { out := vestingAccountYAML{ Address: accAddr, AccountNumber: cva.AccountNumber, - PubKey: getPKString(cva), + PublicKey: getPKString(cva), Sequence: cva.Sequence, OriginalVesting: cva.OriginalVesting, DelegatedFree: cva.DelegatedFree,