mirror of
https://gitee.com/BDWare/sdk-java
synced 2025-01-10 01:44:19 +00:00
fix json.stringify twice bugs
This commit is contained in:
parent
7664c8018b
commit
f7bbcf8208
@ -5,7 +5,7 @@ plugins {
|
|||||||
id 'signing'
|
id 'signing'
|
||||||
}
|
}
|
||||||
group 'org.bdware.bdcontract'
|
group 'org.bdware.bdcontract'
|
||||||
version '1.0.0'
|
version '1.0.1'
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,13 +32,18 @@ public class SmartContractHttpClient {
|
|||||||
|
|
||||||
public static String getExecuteUrl(String ip, int port, ContractRequest cr) {
|
public static String getExecuteUrl(String ip, int port, ContractRequest cr) {
|
||||||
try {
|
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(
|
return String.format(
|
||||||
"http://%s:%d/SCIDE/CMManager?action=executeContract&contractID=%s&operation=%s&arg=%s&pubkey=%s&signature=%s",
|
"http://%s:%d/SCIDE/CMManager?action=executeContract&contractID=%s&operation=%s&arg=%s&pubkey=%s&signature=%s",
|
||||||
ip,
|
ip,
|
||||||
port,
|
port,
|
||||||
cr.getContractID(),
|
cr.getContractID(),
|
||||||
cr.getAction(),
|
cr.getAction(),
|
||||||
URLEncoder.encode(cr.getArg().toString(), "utf-8"),
|
URLEncoder.encode(str, "utf-8"),
|
||||||
cr.getPublicKey(),
|
cr.getPublicKey(),
|
||||||
cr.signature);
|
cr.signature);
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user