Browse Source

test

etomic
jl777 8 years ago
parent
commit
6d99c036bc
  1. 2
      iguana/dpow/dpow_network.c
  2. 2
      iguana/dpow/dpow_rpc.c
  3. 6
      iguana/iguana_notary.c
  4. 2
      iguana/tests/dexkvsearch

2
iguana/dpow/dpow_network.c

@ -774,7 +774,7 @@ char *_dex_kvupdate(struct supernet_info *myinfo,char *symbol,char *key,char *va
valuesize = (int32_t)strlen(value);
dexreq.shortarg = keylen+1;
memcpy(&keyvalue[dexreq.shortarg],value,valuesize+1);
printf("_DEX.(%s) -> (%s) flags.%d\n",key,value,flags);
//printf("_DEX.(%s) -> (%s) flags.%d\n",key,value,flags);
return(_dex_sendrequeststr(myinfo,&dexreq,keyvalue,keylen+valuesize+2,1,""));
}

2
iguana/dpow/dpow_rpc.c

@ -416,7 +416,7 @@ cJSON *dpow_kvupdate(struct supernet_info *myinfo,struct iguana_info *coin,char
if ( coin->FULLNODE < 0 )
{
sprintf(params,"[\"%s\", \"%s\", \"%d\"]",key,value,flags);
printf("KVUPDATE.%s\n",params);
//printf("KVUPDATE.%s\n",params);
retstr = bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"kvupdate",params);
if ( (retjson= cJSON_Parse(retstr)) == 0 )
{

6
iguana/iguana_notary.c

@ -690,7 +690,11 @@ THREE_STRINGS_AND_THREE_INTS(dex,kvupdate,symbol,key,value,flags,unused,unusedb)
return(clonestr("{\"error\":\"only single duration updates via remote access\"}"));
else if ( strlen(key) > 64 || strlen(value) > 256 )
return(clonestr("{\"error\":\"only keylen <=64 and valuesize <= 256 allowed via remote access\"}"));
else return(_dex_kvupdate(myinfo,symbol,key,value,flags));
else
{
//printf("call _dex_kvupdate.(%s) -> (%s) flags.%d\n",key,value,flags);
return(_dex_kvupdate(myinfo,symbol,key,value,flags));
}
} else return(clonestr("{\"error\":\"free updates only on KV chain\"}"));
}

2
iguana/tests/dexkvsearch

@ -1,3 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"kvsearch\",\"key\":\"foo\",\"symbol\":\"KMD\"}"
#curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"kvsearch\",\"key\":\"foo\",\"symbol\":\"KMD\"}"
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"kvsearch\",\"key\":\"test\",\"symbol\":\"KV\"}"

Loading…
Cancel
Save