Skip to content

Commit

Permalink
Update decodeInputDataParameter
Browse files Browse the repository at this point in the history
  • Loading branch information
leej1012 committed Jan 7, 2025
1 parent 562b480 commit b0a936e
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -436,6 +439,9 @@ private InputDataView decodeInputDataParameter(String methodId, String method, L
Map<String, Object> 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);
Expand All @@ -456,6 +462,9 @@ private InputDataView decodeInputDataParameter(String methodId, String method, L
Map<String, Object> 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++;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -522,8 +532,8 @@ private Map<String, Object> 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();
Expand Down

0 comments on commit b0a936e

Please sign in to comment.