Skip to content

Commit

Permalink
fix: Encoder for VerificationMethodReferenced as String (#110)
Browse files Browse the repository at this point in the history
fix(mediator): encoder for the VerificationMethodReferenced

Signed-off-by: Shailesh Patil <shailesh.patil@iohk.io>
Signed-off-by: Shailesh Patil <53746241+mineme0110@users.noreply.github.com>

Signed-off-by: Shailesh Patil <shailesh.patil@iohk.io>
  • Loading branch information
mineme0110 committed May 1, 2024
1 parent 2864c98 commit fda478f
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,13 @@ given BSONDocumentWriter[Recipient] =
given BSONDocumentReader[Recipient] =
Macros.reader[Recipient]

given BSONDocumentWriter[VerificationMethodReferenced] =
Macros.writer[VerificationMethodReferenced]
given BSONDocumentReader[VerificationMethodReferenced] =
Macros.reader[VerificationMethodReferenced]
given BSONWriter[VerificationMethodReferenced] with {
def writeTry(obj: VerificationMethodReferenced): Try[BSONValue] = Try(BSONString(obj.value))
}
given BSONReader[VerificationMethodReferenced] with {
def readTry(bson: BSONValue): Try[VerificationMethodReferenced] =
bson.asTry[String].map(v => VerificationMethodReferenced(v))
}

given BSONDocumentWriter[RecipientHeader] =
Macros.writer[RecipientHeader]
Expand Down

0 comments on commit fda478f

Please sign in to comment.