Skip to content

Commit becac1d

Browse files
committed
Attempt fixing the consistently failing airnode-admin e2e test
1 parent 4363593 commit becac1d

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

packages/airnode-admin/test/e2e/cli.feature.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ it('has disabled DEBUG_COMMANDS flag', () => {
2525
});
2626

2727
describe('CLI', () => {
28-
jest.setTimeout(45_000);
28+
jest.setTimeout(300_000);
2929

3030
let provider: ethers.providers.StaticJsonRpcProvider;
3131
let deployer: ethers.providers.JsonRpcSigner;
@@ -331,23 +331,16 @@ Template data:
331331
});
332332

333333
describe('withdrawal', () => {
334-
let sponsor: ethers.Wallet;
335-
let sponsorWallet: ethers.Wallet;
336-
const sponsorBalance = () => sponsor.getBalance();
337-
338-
beforeEach(async () => {
334+
it('can create and fulfill withdrawal request', async () => {
339335
// Prepare for derivation of designated wallet - see test for designated wallet derivation for details
340-
sponsor = alice;
336+
const sponsor: ethers.Wallet = alice;
341337

342338
// Derive and fund the designated sponsor wallet
343-
sponsorWallet = await deriveSponsorWallet(airnodeWallet.mnemonic.phrase, sponsor.address);
339+
const sponsorWallet = deriveSponsorWallet(airnodeWallet.mnemonic.phrase, sponsor.address);
344340
await deployer.sendTransaction({
345341
to: sponsorWallet.address,
346342
value: ethers.utils.parseEther('1'),
347343
});
348-
});
349-
350-
it('can create and fulfill withdrawal request', async () => {
351344
const requestWithdrawalOutput = execCommand(
352345
'request-withdrawal',
353346
['--sponsor-mnemonic', mnemonic],
@@ -371,13 +364,12 @@ Template data:
371364

372365
expect(checkWithdrawalStatus()).toBe('Withdrawal request is not fulfilled yet');
373366

374-
const balanceBefore = await sponsorBalance();
367+
const balanceBefore = await sponsor.getBalance();
375368
airnodeRrp = airnodeRrp.connect(sponsorWallet);
376369
await admin.fulfillWithdrawal(airnodeRrp, withdrawalRequestId, airnodeWallet.address, sponsor.address, '0.8');
377370
expect(checkWithdrawalStatus()).toBe('Withdrawn amount: 800000000000000000');
378-
expect((await sponsorBalance()).toString()).toBe(
379-
balanceBefore.add(ethers.BigNumber.from('800000000000000000')).toString()
380-
);
371+
const balanceAfter = await sponsor.getBalance();
372+
expect(balanceAfter.toString()).toBe(balanceBefore.add(ethers.BigNumber.from('800000000000000000')).toString());
381373
});
382374
});
383375

0 commit comments

Comments
 (0)