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

hyperledger / identus-cloud-agent / 11056380298

26 Sep 2024 04:28PM UTC coverage: 48.66% (+0.05%) from 48.609%
11056380298

Pull #1375

yshyn-iohk
fix: migration to a new eudi.openid4vci library

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Pull Request #1375: fix: OAS and http clients for Kotliln and TypeScript

34 of 81 new or added lines in 25 files covered. (41.98%)

182 existing lines in 53 files now uncovered.

7860 of 16153 relevant lines covered (48.66%)

0.49 hits per line

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

78.57
/pollux/sql-doobie/src/main/scala/org/hyperledger/identus/pollux/sql/model/db/package.scala
1
package org.hyperledger.identus.pollux.sql.model
2

3
import doobie._
4
import doobie.postgres._
5
import doobie.postgres.implicits._
6
import io.getquill.doobie.DoobieContext
7
import io.getquill.MappedEncoding
8
import org.hyperledger.identus.pollux.core.model.ResourceResolutionMethod
9
import org.hyperledger.identus.shared.models.WalletId
10
import org.postgresql.util.PGobject
11

12
import java.util.UUID
13

14
package object db {
15

16
  given MappedEncoding[WalletId, UUID] = MappedEncoding(_.toUUID)
1✔
17
  given MappedEncoding[UUID, WalletId] = MappedEncoding(WalletId.fromUUID)
1✔
18

19
  given mappedDecoderResourceResolutionMethod: MappedEncoding[ResourceResolutionMethod, String] =
20
    MappedEncoding[ResourceResolutionMethod, String](_.toString)
21

22
  given mappedEncoderResourceResolutionMethod: MappedEncoding[String, ResourceResolutionMethod] =
23
    MappedEncoding[String, ResourceResolutionMethod] {
NEW
24
      case "did"  => ResourceResolutionMethod.did
×
NEW
25
      case "http" => ResourceResolutionMethod.http
×
UNCOV
26
      case other  => throw new IllegalArgumentException(s"Unknown ResourceResolutionMethod: $other")
×
27
    }
28

29
  trait PostgresEnumEncoders {
30
    this: DoobieContext.Postgres[_] =>
31

32
    given encoderResourceResolutionMethod: Encoder[ResourceResolutionMethod] = encoder[ResourceResolutionMethod](
1✔
33
      java.sql.Types.OTHER,
34
      (index: Index, value: ResourceResolutionMethod, row: PrepareRow) => {
35
        val pgObj = new PGobject()
1✔
36
        pgObj.setType("resolution_method_enum")
1✔
37
        pgObj.setValue(value.toString)
1✔
38
        row.setObject(index, pgObj, java.sql.Types.OTHER)
1✔
39
      }
40
    )
41

42
    given decoderResourceResolutionMethod: Decoder[ResourceResolutionMethod] = decoder(row =>
1✔
43
      index =>
44
        row.getObject(index).toString match {
1✔
45
          case "did"  => ResourceResolutionMethod.did
1✔
46
          case "http" => ResourceResolutionMethod.http
1✔
47
        }
48
    )
49
  }
50

51
}
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