From b4d8e288484c72e58882d4eaafeccbef4863dab7 Mon Sep 17 00:00:00 2001 From: Thomas Kammerlocher Date: Mon, 4 Nov 2024 12:13:40 +0100 Subject: [PATCH] fix: fixed a bug where a string within a transaction couldn't be parsed (#249) --- .../construction/service/CardanoConstructionServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/org/cardanofoundation/rosetta/api/construction/service/CardanoConstructionServiceImpl.java b/api/src/main/java/org/cardanofoundation/rosetta/api/construction/service/CardanoConstructionServiceImpl.java index 651f394b..f1a18dd0 100644 --- a/api/src/main/java/org/cardanofoundation/rosetta/api/construction/service/CardanoConstructionServiceImpl.java +++ b/api/src/main/java/org/cardanofoundation/rosetta/api/construction/service/CardanoConstructionServiceImpl.java @@ -503,7 +503,8 @@ public String extractTransactionIfNeeded(String txWithExtraData) { byte[] bytes = HexUtil.decodeHexString(txWithExtraData); Array deserialize = (Array) CborSerializationUtil.deserialize(bytes); // Unpack transaction if needed - if (deserialize.getDataItems().size() == 1) { + if (deserialize.getDataItems().size() == 1 && deserialize.getDataItems().getFirst().getMajorType() + .equals(MajorType.ARRAY)) { deserialize = (Array) deserialize.getDataItems().getFirst(); } if (deserialize.getDataItems().isEmpty()) {