@@ -408,6 +408,12 @@ describe("ZNSRootRegistrar", () => {
408
408
) . to . be . reverted ;
409
409
} ) ;
410
410
411
+ it ( "#isOwnerOf() should revert if wrong enum value is passed" , async ( ) => {
412
+ await expect (
413
+ zns . rootRegistrar . isOwnerOf ( ethers . ZeroHash , user . address , 3 )
414
+ ) . to . be . reverted ;
415
+ } ) ;
416
+
411
417
it ( "#setSubRegistrar() should revert if called by address without ADMIN_ROLE" , async ( ) => {
412
418
const isAdmin = await zns . accessController . hasRole ( ADMIN_ROLE , randomUser . address ) ;
413
419
expect ( isAdmin ) . to . be . false ;
@@ -1353,23 +1359,25 @@ describe("ZNSRootRegistrar", () => {
1353
1359
} ) ;
1354
1360
} ) ;
1355
1361
1356
- it ( "#setRootPricer() should set the rootPricer correctly" , async ( ) => {
1357
- const newPricer = zns . fixedPricer . target ;
1358
- await zns . rootRegistrar . connect ( admin ) . setRootPricer ( newPricer ) ;
1362
+ describe ( "#setRootPricer" , ( ) => {
1363
+ it ( "#setRootPricer() should set the rootPricer correctly" , async ( ) => {
1364
+ const newPricer = zns . fixedPricer . target ;
1365
+ await zns . rootRegistrar . connect ( admin ) . setRootPricer ( newPricer ) ;
1359
1366
1360
- expect ( await zns . rootRegistrar . rootPricer ( ) ) . to . eq ( newPricer ) ;
1367
+ expect ( await zns . rootRegistrar . rootPricer ( ) ) . to . eq ( newPricer ) ;
1361
1368
1362
- // set back
1363
- await zns . rootRegistrar . connect ( admin ) . setRootPricer ( zns . curvePricer . target ) ;
1364
- } ) ;
1369
+ // set back
1370
+ await zns . rootRegistrar . connect ( admin ) . setRootPricer ( zns . curvePricer . target ) ;
1371
+ } ) ;
1365
1372
1366
- it ( "#setRootPricer() should NOT let set 0x0 address as the new pricer" , async ( ) => {
1367
- await expect (
1368
- zns . rootRegistrar . connect ( admin ) . setRootPricer ( ethers . ZeroAddress )
1369
- ) . to . be . revertedWithCustomError (
1370
- zns . subRegistrar ,
1371
- ZERO_ADDRESS_ERR
1372
- ) ;
1373
+ it ( "#setRootPricer() should NOT let set 0x0 address as the new pricer" , async ( ) => {
1374
+ await expect (
1375
+ zns . rootRegistrar . connect ( admin ) . setRootPricer ( ethers . ZeroAddress )
1376
+ ) . to . be . revertedWithCustomError (
1377
+ zns . subRegistrar ,
1378
+ ZERO_ADDRESS_ERR
1379
+ ) ;
1380
+ } ) ;
1373
1381
} ) ;
1374
1382
} ) ;
1375
1383
0 commit comments