mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-20 02:09:10 +01:00
FIX: Fixed testing.
This commit is contained in:
parent
ca365a5615
commit
c35dd1e426
@ -125,7 +125,7 @@ it('Segwit HD (BIP49) can fetch UTXO', async function() {
|
|||||||
hd.usedAddresses = ['1Ez69SnzzmePmZX3WpEzMKTrcBF2gpNQ55', '1BiTCHeYzJNMxBLFCMkwYXNdFEdPJP53ZV']; // hacking internals
|
hd.usedAddresses = ['1Ez69SnzzmePmZX3WpEzMKTrcBF2gpNQ55', '1BiTCHeYzJNMxBLFCMkwYXNdFEdPJP53ZV']; // hacking internals
|
||||||
await hd.fetchUtxo();
|
await hd.fetchUtxo();
|
||||||
assert.equal(hd.utxo.length, 9);
|
assert.equal(hd.utxo.length, 9);
|
||||||
assert.ok(hd.utxo[0].confirmations);
|
assert.ok(typeof hd.utxo[0].confirmations === 'number');
|
||||||
assert.ok(hd.utxo[0].txid);
|
assert.ok(hd.utxo[0].txid);
|
||||||
assert.ok(hd.utxo[0].vout);
|
assert.ok(hd.utxo[0].vout);
|
||||||
assert.ok(hd.utxo[0].amount);
|
assert.ok(hd.utxo[0].amount);
|
||||||
@ -283,6 +283,6 @@ it('can convert blockchain.info TX to blockcypher TX format', () => {
|
|||||||
assert.ok(blockcyphertx.received); // time
|
assert.ok(blockcyphertx.received); // time
|
||||||
assert.ok(blockcyphertx.hash);
|
assert.ok(blockcyphertx.hash);
|
||||||
assert.ok(blockcyphertx.value);
|
assert.ok(blockcyphertx.value);
|
||||||
assert.ok(blockcyphertx.confirmations);
|
assert.ok(typeof blockcyphertx.confirmations === 'number');
|
||||||
assert.ok(blockcyphertx.outputs);
|
assert.ok(blockcyphertx.outputs);
|
||||||
});
|
});
|
||||||
|
@ -41,6 +41,9 @@ export class AbstractHDWallet extends LegacyWallet {
|
|||||||
var clone = Object.assign({}, tx);
|
var clone = Object.assign({}, tx);
|
||||||
clone.received = new Date(clone.time * 1000).toISOString();
|
clone.received = new Date(clone.time * 1000).toISOString();
|
||||||
clone.outputs = clone.out;
|
clone.outputs = clone.out;
|
||||||
|
if (clone.confirmations === undefined) {
|
||||||
|
clone.confirmations = 0;
|
||||||
|
}
|
||||||
for (let o of clone.outputs) {
|
for (let o of clone.outputs) {
|
||||||
o.addresses = [o.addr];
|
o.addresses = [o.addr];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user