@@ -2,6 +2,8 @@ const { ethers } = require('hardhat');
22const { expect } = require ( 'chai' ) ;
33const { loadFixture } = require ( '@nomicfoundation/hardhat-network-helpers' ) ;
44
5+ const { MAX_UINT32 , MAX_UINT64 } = require ( '../../helpers/constants' ) ;
6+
57async function fixture ( ) {
68 const [ user , other ] = await ethers . getSigners ( ) ;
79
@@ -70,7 +72,7 @@ describe('AuthorityUtils', function () {
7072 } ) ;
7173
7274 for ( const immediate of [ true , false ] ) {
73- for ( const delay of [ 0n , 42n ] ) {
75+ for ( const delay of [ 0n , 42n , MAX_UINT32 ] ) {
7476 it ( `returns (immediate=${ immediate } , delay=${ delay } )` , async function ( ) {
7577 await this . authority . _setImmediate ( immediate ) ;
7678 await this . authority . _setDelay ( delay ) ;
@@ -80,6 +82,14 @@ describe('AuthorityUtils', function () {
8082 } ) ;
8183 }
8284 }
85+
86+ it ( 'out of bound delay' , async function ( ) {
87+ await this . authority . _setImmediate ( false ) ;
88+ await this . authority . _setDelay ( MAX_UINT64 ) ; // bigger than the expected uint32
89+ const result = await this . mock . $canCallWithDelay ( this . authority , this . user , this . other , '0x12345678' ) ;
90+ expect ( result . immediate ) . to . equal ( false ) ;
91+ expect ( result . delay ) . to . equal ( 0n ) ;
92+ } ) ;
8393 } ) ;
8494
8595 describe ( 'when authority replies with empty data' , function ( ) {
0 commit comments