• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

input-output-hk / atala-prism-building-blocks / 5544147843

13 Jul 2023 02:11PM UTC coverage: 28.655% (+0.3%) from 28.368%
5544147843

push

web-flow
feat: ATL-4888 Anoncred schema type (#590)

* feat: ATL-4888 Anoncred Schema

* feat: ATL-4888 Added test

* feat: ATL-4888 Include version in type

2799 of 9768 relevant lines covered (28.65%)

0.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/mercury/mercury-library/agent-cli-didcommx/src/main/scala/io/iohk/atala/mercury/AgentHardCode.scala
1
package io.iohk.atala.mercury
2

3
import zio._
4
import io.circe._
5
import io.circe.syntax._
6

7
import io.iohk.atala.mercury.model.{given, _}
8
import io.iohk.atala.mercury.protocol.issuecredential._
9
import java.io.IOException
10

11
import scala.language.implicitConversions
12

13
object AgentHardCode extends ZIOAppDefault {
14

×
15
  def run = for {
×
16
    didPeer <- for {
×
17
      peer <- ZIO.succeed(PeerDID.makePeerDid()) // (serviceEndpoint = serviceEndpoint))
×
18
      _ <- Console.printLine(s"New DID: ${peer.did}") *>
×
19
        Console.printLine(s"JWK for KeyAgreement: ${peer.jwkForKeyAgreement.toJSONString}") *>
×
20
        Console.printLine(s"JWK for KeyAuthentication: ${peer.jwkForKeyAuthentication.toJSONString}")
21
    } yield (peer)
×
22
    _ <- test.provide(DidCommX.liveLayer, AgentPeerService.makeLayer(didPeer))
23
  } yield ()
24

×
25
  val attribute1 = Attribute(name = "name", value = "Joe Blog")
×
26
  val attribute2 = Attribute(name = "dob", value = "01/10/1947")
×
27
  val credentialPreview = CredentialPreview(attributes = Seq(attribute1, attribute2))
×
28
  val body = ProposeCredential.Body(
29
    goal_code = Some("Propose Credential"),
30
    credential_preview = credentialPreview,
×
31
    formats = Seq.empty
32
  )
33

×
34
  def test: ZIO[DidOps & DidAgent, IOException, Unit] = {
×
35
    for {
×
36
      agentService <- ZIO.service[DidAgent]
×
37
      opsService <- ZIO.service[DidOps]
×
38
      msg = Message(
39
        `type` = "TEST",
×
40
        from = Some(agentService.id),
×
41
        to = Seq.empty,
×
42
        body = body.asJson.asObject.get
43
      )
44
      // signed <- didCommService.packSigned(msg)
×
45
      ttt <- opsService.packEncrypted(msg, to = agentService.id)
×
46
      msg2 <- opsService.unpack(ttt.string)
×
47
      _ <- Console.printLine(msg)
48

×
49
      aaa = msg: org.didcommx.didcomm.message.Message
×
50
      _ <- Console.printLine("aaaaaaaaaaaaaaaaaaaaaaaaaaaa")
×
51
      _ <- Console.printLine(aaa.getAttachments())
52
    } yield ()
53
  }
54

55
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc