Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
1884060b52
  1. 11
      iguana/iguana_instantdex.c
  2. 2
      iguana/tests/buy
  3. 2
      iguana/tests/buy2
  4. 2
      iguana/tests/sell
  5. 2
      iguana/tests/sell2

11
iguana/iguana_instantdex.c

@ -838,7 +838,7 @@ int32_t instantdex_inv2data(struct supernet_info *myinfo,struct iguana_info *coi
if ( n > 0 )
{
len = iguana_inv2packet(serialized,sizeof(serialized),MSG_QUOTE,hashes,n);
printf("Send inv2[%d] -> (%s)\n",n,addr->ipaddr);
//printf("Send inv2[%d] -> (%s)\n",n,addr->ipaddr);
return(iguana_queue_send(coin,addr,0,serialized,"inv2",len,0,0));
}
return(-1);
@ -1143,12 +1143,17 @@ char *instantdex_checkoffer(struct supernet_info *myinfo,uint64_t *txidp,struct
return(0);
}
*txidp = myap->orderid;
if ( instantdex_offerfind(myinfo,exchange,0,0,myap->orderid,myap->offer.base,myap->offer.rel,1,0) != 0 )
{
printf("orderid.%llu already there\n",(long long)myap->orderid);
return(0);
}
if ( (otherap= instantdex_acceptable(myinfo,exchange,myap,myap->offer.minperc)) == 0 )
{
printf("instantdex_checkoffer add.%llu from.%llu to acceptableQ\n",(long long)myap->orderid,(long long)myap->offer.account);
//if ( (retstr= instantdex_sendcmd(myinfo,&myap->offer,argjson,"BTCoffer",GENESIS_PUBKEY,INSTANTDEX_HOPS,0,0,1)) != 0 )
// free(retstr);
queue_enqueue("acceptableQ",&exchange->acceptableQ,&myap->DL,0);
if ( instantdex_offerfind(myinfo,exchange,0,0,myap->orderid,myap->offer.base,myap->offer.rel,1,0) == 0 )
printf("cant find just added to acceptableQ\n");
return(jprint(instantdex_offerjson(&myap->offer,myap->orderid),1));
}
else

2
iguana/tests/buy

@ -1 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"password\":\"test\",\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"buy\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}"
curl --url "http://127.0.0.1:7778" --data "{\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"buy\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}"

2
iguana/tests/buy2

@ -1 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"password\":\"test2\",\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"buy\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0027,\"volume\":1.0}"
curl --url "http://127.0.0.1:7778" --data "{\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"buy\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0027,\"volume\":1.0}"

2
iguana/tests/sell

@ -1 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"password\":\"test\",\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"sell\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}"
curl --url "http://127.0.0.1:7778" --data "{\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"sell\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}"

2
iguana/tests/sell2

@ -1 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"password\":\"test2\",\"password\":\"test\",\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"sell\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}"
curl --url "http://127.0.0.1:7778" --data "{\"password\":\"test\",\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"sell\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}"

Loading…
Cancel
Save