Skip to content

Commit

Permalink
Add warning logs for low mana balance
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed Feb 20, 2024
1 parent fa57fdc commit 37983cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: 'true'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: 'true'

Expand Down
4 changes: 4 additions & 0 deletions pkg/faucet/faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,11 +666,15 @@ func (f *Faucet) createTransactionBuilder(api iotago.API, unspentOutputs []UTXOB

unboundStoredManaRemainder, err := safemath.SafeSub(availableManaInputs.UnboundStoredMana, totalManaPayouts)
if err != nil {
f.logSoftError(ierrors.Wrapf(err, "not enough mana left in the faucet to do the payouts: %d < %d", availableManaInputs.UnboundStoredMana, totalManaPayouts))

// underflow => not enough mana left in the faucet
return 0
}

if unboundStoredManaRemainder <= f.opts.manaAmountMinFaucet {
f.logSoftError(ierrors.Errorf("not enough mana left in the faucet: %d < %d", unboundStoredManaRemainder, f.opts.manaAmountMinFaucet))

// not enough mana left in the faucet
return 0
}
Expand Down

0 comments on commit 37983cc

Please sign in to comment.