From b0a936eb424899be41b1b619983704ad0231a662 Mon Sep 17 00:00:00 2001 From: leej1012 Date: Tue, 7 Jan 2025 18:31:14 +0800 Subject: [PATCH] Update decodeInputDataParameter --- .../ontio/service/impl/TransactionServiceImpl.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/TransactionServiceImpl.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/TransactionServiceImpl.java index ba5b0682..20e0acf6 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/TransactionServiceImpl.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/TransactionServiceImpl.java @@ -324,6 +324,9 @@ private InputDataView decodeNeoVmInputData(String inputData) { int index = removeVarBytes.indexOf(rawData); args = removeVarBytes.substring(index + rawData.length()); Object data = map.get("data"); + if (data instanceof BigInteger) { + data = data.toString(); + } params.add(rawData); inputDataDecode.setName(name); inputDataDecode.setType(type); @@ -436,6 +439,9 @@ private InputDataView decodeInputDataParameter(String methodId, String method, L Map map = decodeDataByType(sType, arg, true); String rawData = (String) map.get("rawData"); Object data = map.get("data"); + if (data instanceof BigInteger) { + data = data.toString(); + } params.add(rawData); inputDataDecode.setName(subParameter.getName()); inputDataDecode.setType(sType); @@ -456,6 +462,9 @@ private InputDataView decodeInputDataParameter(String methodId, String method, L Map map = decodeDataByType(sType, arg, true); String rawData = (String) map.get("rawData"); Object data = map.get("data"); + if (data instanceof BigInteger) { + data = data.toString(); + } params.add(rawData); dataList.add(data); argIndex++; @@ -483,6 +492,7 @@ private InputDataView decodeInputDataParameter(String methodId, String method, L params.add(rawData); if (data instanceof BigInteger) { lastLength = ((BigInteger) data).intValue(); + data = data.toString(); } function.append(type).append(ConstantParam.BLANK).append(name).append(ConstantParam.FUNCTION_PARAM_SPLIT); inputDataDecode.setName(name); @@ -522,8 +532,8 @@ private Map decodeDataByType(String type, String arg, boolean is break; case "Uint64": case "BigInt": - BigInteger number = Helper.parseInputDataNumber(arg, isNative); - data = number.toString(); + data = Helper.parseInputDataNumber(arg, isNative); + BigInteger number = (BigInteger) data; if (isNative) { BigInteger rawNumber; int value = number.intValue();