Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jhd2best committed Oct 20, 2024
1 parent ad0ac58 commit 1e751a0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
34 changes: 17 additions & 17 deletions client/server/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ func (s *Server) GetDistributionParams(r *http.Request) (resp any, err error) {

// GetDistributionValidatorByValidatorAddress queries validator commission and self-delegation rewards for validator.
func (s *Server) GetDistributionValidatorByValidatorAddress(r *http.Request) (resp any, err error) {
queryContext, err := s.createQueryContextByHeader(r)
valAddr, err := k1util.CmpPubKeyToValidatorAddress(mux.Vars(r)["validator_pub_key"])
if err != nil {
return nil, err
}

valAddr, err := k1util.CmpPubKeyToValidatorAddress(mux.Vars(r)["validator_pub_key"])
queryContext, err := s.createQueryContextByHeader(r)
if err != nil {
return nil, err
}
Expand All @@ -70,12 +70,12 @@ func (s *Server) GetDistributionValidatorByValidatorAddress(r *http.Request) (re

// GetValidatorCommissionByValidatorAddress queries accumulated commission for a validator.
func (s *Server) GetValidatorCommissionByValidatorAddress(r *http.Request) (resp any, err error) {
queryContext, err := s.createQueryContextByHeader(r)
valAddr, err := k1util.CmpPubKeyToValidatorAddress(mux.Vars(r)["validator_pub_key"])
if err != nil {
return nil, err
}

valAddr, err := k1util.CmpPubKeyToValidatorAddress(mux.Vars(r)["validator_pub_key"])
queryContext, err := s.createQueryContextByHeader(r)
if err != nil {
return nil, err
}
Expand All @@ -93,12 +93,12 @@ func (s *Server) GetValidatorCommissionByValidatorAddress(r *http.Request) (resp

// GetValidatorOutstandingRewardsByValidatorAddress queries rewards of a validator address.
func (s *Server) GetValidatorOutstandingRewardsByValidatorAddress(r *http.Request) (resp any, err error) {
queryContext, err := s.createQueryContextByHeader(r)
valAddr, err := k1util.CmpPubKeyToValidatorAddress(mux.Vars(r)["validator_pub_key"])
if err != nil {
return nil, err
}

valAddr, err := k1util.CmpPubKeyToValidatorAddress(mux.Vars(r)["validator_pub_key"])
queryContext, err := s.createQueryContextByHeader(r)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -157,12 +157,12 @@ func (s *Server) GetAllValidatorOutstandingRewards(req *getAllValidatorOutstandi

// GetValidatorSlashesByValidatorAddress queries slash events of a validator.
func (s *Server) GetValidatorSlashesByValidatorAddress(req *getValidatorSlashesByValidatorAddressRequest, r *http.Request) (resp any, err error) {
queryContext, err := s.createQueryContextByHeader(r)
valAddr, err := k1util.CmpPubKeyToValidatorAddress(mux.Vars(r)["validator_pub_key"])
if err != nil {
return nil, err
}

valAddr, err := k1util.CmpPubKeyToValidatorAddress(mux.Vars(r)["validator_pub_key"])
queryContext, err := s.createQueryContextByHeader(r)
if err != nil {
return nil, err
}
Expand All @@ -189,12 +189,12 @@ func (s *Server) GetValidatorSlashesByValidatorAddress(req *getValidatorSlashesB

// GetDistributionValidatorsByDelegatorAddress queries the validators of a delegator.
func (s *Server) GetDistributionValidatorsByDelegatorAddress(r *http.Request) (resp any, err error) {
queryContext, err := s.createQueryContextByHeader(r)
delAddr, err := k1util.CmpPubKeyToDelegatorAddress(mux.Vars(r)["delegator_pub_key"])
if err != nil {
return nil, err
}

delAddr, err := k1util.CmpPubKeyToDelegatorAddress(mux.Vars(r)["delegator_pub_key"])
queryContext, err := s.createQueryContextByHeader(r)
if err != nil {
return nil, err
}
Expand All @@ -212,12 +212,12 @@ func (s *Server) GetDistributionValidatorsByDelegatorAddress(r *http.Request) (r

// GetDelegatorRewardsByDelegatorAddress queries the total rewards accrued by each validator.
func (s *Server) GetDelegatorRewardsByDelegatorAddress(r *http.Request) (resp any, err error) {
queryContext, err := s.createQueryContextByHeader(r)
delAddr, err := k1util.CmpPubKeyToDelegatorAddress(mux.Vars(r)["delegator_pub_key"])
if err != nil {
return nil, err
}

delAddr, err := k1util.CmpPubKeyToDelegatorAddress(mux.Vars(r)["delegator_pub_key"])
queryContext, err := s.createQueryContextByHeader(r)
if err != nil {
return nil, err
}
Expand All @@ -235,17 +235,17 @@ func (s *Server) GetDelegatorRewardsByDelegatorAddress(r *http.Request) (resp an

// GetDelegatorRewardsByDelegatorAddressValidatorAddress queries the total rewards accrued by a delegation.
func (s *Server) GetDelegatorRewardsByDelegatorAddressValidatorAddress(r *http.Request) (resp any, err error) {
queryContext, err := s.createQueryContextByHeader(r)
valAddr, err := k1util.CmpPubKeyToValidatorAddress(mux.Vars(r)["validator_pub_key"])
if err != nil {
return nil, err
}

valAddr, err := k1util.CmpPubKeyToValidatorAddress(mux.Vars(r)["validator_pub_key"])
delAddr, err := k1util.CmpPubKeyToDelegatorAddress(mux.Vars(r)["delegator_pub_key"])
if err != nil {
return nil, err
}

delAddr, err := k1util.CmpPubKeyToDelegatorAddress(mux.Vars(r)["delegator_pub_key"])
queryContext, err := s.createQueryContextByHeader(r)
if err != nil {
return nil, err
}
Expand All @@ -264,12 +264,12 @@ func (s *Server) GetDelegatorRewardsByDelegatorAddressValidatorAddress(r *http.R

// GetDelegatorWithdrawAddressByDelegatorAddress queries withdraw address of a delegator.
func (s *Server) GetDelegatorWithdrawAddressByDelegatorAddress(r *http.Request) (resp any, err error) {
queryContext, err := s.createQueryContextByHeader(r)
delAddr, err := k1util.CmpPubKeyToDelegatorAddress(mux.Vars(r)["delegator_pub_key"])
if err != nil {
return nil, err
}

delAddr, err := k1util.CmpPubKeyToDelegatorAddress(mux.Vars(r)["delegator_pub_key"])
queryContext, err := s.createQueryContextByHeader(r)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions client/server/staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ func (s *Server) GetValidatorByValidatorAddress(r *http.Request) (resp any, err

// GetValidatorDelegationsByValidatorAddress queries delegate info for given validator.
func (s *Server) GetValidatorDelegationsByValidatorAddress(req *getValidatorDelegationsByValidatorAddressRequest, r *http.Request) (resp any, err error) {
valAddr, err := k1util.CmpPubKeyToValidatorAddress(mux.Vars(r)["validator_pub_key"])
queryContext, err := s.createQueryContextByHeader(r)
if err != nil {
return nil, err
}

queryContext, err := s.createQueryContextByHeader(r)
valAddr, err := k1util.CmpPubKeyToValidatorAddress(mux.Vars(r)["validator_pub_key"])
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions lib/k1util/k1util.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ package k1util
import (
stdecdsa "crypto/ecdsa"
"encoding/hex"
"strings"

"github.com/cometbft/cometbft/crypto"
k1 "github.com/cometbft/cometbft/crypto/secp256k1"
cryptopb "github.com/cometbft/cometbft/proto/tendermint/crypto"
cosmosk1 "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
cosmoscrypto "github.com/cosmos/cosmos-sdk/crypto/types"
cosmostypes "github.com/cosmos/cosmos-sdk/types"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
"github.com/ethereum/go-ethereum/common"
ethcrypto "github.com/ethereum/go-ethereum/crypto"
"strings"

"github.com/piplabs/story/lib/cast"
"github.com/piplabs/story/lib/errors"

cosmoscrypto "github.com/cosmos/cosmos-sdk/crypto/types"
cosmostypes "github.com/cosmos/cosmos-sdk/types"
)

// privKeyLen is the length of a secp256k1 private key.
Expand Down

0 comments on commit 1e751a0

Please sign in to comment.