diff --git a/build.gradle b/build.gradle index 5e107ef..8b9eb99 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id 'signing' } group 'org.bdware.bdcontract' -version '1.0.0' +version '1.0.1' sourceCompatibility = 1.8 diff --git a/src/main/sdk/org/bdware/client/SmartContractHttpClient.java b/src/main/sdk/org/bdware/client/SmartContractHttpClient.java index 4063b61..f05b9a5 100644 --- a/src/main/sdk/org/bdware/client/SmartContractHttpClient.java +++ b/src/main/sdk/org/bdware/client/SmartContractHttpClient.java @@ -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) {