2019-03-30 18:00:34 +01:00
|
|
|
/* global it, describe, afterAll, beforeAll, jasmine */
|
2019-01-29 03:27:07 +01:00
|
|
|
global.net = require('net');
|
2020-03-26 17:37:11 +01:00
|
|
|
global.tls = require('tls');
|
2020-07-01 13:56:52 +02:00
|
|
|
const BlueElectrum = require('../../blue_modules/BlueElectrum');
|
2020-06-01 14:54:23 +02:00
|
|
|
const assert = require('assert');
|
2019-04-01 02:01:11 +02:00
|
|
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = 150 * 1000;
|
2019-03-30 18:00:34 +01:00
|
|
|
|
|
|
|
afterAll(() => {
|
|
|
|
// after all tests we close socket so the test suite can actually terminate
|
2019-05-06 00:17:31 +02:00
|
|
|
BlueElectrum.forceDisconnect();
|
2019-03-30 18:00:34 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
beforeAll(async () => {
|
|
|
|
// awaiting for Electrum to be connected. For RN Electrum would naturally connect
|
|
|
|
// while app starts up, but for tests we need to wait for it
|
|
|
|
try {
|
|
|
|
await BlueElectrum.waitTillConnected();
|
2019-05-02 22:33:03 +02:00
|
|
|
} catch (err) {
|
|
|
|
console.log('failed to connect to Electrum:', err);
|
2019-03-30 18:00:34 +01:00
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
});
|
2019-01-29 03:27:07 +01:00
|
|
|
|
2020-03-26 17:37:11 +01:00
|
|
|
describe('BlueElectrum', () => {
|
2019-07-18 12:22:01 +02:00
|
|
|
it('ElectrumClient can test connection', async () => {
|
2020-10-06 15:46:20 +02:00
|
|
|
assert.ok(!(await BlueElectrum.testConnection('electrum1.bluewallet.io', 444, false)));
|
|
|
|
assert.ok(!(await BlueElectrum.testConnection('electrum1.bluewallet.io', false, 444)));
|
|
|
|
assert.ok(!(await BlueElectrum.testConnection('ya.ru', 444, false)));
|
|
|
|
assert.ok(!(await BlueElectrum.testConnection('google.com', false, 80)));
|
|
|
|
assert.ok(!(await BlueElectrum.testConnection('google.com', 80, false)));
|
|
|
|
assert.ok(!(await BlueElectrum.testConnection('google.com', false, 443)));
|
|
|
|
assert.ok(!(await BlueElectrum.testConnection('google.com', 443, false)));
|
|
|
|
assert.ok(!(await BlueElectrum.testConnection('joyreactor.cc', false, 443)));
|
|
|
|
assert.ok(!(await BlueElectrum.testConnection('joyreactor.cc', 443, false)));
|
|
|
|
assert.ok(!(await BlueElectrum.testConnection('joyreactor.cc', 80, false)));
|
|
|
|
assert.ok(!(await BlueElectrum.testConnection('joyreactor.cc', false, 80)));
|
|
|
|
|
2019-07-18 12:22:01 +02:00
|
|
|
assert.ok(await BlueElectrum.testConnection('electrum1.bluewallet.io', '50001'));
|
2020-03-26 17:37:11 +01:00
|
|
|
assert.ok(await BlueElectrum.testConnection('electrum1.bluewallet.io', false, 443));
|
2019-07-18 12:22:01 +02:00
|
|
|
});
|
|
|
|
|
2019-07-19 02:22:26 +02:00
|
|
|
it('ElectrumClient can estimate fees', async () => {
|
|
|
|
assert.ok((await BlueElectrum.estimateFee(1)) > 1);
|
|
|
|
});
|
|
|
|
|
2020-03-27 20:18:14 +01:00
|
|
|
it('ElectrumClient can request server features', async () => {
|
|
|
|
const features = await BlueElectrum.serverFeatures();
|
|
|
|
// console.warn({features});
|
|
|
|
assert.ok(features.server_version);
|
|
|
|
assert.ok(features.protocol_min);
|
|
|
|
assert.ok(features.protocol_max);
|
|
|
|
});
|
|
|
|
|
2020-06-01 14:54:23 +02:00
|
|
|
it('BlueElectrum can do getBalanceByAddress()', async function () {
|
|
|
|
const address = '3GCvDBAktgQQtsbN6x5DYiQCMmgZ9Yk8BK';
|
|
|
|
const balance = await BlueElectrum.getBalanceByAddress(address);
|
2019-01-29 03:27:07 +01:00
|
|
|
assert.strictEqual(balance.confirmed, 51432);
|
|
|
|
assert.strictEqual(balance.unconfirmed, 0);
|
|
|
|
assert.strictEqual(balance.addr, address);
|
2019-05-06 00:17:31 +02:00
|
|
|
});
|
2019-01-29 03:27:07 +01:00
|
|
|
|
2020-06-01 14:54:23 +02:00
|
|
|
it('BlueElectrum can do getTransactionsByAddress()', async function () {
|
|
|
|
const txs = await BlueElectrum.getTransactionsByAddress('bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh');
|
2019-01-29 03:27:07 +01:00
|
|
|
assert.strictEqual(txs.length, 1);
|
2019-05-06 00:17:31 +02:00
|
|
|
assert.strictEqual(txs[0].tx_hash, 'ad00a92409d8982a1d7f877056dbed0c4337d2ebab70b30463e2802279fb936d');
|
|
|
|
assert.strictEqual(txs[0].height, 563077);
|
|
|
|
});
|
|
|
|
|
2020-06-01 14:54:23 +02:00
|
|
|
it('BlueElectrum can do getTransactionsFullByAddress()', async function () {
|
|
|
|
const txs = await BlueElectrum.getTransactionsFullByAddress('bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh');
|
|
|
|
for (const tx of txs) {
|
2019-05-06 00:17:31 +02:00
|
|
|
assert.ok(tx.address === 'bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh');
|
|
|
|
assert.ok(tx.txid);
|
|
|
|
assert.ok(tx.confirmations);
|
2019-05-09 10:35:57 +02:00
|
|
|
assert.ok(!tx.vin);
|
|
|
|
assert.ok(!tx.vout);
|
|
|
|
assert.ok(tx.inputs);
|
|
|
|
assert.ok(tx.inputs[0].addresses.length > 0);
|
|
|
|
assert.ok(tx.inputs[0].value > 0);
|
|
|
|
assert.ok(tx.outputs);
|
|
|
|
assert.ok(tx.outputs[0].value > 0);
|
|
|
|
assert.ok(tx.outputs[0].scriptPubKey);
|
|
|
|
assert.ok(tx.outputs[0].addresses.length > 0);
|
2019-01-29 03:27:07 +01:00
|
|
|
}
|
|
|
|
});
|
2019-05-06 00:17:31 +02:00
|
|
|
|
2020-06-01 14:54:23 +02:00
|
|
|
it('BlueElectrum can do multiGetBalanceByAddress()', async function () {
|
|
|
|
const balances = await BlueElectrum.multiGetBalanceByAddress([
|
2019-05-06 00:17:31 +02:00
|
|
|
'bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh',
|
|
|
|
'bc1qvd6w54sydc08z3802svkxr7297ez7cusd6266p',
|
|
|
|
'bc1qwp58x4c9e5cplsnw5096qzdkae036ug7a34x3r',
|
|
|
|
'bc1qcg6e26vtzja0h8up5w2m7utex0fsu4v0e0e7uy',
|
|
|
|
]);
|
|
|
|
|
|
|
|
assert.strictEqual(balances.balance, 200000);
|
|
|
|
assert.strictEqual(balances.unconfirmed_balance, 0);
|
2020-06-01 14:54:23 +02:00
|
|
|
assert.strictEqual(balances.addresses.bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh.confirmed, 50000);
|
|
|
|
assert.strictEqual(balances.addresses.bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh.unconfirmed, 0);
|
|
|
|
assert.strictEqual(balances.addresses.bc1qvd6w54sydc08z3802svkxr7297ez7cusd6266p.confirmed, 50000);
|
|
|
|
assert.strictEqual(balances.addresses.bc1qvd6w54sydc08z3802svkxr7297ez7cusd6266p.unconfirmed, 0);
|
|
|
|
assert.strictEqual(balances.addresses.bc1qwp58x4c9e5cplsnw5096qzdkae036ug7a34x3r.confirmed, 50000);
|
|
|
|
assert.strictEqual(balances.addresses.bc1qwp58x4c9e5cplsnw5096qzdkae036ug7a34x3r.unconfirmed, 0);
|
|
|
|
assert.strictEqual(balances.addresses.bc1qcg6e26vtzja0h8up5w2m7utex0fsu4v0e0e7uy.confirmed, 50000);
|
|
|
|
assert.strictEqual(balances.addresses.bc1qcg6e26vtzja0h8up5w2m7utex0fsu4v0e0e7uy.unconfirmed, 0);
|
2019-05-06 00:17:31 +02:00
|
|
|
});
|
2019-05-23 18:22:23 +02:00
|
|
|
|
|
|
|
it('BlueElectrum can do multiGetUtxoByAddress()', async () => {
|
2020-06-01 14:54:23 +02:00
|
|
|
const utxos = await BlueElectrum.multiGetUtxoByAddress(
|
2019-05-23 18:22:23 +02:00
|
|
|
[
|
|
|
|
'bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh',
|
|
|
|
'bc1qvd6w54sydc08z3802svkxr7297ez7cusd6266p',
|
|
|
|
'bc1qwp58x4c9e5cplsnw5096qzdkae036ug7a34x3r',
|
|
|
|
'bc1qcg6e26vtzja0h8up5w2m7utex0fsu4v0e0e7uy',
|
|
|
|
],
|
|
|
|
3,
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.strictEqual(Object.keys(utxos).length, 4);
|
|
|
|
assert.strictEqual(
|
2020-06-01 14:54:23 +02:00
|
|
|
utxos.bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh[0].txId,
|
2019-05-23 18:22:23 +02:00
|
|
|
'ad00a92409d8982a1d7f877056dbed0c4337d2ebab70b30463e2802279fb936d',
|
|
|
|
);
|
2020-06-01 14:54:23 +02:00
|
|
|
assert.strictEqual(utxos.bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh[0].vout, 1);
|
|
|
|
assert.strictEqual(utxos.bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh[0].value, 50000);
|
|
|
|
assert.strictEqual(utxos.bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh[0].address, 'bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh');
|
2019-05-23 18:22:23 +02:00
|
|
|
});
|
2019-06-09 19:06:21 +02:00
|
|
|
|
|
|
|
it('ElectrumClient can do multiGetHistoryByAddress()', async () => {
|
2020-06-01 14:54:23 +02:00
|
|
|
const histories = await BlueElectrum.multiGetHistoryByAddress(
|
2019-06-09 19:06:21 +02:00
|
|
|
[
|
|
|
|
'bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh',
|
|
|
|
'bc1qvd6w54sydc08z3802svkxr7297ez7cusd6266p',
|
|
|
|
'bc1qwp58x4c9e5cplsnw5096qzdkae036ug7a34x3r',
|
|
|
|
'bc1qcg6e26vtzja0h8up5w2m7utex0fsu4v0e0e7uy',
|
|
|
|
'bc1qcg6e26vtzja0h8up5w2m7utex0fsu4v0e0e7uy', // duplicate intended
|
|
|
|
],
|
|
|
|
3,
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.ok(
|
2020-06-01 14:54:23 +02:00
|
|
|
histories.bc1qt4t9xl2gmjvxgmp5gev6m8e6s9c85979ta7jeh[0].tx_hash ===
|
2019-06-09 19:06:21 +02:00
|
|
|
'ad00a92409d8982a1d7f877056dbed0c4337d2ebab70b30463e2802279fb936d',
|
|
|
|
);
|
|
|
|
assert.ok(
|
2020-06-01 14:54:23 +02:00
|
|
|
histories.bc1qcg6e26vtzja0h8up5w2m7utex0fsu4v0e0e7uy[0].tx_hash ===
|
2019-06-09 19:06:21 +02:00
|
|
|
'5e2fa84148a7389537434b3ad12fcae71ed43ce5fb0f016a7f154a9b99a973df',
|
|
|
|
);
|
|
|
|
assert.ok(Object.keys(histories).length === 4);
|
|
|
|
});
|
|
|
|
|
2019-06-30 12:59:10 +02:00
|
|
|
it('ElectrumClient can do multiGetTransactionByTxid()', async () => {
|
2020-06-01 14:54:23 +02:00
|
|
|
const txdatas = await BlueElectrum.multiGetTransactionByTxid(
|
2019-06-09 19:06:21 +02:00
|
|
|
[
|
|
|
|
'ad00a92409d8982a1d7f877056dbed0c4337d2ebab70b30463e2802279fb936d',
|
|
|
|
'042c9e276c2d06b0b84899771a7f218af90dd60436947c49a844a05d7c104b26',
|
|
|
|
'2cf439be65e7cc7c6e4db721b1c8fcb1cd95ff07cde79a52a73b3d15a12b2eb6',
|
|
|
|
'5e2fa84148a7389537434b3ad12fcae71ed43ce5fb0f016a7f154a9b99a973df',
|
|
|
|
'5e2fa84148a7389537434b3ad12fcae71ed43ce5fb0f016a7f154a9b99a973df', // duplicate intended
|
|
|
|
],
|
|
|
|
3,
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.ok(
|
2020-06-01 14:54:23 +02:00
|
|
|
txdatas.ad00a92409d8982a1d7f877056dbed0c4337d2ebab70b30463e2802279fb936d.txid ===
|
2019-06-09 19:06:21 +02:00
|
|
|
'ad00a92409d8982a1d7f877056dbed0c4337d2ebab70b30463e2802279fb936d',
|
|
|
|
);
|
|
|
|
assert.ok(
|
|
|
|
txdatas['5e2fa84148a7389537434b3ad12fcae71ed43ce5fb0f016a7f154a9b99a973df'].txid ===
|
|
|
|
'5e2fa84148a7389537434b3ad12fcae71ed43ce5fb0f016a7f154a9b99a973df',
|
|
|
|
);
|
|
|
|
assert.ok(txdatas['5e2fa84148a7389537434b3ad12fcae71ed43ce5fb0f016a7f154a9b99a973df'].size);
|
|
|
|
assert.ok(txdatas['5e2fa84148a7389537434b3ad12fcae71ed43ce5fb0f016a7f154a9b99a973df'].vin);
|
|
|
|
assert.ok(txdatas['5e2fa84148a7389537434b3ad12fcae71ed43ce5fb0f016a7f154a9b99a973df'].vout);
|
|
|
|
assert.ok(txdatas['5e2fa84148a7389537434b3ad12fcae71ed43ce5fb0f016a7f154a9b99a973df'].blocktime);
|
|
|
|
assert.ok(Object.keys(txdatas).length === 4);
|
|
|
|
});
|
2019-06-30 12:59:10 +02:00
|
|
|
|
2020-01-04 23:38:45 +01:00
|
|
|
it('multiGetTransactionByTxid() can work with big batches', async () => {
|
|
|
|
// eslint-disable-next-line
|
|
|
|
let vinTxids = ["fb083ca5fb98451314836bbf31d08bf658deddcc8947d76eefe44b5aa49f3a48","5f0f4ac816af5717f6e049454ef698c5d46b2303b1622a17b42eed0d914ea412","8f58af45a9375ed2516237e6910186f4c9c5655a873396e71721057bdd68b3f2","e3cca3df55a880adbe639955c68772d2c491b36e28368380241ac096d9967095","5aef653da43618151ea24ed13b26e67415a397212a60dbb3609a67ba1c01373b","b67c9ce40020584b82085f4093d066c2759542d9aa612bd1cc2e561548e2f9bb","28f29df4660afa58dd6e0f9c31d3e3c204b575029c4b429dbab7da834748f097","147aa266b25fb24bfd7f2e66a1d8eeaa5086c35922c59a36a7a7c4e6a7805d5d","40f00b01d2173c46fc1b4f462132f183beb368bd43df7b88869a8bb7a8bb3b5f","b67c9ce40020584b82085f4093d066c2759542d9aa612bd1cc2e561548e2f9bb","147aa266b25fb24bfd7f2e66a1d8eeaa5086c35922c59a36a7a7c4e6a7805d5d","ba4a6c71c3b3d738609526693bdf87ed5b441f3546d70a2a83128cf6645c10dd","b1b7410fb84def2a3fa0ba54e587e3ce373c4f6e1972b5a7044c804e53101131","a4a0790f7d00ad7da97e349062cff61da12bc2b1ee06223a41d4960621ad6781","b1b7410fb84def2a3fa0ba54e587e3ce373c4f6e1972b5a7044c804e53101131","15e499177b871ac205bf509e1abd81c29a72475661957ea82db69f4afde6cc3f","6702bf9dc679c9086d0cb3f43c10d48bb200e1b29d73b4b4a399bd3eae31f4d0","51c07c5c882b49931d18adf2f62afed25db53ef4264b1f3144152b6c4dfeda1c","38eba464479c79a230e0256b7e9cc9b9cc8539b9a7297bc9961046df29d63b4a","5d29eef47330797e9b37cf0d57e48a871a6e249a0102e4744ec9d30613b054b8","3af7c1fa064a2c74e0d34972895daba4b78f32eae596774bb4bb35d44cf069c1","cc5485827920ea5de1375c9806a1b6f7db1f87f2e4074481778d1e44183b3cf6","38eba464479c79a230e0256b7e9cc9b9cc8539b9a7297bc9961046df29d63b4a","217b99f47c1a05076b68e98cf65b08df8aa485c28c74e43a0ab5a4aa98a89fa0","fb2b8dcb2997c331bd8d9f4d611293874bde116184ef38dfd5a0d5745f9d475d","2ef35d16748d56d4ec19fb458bc0147e85dd1d78e25f71f0ddd71ba22f0f49ec","05b4009d2ec7c6472a10d652efdbd7e4fa72a2e2448287e386c4d68864ba75af","cd801bc012c361fd6be0bc5b440c71d656d2fa14af90af1f469fc91ca3be0967","24807d3563342275bee7cc4b98dc2fadb9e39d074534e79c7921b46596988344","2b29aaa43d344393769f38e1d3dc0ba1d89b2f9868311ff9ec9eb44183d21250","b07747a598d4f1f0beae08332568292104f4360929057396c5637c1900e4f3ff","f13a237529bfd21edad34678f1da8ebd4606422a85b5f92ee270f3808c286e44","20264987b20aa1d6975cf9bad62855c3f8c1492e38ea7a73963eb355bd18b77f","65e0a29033eb3cea6b4c9eaa7448754e468585cf1877e0b228281138421f30cb","133874b546cdc715439d1d1dba865419a9640ee740f8a72191d1221ac29d066b","b056e86b160b08d3e944f1d61368d3523e9c0820ebc8f755b98ac38eb3e307d1","4bb01e9b0388441442a04bb36fe932c3e3da525c4c09413c90f0a6a74c57d280","2fc80afde86a45f5f113067f44433d44da28d6e17dd8dbe19f511bc371863a1c","e7650f7fa769c2b1aee41477278633a342017c81009feff8b6566b3f3664b6dc","01315e63a7b852f1dfd83bc7a405351492c076d88f2ae4adc3c32d3431fd5a35","7cb1e59903fb72e4f618ba7ab078765e9117d8aca2421268fe24b41986df37ba","7fd27c38816b461eba58b547a524747b28eec2b58e2c8fd29fa9858de96265f5","38b95ee03adf62feb5188c1a8c5ac6334e95e0e21bba6b30e667b54f6ad7b728","8927bc71680f4a9f25af6f2c0c4e1956e0e703124ac725d842c64bba5e92a6e5","48d0b1d45f8e228d41f01f71e56618d0f2ce8263bbd9b59352760640eb2df66c","8f41920019edb0924b861daa6feaf2922d0ce0a9c45b777ba88f6e026cb9a6ea","7a4dad8678a23b608ce8acacd9a2f4c24929bc68037fb2991a43cc022e977b60","684daad794ebc87661f8250eb42621db03f6b3f31185e0f760ee3db73286e6c9","69080677f9b643e100e62a2edf12e2dbd529b047d584ff922e5458381761a05d","ccc4c5111cc02d243b67fc20fd93026d88add65c6fd2055602152227903c703c","242fc7936d4480e5fba4b9515aca0b97de121a9effcc1be26d4e455c7adef9f1","833db41cd8b9c20470bc3b5e70249d243aacfcf6b69593ac460a0029467689b9","5fd098cace35e4c0d08f10059d520bae1b2b074ac1059d2980a1be82a8f77f31","e445ff4d77e50cd5d04d2dd3c482677c5531c2198494768dacb624d4f7f7bfc5","c4e521e8f00cc3979bdd0e0c99970374fa1f92ff742a3e9fdf52c1e4bbcfd78d","a1d6296a9801ee538e0d27feb10f8be41b00b0fccc6c83fcb49e98f23c42dcd3","aa368285e0e05d9bc3f957b89b95260349684cc872b167f36a61982bf63c2201","f4fa04c284d1f3eb907f9e7f8adf6e1e832a21ed763d6d23857e45926f9ce10a","fb9e869cf8465c71c8f4a1756a6dbd8dcd1eca4246d8645b037ad0cc65e800f0","e059ad921e8a07dacd01727774bd17821768e61d3f7062f77131f517a9197e50","8736be2b2a646ce5a471e16baf9d11aadd818a71dfe790395b0b28
|
2020-06-01 14:54:23 +02:00
|
|
|
const vintxdatas = await BlueElectrum.multiGetTransactionByTxid(vinTxids);
|
2020-01-04 23:38:45 +01:00
|
|
|
assert.ok(vintxdatas['8881027cfa2be033b7a9724b5547b710f5ba8aef1becb3ed53d34d614a54e3bc']);
|
|
|
|
});
|
|
|
|
|
2019-10-06 01:57:20 +02:00
|
|
|
it.skip('multiGetTransactionByTxid() can work with huge tx', async () => {
|
|
|
|
// electrum cant return verbose output because of "response too large (over 1,000,000 bytes"
|
|
|
|
// for example:
|
|
|
|
// echo '[{"jsonrpc":"2.0","method":"blockchain.transaction.get","params":["484a11c5e086a281413b9192b4f60c06abf745f08c2c28c4b4daefe6df3b9e5c", true],"id":1}]' | nc bitkoins.nl 50001 -i 1
|
|
|
|
// @see https://electrumx.readthedocs.io/en/latest/protocol-methods.html#blockchain-transaction-get
|
|
|
|
//
|
|
|
|
// possible solution: fetch it without verbose and decode locally. unfortunatelly it omits such info as confirmations, time etc
|
|
|
|
// so whoever uses it should be prepared for this.
|
|
|
|
// tbh consumer wallets dont usually work with such big txs, so probably we dont need it
|
2020-06-01 14:54:23 +02:00
|
|
|
const txdatas = await BlueElectrum.multiGetTransactionByTxid(['484a11c5e086a281413b9192b4f60c06abf745f08c2c28c4b4daefe6df3b9e5c']);
|
2019-10-06 01:57:20 +02:00
|
|
|
assert.ok(txdatas['484a11c5e086a281413b9192b4f60c06abf745f08c2c28c4b4daefe6df3b9e5c']);
|
|
|
|
});
|
|
|
|
|
2019-06-30 12:59:10 +02:00
|
|
|
it('ElectrumClient can do multiGetHistoryByAddress() to obtain txhex', async () => {
|
2020-06-01 14:54:23 +02:00
|
|
|
const txdatas = await BlueElectrum.multiGetTransactionByTxid(
|
2019-06-30 12:59:10 +02:00
|
|
|
['881c54edd95cbdd1583d6b9148eb35128a47b64a2e67a5368a649d6be960f08e'],
|
|
|
|
3,
|
|
|
|
false,
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.strictEqual(
|
|
|
|
txdatas['881c54edd95cbdd1583d6b9148eb35128a47b64a2e67a5368a649d6be960f08e'],
|
|
|
|
'02000000000102f1155666b534f7cb476a0523a45dc8731d38d56b5b08e877c968812423fbd7f3010000000000000000d8a2882a692ee759b43e6af48ac152dd3410cc4b7d25031e83b3396c16ffbc8900000000000000000002400d03000000000017a914e286d58e53f9247a4710e51232cce0686f16873c870695010000000000160014d3e2ecbf4d91321794e0297e0284c47527cf878b02483045022100d18dc865fb4d087004d021d480b983b8afb177a1934ce4cd11cf97b03e17944f02206d7310687a84aab5d4696d535bca69c2db4449b48feb55fff028aa004f2d1744012103af4b208608c75f38e78f6e5abfbcad9c360fb60d3e035193b2cd0cdc8fc0155c0247304402207556e859845df41d897fe442f59b6106c8fa39c74ba5b7b8e3268ab0aebf186f0220048a9f3742339c44a1e5c78b491822b96070bcfda3f64db9dc6434f8e8068475012102456e5223ed3884dc6b0e152067fd836e3eb1485422eda45558bf83f59c6ad09f00000000',
|
|
|
|
);
|
|
|
|
});
|
2019-01-29 03:27:07 +01:00
|
|
|
});
|