Skip to content

Commit 323bdf8

Browse files
committed
test: fix race condition in BridgeEscrow tests
1 parent 8aa3bd6 commit 323bdf8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/gateway/bridgeEscrow.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ describe('BridgeEscrow', () => {
4141
describe('approveAll', function () {
4242
it('cannot be called by someone other than the governor', async function () {
4343
const tx = bridgeEscrow.connect(tokenReceiver.signer).approveAll(spender.address)
44-
expect(tx).to.be.revertedWith('Caller must be Controller governor')
44+
await expect(tx).revertedWith('Caller must be Controller governor')
4545
})
4646
it('allows a spender to transfer GRT held by the contract', async function () {
4747
expect(await grt.allowance(bridgeEscrow.address, spender.address)).eq(0)
4848
const tx = grt
4949
.connect(spender.signer)
5050
.transferFrom(bridgeEscrow.address, tokenReceiver.address, nTokens)
51-
expect(tx).to.be.revertedWith('ERC20: transfer amount exceeds allowance')
51+
await expect(tx).revertedWith('ERC20: transfer amount exceeds allowance')
5252
await bridgeEscrow.connect(governor.signer).approveAll(spender.address)
53-
expect(
54-
await grt
53+
await expect(
54+
grt
5555
.connect(spender.signer)
5656
.transferFrom(bridgeEscrow.address, tokenReceiver.address, nTokens),
5757
).to.emit(grt, 'Transfer')
@@ -62,7 +62,7 @@ describe('BridgeEscrow', () => {
6262
describe('revokeAll', function () {
6363
it('cannot be called by someone other than the governor', async function () {
6464
const tx = bridgeEscrow.connect(tokenReceiver.signer).revokeAll(spender.address)
65-
expect(tx).to.be.revertedWith('Caller must be Controller governor')
65+
await expect(tx).revertedWith('Caller must be Controller governor')
6666
})
6767
it("revokes a spender's permission to transfer GRT held by the contract", async function () {
6868
await bridgeEscrow.connect(governor.signer).approveAll(spender.address)
@@ -71,7 +71,7 @@ describe('BridgeEscrow', () => {
7171
const tx = grt
7272
.connect(spender.signer)
7373
.transferFrom(bridgeEscrow.address, tokenReceiver.address, BigNumber.from('1'))
74-
expect(tx).to.be.revertedWith('ERC20: transfer amount exceeds allowance')
74+
await expect(tx).revertedWith('ERC20: transfer amount exceeds allowance')
7575
})
7676
})
7777
})

0 commit comments

Comments
 (0)