Skip to content

Commit

Permalink
fix(wallet): Restore initWaitForElectrumToSync logic in wallet restor…
Browse files Browse the repository at this point in the history
…e test
  • Loading branch information
coreyphillips committed Jan 25, 2024
1 parent f414b07 commit 75fa00b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions __tests__/wallet-restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 () => {
Expand All @@ -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 () => {
Expand All @@ -37,6 +43,7 @@ describe('Wallet - wallet restore and receive', () => {
'1',
);
await rpc.generateToAddress(1, await rpc.getNewAddress());
await waitForElectrum();

const servers = [
{
Expand Down

0 comments on commit 75fa00b

Please sign in to comment.