diff --git a/integration-tests/test/boba-api.spec.ts b/integration-tests/test/boba-api.spec.ts index 020dd50145..75211f9dac 100644 --- a/integration-tests/test/boba-api.spec.ts +++ b/integration-tests/test/boba-api.spec.ts @@ -79,6 +79,8 @@ describe('Boba API Tests', async () => { const deadline = Math.floor(Date.now() / 1000) + 90 const verifyingContract = L2Boba.address + await L2Boba.transfer(env.l2Wallet_2.address, value) + const data: any = { primaryType: 'Permit', types: { EIP712Domain, Permit }, @@ -236,7 +238,7 @@ describe('Boba API Tests', async () => { expect(BobaBalanceAfter).to.be.deep.eq(BobaBalanceBefore) expect(ETHBalanceAfter).to.be.deep.eq(ETHBalanceBefore) expect(GPO_ETHBalanceAfter).to.be.deep.eq(GPO_ETHBalanceBefore) - }).retries(3) + }) it('should return reverted reason from API if Boba_GasPriceOracle has insufficient ETH', async () => { // withdraw ETH first @@ -254,6 +256,8 @@ describe('Boba API Tests', async () => { const deadline = Math.floor(Date.now() / 1000) + 90 const verifyingContract = L2Boba.address + await L2Boba.transfer(env.l2Wallet_2.address, value) + const data: any = { primaryType: 'Permit', types: { EIP712Domain, Permit }, @@ -303,7 +307,7 @@ describe('Boba API Tests', async () => { to: Boba_GasPriceOracle.address, value: ethers.utils.parseEther('10'), }) - }).retries(3) + }) }) }) }) diff --git a/integration-tests/test/turing.spec.ts b/integration-tests/test/turing.spec.ts index 1d1de50528..6c7bc2cae7 100644 --- a/integration-tests/test/turing.spec.ts +++ b/integration-tests/test/turing.spec.ts @@ -95,32 +95,34 @@ describe('Turing 256 Bit Random Number Test', async () => { const preL1BOBABalance = await L1BOBAToken.balanceOf(env.l1Wallet.address) const preL2BOBABalance = await L2BOBAToken.balanceOf(env.l2Wallet.address) - const approveL1BOBATX = await L1BOBAToken.approve( - L1StandardBridge.address, - depositBOBAAmount - ) - await approveL1BOBATX.wait() - - await env.waitForXDomainTransaction( - L1StandardBridge.depositERC20( - L1BOBAToken.address, - L2BOBAToken.address, - depositBOBAAmount, - 9999999, - ethers.utils.formatBytes32String(new Date().getTime().toString()) + if (preL2BOBABalance.lt(depositBOBAAmount)) { + const approveL1BOBATX = await L1BOBAToken.approve( + L1StandardBridge.address, + depositBOBAAmount + ) + await approveL1BOBATX.wait() + + await env.waitForXDomainTransaction( + L1StandardBridge.depositERC20( + L1BOBAToken.address, + L2BOBAToken.address, + depositBOBAAmount, + 9999999, + ethers.utils.formatBytes32String(new Date().getTime().toString()) + ) ) - ) - const postL1BOBABalance = await L1BOBAToken.balanceOf(env.l1Wallet.address) - const postL2BOBABalance = await L2BOBAToken.balanceOf(env.l2Wallet.address) + const postL1BOBABalance = await L1BOBAToken.balanceOf(env.l1Wallet.address) + const postL2BOBABalance = await L2BOBAToken.balanceOf(env.l2Wallet.address) - expect(preL1BOBABalance).to.deep.eq( - postL1BOBABalance.add(depositBOBAAmount) - ) + expect(preL1BOBABalance).to.deep.eq( + postL1BOBABalance.add(depositBOBAAmount) + ) - expect(preL2BOBABalance).to.deep.eq( - postL2BOBABalance.sub(depositBOBAAmount) - ) + expect(preL2BOBABalance).to.deep.eq( + postL2BOBABalance.sub(depositBOBAAmount) + ) + } }).retries(3) it('contract should be whitelisted', async () => {