From 2b2751a69362cc5a9b5335484f021655efba0e85 Mon Sep 17 00:00:00 2001 From: Alexander Slesarenko Date: Fri, 16 Feb 2024 20:07:03 +0100 Subject: [PATCH] test of DigestSize --- .../scala/scorex/crypto/hash/HashTest.scala | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/shared/src/test/scala/scorex/crypto/hash/HashTest.scala b/shared/src/test/scala/scorex/crypto/hash/HashTest.scala index 4fce1e88..a3f3df93 100644 --- a/shared/src/test/scala/scorex/crypto/hash/HashTest.scala +++ b/shared/src/test/scala/scorex/crypto/hash/HashTest.scala @@ -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 { @@ -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 } } }