Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
dcec056651
  1. 2
      basilisk/basilisk_swap.c
  2. 10
      iguana/iguana_payments.c
  3. 2
      iguana/tests/decoderawtransaction

2
basilisk/basilisk_swap.c

@ -1374,7 +1374,7 @@ void basilisk_swaploop(void *_swap)
basilisk_swapget(myinfo,swap,0x80000000,data,maxlen,basilisk_verify_otherstatebits); basilisk_swapget(myinfo,swap,0x80000000,data,maxlen,basilisk_verify_otherstatebits);
} }
printf("end of atomic swap\n"); printf("end of atomic swap\n");
if ( swap->iambob != 0 && bits256_nonz(swap->bobdeposit.txid) != 0 ) if ( swap->iambob != 0 )//&& bits256_nonz(swap->bobdeposit.txid) != 0 )
{ {
printf("BOB reclaims refund\n"); printf("BOB reclaims refund\n");
basilisk_bobdeposit_refund(myinfo,swap); basilisk_bobdeposit_refund(myinfo,swap);

10
iguana/iguana_payments.c

@ -969,19 +969,19 @@ char *iguana_validaterawtx(struct supernet_info *myinfo,struct iguana_info *coin
STRING_AND_INT(bitcoinrpc,validaterawtransaction,rawtx,suppress) STRING_AND_INT(bitcoinrpc,validaterawtransaction,rawtx,suppress)
{ {
uint8_t *extraspace; char *retstr; struct iguana_msgtx msgtx; int32_t extralen=65536; uint8_t *extraspace; int32_t extralen=65536; char *retstr; struct iguana_msgtx msgtx;
if ( remoteaddr != 0 ) if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}")); return(clonestr("{\"error\":\"no remote\"}"));
cJSON *txobj; char *teststr= "{\"version\":1,\"locktime\":0,\"vin\":[{\"userdata\":\"20ae439d344513eab8e718d8214fe6ae8133b8b5b594afd64da21d0e40b9c37cdd00\",\"txid\":\"2c1320315f4fb519cbf2b4d7b67855013b9a09a85e515df43b41d407a0083b09\",\"vout\":0,\"scriptPubKey\":{\"hex\":\"a9142e7674400d04217f770f2222126dc7fee44b06b487\"},\"suppress\":1,\"redeemScript\":\"63041686a657b1752102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac67a914ed74c61c27656abc6c20687c3a9212ffdc6f34cd88210398a4cb9f6ea7c52a4e27455028a95e2e4e397a110fb75f072c2c58a8bdcbf4baac68\"}],\"vout\":[{\"satoshis\":\"16733\",\"scriptPubkey\":{\"hex\":\"76a91454a752f0d71b89d7c014ed0be29ca231c9546f9f88ac\"}}]}"; //cJSON *txobj; char *teststr= "{\"version\":1,\"locktime\":0,\"vin\":[{\"userdata\":\"20ae439d344513eab8e718d8214fe6ae8133b8b5b594afd64da21d0e40b9c37cdd00\",\"txid\":\"2c1320315f4fb519cbf2b4d7b67855013b9a09a85e515df43b41d407a0083b09\",\"vout\":0,\"scriptPubKey\":{\"hex\":\"a9142e7674400d04217f770f2222126dc7fee44b06b487\"},\"suppress\":1,\"redeemScript\":\"63041686a657b1752102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac67a914ed74c61c27656abc6c20687c3a9212ffdc6f34cd88210398a4cb9f6ea7c52a4e27455028a95e2e4e397a110fb75f072c2c58a8bdcbf4baac68\"}],\"vout\":[{\"satoshis\":\"16733\",\"scriptPubkey\":{\"hex\":\"76a91454a752f0d71b89d7c014ed0be29ca231c9546f9f88ac\"}}]}";
extraspace = calloc(1,extralen); extraspace = calloc(1,extralen);
if ( (txobj= cJSON_Parse(teststr)) != 0 ) /*if ( (txobj= cJSON_Parse(teststr)) != 0 )
{ {
bits256 txid; bits256 txid;
rawtx = bitcoin_json2hex(myinfo,coin,&txid,txobj,0); rawtx = bitcoin_json2hex(myinfo,coin,&txid,txobj,0);
txobj = bitcoin_hex2json(coin,coin->blocks.hwmchain.height,&txid,0,rawtx,extraspace,extralen,0,0,suppress); txobj = bitcoin_hex2json(coin,coin->blocks.hwmchain.height,&txid,0,rawtx,extraspace,extralen,0,0,suppress);
printf("RAWTX.(%s) -> (%s)\n",rawtx,jprint(txobj,0)); printf("RAWTX.(%s) -> (%s)\n",rawtx,jprint(txobj,0));
} }*/
//retstr = iguana_validaterawtx(myinfo,coin,&msgtx,extraspace,extralen,rawtx,0,suppress); retstr = iguana_validaterawtx(myinfo,coin,coin->blocks.hwmchain.height,&msgtx,extraspace,extralen,rawtx,0,suppress);
free(extraspace); free(extraspace);
return(rawtx); return(rawtx);
} }

2
iguana/tests/decoderawtransaction

@ -1 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"decoderawtransaction\",\"params\":[\"0100000080ada85701522d200c3b6d4333a86a68ba2720a9ad722a7dcb5b2dcf9f396d6c8446348a100000000092483045022100c636f237a1ed9437b7e228ff5e65ca08d514df6b0fe0b2a2e586a04f146370680220548238c13ff10c958a71d8be889d87baf5eae1cb703e0a869d91c919957c5b9801483045022100b94843c6dfa085fab09e11633f82a88f950af726a6545c5be82d5e50af294a8302207558a585f9b8ee11714524233ef6f288c1859c0bdcc7ce6469051e66777620ee01ffffffff01706f9800000000001976a91454a752f0d71b89d7c014ed0be29ca231c9546f9f88ac00000000\", 1]}" curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"method\":\"decoderawtransaction\",\"params\":[\"01000000016b7fd1559c5b5741bb5a2a4c4b7ec3d58dad5b446443b46af871f7c78f87e1c000000000d2483045022100fe525e98f13f57b1db4137b63898eb5c5110686220f936fbfba947eb2ba95e2a0220666c4ff5c818a553b1a3dd1834b9d90b45ec8bce5219e16396612f0c69a885ec012029eaebaaacbf20946af0141977494304985804bb3a799b3cfcd67f95e7d9101e004c6763042027a957b1752103175cf93574c31637b8c2d8acd5319e3cd23761b5e418d32c6bcb194972ba9273ac67a91461c860a1e8cc35ff310ba0f86e568fc6ebfff511882102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac68ffffffff01474d0000000000001976a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac00000000\", 1]}"

Loading…
Cancel
Save