Skip to content

Commit

Permalink
fix: amount negative value
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci committed Oct 25, 2024
1 parent 7af6f6d commit 973319d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bridge/standard/cmd/emulator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ func main() {
ticker := time.NewTicker(15 * time.Second)
defer ticker.Stop()

minWeiValue := big.NewInt(params.Ether / 100) // Enforce minimum value of 0.01 ETH.

RESTART:
for {
select {
Expand All @@ -199,10 +201,9 @@ func main() {
})

// Generate a random amount of wei in [0.01, 1] ETH
randWeiValue := big.NewInt(rand.Int64N(int64(params.Ether)))
if randWeiValue.Cmp(big.NewInt(params.Ether/1000)) < 0 {
// Enforce minimum value of 0.01 ETH
randWeiValue = big.NewInt(params.Ether / 1000)
randWeiValue := big.NewInt(rand.Int64N(params.Ether))
if randWeiValue.Cmp(minWeiValue) < 0 {
randWeiValue = minWeiValue
}

// Create and start the transfer to the settlement chain
Expand Down

0 comments on commit 973319d

Please sign in to comment.