Skip to content

Commit

Permalink
chore: bump golangci-lint to v1.61.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gacevicljubisa committed Dec 2, 2024
1 parent b49452c commit b8a978d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.61.0
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ linters:
enable:
- asciicheck
- bidichk
# - depguard
- copyloopvar
- dogsled
- durationcheck
- errcheck
- errname
- errorlint
- exportloopref
- forbidigo
- gochecknoinits
- goconst
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GO ?= go
GOBIN ?= $$($(GO) env GOPATH)/bin
GOLANGCI_LINT ?= $(GOBIN)/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.51.0
GOLANGCI_LINT_VERSION ?= v1.61.0

.PHONY: get-golangcilint
get-golangcilint:
Expand Down
4 changes: 2 additions & 2 deletions pkg/funder/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ package funder

import "math/big"

func CalcTopUpAmount(min float64, currAmount *big.Int, decimals int) *big.Int {
return calcTopUpAmount(min, currAmount, decimals)
func CalcTopUpAmount(minVal float64, currAmount *big.Int, decimals int) *big.Int {
return calcTopUpAmount(minVal, currAmount, decimals)
}

func FormatAmount(amount *big.Int, decimals int) string {
Expand Down
5 changes: 3 additions & 2 deletions pkg/funder/funder.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func fundNamespace(
if err != nil {
return fmt.Errorf("failed to fetch chainID from ChainNodeEndpoint: %w", err)
}

log.Infof("using specified ChainNodeEndpoint to retrieve funding chainID: %d", chainID)
}

Expand Down Expand Up @@ -325,10 +326,10 @@ func topUpWallet(
return topUpAmount, nil
}

func calcTopUpAmount(min float64, currAmount *big.Int, decimals int) *big.Int {
func calcTopUpAmount(minVal float64, currAmount *big.Int, decimals int) *big.Int {
exp := big.NewInt(0).Exp(big.NewInt(10), big.NewInt(int64(decimals)), nil)

minAmount := big.NewFloat(min)
minAmount := big.NewFloat(minVal)
minAmount = minAmount.Mul(
minAmount,
big.NewFloat(0).SetInt(exp),
Expand Down
1 change: 1 addition & 0 deletions pkg/funder/node_lister.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func fetchNamespaceNodeInfo(ctx context.Context, namespace string, chainID int64
}

walletInfoResponseC := make(chan walletInfoResponse, len(nodes))

for _, nodeInfo := range nodes {
go func(nodeInfo NodeInfo) {
if chainID == 0 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/funder/staker.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func Stake(ctx context.Context, cfg Config, nl NodeLister, options ...FunderOpti
return nil
}

func stakeAllNodes(ctx context.Context, nodes []NodeInfo, min float64, log logging.Logger) {
func stakeAllNodes(ctx context.Context, nodes []NodeInfo, minVal float64, log logging.Logger) {
wg := sync.WaitGroup{}
wg.Add(len(nodes))

Expand All @@ -70,7 +70,7 @@ func stakeAllNodes(ctx context.Context, nodes []NodeInfo, min float64, log loggi
return
}

amount := calcTopUpAmount(min, si.StakedAmount, wallet.SwarmTokenDecimals)
amount := calcTopUpAmount(minVal, si.StakedAmount, wallet.SwarmTokenDecimals)
if amount.Cmp(big.NewInt(0)) <= 0 {
skipped.Add(1)
log.Infof("node[%s] - already staked", node.Name)
Expand Down

0 comments on commit b8a978d

Please sign in to comment.