@@ -382,18 +382,23 @@ describe('L1GraphTokenGateway', () => {
382
382
. updateL2MintAllowance ( toGRT ( '1' ) , await latestBlock ( ) )
383
383
await expect ( tx ) . revertedWith ( 'Caller must be Controller governor' )
384
384
} )
385
- it ( 'does not allow using a future block number' , async function ( ) {
385
+ it ( 'does not allow using a future or current block number' , async function ( ) {
386
386
const issuancePerBlock = toGRT ( '120' )
387
387
let issuanceUpdatedAtBlock = ( await latestBlock ( ) ) . add ( 2 )
388
388
const tx1 = l1GraphTokenGateway
389
389
. connect ( governor . signer )
390
390
. updateL2MintAllowance ( issuancePerBlock , issuanceUpdatedAtBlock )
391
- await expect ( tx1 ) . revertedWith ( 'BLOCK_CANT_BE_FUTURE ' )
391
+ await expect ( tx1 ) . revertedWith ( 'BLOCK_MUST_BE_PAST ' )
392
392
issuanceUpdatedAtBlock = ( await latestBlock ( ) ) . add ( 1 ) // This will be block.number in our next tx
393
393
const tx2 = l1GraphTokenGateway
394
394
. connect ( governor . signer )
395
395
. updateL2MintAllowance ( issuancePerBlock , issuanceUpdatedAtBlock )
396
- await expect ( tx2 )
396
+ await expect ( tx2 ) . revertedWith ( 'BLOCK_MUST_BE_PAST' )
397
+ issuanceUpdatedAtBlock = await latestBlock ( ) // This will be block.number-1 in our next tx
398
+ const tx3 = l1GraphTokenGateway
399
+ . connect ( governor . signer )
400
+ . updateL2MintAllowance ( issuancePerBlock , issuanceUpdatedAtBlock )
401
+ await expect ( tx3 )
397
402
. emit ( l1GraphTokenGateway , 'L2MintAllowanceUpdated' )
398
403
. withArgs ( toGRT ( '0' ) , issuancePerBlock , issuanceUpdatedAtBlock )
399
404
} )
@@ -474,18 +479,23 @@ describe('L1GraphTokenGateway', () => {
474
479
. setL2MintAllowanceParametersManual ( toGRT ( '0' ) , toGRT ( '1' ) , await latestBlock ( ) )
475
480
await expect ( tx ) . revertedWith ( 'Caller must be Controller governor' )
476
481
} )
477
- it ( 'does not allow using a future block number' , async function ( ) {
482
+ it ( 'does not allow using a future or current block number' , async function ( ) {
478
483
const issuancePerBlock = toGRT ( '120' )
479
484
let issuanceUpdatedAtBlock = ( await latestBlock ( ) ) . add ( 2 )
480
485
const tx1 = l1GraphTokenGateway
481
486
. connect ( governor . signer )
482
487
. setL2MintAllowanceParametersManual ( toGRT ( '0' ) , issuancePerBlock , issuanceUpdatedAtBlock )
483
- await expect ( tx1 ) . revertedWith ( 'BLOCK_CANT_BE_FUTURE ' )
488
+ await expect ( tx1 ) . revertedWith ( 'BLOCK_MUST_BE_PAST ' )
484
489
issuanceUpdatedAtBlock = ( await latestBlock ( ) ) . add ( 1 ) // This will be block.number in our next tx
485
490
const tx2 = l1GraphTokenGateway
486
491
. connect ( governor . signer )
487
492
. setL2MintAllowanceParametersManual ( toGRT ( '0' ) , issuancePerBlock , issuanceUpdatedAtBlock )
488
- await expect ( tx2 )
493
+ await expect ( tx2 ) . revertedWith ( 'BLOCK_MUST_BE_PAST' )
494
+ issuanceUpdatedAtBlock = await latestBlock ( ) // This will be block.number-1 in our next tx
495
+ const tx3 = l1GraphTokenGateway
496
+ . connect ( governor . signer )
497
+ . setL2MintAllowanceParametersManual ( toGRT ( '0' ) , issuancePerBlock , issuanceUpdatedAtBlock )
498
+ await expect ( tx3 )
489
499
. emit ( l1GraphTokenGateway , 'L2MintAllowanceUpdated' )
490
500
. withArgs ( toGRT ( '0' ) , issuancePerBlock , issuanceUpdatedAtBlock )
491
501
} )
0 commit comments