fix json.stringify twice bugs

This commit is contained in:
CaiHQ 2022-07-05 12:00:11 +08:00
parent 7664c8018b
commit f7bbcf8208
2 changed files with 7 additions and 2 deletions

View File

@ -5,7 +5,7 @@ plugins {
id 'signing'
}
group 'org.bdware.bdcontract'
version '1.0.0'
version '1.0.1'
sourceCompatibility = 1.8

View File

@ -32,13 +32,18 @@ public class SmartContractHttpClient {
public static String getExecuteUrl(String ip, int port, ContractRequest cr) {
try {
String str;
if (cr.getArg() == null) str = "";
else if (cr.getArg().isJsonPrimitive())
str = cr.getArg().getAsString();
else str = cr.getArg().toString();
return String.format(
"http://%s:%d/SCIDE/CMManager?action=executeContract&contractID=%s&operation=%s&arg=%s&pubkey=%s&signature=%s",
ip,
port,
cr.getContractID(),
cr.getAction(),
URLEncoder.encode(cr.getArg().toString(), "utf-8"),
URLEncoder.encode(str, "utf-8"),
cr.getPublicKey(),
cr.signature);
} catch (UnsupportedEncodingException e) {