Skip to content

Commit

Permalink
chore: bump golangci-lint to 1.61.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gacevicljubisa committed Oct 27, 2024
1 parent d806d12 commit 5d997f4
Show file tree
Hide file tree
Showing 6 changed files with 9 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(minValue float64, currAmount *big.Int, decimals int) *big.Int {
return calcTopUpAmount(minValue, currAmount, decimals)
}

func FormatAmount(amount *big.Int, decimals int) string {
Expand Down
4 changes: 2 additions & 2 deletions pkg/funder/funder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
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, minValue 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(minValue, 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 5d997f4

Please sign in to comment.