fix: fix bugs in signature of ContractRequest

add ContractRequest.parseArg to handle the type of arg
This commit is contained in:
Frank.R.Wu 2021-12-11 19:25:43 +08:00
parent 4bbe861fcc
commit 654ec47663

View File

@ -138,11 +138,19 @@ public class ContractRequest extends SM2Verifiable
"%s|%s|%s%s|%s",
(contractDOI != null && contractDOI.length() > 0) ? contractDOI : contractID,
action,
arg.getAsString(),
parseArg(),
gasLimit > 0 ? "|" + gasLimit : "",
requester);
}
private String parseArg() {
try {
return arg.getAsString();
} catch (Exception e) {
return arg.toString();
}
}
public byte[] toByte() {
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();