Browse Source

test

olddPoW
jl777 8 years ago
parent
commit
131b51b788
  1. 13
      iguana/iguana_notary.c
  2. 1
      iguana/tests/ratifyA_7776
  3. 1
      includes/iguana_apideclares.h

13
iguana/iguana_notary.c

@ -287,6 +287,19 @@ STRING_ARG(iguana,addnotary,ipaddr)
return(clonestr("{\"result\":\"notary node added\"}"));
}
INT_AND_ARRAY(dpow,addnotaries,flag,notaries)
{
int32_t i,n;
if ( notaries != 0 && (n= cJSON_GetArraySize(notaries)) > 0 )
{
for (i=0; i<n; i++)
{
dpow_nanomsginit(myinfo,jstri(notaries,i));
}
}
return(clonestr("{\"result\":\"notary nodes added\"}"));
}
STRING_ARG(dpow,active,maskhex)
{
int32_t i,numnotaries,kmdheight,len; char pubkeystr[67]; uint8_t pubkeys[64][33],data[8],revdata[8]; uint64_t mask; cJSON *retjson,*array = cJSON_CreateArray();

1
iguana/tests/ratifyA_7776

@ -0,0 +1 @@
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"dpow\",\"method\":\"ratify\",\"minsigs\":2,\"timestamp\":1476711523,\"ratified\":[{\"handle\":\"testA\",\"pubkey\":\"03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828\"}, {\"handle\":\"testB\",\"pubkey\":\"02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344\"}]}"

1
includes/iguana_apideclares.h

@ -17,6 +17,7 @@ TWO_STRINGS(iguana,dpow,symbol,pubkey);
STRING_ARG(dpow,active,maskhex);
TWOINTS_AND_ARRAY(dpow,ratify,minsigs,timestamp,ratified);
ZERO_ARGS(dpow,cancelratify);
INT_AND_ARRAY(dpow,addnotaries,flag,notaries);
TWO_STRINGS(zcash,passthru,function,hex);
TWO_STRINGS(komodo,passthru,function,hex);

Loading…
Cancel
Save