mirror of
https://gitee.com/BDWare/sdk-java
synced 2025-01-09 17:34:19 +00:00
fix json.stringify twice bugs
This commit is contained in:
parent
7664c8018b
commit
f7bbcf8208
@ -5,7 +5,7 @@ plugins {
|
||||
id 'signing'
|
||||
}
|
||||
group 'org.bdware.bdcontract'
|
||||
version '1.0.0'
|
||||
version '1.0.1'
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user