-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wallet): Restore initWaitForElectrumToSync logic in wallet restor…
…e test
- Loading branch information
1 parent
f414b07
commit 75fa00b
Showing
1 changed file
with
7 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import store from '../src/store'; | |
import { restoreSeed } from '../src/utils/startup'; | ||
import { EAvailableNetworks, EProtocol } from 'beignet'; | ||
import { getOnChainWallet } from '../src/utils/wallet'; | ||
import initWaitForElectrumToSync from './utils/wait-for-electrum'; | ||
import { EAvailableNetwork } from '../src/utils/networks'; | ||
|
||
jest.setTimeout(60_000); | ||
|
@@ -15,6 +16,7 @@ const bitcoinURL = 'http://polaruser:[email protected]:43782'; | |
const selectedNetwork = EAvailableNetwork.bitcoinRegtest; | ||
|
||
describe('Wallet - wallet restore and receive', () => { | ||
let waitForElectrum; | ||
const rpc = new BitcoinJsonRpc(bitcoinURL); | ||
|
||
beforeAll(async () => { | ||
|
@@ -28,6 +30,10 @@ describe('Wallet - wallet restore and receive', () => { | |
await rpc.generateToAddress(10, address); | ||
balance = await rpc.getBalance(); | ||
} | ||
waitForElectrum = await initWaitForElectrumToSync( | ||
{ host: electrumHost, port: electrumPort }, | ||
bitcoinURL, | ||
); | ||
}); | ||
|
||
it("can restore wallet and it's balance", async () => { | ||
|
@@ -37,6 +43,7 @@ describe('Wallet - wallet restore and receive', () => { | |
'1', | ||
); | ||
await rpc.generateToAddress(1, await rpc.getNewAddress()); | ||
await waitForElectrum(); | ||
|
||
const servers = [ | ||
{ | ||
|