Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
a1d45fdd42
  1. 7
      iguana/iguana_wallet.c
  2. 1
      iguana/tests/validateaddress

7
iguana/iguana_wallet.c

@ -297,8 +297,6 @@ cJSON *iguana_waddressjson(cJSON *item,struct iguana_waddress *waddr)
if ( item == 0 ) if ( item == 0 )
item = cJSON_CreateObject(); item = cJSON_CreateObject();
jaddstr(item,"address",waddr->coinaddr); jaddstr(item,"address",waddr->coinaddr);
init_hexbytes_noT(str,waddr->pubkey,33);
jaddstr(item,"pubkey",str);
//jaddstr(item,"privkey",bits256_str(str,waddr->privkey)); //jaddstr(item,"privkey",bits256_str(str,waddr->privkey));
//jaddstr(item,"wif",waddr->wifstr); //jaddstr(item,"wif",waddr->wifstr);
init_hexbytes_noT(str,waddr->rmd160,20); init_hexbytes_noT(str,waddr->rmd160,20);
@ -309,6 +307,11 @@ cJSON *iguana_waddressjson(cJSON *item,struct iguana_waddress *waddr)
init_hexbytes_noT(redeemScript,waddr->redeemScript,waddr->scriptlen); init_hexbytes_noT(redeemScript,waddr->redeemScript,waddr->scriptlen);
jaddstr(item,"redeemScript",redeemScript); jaddstr(item,"redeemScript",redeemScript);
} }
else
{
init_hexbytes_noT(str,waddr->pubkey,33);
jaddstr(item,"pubkey",str);
}
return(item); return(item);
} }

1
iguana/tests/validateaddress

@ -0,0 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"method\":\"validateaddress\",\"params\":[\"1BnPHAZuPvYSgWkRfEu6wHDL8uGRzDcTjt\"]}"
Loading…
Cancel
Save