Skip to content

Commit

Permalink
ATL-6447: rebase tests
Browse files Browse the repository at this point in the history
Signed-off-by: Bassam Riman <bassam.riman@iohk.io>
  • Loading branch information
CryptoKnightIOG committed Apr 21, 2024
1 parent 56cdd47 commit 0ff68a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.iohk.atala.pollux.core.service.verification

import io.iohk.atala.agent.walletapi.crypto.{Prism14ECPrivateKey, Prism14ECPublicKey}
import io.iohk.atala.agent.walletapi.service.{ManagedDIDService, MockManagedDIDService}
import io.iohk.atala.castor.core.model.did.VerificationRelationship
import io.iohk.atala.castor.core.service.{DIDService, MockDIDService}
Expand All @@ -20,8 +19,8 @@ trait VcVerificationServiceSpecHelper {
protected val issuer =
Issuer(
did = io.iohk.atala.pollux.vc.jwt.DID(issuerDidData.id.did.toString),
signer = ES256KSigner(Prism14ECPrivateKey(issuerKp.getPrivateKey).toJavaPrivateKey),
publicKey = Prism14ECPublicKey(issuerKp.getPublicKey).toJavaPublicKey
signer = ES256KSigner(issuerKp.privateKey.toJavaPrivateKey),
publicKey = issuerKp.publicKey.toJavaPublicKey
)

protected val issuerDidServiceExpectations: Expectation[DIDService] =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package io.iohk.atala.verification.controller

import com.typesafe.config.ConfigFactory
import io.iohk.atala.agent.server.config.AppConfig
import io.iohk.atala.agent.server.http.CustomServerInterceptors
import io.iohk.atala.agent.walletapi.crypto.{Prism14ECPrivateKey, Prism14ECPublicKey}
import io.iohk.atala.agent.walletapi.model.BaseEntity
import io.iohk.atala.agent.walletapi.service.ManagedDIDService
import io.iohk.atala.castor.core.model.did.VerificationRelationship
Expand All @@ -22,8 +19,6 @@ import sttp.tapir.server.interceptor.CustomiseInterceptors
import sttp.tapir.server.stub.TapirStubInterpreter
import sttp.tapir.ztapir.RIOMonadError
import zio.*
import zio.config.typesafe.TypesafeConfigSource
import zio.config.{ReadError, read}
import zio.test.*

trait VcVerificationControllerTestTools extends PostgresTestContainerSupport {
Expand All @@ -35,22 +30,12 @@ trait VcVerificationControllerTestTools extends PostgresTestContainerSupport {
protected val issuer =
Issuer(
did = io.iohk.atala.pollux.vc.jwt.DID(issuerDidData.id.did.toString),
signer = ES256KSigner(Prism14ECPrivateKey(issuerKp.getPrivateKey).toJavaPrivateKey),
publicKey = Prism14ECPublicKey(issuerKp.getPublicKey).toJavaPublicKey
signer = ES256KSigner(issuerKp.privateKey.toJavaPrivateKey),
publicKey = issuerKp.publicKey.toJavaPublicKey
)

val didResolverLayer = ZLayer.fromZIO(ZIO.succeed(makeResolver(Map.empty)))

val configLayer: Layer[ReadError[String], AppConfig] = ZLayer.fromZIO {
read(
AppConfig.descriptor.from(
TypesafeConfigSource.fromTypesafeConfig(
ZIO.attempt(ConfigFactory.load())
)
)
)
}

private[this] def makeResolver(lookup: Map[String, DIDDocument]): DidResolver = (didUrl: String) => {
lookup
.get(didUrl)
Expand Down

0 comments on commit 0ff68a2

Please sign in to comment.