Browse Source

#89 Properly log "error" field from ETH node response.

pass-iguana-arg
Artem Pikulin 7 years ago
parent
commit
3ec274b4a5
  1. 3
      etomic_build/enable
  2. 2
      etomic_build/userpass
  3. 2
      iguana/exchanges/etomicswap/etomiccurl.c

3
etomic_build/enable

@ -1,5 +1,4 @@
#!/bin/bash
source userpass
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"ETH\"}"
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"KMD\"}"
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"ETOMIC\"}"
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"ETH\"}"

2
etomic_build/userpass

@ -1,2 +1,2 @@
#export userpass="<put the userpass value from the first API call here>"
export userpass="c3d8c2a364b7d18c1f9d7321d017b92e9f9c791e4f5c741214fefdea8a071256"
export userpass="$USERPASS"

2
iguana/exchanges/etomicswap/etomiccurl.c

@ -43,7 +43,7 @@ cJSON *parseEthRpcResponse(char *requestResult)
cJSON *tmp = cJSON_GetObjectItem(json, "result");
cJSON *error = cJSON_GetObjectItem(json, "error");
cJSON *result = NULL;
if (!is_cJSON_Null(tmp)) {
if (tmp != NULL && !is_cJSON_Null(tmp)) {
result = cJSON_Duplicate(tmp, 1);
} else if (error != NULL && !is_cJSON_Null(error)) {
char *errorString = cJSON_PrintUnformatted(error);

Loading…
Cancel
Save