Skip to content

Commit

Permalink
Update main.go
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
faddat and coderabbitai[bot] authored Oct 27, 2024
1 parent 99e7b0b commit f923132
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,20 @@ func main() {
log.Fatalf("Failed to get balances after adjustment: %v", err)
}

if !lib.CheckBalancesWithinThreshold(balances, 0.10) {
totalBalance := sdkmath.ZeroInt()
for _, balance := range balances {
totalBalance = totalBalance.Add(balance)
}
if totalBalance.IsZero() {
fmt.Println("All accounts have zero balance. Proceeding without adjusting balances.")
} else {
log.Fatalf("Account balances are still not within 10%% of each other after adjustment")
}
if lib.CheckBalancesWithinThreshold(balances, 0.10) {
return
}

totalBalance := sdkmath.ZeroInt()
for _, balance := range balances {
totalBalance = totalBalance.Add(balance)
}
if totalBalance.IsZero() {
fmt.Println("All accounts have zero balance. Proceeding without adjusting balances.")
return
}
log.Fatalf("Account balances are still not within 10%% of each other after adjustment")
}
}

nodeURL := config.Nodes.RPC[0] // Use the first node

Check failure on line 122 in main.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: non-declaration statement outside function body

Check failure on line 122 in main.go

View workflow job for this annotation

GitHub Actions / lint

expected declaration, found nodeURL (typecheck)

Check failure on line 122 in main.go

View workflow job for this annotation

GitHub Actions / build (1.23.x, ubuntu-latest)

syntax error: non-declaration statement outside function body
Expand Down

0 comments on commit f923132

Please sign in to comment.