diff --git a/castor/src/test/scala/org/hyperledger/identus/castor/core/model/did/PrismDIDSpec.scala b/castor/src/test/scala/org/hyperledger/identus/castor/core/model/did/PrismDIDSpec.scala index 54a18c23ed..ac4cade98a 100644 --- a/castor/src/test/scala/org/hyperledger/identus/castor/core/model/did/PrismDIDSpec.scala +++ b/castor/src/test/scala/org/hyperledger/identus/castor/core/model/did/PrismDIDSpec.scala @@ -1,7 +1,7 @@ package org.hyperledger.identus.castor.core.model.did import com.google.protobuf.ByteString -import io.iohk.atala.prism.crypto.{Sha256, Sha256Digest} +import org.hyperledger.identus.shared.crypto.Sha256Hash import io.iohk.atala.prism.protos.node_models import org.hyperledger.identus.shared.models.Base64UrlString import zio.* @@ -12,11 +12,11 @@ import org.hyperledger.identus.castor.core.model.did.PrismDID object PrismDIDSpec extends ZIOSpecDefault { private val canonicalSuffixHex = "9b5118411248d9663b6ab15128fba8106511230ff654e7514cdcc4ce919bde9b" - private val canonicalSuffix = Sha256Digest.fromHex(canonicalSuffixHex) + private val canonicalSuffix = Sha256Hash.fromHex(canonicalSuffixHex) private val encodedStateUsedBase64 = "Cj8KPRI7CgdtYXN0ZXIwEAFKLgoJc2VjcDI1NmsxEiEDHpf-yhIns-LP3tLvA8icC5FJ1ZlBwbllPtIdNZ3q0jU" - private val short = PrismDID.buildCanonical(canonicalSuffix.getValue).toOption.get + private val short = PrismDID.buildCanonical(canonicalSuffix.bytes.toArray).toOption.get private val long = PrismDID .buildLongFormFromAtalaOperation( node_models.AtalaOperation.parseFrom(Base64UrlString.fromStringUnsafe(encodedStateUsedBase64).toByteArray) @@ -27,7 +27,7 @@ object PrismDIDSpec extends ZIOSpecDefault { private val didParserSpec = suite("PrismDID.fromString")( test("success for valid DID") { - val stateHash = Sha256.compute(Array()).getValue + val stateHash = Sha256Hash.compute(Array()).bytes.toArray val validDID = PrismDID.buildCanonical(stateHash).toOption.get val unsafeDID = PrismDID.fromString(validDID.toString) assert(unsafeDID)(isRight(equalTo(validDID))) @@ -58,7 +58,7 @@ object PrismDIDSpec extends ZIOSpecDefault { ) val encodedState = mockAtalaOperation.toByteArray val encodedStateBase64 = Base64UrlString.fromByteArray(encodedState).toStringNoPadding - val stateHash = Sha256.compute(encodedState).getHexValue + val stateHash = Sha256Hash.compute(encodedState).hexEncoded val didString = s"did:prism:$stateHash:$encodedStateBase64" val unsafeDID = PrismDID.fromString(didString) assert(unsafeDID)(isLeft(containsString("CreateDid Atala operation expected")))