Browse Source

Test

etomic
jl777 8 years ago
parent
commit
4137dcd634
  1. 6
      basilisk/smartaddress.c
  2. 2
      iguana/tests/smartadd

6
basilisk/smartaddress.c

@ -81,7 +81,10 @@ cJSON *smartaddress_json(struct smartaddress *ap)
void smartaddress_symboladd(struct smartaddress *ap,char *symbol,double maxbid,double minask)
{
struct smartaddress_symbol *sp;
char tmp[64]; struct smartaddress_symbol *sp;
strcpy(tmp,ap->typestr), touppercase(tmp);
if ( strcmp(tmp,symbol) != 0 )
{
ap->symbols = realloc(ap->symbols,(ap->numsymbols+1) * sizeof(*ap->symbols));
sp = &ap->symbols[ap->numsymbols++];
memset(sp,0,sizeof(*sp));
@ -89,6 +92,7 @@ void smartaddress_symboladd(struct smartaddress *ap,char *symbol,double maxbid,d
sp->maxbid = maxbid;
sp->minask = minask;
}
}
int32_t _smartaddress_add(struct supernet_info *myinfo,bits256 privkey,char *symbol,double maxbid,double minask)
{

2
iguana/tests/smartadd

@ -1,3 +1,3 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"smartaddress\",\"type\":\"usd\",\"symbol\":\"USD\"}" # first time
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"smartaddress\",\"type\":\"usd\",\"symbol\":\"LTC\",\"maxbid\":10,\"minask\":10}"
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"smartaddress\",\"type\":\"usd\",\"symbol\":\"REVS\",\"maxbid\":0.20,\"minask\":0.10}"

Loading…
Cancel
Save