We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d45697 commit 3b14d74Copy full SHA for 3b14d74
src/test/scala/scorex/crypto/authds/merkle/MerkleTreeSpecification.scala
@@ -50,12 +50,13 @@ class MerkleTreeSpecification extends AnyPropSpec with ScalaCheckDrivenPropertyC
50
}
51
52
property("Batch proof generation by indices") {
53
+ val r = new Random()
54
forAll(smallInt) { N: Int =>
55
whenever(N > 0) {
56
val d = (0 until N).map(_ => LeafData @@ scorex.utils.Random.randomBytes(LeafSize))
57
val tree = MerkleTree(d)
- val randIndices = (0 until Random.between(1, N + 1))
58
- .map(_ => Random.between(0, N))
+ val randIndices = (0 until r.nextInt(N + 1) + 1)
59
+ .map(_ => r.nextInt(N))
60
.distinct
61
.sorted
62
tree.proofByIndices(randIndices).get.valid(tree.rootHash) shouldBe true
0 commit comments