From e2a9919ff77d5e49cff6ae10a90556fcb3f7d7d2 Mon Sep 17 00:00:00 2001 From: Benjamin Voiturier Date: Wed, 4 Dec 2024 15:30:01 +0100 Subject: [PATCH] fix: fix Json serialisation error when packing forward message for mediator Signed-off-by: Benjamin Voiturier --- .../hyperledger/identus/mercury/model/EncryptedMessage.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mercury/models/src/main/scala/org/hyperledger/identus/mercury/model/EncryptedMessage.scala b/mercury/models/src/main/scala/org/hyperledger/identus/mercury/model/EncryptedMessage.scala index 323a377d0f..5e5661016b 100644 --- a/mercury/models/src/main/scala/org/hyperledger/identus/mercury/model/EncryptedMessage.scala +++ b/mercury/models/src/main/scala/org/hyperledger/identus/mercury/model/EncryptedMessage.scala @@ -1,7 +1,7 @@ package org.hyperledger.identus.mercury.model import zio.json.ast.Json -import zio.json.EncoderOps +import zio.json.DecoderOps import java.util.Base64 @@ -9,7 +9,8 @@ trait EncryptedMessage { // (private val msg: PackEncryptedResult) { def string: String // = msg.getPackedMessage def base64: String = Base64.getUrlEncoder.encodeToString(string.getBytes) def asJson: Json.Obj = { - string.toJsonAST + string + .fromJson[Json] .flatMap(o => o.asObject match case None => Left(RuntimeException(s"Expecting Json Object got '$o'"))