Skip to content

Commit

Permalink
fix(pollux): Fix Instant encoder in JdbcPresentationRepository (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioPinheiro authored Mar 3, 2023
1 parent 30b6106 commit 2ece2c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package io.iohk.atala.pollux.sql.repository
import cats.data.NonEmptyList
import cats.instances.seq
import doobie.*
import doobie.implicits.*
import doobie.implicits._
import doobie.postgres.implicits._
import io.circe._
import io.circe.parser._
import io.circe.syntax._
Expand Down Expand Up @@ -47,14 +48,10 @@ class JdbcCredentialRepository(xa: Transactor[Task], maxRetries: Int) extends Cr
// given logHandler: LogHandler = LogHandler.jdkLogHandler

import IssueCredentialRecord._
// given uuidGet: Get[UUID] = Get[String].map(UUID.fromString)
// given uuidPut: Put[UUID] = Put[String].contramap(_.toString())

given didCommIDGet: Get[DidCommID] = Get[String].map(DidCommID(_))
given didCommIDPut: Put[DidCommID] = Put[String].contramap(_.value)

import doobie.postgres.implicits.JavaTimeInstantMeta

given protocolStateGet: Get[ProtocolState] = Get[String].map(ProtocolState.valueOf)
given protocolStatePut: Put[ProtocolState] = Put[String].contramap(_.toString)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ class JdbcPresentationRepository(
given didCommIDGet: Get[DidCommID] = Get[String].map(DidCommID(_))
given didCommIDPut: Put[DidCommID] = Put[String].contramap(_.value)

given instantGet: Get[Instant] = Get[Long].map(Instant.ofEpochSecond)
given instantPut: Put[Instant] = Put[Long].contramap(_.getEpochSecond())

given protocolStateGet: Get[ProtocolState] = Get[String].map(ProtocolState.valueOf)
given protocolStatePut: Put[ProtocolState] = Put[String].contramap(_.toString)

Expand Down

0 comments on commit 2ece2c6

Please sign in to comment.