Skip to content

Commit

Permalink
chore: fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Feb 9, 2024
1 parent 0b8a10b commit 7c7bd7a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"errors"
"fmt"
"slices"
"time"
Expand Down Expand Up @@ -37,7 +38,7 @@ func (c Config) Validate() error {
}

if c.IsConsumer() && c.ConsumerChainID == "" {
return fmt.Errorf("chain is consumer, but consumer-chain-id is not set")
return errors.New("chain is consumer, but consumer-chain-id is not set")
}

return nil
Expand Down
3 changes: 2 additions & 1 deletion pkg/fetcher/cosmos.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fetcher

import (
"encoding/json"
"errors"
"fmt"
configPkg "main/pkg/config"
"main/pkg/types"
Expand Down Expand Up @@ -185,7 +186,7 @@ func (f *CosmosDataFetcher) GetUpgradePlan() (*types.Upgrade, error) {
}

if response.Plan == nil {
return nil, fmt.Errorf("upgrade plan is not present")
return nil, errors.New("upgrade plan is not present")
}

return &types.Upgrade{
Expand Down
4 changes: 2 additions & 2 deletions pkg/fetcher/noop.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fetcher

import (
"fmt"
"errors"
"main/pkg/types"
)

Expand All @@ -17,5 +17,5 @@ func (f *NoopDataFetcher) GetValidators() (*types.ChainValidators, error) {
}

func (f *NoopDataFetcher) GetUpgradePlan() (*types.Upgrade, error) {
return nil, fmt.Errorf("upgrade is not present")
return nil, errors.New("upgrade is not present")
}
3 changes: 2 additions & 1 deletion pkg/tendermint/tendermint.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tendermint

import (
"encoding/json"
"errors"
"fmt"
configPkg "main/pkg/config"
"net/http"
Expand Down Expand Up @@ -47,7 +48,7 @@ func (rpc *RPC) GetValidators() ([]types.TendermintValidator, error) {
}

if response == nil || response.Result == nil || response.Result.Total == "" {
return nil, fmt.Errorf("malformed response from node")
return nil, errors.New("malformed response from node")
}

total, err := strconv.ParseInt(response.Result.Total, 10, 64)
Expand Down
6 changes: 3 additions & 3 deletions pkg/types/converter.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package types

import (
"fmt"
"errors"
"math/big"
"strings"
)
Expand All @@ -21,7 +21,7 @@ func ValidatorsWithLatestRoundFromTendermintResponse(
vp := new(big.Int)
vp, ok := vp.SetString(validator.VotingPower, 10)
if !ok {
return nil, fmt.Errorf("error setting string")
return nil, errors.New("error setting string")
}

validators[index] = ValidatorWithRoundVote{
Expand Down Expand Up @@ -62,7 +62,7 @@ func ValidatorsWithAllRoundsFromTendermintResponse(
vp := new(big.Int)
vp, ok := vp.SetString(validator.VotingPower, 10)
if !ok {
return ValidatorsWithAllRoundsVotes{}, fmt.Errorf("error setting string")
return ValidatorsWithAllRoundsVotes{}, errors.New("error setting string")
}

validators[index] = Validator{
Expand Down

0 comments on commit 7c7bd7a

Please sign in to comment.