From 5d997f466ab267c9e6e6192599b02af6ba91af88 Mon Sep 17 00:00:00 2001 From: Ljubisa Gacevic Date: Sun, 27 Oct 2024 12:53:53 +0100 Subject: [PATCH] chore: bump golangci-lint to 1.61.0 --- .github/workflows/lint.yml | 2 +- .golangci.yml | 3 +-- Makefile | 2 +- pkg/funder/export_test.go | 4 ++-- pkg/funder/funder.go | 4 ++-- pkg/funder/staker.go | 4 ++-- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0fcd6e8..9f45f35 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,4 +13,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: v1.56.2 + version: v1.61.0 diff --git a/.golangci.yml b/.golangci.yml index 64bb190..b163c4f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,13 +4,12 @@ linters: enable: - asciicheck - bidichk - # - depguard + - copyloopvar - dogsled - durationcheck - errcheck - errname - errorlint - - exportloopref - forbidigo - gochecknoinits - goconst diff --git a/Makefile b/Makefile index 3007bba..735223e 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/pkg/funder/export_test.go b/pkg/funder/export_test.go index 9448de0..ce2ce80 100644 --- a/pkg/funder/export_test.go +++ b/pkg/funder/export_test.go @@ -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(minValue float64, currAmount *big.Int, decimals int) *big.Int { + return calcTopUpAmount(minValue, currAmount, decimals) } func FormatAmount(amount *big.Int, decimals int) string { diff --git a/pkg/funder/funder.go b/pkg/funder/funder.go index 373a261..b7cee77 100644 --- a/pkg/funder/funder.go +++ b/pkg/funder/funder.go @@ -316,10 +316,10 @@ func topUpWallet( return topUpAmount, nil } -func calcTopUpAmount(min float64, currAmount *big.Int, decimals int) *big.Int { +func calcTopUpAmount(minValue 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(minValue) minAmount = minAmount.Mul( minAmount, big.NewFloat(0).SetInt(exp), diff --git a/pkg/funder/staker.go b/pkg/funder/staker.go index 184c2a0..88ea11f 100644 --- a/pkg/funder/staker.go +++ b/pkg/funder/staker.go @@ -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, minValue float64, log logging.Logger) { wg := sync.WaitGroup{} wg.Add(len(nodes)) @@ -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(minValue, si.StakedAmount, wallet.SwarmTokenDecimals) if amount.Cmp(big.NewInt(0)) <= 0 { skipped.Add(1) log.Infof("node[%s] - already staked", node.Name)