Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
misko9 committed Nov 21, 2024
1 parent 539c165 commit 0a06baf
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion chain/thorchain/api_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/strangelove-ventures/interchaintest/v8/chain/thorchain/common"
)

// Generic query for routes not yet supported here
// Generic query for routes not yet supported here.
func (c *Thorchain) ApiQuery(ctx context.Context, path string, args ...string) (any, error) {

Check failure on line 23 in chain/thorchain/api_query.go

View workflow job for this annotation

GitHub Actions / golangci-lint

ST1003: method ApiQuery should be APIQuery (stylecheck)
url := fmt.Sprintf("%s/%s", c.GetAPIAddress(), path)
var res any
Expand Down
8 changes: 4 additions & 4 deletions chain/thorchain/module_thorchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (tn *ChainNode) Bond(ctx context.Context, amount math.Int) error {
return err
}

// Sets validator node keys, must be called by validator
// Sets validator node keys, must be called by validator.
func (tn *ChainNode) SetNodeKeys(ctx context.Context) error {
_, err := tn.ExecTx(ctx,
valKey, "thorchain", "set-node-keys",
Expand All @@ -60,18 +60,18 @@ func (tn *ChainNode) SetNodeKeys(ctx context.Context) error {
return err
}

// Sets validator ip address, must be called by validator
// Sets validator ip address, must be called by validator.
func (tn *ChainNode) SetIpAddress(ctx context.Context) error {

Check failure on line 64 in chain/thorchain/module_thorchain.go

View workflow job for this annotation

GitHub Actions / golangci-lint

ST1003: method SetIpAddress should be SetIPAddress (stylecheck)
_, err := tn.ExecTx(ctx,
valKey, "thorchain", "set-ip-address", tn.NodeAccount.IPAddress,
)
return err
}

// Sets validator's binary version
// Sets validator's binary version.
func (tn *ChainNode) SetVersion(ctx context.Context) error {
_, err := tn.ExecTx(ctx,
valKey, "thorchain", "set-version",
)
return err
}
}
6 changes: 3 additions & 3 deletions chain/thorchain/thorchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ func (c *Thorchain) AddValidators(ctx context.Context, configFileOverrides map[s
// Fund validator from faucet
if err := c.SendFunds(ctx, "faucet", ibc.WalletAmount{
Address: c.Validators[i].NodeAccount.NodeAddress,
Amount: sdkmath.NewInt(100).MulRaw(decimalPow), // 100e8 rune
Denom: c.cfg.Denom,
Amount: sdkmath.NewInt(100).MulRaw(decimalPow), // 100e8 rune
Denom: c.cfg.Denom,
}); err != nil {
return fmt.Errorf("failed to fund val %d, %w", i, err)
}
Expand Down Expand Up @@ -245,7 +245,7 @@ func (c *Thorchain) AddValidators(ctx context.Context, configFileOverrides map[s
return c.StartAllValSidecars(ctx)
}

// AddDuplicateValidator spins up a duplicate validator node to test double signing
// AddDuplicateValidator spins up a duplicate validator node to test double signing.
func (c *Thorchain) AddDuplicateValidator(ctx context.Context, configFileOverrides map[string]any, originalVal *ChainNode) (*ChainNode, error) {
// Get peer string for existing nodes
peers := c.Nodes().PeerString(ctx)
Expand Down
38 changes: 19 additions & 19 deletions chain/thorchain/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,36 @@ type NodeAccount struct {
}

type OpenapiNode struct {
NodeAddress string `json:"node_address"`
Status string `json:"status"`
PubKeySet NodeAccountPubKeySet `json:"pub_key_set"`
NodeAddress string `json:"node_address"`
Status string `json:"status"`
PubKeySet NodeAccountPubKeySet `json:"pub_key_set"`
// the consensus pub key for the node
ValidatorConsPubKey string `json:"validator_cons_pub_key"`
// the P2PID (:6040/p2pid endpoint) of the node
PeerId string `json:"peer_id"`

Check failure on line 33 in chain/thorchain/types.go

View workflow job for this annotation

GitHub Actions / golangci-lint

ST1003: struct field PeerId should be PeerID (stylecheck)
// the block height at which the node became active
ActiveBlockHeight int64 `json:"active_block_height"`
// the block height of the current provided information for the node
StatusSince int64 `json:"status_since"`
StatusSince int64 `json:"status_since"`
NodeOperatorAddress string `json:"node_operator_address"`
// current node bond
TotalBond string `json:"total_bond"`
TotalBond string `json:"total_bond"`
BondProviders NodeBondProviders `json:"bond_providers"`
// the set of vault public keys of which the node is a member
SignerMembership []string `json:"signer_membership"`
RequestedToLeave bool `json:"requested_to_leave"`
RequestedToLeave bool `json:"requested_to_leave"`
// indicates whether the node has been forced to leave by the network, typically via ban
ForcedToLeave bool `json:"forced_to_leave"`
LeaveHeight int64 `json:"leave_height"`
IpAddress string `json:"ip_address"`
ForcedToLeave bool `json:"forced_to_leave"`
LeaveHeight int64 `json:"leave_height"`
IpAddress string `json:"ip_address"`

Check failure on line 48 in chain/thorchain/types.go

View workflow job for this annotation

GitHub Actions / golangci-lint

ST1003: struct field IpAddress should be IPAddress (stylecheck)
// the currently set version of the node
Version string `json:"version"`
// the accumulated slash points, reset at churn but excessive slash points may carry over
SlashPoints int64 `json:"slash_points"`
Jail NodeJail `json:"jail"`
CurrentAward string `json:"current_award"`
SlashPoints int64 `json:"slash_points"`
Jail NodeJail `json:"jail"`
CurrentAward string `json:"current_award"`
// the last observed heights for all chain by the node
ObserveChains []ChainHeight `json:"observe_chains"`
ObserveChains []ChainHeight `json:"observe_chains"`
PreflightStatus NodePreflightStatus `json:"preflight_status"`
}

Expand All @@ -62,7 +62,7 @@ type NodePreflightStatus struct {
Status string `json:"status"`
// the reason for the transition to the next status
Reason string `json:"reason"`
Code int64 `json:"code"`
Code int64 `json:"code"`
}

type NodeBondProviders struct {
Expand All @@ -74,17 +74,17 @@ type NodeBondProviders struct {

type NodeBondProvider struct {
BondAddress *string `json:"bond_address,omitempty"`
Bond *string `json:"bond,omitempty"`
Bond *string `json:"bond,omitempty"`
}

type NodeJail struct {
ReleaseHeight *int64 `json:"release_height,omitempty"`
Reason *string `json:"reason,omitempty"`
ReleaseHeight *int64 `json:"release_height,omitempty"`
Reason *string `json:"reason,omitempty"`
}

type ChainHeight struct {
Chain string `json:"chain"`
Height int64 `json:"height"`
Chain string `json:"chain"`
Height int64 `json:"height"`
}

// ProtoMessage is implemented by generated protocol buffer messages.
Expand Down

0 comments on commit 0a06baf

Please sign in to comment.