@@ -29,7 +29,7 @@ class BatchAVLProver[D <: Digest, HF <: CryptographicHash[D]](val keyLength: Int
29
29
(implicit val hf : HF = Blake2b256 )
30
30
extends AuthenticatedTreeOps [D ] with ToStringHelper with ScorexLogging {
31
31
32
- protected val labelLength = hf.DigestSize
32
+ protected val labelLength : Int = hf.DigestSize
33
33
34
34
private [batch] var topNode : ProverNodes [D ] = oldRootAndHeight.map(_._1).getOrElse({
35
35
val t = new ProverLeaf (NegativeInfinityKey ,
@@ -230,7 +230,7 @@ class BatchAVLProver[D <: Digest, HF <: CryptographicHash[D]](val keyLength: Int
230
230
}
231
231
}
232
232
233
- loop(topNode, false )
233
+ loop(topNode, keyFound = false )
234
234
}
235
235
236
236
/**
@@ -267,7 +267,7 @@ class BatchAVLProver[D <: Digest, HF <: CryptographicHash[D]](val keyLength: Int
267
267
* that contains only this info)
268
268
* - Condense the sequence of values if they are mostly not randomly distributed
269
269
* */
270
- def packTree (rNode : ProverNodes [D ]) {
270
+ def packTree (rNode : ProverNodes [D ]): Unit = {
271
271
// Post order traversal to pack up the tree
272
272
if (! rNode.visited) {
273
273
packagedTree += LabelInPackagedProof
@@ -357,21 +357,21 @@ class BatchAVLProver[D <: Digest, HF <: CryptographicHash[D]](val keyLength: Int
357
357
* @return Random leaf from the tree that is not positive or negative infinity
358
358
*/
359
359
def randomWalk (rand : Random = new Random ): Option [(ADKey , ADValue )] = {
360
- def internalNodeFn (r : InternalProverNode [D ], dummy : Unit . type ) =
360
+ def internalNodeFn (r : InternalProverNode [D ], dummy : Unit ) : ( ProverNodes [ D ], Unit ) =
361
361
rand.nextBoolean() match {
362
362
case true =>
363
- (r.right, Unit )
363
+ (r.right, () )
364
364
case false =>
365
- (r.left, Unit )
365
+ (r.left, () )
366
366
}
367
367
368
- def leafFn (leaf : ProverLeaf [D ], dummy : Unit . type ): Option [(ADKey , ADValue )] = {
368
+ def leafFn (leaf : ProverLeaf [D ], dummy : Unit ): Option [(ADKey , ADValue )] = {
369
369
if (leaf.key sameElements PositiveInfinityKey ) None
370
370
else if (leaf.key sameElements NegativeInfinityKey ) None
371
371
else Some (leaf.key -> leaf.value)
372
372
}
373
373
374
- treeWalk(internalNodeFn, leafFn, Unit )
374
+ treeWalk(internalNodeFn, leafFn, () )
375
375
}
376
376
377
377
/**
@@ -442,7 +442,7 @@ class BatchAVLProver[D <: Digest, HF <: CryptographicHash[D]](val keyLength: Int
442
442
var fail : Boolean = false
443
443
444
444
def checkTreeHelper (rNode : ProverNodes [D ]): (ProverLeaf [D ], ProverLeaf [D ], Int ) = {
445
- def myRequire (t : Boolean , s : String ) = {
445
+ def myRequire (t : Boolean , s : String ): Unit = {
446
446
if (! t) {
447
447
var x = rNode.key(0 ).toInt
448
448
if (x < 0 ) x = x + 256
0 commit comments