Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.8
sbt.version=1.8.2
6 changes: 6 additions & 0 deletions src/main/scala/iog/psg/cardano/TxMetadataOut.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ final case class TxMetadataOut(json: Json) {
case Some(ValueTypeBytes) =>
extractBytesField(cursor)

case Some(ValueTypeList) =>
extractListField(cursor, key)

case Some(ValueTypeMap) =>
extractMapField(cursor, key)

case Some(valueType) => Left(DecodingFailure(s"Invalid type '$valueType'", List(DownField(key))))

case None => Left(DecodingFailure("Missing value under key", List(DownField(key))))
Expand Down
3 changes: 2 additions & 1 deletion src/test/scala/iog/psg/cardano/TxMetadataCodecSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ class TxMetadataCodecSpec extends AnyFlatSpec with Matchers with DummyModel {
3 -> MetadataValueArray(Seq(
MetadataValueLong(14),
MetadataValueByteString(ByteString("2512a00e9653fe49a44a5886202e24d77eeb998f")),
MetadataValueStr("1337")
MetadataValueStr("1337"),
MetadataValueMap(Map(MetadataValueLong(1) -> MetadataValueLong(3)))
)),
4 -> MetadataValueMap(
Map(
Expand Down
12 changes: 12 additions & 0 deletions src/test/scala/iog/psg/cardano/util/DummyModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ trait DummyModel { self: Assertions =>
| },
| {
| "string": "1337"
| },
| {
| "map": [
| {
| "k": {
| "int":1
| },
| "v":{
| "int": 3
| }
| }
| ]
| }
| ]
| },
Expand Down