mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-20 02:09:10 +01:00
Merge pull request #6297 from BlueWallet/tst-watchonly
TST: improved watch-only test
This commit is contained in:
commit
9daf8921cd
@ -96,10 +96,18 @@ describe('Watch only wallet', () => {
|
|||||||
assert.strictEqual(w.getBalance(), 200000);
|
assert.strictEqual(w.getBalance(), 200000);
|
||||||
await w.fetchTransactions();
|
await w.fetchTransactions();
|
||||||
assert.strictEqual(w.getTransactions().length, 4);
|
assert.strictEqual(w.getTransactions().length, 4);
|
||||||
assert.ok((await w.getAddressAsync()).startsWith('bc1'));
|
const nextAddress = await w.getAddressAsync();
|
||||||
|
|
||||||
|
assert.strictEqual(w.getNextFreeAddressIndex(), 2);
|
||||||
|
assert.strictEqual(nextAddress, 'bc1q6442dedpwvqldldnsyux3cuz27paqks0pf2kvf');
|
||||||
|
assert.strictEqual(nextAddress, w._getExternalAddressByIndex(w.getNextFreeAddressIndex()));
|
||||||
|
|
||||||
|
const nextChangeAddress = await w.getChangeAddressAsync();
|
||||||
|
assert.strictEqual(nextChangeAddress, 'bc1qgltdyjnertcyvdn9hlkfpgr6hc260rjrss49uy');
|
||||||
});
|
});
|
||||||
|
|
||||||
// skipped because its generally rare case
|
// skipped because its generally rare case
|
||||||
|
// eslint-disable-next-line jest/no-disabled-tests
|
||||||
it.skip('can fetch txs for address funded by genesis txs', async () => {
|
it.skip('can fetch txs for address funded by genesis txs', async () => {
|
||||||
const w = new WatchOnlyWallet();
|
const w = new WatchOnlyWallet();
|
||||||
w.setSecret('37jKPSmbEGwgfacCr2nayn1wTaqMAbA94Z');
|
w.setSecret('37jKPSmbEGwgfacCr2nayn1wTaqMAbA94Z');
|
||||||
|
Loading…
Reference in New Issue
Block a user