From e3a2766d355341f6a33d958c1a2aa3a44902d3a4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Jan 2016 00:29:55 -0300 Subject: [PATCH] test --- crypto777/curve25519.c | 20 +++-- deprecated/obsolete.h | 49 +++++++++++ iguana/SuperNET.c | 16 ++-- iguana/SuperNET.h | 1 + iguana/SuperNET_category.c | 15 ++++ iguana/iguana_json.c | 9 +- iguana/iguana_msg.c | 4 +- iguana/main.c | 1 + iguana/pangea_api.c | 153 ++++++++++++++++++++++------------ includes/iguana_apideclares.h | 30 ++++--- includes/iguana_apidefs.h | 2 + includes/iguana_apiundefs.h | 1 + 12 files changed, 218 insertions(+), 83 deletions(-) diff --git a/crypto777/curve25519.c b/crypto777/curve25519.c index 080bc72fd..4733cfa93 100755 --- a/crypto777/curve25519.c +++ b/crypto777/curve25519.c @@ -1714,6 +1714,13 @@ uint64_t acct777_nxt64bits(bits256 pubkey) return(acct.txid); } +bits256 acct777_msgpubkey(uint8_t *data,int32_t datalen) +{ + bits256 hash; + vcalc_sha256(0,hash.bytes,data,datalen); + return(acct777_pubkey(hash)); +} + bits256 acct777_hashiter(bits256 privkey,bits256 pubkey,int32_t lockdays,uint8_t chainlen) { uint16_t lockseed,signlen = 0; uint8_t signbuf[16]; bits256 shared,lockhash; @@ -1761,19 +1768,22 @@ uint64_t acct777_sign(struct acct777_sig *sig,bits256 privkey,bits256 otherpubke uint64_t acct777_validate(struct acct777_sig *sig,uint32_t timestamp,uint8_t *data,int32_t datalen) { - struct acct777_sig checksig; - acct777_sign(&checksig,GENESIS_PRIVKEY,sig->pubkey,timestamp,data,datalen); + struct acct777_sig checksig; uint64_t signerbits; + acct777_sign(&checksig,acct777_msgpubkey(data,datalen),sig->pubkey,timestamp,data,datalen); if ( memcmp(checksig.sigbits.bytes,sig->sigbits.bytes,sizeof(checksig.sigbits)) != 0 ) { printf("sig compare error using sig->pub from %llu\n",(long long)acct777_nxt64bits(sig->pubkey)); return(0); } - return(acct777_nxt64bits(sig->pubkey)); + signerbits = acct777_nxt64bits(sig->pubkey); + if ( signerbits == checksig.signer64bits ) + return(signerbits); + else return(0); } uint64_t acct777_signtx(struct acct777_sig *sig,bits256 privkey,uint32_t timestamp,uint8_t *data,int32_t datalen) { - return(acct777_sign(sig,privkey,GENESIS_PUBKEY,timestamp,data,datalen)); + return(acct777_sign(sig,privkey,acct777_msgpubkey(data,datalen),timestamp,data,datalen)); } uint64_t acct777_swaptx(bits256 privkey,struct acct777_sig *sig,uint32_t timestamp,uint8_t *data,int32_t datalen) @@ -1781,7 +1791,7 @@ uint64_t acct777_swaptx(bits256 privkey,struct acct777_sig *sig,uint32_t timesta uint64_t othernxt; if ( (othernxt= acct777_validate(sig,timestamp,data,datalen)) != sig->signer64bits ) return(0); - return(acct777_sign(sig,privkey,GENESIS_PUBKEY,timestamp,data,datalen)); + return(acct777_sign(sig,privkey,acct777_msgpubkey(data,datalen),timestamp,data,datalen)); } #undef force_inline diff --git a/deprecated/obsolete.h b/deprecated/obsolete.h index 62095a1e8..54eb1083a 100644 --- a/deprecated/obsolete.h +++ b/deprecated/obsolete.h @@ -12331,5 +12331,54 @@ len = 0; { return(acct777_pubkey(testprivkey(selector))); } + + /*char *pangea_univ(uint8_t *mypriv,cJSON *json) + { + char *addrtypes[][3] = { {"BTC","0","80"}, {"LTC","48"}, {"BTCD","60","bc"}, {"DOGE","30"}, {"VRC","70"}, {"OPAL","115"}, {"BITS","25"} }; + char *wipstr,*coin,*coinaddr,pubkeystr[67],rsaddr[64],destaddr[64],wifbuf[128]; uint8_t priv[32],pub[33],addrtype; int32_t i; + uint64_t nxt64bits; cJSON *retjson,*item; + PNACL_message("inside rosetta\n"); + if ( (coin= jstr(json,"coin")) != 0 ) + { + if ( (wipstr= jstr(json,"wif")) != 0 || (wipstr= jstr(json,"wip")) != 0 ) + { + PNACL_message("got wip.(%s)\n",wipstr); + btc_wip2priv(priv,wipstr); + } + else if ( (coinaddr= jstr(json,"addr")) != 0 ) + { + if ( getprivkey(priv,coin,coinaddr) < 0 ) + return(clonestr("{\"error\":\"cant get privkey\"}")); + } + } else memcpy(priv,mypriv,sizeof(priv)); + btc_priv2pub(pub,priv); + init_hexbytes_noT(pubkeystr,pub,33); + PNACL_message("pubkey.%s\n",pubkeystr); + retjson = cJSON_CreateObject(); + jaddstr(retjson,"btcpubkey",pubkeystr); + for (i=0; ibytes,(uint8_t *)subcategory,(int32_t)strlen(subcategory)); - return(categoryhash); + bits256 categoryhash,subhash; cJSON *retjson = cJSON_CreateObject(); + categoryhash = calc_categoryhashes(&subhash,category,subcategory); + jaddstr(retjson,"result","category hashes calculated"); + jaddbits256(retjson,"categoryhash",categoryhash); + jaddbits256(retjson,"subhash",subhash); + return(jprint(retjson,1)); } TWO_STRINGS(SuperNET,subscribe,category,subcategory) diff --git a/iguana/SuperNET.h b/iguana/SuperNET.h index 0c86dbe97..db2f0f6bd 100644 --- a/iguana/SuperNET.h +++ b/iguana/SuperNET.h @@ -138,6 +138,7 @@ struct category_msg *category_gethexmsg(struct supernet_info *myinfo,bits256 cat char *SuperNET_htmlstr(char *fname,char *htmlstr,int32_t maxsize,char *agentstr); char *SuperNET_categorymulticast(struct supernet_info *myinfo,int32_t surveyflag,bits256 categoryhash,bits256 subcategory,char *message,int32_t maxdelay,int32_t broadcastflag,int32_t plaintext); +bits256 calc_categoryhashes(bits256 *subhashp,char *category,char *subcategory); #endif diff --git a/iguana/SuperNET_category.c b/iguana/SuperNET_category.c index 64c807f6d..69beeeab0 100644 --- a/iguana/SuperNET_category.c +++ b/iguana/SuperNET_category.c @@ -15,6 +15,21 @@ #include "iguana777.h" +bits256 calc_categoryhashes(bits256 *subhashp,char *category,char *subcategory) +{ + bits256 categoryhash; + if ( category == 0 || category[0] == 0 || strcmp(category,"broadcast") == 0 ) + categoryhash = GENESIS_PUBKEY; + else vcalc_sha256(0,categoryhash.bytes,(uint8_t *)category,(int32_t)strlen(category)); + if ( subhashp != 0 ) + { + if ( subcategory == 0 || subcategory[0] == 0 || strcmp(subcategory,"broadcast") == 0 ) + *subhashp = GENESIS_PUBKEY; + else vcalc_sha256(0,subhashp->bytes,(uint8_t *)subcategory,(int32_t)strlen(subcategory)); + } + return(categoryhash); +} + queue_t *category_Q(bits256 categoryhash,bits256 subhash) { struct category_info *cat,*sub; queue_t *Q = 0; diff --git a/iguana/iguana_json.c b/iguana/iguana_json.c index b01fe202c..8da5e73d9 100755 --- a/iguana/iguana_json.c +++ b/iguana/iguana_json.c @@ -107,6 +107,7 @@ cJSON *SuperNET_helpjson() #define IGUANA_HELP_H(agent,name,hash) array = helpjson(IGUANA_ARGS,#agent,#name,helparray(cJSON_CreateArray(),helpitem(#hash,"hash"))) #define IGUANA_HELP_HI(agent,name,hash,val) array = helpjson(IGUANA_ARGS,#agent,#name,helparray2(cJSON_CreateArray(),helpitem(#hash,"hash"),helpitem(#val,"int"))) #define IGUANA_HELP_HH(agent,name,hash,hash2) array = helpjson(IGUANA_ARGS,#agent,#name,helparray2(cJSON_CreateArray(),helpitem(#hash,"hash"),helpitem(#hash2,"hash"))) +#define IGUANA_HELP_HA(agent,name,hash,obj) array = helpjson(IGUANA_ARGS,#agent,#name,helparray2(cJSON_CreateArray(),helpitem(#hash,"hash"),helpitem(#obj,"array"))) #define IGUANA_HELP_HS(agent,name,hash,str) array = helpjson(IGUANA_ARGS,#agent,#name,helparray2(cJSON_CreateArray(),helpitem(#hash,"hash"),helpitem(#str,"str"))) #define IGUANA_HELP_HII(agent,name,hash,val,val2) array = helpjson(IGUANA_ARGS,#agent,#name,helparray3(cJSON_CreateArray(),helpitem(#hash,"hash"),helpitem(#val,"int"),helpitem(#val2,"int"))) #define IGUANA_HELP_HHS(agent,name,hash,hash2,str) array = helpjson(IGUANA_ARGS,#agent,#name,helparray3(cJSON_CreateArray(),helpitem(#hash,"hash"),helpitem(#hash2,"hash"),helpitem(#str,"str"))) @@ -151,6 +152,7 @@ cJSON *SuperNET_helpjson() #define U64_AND_ARRAY IGUANA_HELP_64A #define HASH_ARG IGUANA_HELP_H #define TWO_HASHES IGUANA_HELP_HH +#define HASH_AND_ARRAY IGUANA_HELP_HA #include "../includes/iguana_apideclares.h" @@ -322,6 +324,7 @@ int32_t pretty_forms(char *fname,char *agentstr) fprintf(fp,"%s\n",header); if ( (helpjson= SuperNET_helpjson()) != 0 ) { + printf("JSON.(%s)\n",jprint(helpjson,0)); if ( (array= jarray(&n,helpjson,"API")) != 0 ) { for (i=0; i


"); printf("



\n"); @@ -734,6 +739,7 @@ char *SuperNET_parser(struct supernet_info *myinfo,char *agent,char *method,cJSO #define IGUANA_DISPATCH_H(agent,name,hash) else if ( strcmp(method,#name) == 0 ) return(agent ## _ ## name(IGUANA_ARGS,jbits256(json,#hash))) #define IGUANA_DISPATCH_HI(agent,name,hash,val) else if ( strcmp(method,#name) == 0 ) return(agent ## _ ## name(IGUANA_ARGS,jbits256(json,#hash),juint(json,#val))) #define IGUANA_DISPATCH_HH(agent,name,hash,hash2) else if ( strcmp(method,#name) == 0 ) return(agent ## _ ## name(IGUANA_ARGS,jbits256(json,#hash),jbits256(json,#hash2))) +#define IGUANA_DISPATCH_HA(agent,name,hash,array) else if ( strcmp(method,#name) == 0 ) return(agent ## _ ## name(IGUANA_ARGS,jbits256(json,#hash),jobj(json,#array))) #define IGUANA_DISPATCH_HS(agent,name,hash,str) else if ( strcmp(method,#name) == 0 ) return(agent ## _ ## name(IGUANA_ARGS,jbits256(json,#hash),jstr(json,#str))) #define IGUANA_DISPATCH_HII(agent,name,hash,val,val2) else if ( strcmp(method,#name) == 0 ) return(agent ## _ ## name(IGUANA_ARGS,jbits256(json,#hash),juint(json,#val),juint(json,#val2))) #define IGUANA_DISPATCH_HHS(agent,name,hash,hash2,str) else if ( strcmp(method,#name) == 0 ) return(agent ## _ ## name(IGUANA_ARGS,jbits256(json,#hash),jbits256(json,#hash2),jstr(json,#str))) @@ -778,6 +784,7 @@ char *SuperNET_parser(struct supernet_info *myinfo,char *agent,char *method,cJSO #define U64_AND_ARRAY IGUANA_DISPATCH_64A #define HASH_ARG IGUANA_DISPATCH_H #define TWO_HASHES IGUANA_DISPATCH_HH +#define HASH_AND_ARRAY IGUANA_DISPATCH_HA #include "../includes/iguana_apideclares.h" //#undef IGUANA_ARGS diff --git a/iguana/iguana_msg.c b/iguana/iguana_msg.c index 247df2f45..106ebc15a 100755 --- a/iguana/iguana_msg.c +++ b/iguana/iguana_msg.c @@ -45,8 +45,8 @@ int32_t iguana_rwversion(int32_t rwflag,uint8_t *serialized,struct iguana_msgver len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->nStartingHeight),&msg->nStartingHeight); if ( msg->nVersion > 70000 ) len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->relayflag),&msg->relayflag); - if ( rwflag == 0 ) - printf("%-15s v.%llu srv.%llx %u ht.%llu [%s].R%d nonce.%llx\n",ipaddr,(long long)msg->nVersion,(long long)msg->nServices,(uint32_t)msg->nTime,(long long)msg->nStartingHeight,msg->strSubVer,msg->relayflag,(long long)msg->nonce); + //if ( rwflag == 0 ) + // printf("%-15s v.%llu srv.%llx %u ht.%llu [%s].R%d nonce.%llx\n",ipaddr,(long long)msg->nVersion,(long long)msg->nServices,(uint32_t)msg->nTime,(long long)msg->nStartingHeight,msg->strSubVer,msg->relayflag,(long long)msg->nonce); return(len); } diff --git a/iguana/main.c b/iguana/main.c index b762fe3e2..b2072f6de 100644 --- a/iguana/main.c +++ b/iguana/main.c @@ -452,6 +452,7 @@ void iguana_main(void *arg) signal(SIGCONT,sigcontinue_func); if ( IGUANA_NUMHELPERS == 0 ) IGUANA_NUMHELPERS = 1; + category_sub(&MYINFO,GENESIS_PUBKEY,GENESIS_PUBKEY); for (i=0; iallocsize ) + { + printf("pangea message size mismatch %d != %d\n",size,pm->allocsize); + return(-1); + } + if ( (signerbits = acct777_validate(&pm->sig,pm->sig.timestamp,&((uint8_t *)pm)[sizeof(pm->sig)],pm->allocsize-sizeof(pm->sig))) != 0 ) + { + return(0); + } + return(-1); +} + +struct pangea_msghdr *pangea_msgcreate(struct supernet_info *myinfo,uint8_t *space,bits256 tablehash,uint8_t *data,int32_t datalen) +{ + struct pangea_msghdr *pm = (struct pangea_msghdr *)space; + memset(pm,0,sizeof(*pm)); + pm->sig.pubkey = myinfo->myaddr.pubkey; + pm->sig.signer64bits = acct777_nxt64bits(pm->sig.pubkey); + pm->sig.timestamp = (uint32_t)time(NULL); + if ( datalen > 0 ) + memcpy(pm->data,data,datalen); + pm->allocsize = (int32_t)(sizeof(*pm) + datalen); + pm->tablehash = tablehash; + pm->ipbits = myinfo->myaddr.myipbits; + acct777_sign(&pm->sig,myinfo->privkey,tablehash,pm->sig.timestamp,&space[sizeof(pm->sig)],pm->allocsize); + if ( pangea_validate(pm,pm->allocsize) == 0 ) + return(pm); + else printf("error validating pangea msg\n"); + return(0); +} + +void pangea_update(struct supernet_info *myinfo) +{ + struct category_msg *m; bits256 pangeahash; + pangeahash = calc_categoryhashes(0,"pangea",0); + while ( (m= category_gethexmsg(myinfo,pangeahash,GENESIS_PUBKEY)) != 0 ) + { + if ( pangea_validate((struct pangea_msghdr *)m->msg,m->len) == 0 ) + pangea_updatemsg(myinfo,(struct pangea_msghdr *)m->msg,m->len); + free(m); + } +} + void pangea_sendcmd(char *hex,union pangeanet777 *hn,char *cmdstr,int32_t destplayer,uint8_t *data,int32_t datalen,int32_t cardi,int32_t turni) { int32_t n,hexlen,blindflag = 0; uint64_t destbits; bits256 destpub; cJSON *json; char hoststr[1024]; struct pangea_info *sp; @@ -238,55 +307,6 @@ void _pangea_chat(uint64_t senderbits,void *buf,int32_t len,int32_t senderind) PNACL_message(">>>>>>>>>>> CHAT FROM.%d %llu: (%s)\n",senderind,(long long)senderbits,(char *)buf); } -/*char *pangea_univ(uint8_t *mypriv,cJSON *json) -{ - char *addrtypes[][3] = { {"BTC","0","80"}, {"LTC","48"}, {"BTCD","60","bc"}, {"DOGE","30"}, {"VRC","70"}, {"OPAL","115"}, {"BITS","25"} }; - char *wipstr,*coin,*coinaddr,pubkeystr[67],rsaddr[64],destaddr[64],wifbuf[128]; uint8_t priv[32],pub[33],addrtype; int32_t i; - uint64_t nxt64bits; cJSON *retjson,*item; - PNACL_message("inside rosetta\n"); - if ( (coin= jstr(json,"coin")) != 0 ) - { - if ( (wipstr= jstr(json,"wif")) != 0 || (wipstr= jstr(json,"wip")) != 0 ) - { - PNACL_message("got wip.(%s)\n",wipstr); - btc_wip2priv(priv,wipstr); - } - else if ( (coinaddr= jstr(json,"addr")) != 0 ) - { - if ( getprivkey(priv,coin,coinaddr) < 0 ) - return(clonestr("{\"error\":\"cant get privkey\"}")); - } - } else memcpy(priv,mypriv,sizeof(priv)); - btc_priv2pub(pub,priv); - init_hexbytes_noT(pubkeystr,pub,33); - PNACL_message("pubkey.%s\n",pubkeystr); - retjson = cJSON_CreateObject(); - jaddstr(retjson,"btcpubkey",pubkeystr); - for (i=0; inxt64bits,*(bits256 *)plugin->mypriv,*(bits256 *)plugin->mypub,plugin->transport,plugin->ipaddr,plugin->pangeaport,juint(json,"minbuyin"),juint(json,"maxbuyin"),juint(json,"rakemillis")); @@ -565,30 +585,55 @@ INT_AND_ARRAY(pangea,handsummary,senderind,args) } -//U64_AND_ARRAY(pangea,turn,tableid,args); -U64_AND_ARRAY(pangea,status,tableid,args) +HASH_AND_ARRAY(pangea,status,tablehash,args) { cJSON *retjson = cJSON_CreateObject(); return(jprint(retjson,1)); } -U64_AND_ARRAY(pangea,mode,tableid,args) +HASH_AND_ARRAY(pangea,mode,tablehash,args) { cJSON *retjson = cJSON_CreateObject(); return(jprint(retjson,1)); } -U64_AND_ARRAY(pangea,buyin,tableid,args) +HASH_AND_ARRAY(pangea,buyin,tablehash,args) { cJSON *retjson = cJSON_CreateObject(); return(jprint(retjson,1)); } -U64_AND_ARRAY(pangea,history,tableid,args) +HASH_AND_ARRAY(pangea,history,tablehash,args) { cJSON *retjson = cJSON_CreateObject(); return(jprint(retjson,1)); } + +ZERO_ARGS(pangea,lobby) +{ + pangea_update(myinfo); + return(jprint(pangea_lobbyjson(myinfo),1)); +} + +INT_AND_ARRAY(pangea,host,minplayers,args) +{ + char *req = "{\"host\":\"table\"}"; + bits256 pangeahash,tablehash; struct pangea_msghdr *pm; uint8_t space[sizeof(*pm) + 512]; + pangeahash = calc_categoryhashes(0,"pangea",0); + OS_randombytes(tablehash.bytes,sizeof(tablehash)); + pm = pangea_msgcreate(myinfo,space,tablehash,(void *)req,(int32_t)strlen(req)); + return(SuperNET_categorymulticast(myinfo,0,pangeahash,tablehash,(void *)pm,0,1,1)); +} + +HASH_AND_ARRAY(pangea,join,tablehash,args) +{ + char *req = "{\"lobby\":\"join\"}"; + bits256 pangeahash; struct pangea_msghdr *pm; uint8_t space[sizeof(*pm) + 512]; + pangeahash = calc_categoryhashes(0,"pangea",0); + pm = pangea_msgcreate(myinfo,space,tablehash,(void *)req,(int32_t)strlen(req)); + return(SuperNET_categorymulticast(myinfo,0,pangeahash,tablehash,(void *)pm,0,1,1)); +} + #undef IGUANA_ARGS #include "../includes/iguana_apiundefs.h" diff --git a/includes/iguana_apideclares.h b/includes/iguana_apideclares.h index 6b53736a3..61b211ed8 100755 --- a/includes/iguana_apideclares.h +++ b/includes/iguana_apideclares.h @@ -14,16 +14,10 @@ ******************************************************************************/ ZERO_ARGS(SuperNET,help); -TWO_STRINGS(SuperNET,html,agentform,htmlfile); STRING_ARG(SuperNET,bitcoinrpc,setcoin); -TWOSTRINGS_AND_TWOHASHES_AND_TWOINTS(SuperNET,DHT,hexmsg,destip,categoryhash,subhash,maxdelay,broadcast); -STRING_AND_TWOINTS(mouse,image,name,x,y); -STRING_AND_TWOINTS(mouse,change,name,x,y); -STRING_AND_TWOINTS(mouse,click,name,x,y); -STRING_ARG(mouse,close,name); -STRING_ARG(mouse,leave,name); -STRING_AND_INT(keyboard,key,name,c); +TWO_STRINGS(SuperNET,html,agentform,htmlfile); +TWOSTRINGS_AND_TWOHASHES_AND_TWOINTS(SuperNET,DHT,hexmsg,destip,categoryhash,subhash,maxdelay,broadcast); THREE_STRINGS(SuperNET,rosetta,passphrase,pin,showprivkey); ZERO_ARGS(SuperNET,keypair); @@ -43,6 +37,14 @@ TWO_STRINGS(SuperNET,gethexmsg,category,subcategory); THREE_STRINGS(SuperNET,posthexmsg,category,subcategory,hexmsg); THREE_STRINGS(SuperNET,announce,category,subcategory,message); THREE_STRINGS(SuperNET,survey,category,subcategory,message); +TWO_STRINGS(SuperNET,categoryhashes,category,subcategory); + +STRING_AND_TWOINTS(mouse,image,name,x,y); +STRING_AND_TWOINTS(mouse,change,name,x,y); +STRING_AND_TWOINTS(mouse,click,name,x,y); +STRING_ARG(mouse,close,name); +STRING_ARG(mouse,leave,name); +STRING_AND_INT(keyboard,key,name,c); STRING_ARG(SuperNET,getpeers,activecoin); TWO_ARRAYS(SuperNET,mypeers,supernet,rawpeers); @@ -69,10 +71,14 @@ INT_AND_ARRAY(pangea,action,senderind,args); INT_AND_ARRAY(pangea,showdown,senderind,args); INT_AND_ARRAY(pangea,handsummary,senderind,args); -U64_AND_ARRAY(pangea,status,tableid,args); -U64_AND_ARRAY(pangea,mode,tableid,args); -U64_AND_ARRAY(pangea,buyin,tableid,args); -U64_AND_ARRAY(pangea,history,tableid,args); +HASH_AND_ARRAY(pangea,status,tableid,args); +HASH_AND_ARRAY(pangea,mode,tableid,args); +HASH_AND_ARRAY(pangea,buyin,tableid,args); +HASH_AND_ARRAY(pangea,history,tableid,args); + +ZERO_ARGS(pangea,lobby); +INT_AND_ARRAY(pangea,host,minplayers,args); +HASH_AND_ARRAY(pangea,join,tablehash,args); STRING_ARG(iguana,peers,activecoin); STRING_AND_INT(iguana,maxpeers,activecoin,max); diff --git a/includes/iguana_apidefs.h b/includes/iguana_apidefs.h index 1d4aed3e7..a8aaeace4 100755 --- a/includes/iguana_apidefs.h +++ b/includes/iguana_apidefs.h @@ -29,6 +29,7 @@ #define IGUANA_CFUNC_HI(agent,name,hash,val) char *agent ## _ ## name(IGUANA_ARGS,bits256 hash,int32_t val) #define IGUANA_CFUNC_H(agent,name,hash) char *agent ## _ ## name(IGUANA_ARGS,bits256 hash) #define IGUANA_CFUNC_HS(agent,name,hash,str) char *agent ## _ ## name(IGUANA_ARGS,bits256 hash,char *str) +#define IGUANA_CFUNC_HA(agent,name,hash,array) char *agent ## _ ## name(IGUANA_ARGS,bits256 hash,cJSON *array) #define IGUANA_CFUNC_HH(agent,name,hash,hash2) char *agent ## _ ## name(IGUANA_ARGS,bits256 hash,bits256 hash2) #define IGUANA_CFUNC_HHS(agent,name,hash,hash2,str) char *agent ## _ ## name(IGUANA_ARGS,bits256 hash,bits256 hash2,char *str) #define IGUANA_CFUNC_HAS(agent,name,hash,array,str) char *agent ## _ ## name(IGUANA_ARGS,bits256 hash,cJSON *array,char *str) @@ -72,4 +73,5 @@ #define HASH_ARRAY_STRING IGUANA_CFUNC_HAS #define U64_AND_ARRAY IGUANA_CFUNC_64A #define HASH_ARG IGUANA_CFUNC_H +#define HASH_AND_ARRAY IGUANA_CFUNC_HA #define TWO_HASHES IGUANA_CFUNC_HH diff --git a/includes/iguana_apiundefs.h b/includes/iguana_apiundefs.h index b9ade68b2..2fd2e0068 100755 --- a/includes/iguana_apiundefs.h +++ b/includes/iguana_apiundefs.h @@ -29,6 +29,7 @@ #undef TWOHASHES_AND_STRING #undef HASH_ARRAY_STRING #undef U64_AND_ARRAY +#undef HASH_AND_ARRAY #undef HASH_ARG #undef TWO_HASHES #undef TWOSTRINGS_AND_TWOHASHES_AND_TWOINTS