@@ -12,6 +12,7 @@ const {
12
12
encodeSingle,
13
13
} = require ( '@openzeppelin/contracts/test/helpers/erc7579' ) ;
14
14
const { shouldBehaveLikeERC7579Module } = require ( './ERC7579Module.behavior' ) ;
15
+ const { OperationState, ProposalState } = require ( '../../helpers/enums' ) ;
15
16
16
17
async function fixture ( ) {
17
18
// Deploy ERC-7579 validator module
@@ -155,10 +156,14 @@ describe('ERC7579DelayedExecutor', function () {
155
156
) . to . eventually . deep . equal ( [ now , now + this . delay , now + this . delay + this . expiration ] ) ;
156
157
} ) ;
157
158
158
- it ( 'reverts with ERC7579ExecutorUnauthorizedSchedule if called by other account' , async function ( ) {
159
+ it ( 'no-ops if called by other account' , async function ( ) {
160
+ await this . mock . schedule ( this . mockAccount . address , salt , this . mode , this . calldata ) ; // not revert
159
161
await expect (
160
- this . mock . schedule ( this . mockAccount . address , salt , this . mode , this . calldata ) ,
161
- ) . to . be . revertedWithCustomError ( this . mock , 'ERC7579ExecutorUnauthorizedSchedule' ) ;
162
+ this . mock . getSchedule ( this . mockAccount . address , salt , this . mode , this . calldata ) ,
163
+ ) . to . eventually . deep . equal ( [ 0n , 0n , 0n ] ) ;
164
+ await expect ( this . mock . state ( this . mockAccount . address , salt , this . mode , this . calldata ) ) . to . eventually . equal (
165
+ OperationState . Unknown ,
166
+ ) ;
162
167
} ) ;
163
168
} ) ;
164
169
@@ -232,9 +237,12 @@ describe('ERC7579DelayedExecutor', function () {
232
237
} ) ;
233
238
234
239
it ( 'reverts with ERC7579ExecutorUnauthorizedCancellation if called by other account' , async function ( ) {
235
- await expect (
236
- this . mock . cancel ( this . mockAccount . address , salt , this . mode , this . calldata ) ,
237
- ) . to . be . revertedWithCustomError ( this . mock , 'ERC7579ExecutorUnauthorizedCancellation' ) ;
240
+ const previousState = await this . mock . state ( this . mockAccount . address , salt , this . mode , this . calldata ) ;
241
+ expect ( previousState ) . to . not . eq ( ProposalState . Canceled ) ;
242
+ await this . mock . cancel ( this . mockAccount . address , salt , this . mode , this . calldata ) ; // not revert
243
+ await expect ( this . mock . state ( this . mockAccount . address , salt , this . mode , this . calldata ) ) . to . eventually . equal (
244
+ previousState ,
245
+ ) ;
238
246
} ) ;
239
247
} ) ;
240
248
} ) ;
0 commit comments