@@ -241,10 +241,10 @@ describe('L1GraphTokenGateway', () => {
241
241
it ( 'can be paused and unpaused by the governor' , async function ( ) {
242
242
let tx = l1GraphTokenGateway . connect ( governor . signer ) . setPaused ( false )
243
243
await expect ( tx ) . emit ( l1GraphTokenGateway , 'PauseChanged' ) . withArgs ( false )
244
- await expect ( await l1GraphTokenGateway . paused ( ) ) . eq ( false )
244
+ expect ( await l1GraphTokenGateway . paused ( ) ) . eq ( false )
245
245
tx = l1GraphTokenGateway . connect ( governor . signer ) . setPaused ( true )
246
246
await expect ( tx ) . emit ( l1GraphTokenGateway , 'PauseChanged' ) . withArgs ( true )
247
- await expect ( await l1GraphTokenGateway . paused ( ) ) . eq ( true )
247
+ expect ( await l1GraphTokenGateway . paused ( ) ) . eq ( true )
248
248
} )
249
249
describe ( 'setPauseGuardian' , function ( ) {
250
250
it ( 'cannot be called by someone other than governor' , async function ( ) {
@@ -265,10 +265,10 @@ describe('L1GraphTokenGateway', () => {
265
265
await l1GraphTokenGateway . connect ( governor . signer ) . setPauseGuardian ( pauseGuardian . address )
266
266
let tx = l1GraphTokenGateway . connect ( pauseGuardian . signer ) . setPaused ( false )
267
267
await expect ( tx ) . emit ( l1GraphTokenGateway , 'PauseChanged' ) . withArgs ( false )
268
- await expect ( await l1GraphTokenGateway . paused ( ) ) . eq ( false )
268
+ expect ( await l1GraphTokenGateway . paused ( ) ) . eq ( false )
269
269
tx = l1GraphTokenGateway . connect ( pauseGuardian . signer ) . setPaused ( true )
270
270
await expect ( tx ) . emit ( l1GraphTokenGateway , 'PauseChanged' ) . withArgs ( true )
271
- await expect ( await l1GraphTokenGateway . paused ( ) ) . eq ( true )
271
+ expect ( await l1GraphTokenGateway . paused ( ) ) . eq ( true )
272
272
} )
273
273
} )
274
274
} )
@@ -361,8 +361,8 @@ describe('L1GraphTokenGateway', () => {
361
361
)
362
362
const escrowBalance = await grt . balanceOf ( bridgeEscrow . address )
363
363
const senderBalance = await grt . balanceOf ( tokenSender . address )
364
- await expect ( escrowBalance ) . eq ( toGRT ( '10' ) )
365
- await expect ( senderBalance ) . eq ( toGRT ( '990' ) )
364
+ expect ( escrowBalance ) . eq ( toGRT ( '10' ) )
365
+ expect ( senderBalance ) . eq ( toGRT ( '990' ) )
366
366
}
367
367
before ( async function ( ) {
368
368
await fixture . configureL1Bridge (
@@ -431,12 +431,12 @@ describe('L1GraphTokenGateway', () => {
431
431
. emit ( l1GraphTokenGateway , 'L2MintAllowanceUpdated' )
432
432
. withArgs ( toGRT ( '0' ) , issuancePerBlock , issuanceUpdatedAtBlock )
433
433
// Now the mint allowance should be issuancePerBlock * 3
434
- await expect (
434
+ expect (
435
435
await l1GraphTokenGateway . accumulatedL2MintAllowanceAtBlock ( await latestBlock ( ) ) ,
436
436
) . to . eq ( issuancePerBlock . mul ( 3 ) )
437
- await expect ( await l1GraphTokenGateway . accumulatedL2MintAllowanceSnapshot ( ) ) . to . eq ( 0 )
438
- await expect ( await l1GraphTokenGateway . l2MintAllowancePerBlock ( ) ) . to . eq ( issuancePerBlock )
439
- await expect ( await l1GraphTokenGateway . lastL2MintAllowanceUpdateBlock ( ) ) . to . eq (
437
+ expect ( await l1GraphTokenGateway . accumulatedL2MintAllowanceSnapshot ( ) ) . to . eq ( 0 )
438
+ expect ( await l1GraphTokenGateway . l2MintAllowancePerBlock ( ) ) . to . eq ( issuancePerBlock )
439
+ expect ( await l1GraphTokenGateway . lastL2MintAllowanceUpdateBlock ( ) ) . to . eq (
440
440
issuanceUpdatedAtBlock ,
441
441
)
442
442
@@ -455,14 +455,14 @@ describe('L1GraphTokenGateway', () => {
455
455
. emit ( l1GraphTokenGateway , 'L2MintAllowanceUpdated' )
456
456
. withArgs ( expectedAccumulatedSnapshot , newIssuancePerBlock , newIssuanceUpdatedAtBlock )
457
457
458
- await expect (
458
+ expect (
459
459
await l1GraphTokenGateway . accumulatedL2MintAllowanceAtBlock ( await latestBlock ( ) ) ,
460
460
) . to . eq ( expectedAccumulatedSnapshot . add ( newIssuancePerBlock . mul ( 2 ) ) )
461
- await expect ( await l1GraphTokenGateway . accumulatedL2MintAllowanceSnapshot ( ) ) . to . eq (
461
+ expect ( await l1GraphTokenGateway . accumulatedL2MintAllowanceSnapshot ( ) ) . to . eq (
462
462
expectedAccumulatedSnapshot ,
463
463
)
464
- await expect ( await l1GraphTokenGateway . l2MintAllowancePerBlock ( ) ) . to . eq ( newIssuancePerBlock )
465
- await expect ( await l1GraphTokenGateway . lastL2MintAllowanceUpdateBlock ( ) ) . to . eq (
464
+ expect ( await l1GraphTokenGateway . l2MintAllowancePerBlock ( ) ) . to . eq ( newIssuancePerBlock )
465
+ expect ( await l1GraphTokenGateway . lastL2MintAllowanceUpdateBlock ( ) ) . to . eq (
466
466
newIssuanceUpdatedAtBlock ,
467
467
)
468
468
} )
@@ -504,14 +504,12 @@ describe('L1GraphTokenGateway', () => {
504
504
. emit ( l1GraphTokenGateway , 'L2MintAllowanceUpdated' )
505
505
. withArgs ( snapshotValue , issuancePerBlock , issuanceUpdatedAtBlock )
506
506
// Now the mint allowance should be 10 + issuancePerBlock * 3
507
- await expect (
507
+ expect (
508
508
await l1GraphTokenGateway . accumulatedL2MintAllowanceAtBlock ( await latestBlock ( ) ) ,
509
509
) . to . eq ( snapshotValue . add ( issuancePerBlock . mul ( 3 ) ) )
510
- await expect ( await l1GraphTokenGateway . accumulatedL2MintAllowanceSnapshot ( ) ) . to . eq (
511
- snapshotValue ,
512
- )
513
- await expect ( await l1GraphTokenGateway . l2MintAllowancePerBlock ( ) ) . to . eq ( issuancePerBlock )
514
- await expect ( await l1GraphTokenGateway . lastL2MintAllowanceUpdateBlock ( ) ) . to . eq (
510
+ expect ( await l1GraphTokenGateway . accumulatedL2MintAllowanceSnapshot ( ) ) . to . eq ( snapshotValue )
511
+ expect ( await l1GraphTokenGateway . l2MintAllowancePerBlock ( ) ) . to . eq ( issuancePerBlock )
512
+ expect ( await l1GraphTokenGateway . lastL2MintAllowanceUpdateBlock ( ) ) . to . eq (
515
513
issuanceUpdatedAtBlock ,
516
514
)
517
515
@@ -532,14 +530,14 @@ describe('L1GraphTokenGateway', () => {
532
530
. emit ( l1GraphTokenGateway , 'L2MintAllowanceUpdated' )
533
531
. withArgs ( newSnapshotValue , newIssuancePerBlock , newIssuanceUpdatedAtBlock )
534
532
535
- await expect (
533
+ expect (
536
534
await l1GraphTokenGateway . accumulatedL2MintAllowanceAtBlock ( await latestBlock ( ) ) ,
537
535
) . to . eq ( newSnapshotValue . add ( newIssuancePerBlock . mul ( 2 ) ) )
538
- await expect ( await l1GraphTokenGateway . accumulatedL2MintAllowanceSnapshot ( ) ) . to . eq (
536
+ expect ( await l1GraphTokenGateway . accumulatedL2MintAllowanceSnapshot ( ) ) . to . eq (
539
537
newSnapshotValue ,
540
538
)
541
- await expect ( await l1GraphTokenGateway . l2MintAllowancePerBlock ( ) ) . to . eq ( newIssuancePerBlock )
542
- await expect ( await l1GraphTokenGateway . lastL2MintAllowanceUpdateBlock ( ) ) . to . eq (
539
+ expect ( await l1GraphTokenGateway . l2MintAllowancePerBlock ( ) ) . to . eq ( newIssuancePerBlock )
540
+ expect ( await l1GraphTokenGateway . lastL2MintAllowanceUpdateBlock ( ) ) . to . eq (
543
541
newIssuanceUpdatedAtBlock ,
544
542
)
545
543
} )
@@ -792,8 +790,8 @@ describe('L1GraphTokenGateway', () => {
792
790
. withArgs ( grt . address , l2Receiver . address , tokenSender . address , toBN ( '0' ) , toGRT ( '8' ) )
793
791
const escrowBalance = await grt . balanceOf ( bridgeEscrow . address )
794
792
const senderBalance = await grt . balanceOf ( tokenSender . address )
795
- await expect ( escrowBalance ) . eq ( toGRT ( '2' ) )
796
- await expect ( senderBalance ) . eq ( toGRT ( '998' ) )
793
+ expect ( escrowBalance ) . eq ( toGRT ( '2' ) )
794
+ expect ( senderBalance ) . eq ( toGRT ( '998' ) )
797
795
} )
798
796
it ( 'mints tokens up to the L2 mint allowance' , async function ( ) {
799
797
await grt . connect ( tokenSender . signer ) . approve ( l1GraphTokenGateway . address , toGRT ( '10' ) )
@@ -838,16 +836,17 @@ describe('L1GraphTokenGateway', () => {
838
836
await expect ( tx )
839
837
. emit ( l1GraphTokenGateway , 'WithdrawalFinalized' )
840
838
. withArgs ( grt . address , l2Receiver . address , tokenSender . address , toBN ( '0' ) , toGRT ( '18' ) )
841
- await expect ( tx ) . emit ( l1GraphTokenGateway , 'TokensMintedFromL2' ) . withArgs ( toGRT ( '8' ) )
842
- await expect ( await l1GraphTokenGateway . totalMintedFromL2 ( ) ) . to . eq ( toGRT ( '8' ) )
843
- await expect (
839
+ . emit ( l1GraphTokenGateway , 'TokensMintedFromL2' )
840
+ . withArgs ( toGRT ( '8' ) )
841
+ expect ( await l1GraphTokenGateway . totalMintedFromL2 ( ) ) . to . eq ( toGRT ( '8' ) )
842
+ expect (
844
843
await l1GraphTokenGateway . accumulatedL2MintAllowanceAtBlock ( await latestBlock ( ) ) ,
845
844
) . to . eq ( toGRT ( '8' ) )
846
845
847
846
const escrowBalance = await grt . balanceOf ( bridgeEscrow . address )
848
847
const senderBalance = await grt . balanceOf ( tokenSender . address )
849
- await expect ( escrowBalance ) . eq ( toGRT ( '0' ) )
850
- await expect ( senderBalance ) . eq ( toGRT ( '1008' ) )
848
+ expect ( escrowBalance ) . eq ( toGRT ( '0' ) )
849
+ expect ( senderBalance ) . eq ( toGRT ( '1008' ) )
851
850
} )
852
851
it ( 'reverts if the amount to mint is over the allowance' , async function ( ) {
853
852
await grt . connect ( tokenSender . signer ) . approve ( l1GraphTokenGateway . address , toGRT ( '10' ) )
0 commit comments