Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petarTxFusion committed Oct 27, 2024
1 parent a070e59 commit 6694aa0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions tests/integration/signer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ describe('L1VoidSigner', () => {
refundRecipient: await signer.getAddress(),
});
expect(result.isZero()).to.be.false;
});
}).timeout(25_000);
} else {
it('should throw an error for insufficient allowance when estimating gas for ETH deposit transaction', async () => {
try {
Expand All @@ -800,7 +800,7 @@ describe('L1VoidSigner', () => {
} catch (e) {
expect((e as any).reason).to.include('ERC20: insufficient allowance');
}
});
}).timeout(25_000);

it('should return gas estimation for ETH deposit transaction', async () => {
const wallet = new Wallet(PRIVATE_KEY1, provider, ethProvider);
Expand All @@ -826,7 +826,7 @@ describe('L1VoidSigner', () => {
refundRecipient: await signer.getAddress(),
});
expect(result.isZero()).to.be.false;
});
}).timeout(25_000);

it('should return gas estimation for base token deposit transaction', async () => {
const wallet = new Wallet(PRIVATE_KEY1, provider, ethProvider);
Expand All @@ -852,7 +852,7 @@ describe('L1VoidSigner', () => {
refundRecipient: await signer.getAddress(),
});
expect(result.isZero()).to.be.false;
});
}).timeout(25_000);

it('should return gas estimation for DAI deposit transaction', async () => {
const wallet = new Wallet(PRIVATE_KEY1, provider, ethProvider);
Expand Down Expand Up @@ -884,7 +884,7 @@ describe('L1VoidSigner', () => {
refundRecipient: await signer.getAddress(),
});
expect(result.isZero()).to.be.false;
});
}).timeout(25_000);
}
});

Expand Down
28 changes: 14 additions & 14 deletions tests/integration/wallet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ describe('Wallet', () => {
} catch (e) {
expect((e as any).reason).to.include('ERC20: insufficient allowance');
}
});
}).timeout(25_000);

it('should return gas estimation for ETH deposit transaction', async () => {
const token = utils.LEGACY_ETH_ADDRESS;
Expand All @@ -702,7 +702,7 @@ describe('Wallet', () => {
refundRecipient: await wallet.getAddress(),
});
expect(result.isZero()).to.be.false;
});
}).timeout(25_000);

it('should return gas estimation for base token deposit transaction', async () => {
const token = await wallet.getBaseToken();
Expand All @@ -726,7 +726,7 @@ describe('Wallet', () => {
refundRecipient: await wallet.getAddress(),
});
expect(result.isZero()).to.be.false;
});
}).timeout(25_000);

it('should return gas estimation for DAI deposit transaction', async () => {
const token = DAI_L1;
Expand Down Expand Up @@ -756,7 +756,7 @@ describe('Wallet', () => {
refundRecipient: await wallet.getAddress(),
});
expect(result.isZero()).to.be.false;
});
}).timeout(25_000);
}
});

Expand All @@ -780,7 +780,7 @@ describe('Wallet', () => {
.be.true;
expect(l1BalanceBeforeDeposit.sub(l1BalanceAfterDeposit).gte(amount)).to
.be.true;
}).timeout(10_000);
}).timeout(25_000);

it('should deposit DAI to L2 network', async () => {
const amount = 5;
Expand Down Expand Up @@ -998,7 +998,7 @@ describe('Wallet', () => {
'Not enough allowance to cover the deposit!'
);
}
}).timeout(10_000);
}).timeout(25_000);

it('should return fee for DAI token deposit', async () => {
const tx = await wallet.approveERC20(DAI_L1, 5);
Expand All @@ -1014,7 +1014,7 @@ describe('Wallet', () => {
expect(BigNumber.from(result.maxFeePerGas).isZero()).to.be.false;
expect(BigNumber.from(result.maxPriorityFeePerGas).isZero()).to.be
.false;
}).timeout(10_000);
}).timeout(25_000);

it('should throw an error when there is not enough balance for the deposit', async () => {
try {
Expand All @@ -1032,7 +1032,7 @@ describe('Wallet', () => {
'Not enough balance for deposit!'
);
}
}).timeout(10_000);
}).timeout(25_000);
} else {
it('should throw an error when there is not enough base token allowance to cover the deposit', async () => {
try {
Expand All @@ -1048,7 +1048,7 @@ describe('Wallet', () => {
'Not enough base token allowance to cover the deposit!'
);
}
}).timeout(10_000);
}).timeout(25_000);

it('should return fee for ETH token deposit', async () => {
const token = utils.LEGACY_ETH_ADDRESS;
Expand All @@ -1072,7 +1072,7 @@ describe('Wallet', () => {
expect(BigNumber.from(result.maxFeePerGas).isZero()).to.be.false;
expect(BigNumber.from(result.maxPriorityFeePerGas).isZero()).to.be
.false;
}).timeout(10_000);
}).timeout(25_000);

it('should return fee for base token deposit', async () => {
const token = await wallet.getBaseToken();
Expand All @@ -1090,7 +1090,7 @@ describe('Wallet', () => {
to: await wallet.getAddress(),
});
expect(result).not.to.be.null;
}).timeout(10_000);
}).timeout(25_000);

it('should return fee for DAI token deposit', async () => {
const token = DAI_L1;
Expand Down Expand Up @@ -1119,7 +1119,7 @@ describe('Wallet', () => {
expect(BigNumber.from(result.maxFeePerGas).isZero()).to.be.false;
expect(BigNumber.from(result.maxPriorityFeePerGas).isZero()).to.be
.false;
}).timeout(10_000);
}).timeout(25_000);

it('should throw an error when there is not enough token allowance to cover the deposit', async () => {
const token = DAI_L1;
Expand Down Expand Up @@ -1468,7 +1468,7 @@ describe('Wallet', () => {

const result = await wallet.estimateGasRequestExecute(tx);
expect(result.isZero()).to.be.false;
}).timeout(10_000);
}).timeout(25_000);
}
});

Expand Down Expand Up @@ -1537,7 +1537,7 @@ describe('Wallet', () => {
expect(
l1BalanceBeforeExecution.sub(l1BalanceAfterExecution).gte(amount)
).to.be.true;
}).timeout(10_000);
}).timeout(25_000);
}
});

Expand Down

0 comments on commit 6694aa0

Please sign in to comment.