Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions shared/src/test/scala/scorex/crypto/hash/HashTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import org.scalatest.matchers.should.Matchers
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import scorex.util.encode.Base16

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
import scala.concurrent.{Await, Future}

trait HashTest extends AnyPropSpec
with ScalaCheckDrivenPropertyChecks
with Matchers {
Expand Down Expand Up @@ -56,15 +52,11 @@ trait HashTest extends AnyPropSpec
}


property(s"${hash.getClass.getSimpleName} should return correct Tag") {
forAll { (string: String, bytes: Array[Byte]) =>
val digest = hash(string)
digest.isInstanceOf[D] shouldBe true
if (digest.isInstanceOf[Digest32]) {
hash.DigestSize shouldBe 32
} else if (digest.isInstanceOf[Digest64]) {
hash.DigestSize shouldBe 64
}
property(s"${hash.getClass.getSimpleName} should have correct size") {
if (hash.isInstanceOf[CryptographicHash32]) {
hash.DigestSize shouldBe 32
} else {
hash.DigestSize shouldBe 64
}
}
}
Expand Down