Browse Source

test

etomic
jl777 8 years ago
parent
commit
f0c9d6c286
  1. 6
      iguana/dpow/dpow_network.c
  2. 7
      iguana/tests/dexcheckaddress
  3. 2
      iguana/tests/dexlistunspent

6
iguana/dpow/dpow_network.c

@ -177,7 +177,7 @@ int32_t signed_nn_recv(void **freeptrp,void *ctx,uint8_t notaries[64][33],int32_
if ( memcmp(pubkey33,notaries[i],33) == 0 ) if ( memcmp(pubkey33,notaries[i],33) == 0 )
{ {
*(void **)packetp = (void **)((uint64_t)sigpacket + sizeof(*sigpacket)); *(void **)packetp = (void **)((uint64_t)sigpacket + sizeof(*sigpacket));
//printf("got signed packet from notary.%d\n",i); printf("got signed packet from notary.%d\n",i);
*freeptrp = sigpacket; *freeptrp = sigpacket;
return((int32_t)(recvbytes - sizeof(*sigpacket))); return((int32_t)(recvbytes - sizeof(*sigpacket)));
} }
@ -194,7 +194,7 @@ int32_t signed_nn_recv(void **freeptrp,void *ctx,uint8_t notaries[64][33],int32_
printf(" invalid pubkey33 n.%d\n",n); printf(" invalid pubkey33 n.%d\n",n);
} else printf("recoververify error nonce.%u packetlen.%d\n",sigpacket->nonce,sigpacket->packetlen); } else printf("recoververify error nonce.%u packetlen.%d\n",sigpacket->nonce,sigpacket->packetlen);
} else printf("hash mismatch or bad nonce.%u packetlen.%d\n",sigpacket->nonce,sigpacket->packetlen); } else printf("hash mismatch or bad nonce.%u packetlen.%d\n",sigpacket->nonce,sigpacket->packetlen);
} //else printf("recvbytes.%d mismatched packetlen.%d + %ld\n",recvbytes,sigpacket!=0?sigpacket->packetlen:-1,sizeof(*sigpacket)); } else printf("recvbytes.%d mismatched packetlen.%d + %ld\n",recvbytes,sigpacket!=0?sigpacket->packetlen:-1,sizeof(*sigpacket));
//printf("free sigpacket.%p freeptrp.%p packetp.%p\n",sigpacket,*freeptrp,*(void **)packetp); //printf("free sigpacket.%p freeptrp.%p packetp.%p\n",sigpacket,*freeptrp,*(void **)packetp);
if ( sigpacket != 0 ) if ( sigpacket != 0 )
nn_freemsg(sigpacket), sigpacket = 0; nn_freemsg(sigpacket), sigpacket = 0;
@ -1772,7 +1772,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo)
num++; num++;
if ( dex_packetcheck(myinfo,dexp,size) == 0 ) if ( dex_packetcheck(myinfo,dexp,size) == 0 )
{ {
//printf("FROM BUS.%08x -> pub\n",dexp->crc32); printf("FROM BUS.%08x -> pub\n",dexp->crc32);
signed_nn_send(myinfo->ctx,myinfo->persistent_priv,myinfo->pubsock,dexp,size); signed_nn_send(myinfo->ctx,myinfo->persistent_priv,myinfo->pubsock,dexp,size);
dex_packet(myinfo,dexp,size); dex_packet(myinfo,dexp,size);
} }

7
iguana/tests/dexcheckaddress

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"checkaddress\",\"address\":\"1Hgzt5xsnbfc8UTWqWKSTLRm5bEYHYBoCE\",\"symbol\":\"BTC\"}" curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"checkaddress\",\"address\":\"RYHpUJFaB4QHUW8jCJCCNL2kzWq3D3QoyG\",\"symbol\":\"KMD\"}"
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"checkaddress\",\"address\":\"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\",\"symbol\":\"USD\"}" #curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"checkaddress\",\"address\":\"1Hgzt5xsnbfc8UTWqWKSTLRm5bEYHYBoCE\",\"symbol\":\"BTC\"}"
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"checkaddress\",\"address\":\"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\",\"symbol\":\"MVP\"}" #curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"checkaddress\",\"address\":\"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\",\"symbol\":\"USD\"}"
#curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"checkaddress\",\"address\":\"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\",\"symbol\":\"MVP\"}"

2
iguana/tests/dexlistunspent

@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\",\"symbol\":\"KMD\"}" curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"listunspent\",\"address\":\"RYHpUJFaB4QHUW8jCJCCNL2kzWq3D3QoyG\",\"symbol\":\"KMD\"}"

Loading…
Cancel
Save