Skip to content

Commit

Permalink
Linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdee committed Mar 4, 2024
1 parent 697b6d4 commit 564228f
Show file tree
Hide file tree
Showing 53 changed files with 53 additions and 52 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ linters:
- nlreturn
- nolintlint
- nosnakecase
- perfsprint
- promlinter
- rowserrcheck
- scopelint
Expand Down
2 changes: 1 addition & 1 deletion cmd/accountcreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var accountCreateCmd = &cobra.Command{
ethdo account create --account="primary/operations" --passphrase="my secret"
In quiet mode this will return 0 if the account is created successfully, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := accountcreate.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/accountderive.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var accountDeriveCmd = &cobra.Command{
ethdo account derive --mnemonic="..." --path="m/12381/3600/0/0"
In quiet mode this will return 0 if the inputs can derive an account account, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := accountderive.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/accountimport.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var accountImportCmd = &cobra.Command{
ethdo account import --account="primary/testing" --key="0x..." --passphrase="my secret"
In quiet mode this will return 0 if the account is imported successfully, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := accountimport.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/accountinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var accountInfoCmd = &cobra.Command{
ethdo account info --account="primary/my funds"
In quiet mode this will return 0 if the account exists, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("timeout"))
defer cancel()

Expand Down
2 changes: 1 addition & 1 deletion cmd/accountkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var accountKeyCmd = &cobra.Command{
ethdo account key --account="Personal wallet/Operations" --passphrase="my account passphrase"
In quiet mode this will return 0 if the key can be obtained, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := accountkey.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/accountlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var accountLockCmd = &cobra.Command{
ethdo account lock --account="primary/my funds"
In quiet mode this will return 0 if the account is locked, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("timeout"))
defer cancel()

Expand Down
2 changes: 1 addition & 1 deletion cmd/accountunlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var accountUnlockCmd = &cobra.Command{
ethdo account unlock --account="primary/my funds" --passphrase="secret"
In quiet mode this will return 0 if the account is unlocked, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("timeout"))
defer cancel()

Expand Down
2 changes: 1 addition & 1 deletion cmd/attesterduties.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var attesterDutiesCmd = &cobra.Command{
ethdo attester duties --validator=Validators/00001 --epoch=12345
In quiet mode this will return 0 if a duty from the attester is found, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := attesterduties.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/attesterinclusion.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var attesterInclusionCmd = &cobra.Command{
ethdo attester inclusion --validator=Validators/00001 --epoch=12345
In quiet mode this will return 0 if an attestation from the attester is found on the block of the given epoch, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := attesterinclusion.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/blockanalyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var blockAnalyzeCmd = &cobra.Command{
ethdo block analyze --blockid=12345
In quiet mode this will return 0 if the block information is present and not skipped, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := blockanalyze.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/blockinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var blockInfoCmd = &cobra.Command{
ethdo block info --blockid=12345
In quiet mode this will return 0 if the block information is present and not skipped, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := blockinfo.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/chaineth1votes.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var chainEth1VotesCmd = &cobra.Command{
Note that this will fetch the votes made in blocks up to the end of the provided epoch.
In quiet mode this will return 0 if there is a majority for the votes, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := chaineth1votes.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/chaininfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var chainInfoCmd = &cobra.Command{
ethdo chain info
In quiet mode this will return 0 if the chain information can be obtained, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
ctx := context.Background()

eth2Client, err := util.ConnectToBeaconNode(ctx, &util.ConnectOpts{
Expand Down
2 changes: 1 addition & 1 deletion cmd/chainqueues.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var chainQueuesCmd = &cobra.Command{
ethdo chain queues
In quiet mode this will return 0 if the entry and exit queues are 0, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := chainqueues.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/chainspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var chainSpecCmd = &cobra.Command{
ethdo chain spec
In quiet mode this will return 0 if the chain specification can be obtained, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
ctx := context.Background()

eth2Client, err := util.ConnectToBeaconNode(ctx, &util.ConnectOpts{
Expand Down
2 changes: 1 addition & 1 deletion cmd/chainstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var chainStatusCmd = &cobra.Command{
ethdo chain status
In quiet mode this will return 0 if the chain status can be obtained, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
ctx := context.Background()

eth2Client, err := util.ConnectToBeaconNode(ctx, &util.ConnectOpts{
Expand Down
2 changes: 1 addition & 1 deletion cmd/chaintime.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var chainTimeCmd = &cobra.Command{
Long: `Obtain info about the chain at a given time. For example:
ethdo chain time --slot=12345`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := chaintime.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/chainverifysignedcontributionandproof.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var chainVerifySignedContributionAndProofCmd = &cobra.Command{
ethdo chain verify signedcontributionandproof --data=... --validator=...
validator can be an account, a public key or an index.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := chainverifysignedcontributionandproof.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/depositverify.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var depositVerifyCmd = &cobra.Command{
The deposit data is compared to the supplied withdrawal account/public key, validator public key, and value to ensure they match.
In quiet mode this will return 0 if the data is verified correctly, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
assert(depositVerifyData != "", "--data is required")
var data []byte
var err error
Expand Down
2 changes: 1 addition & 1 deletion cmd/epochsummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var epochSummaryCmd = &cobra.Command{
ethdo epoch summary --epoch=12345
In quiet mode this will return 0 if information for the epoch is found, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := epochsummary.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/exitverify.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var exitVerifyCmd = &cobra.Command{
ethdo exit verify --signed-operation=exitdata.json --validator=primary/current
In quiet mode this will return 0 if the exit is verified correctly, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
ctx := context.Background()

assert(viper.GetString("signed-operation") != "", "signed-operation is required")
Expand Down
2 changes: 1 addition & 1 deletion cmd/nodeevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var nodeEventsCmd = &cobra.Command{
Long: `Report events from a node. For example:
ethdo node events --events=head,chain_reorg.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := nodeevents.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/nodeinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var nodeInfoCmd = &cobra.Command{
ethdo node info
In quiet mode this will return 0 if the node information can be obtained, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
ctx := context.Background()

eth2Client, err := util.ConnectToBeaconNode(ctx, &util.ConnectOpts{
Expand Down
2 changes: 1 addition & 1 deletion cmd/proposerduties.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var proposerDutiesCmd = &cobra.Command{
ethdo proposer duties --epoch=12345
In quiet mode this will return 0 if duties can be obtained, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := proposerduties.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/signatureaggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var signatureAggregateCmd = &cobra.Command{
Signatures are specified as "signature" for simple aggregation, and as "id:signature" for threshold aggregation.
In quiet mode this will return 0 if the signatures can be aggregated, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
assert(len(signatureAggregateSignatures) > 1, "multiple signatures required to aggregate")
var signature *bls.Sign
var err error
Expand Down
2 changes: 1 addition & 1 deletion cmd/signaturesign.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var signatureSignCmd = &cobra.Command{
ethdo signature sign --data=0x5f24e819400c6a8ee2bfc014343cd971b7eb707320025a7bcd83e621e26c35b7 --account="Personal wallet/Operations" --passphrase="my account passphrase"
In quiet mode this will return 0 if the data can be signed, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("timeout"))
defer cancel()

Expand Down
2 changes: 1 addition & 1 deletion cmd/signatureverify.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var signatureVerifyCmd = &cobra.Command{
ethdo signature verify --data=0x5f24e819400c6a8ee2bfc014343cd971b7eb707320025a7bcd83e621e26c35b7 --signature=0x8888... --account="Personal wallet/Operations"
In quiet mode this will return 0 if the data can be signed, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("timeout"))
defer cancel()

Expand Down
2 changes: 1 addition & 1 deletion cmd/slottime.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var slotTimeCmd = &cobra.Command{
ethdo slot time --slot=12345
In quiet mode this will return 0.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := slottime.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/synccommitteeinclusion.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var synccommitteeInclusionCmd = &cobra.Command{
In quiet mode this will return 0 if the validator was in the sync committee, otherwise 1.
epoch can be a specific epoch; If not supplied all slots for the current sync committee period will be provided`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := synccommitteeinclusion.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/synccommitteemembers.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var synccommitteeMembersCmd = &cobra.Command{
In quiet mode this will return 0 if the synccommittee members are found, otherwise 1.
epoch can be a specific epoch. period can be 'current' for the current sync period or 'next' for the next sync period`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := synccommitteemembers.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/validatorcredentialsget.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var validatorCredentialsGetCmd = &cobra.Command{
ethdo validator credentials get --validator=primary/validator
In quiet mode this will return 0 if the validator exists, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := validatorcredentialsget.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/validatorcredentialsset.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The validator account can be specified in one of a number of ways:
- account and withdrawal account using --account and --withdrawal-account; this will generate a single operation
In quiet mode this will return 0 if the credentials operation has been generated (and successfully broadcast if online), otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := validatorcredentialsset.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/validatordepositdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ If validatoraccount is provided with an account path it will generate deposit da
The information generated can be passed to ethereal to create a deposit from the Ethereum 1 chain.
In quiet mode this will return 0 if the data can be generated correctly, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := validatordepositdata.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/validatorduties.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var validatorDutiesCmd = &cobra.Command{
Attester duties are known for the current and next epoch. Proposer duties are known for the current epoch.
In quiet mode this will return 0 if the duties have been obtained, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := validatorduties.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/validatorexit.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The validator and key can be specified in one of a number of ways:
- validator account using --validator
In quiet mode this will return 0 if the exit operation has been generated (and successfully broadcast if online), otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := validatorexit.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/validatorexpectation.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var validatorExpectationCmd = &cobra.Command{
Long: `Calculate expectation for individual validators. For example:
ethdo validator expectation`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := validatorexpectation.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/validatorinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var validatorInfoCmd = &cobra.Command{
ethdo validator info --validator=primary/validator
In quiet mode this will return 0 if the validator information can be obtained, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
ctx := context.Background()

eth2Client, err := util.ConnectToBeaconNode(ctx, &util.ConnectOpts{
Expand Down
2 changes: 1 addition & 1 deletion cmd/validatorkeycheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var validatorKeycheckCmd = &cobra.Command{
A mnemonic can be used in place of a private key, in which case the first 1,024 indices of the standard withdrawal key path will be scanned for a matching key.
In quiet mode this will return 0 if the withdrawal credentials match the key, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := validatorkeycheck.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/validatorsummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var validatorSummaryCmd = &cobra.Command{
ethdo validator summary --validators=1,2,3 --epoch=12345
In quiet mode this will return 0 if information for the epoch is found, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := validatorsummary.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/validatorwithdrawal.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var validatorWithdrawalCmd = &cobra.Command{
ethdo validator withdrawal --validator=primary/validator
In quiet mode this will return 0 if the validator exists, otherwise 1.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := validatorwithdrawal.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/validatoryield.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var validatorYieldCmd = &cobra.Command{
ethdo validator yield
It is important to understand the yield is both probabilistic and dependent on network conditions.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := validatoryield.Run(cmd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var versionCmd = &cobra.Command{
Long: `Obtain the version of ethdo. For example:
ethdo version`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
fmt.Println(ReleaseVersion)
if viper.GetBool("verbose") {
if info, ok := debug.ReadBuildInfo(); ok {
Expand Down
2 changes: 1 addition & 1 deletion cmd/walletaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var walletAccountsCmd = &cobra.Command{
ethdo wallet accounts --wallet=primary
In quiet mode this will return 0 if the wallet holds any addresses, otherwise 1.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("timeout"))
defer cancel()

Expand Down
Loading

0 comments on commit 564228f

Please sign in to comment.