Skip to content

Commit

Permalink
op-node: Add RandomBool to testutils
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianst committed Feb 13, 2023
1 parent 38773bb commit 3397ab2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions op-node/testutils/random.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ import (
"github.com/ethereum/go-ethereum/crypto"
)

func RandomBool(rng *rand.Rand) bool {
if b := rng.Intn(2); b == 0 {
return false
}
return true
}

func RandomHash(rng *rand.Rand) (out common.Hash) {
rng.Read(out[:])
return
Expand Down

0 comments on commit 3397ab2

Please sign in to comment.