Skip to content

Commit a7614be

Browse files
committed
test: update TimelockPolicy tests for custom error selectors
1 parent 33c161c commit a7614be

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

test/btt/Timelock.t.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -503,15 +503,15 @@ contract TimelockTest is Test {
503503
function test_GivenInitialized_WhenCallingCheckSignaturePolicy() external whenCallingCheckSignaturePolicy {
504504
// it should revert (TOB-KERNEL-20: signature validation not supported)
505505
vm.prank(WALLET);
506-
vm.expectRevert("TimelockPolicy: signature validation not supported");
506+
vm.expectRevert(TimelockPolicy.SignatureValidationNotSupported.selector);
507507
timelockPolicy.checkSignaturePolicy(POLICY_ID, address(0), bytes32(0), "");
508508
}
509509

510510
function test_GivenNotInitialized_WhenCallingCheckSignaturePolicy() external whenCallingCheckSignaturePolicy {
511511
// it should revert (TOB-KERNEL-20: signature validation not supported)
512512
address uninitWallet = address(0xcccc);
513513
vm.prank(uninitWallet);
514-
vm.expectRevert("TimelockPolicy: signature validation not supported");
514+
vm.expectRevert(TimelockPolicy.SignatureValidationNotSupported.selector);
515515
timelockPolicy.checkSignaturePolicy(POLICY_ID, address(0), bytes32(0), "");
516516
}
517517

@@ -524,7 +524,7 @@ contract TimelockTest is Test {
524524
function test_GivenDelayAndExpirationAreNonzero() external whenCallingValidateSignatureWithData {
525525
// it should revert (TOB-KERNEL-20: stateless signature validation not supported)
526526
bytes memory data = abi.encode(uint48(1 hours), uint48(1 days));
527-
vm.expectRevert("TimelockPolicy: stateless signature validation not supported");
527+
vm.expectRevert(TimelockPolicy.StatelessValidationNotSupported.selector);
528528
timelockPolicy.validateSignatureWithData(bytes32(0), "", data);
529529
}
530530

@@ -534,7 +534,7 @@ contract TimelockTest is Test {
534534
{
535535
// it should revert (TOB-KERNEL-20: stateless signature validation not supported)
536536
bytes memory data = abi.encode(uint48(0), uint48(1 days));
537-
vm.expectRevert("TimelockPolicy: stateless signature validation not supported");
537+
vm.expectRevert(TimelockPolicy.StatelessValidationNotSupported.selector);
538538
timelockPolicy.validateSignatureWithData(bytes32(0), "", data);
539539
}
540540

@@ -544,7 +544,7 @@ contract TimelockTest is Test {
544544
{
545545
// it should revert (TOB-KERNEL-20: stateless signature validation not supported)
546546
bytes memory data = abi.encode(uint48(1 hours), uint48(0));
547-
vm.expectRevert("TimelockPolicy: stateless signature validation not supported");
547+
vm.expectRevert(TimelockPolicy.StatelessValidationNotSupported.selector);
548548
timelockPolicy.validateSignatureWithData(bytes32(0), "", data);
549549
}
550550

@@ -560,7 +560,7 @@ contract TimelockTest is Test {
560560
{
561561
// it should revert (TOB-KERNEL-20: stateless signature validation not supported)
562562
bytes memory data = abi.encode(uint48(1 hours), uint48(1 days));
563-
vm.expectRevert("TimelockPolicy: stateless signature validation not supported");
563+
vm.expectRevert(TimelockPolicy.StatelessValidationNotSupported.selector);
564564
timelockPolicy.validateSignatureWithDataWithSender(address(0), bytes32(0), "", data);
565565
}
566566

@@ -570,7 +570,7 @@ contract TimelockTest is Test {
570570
{
571571
// it should revert (TOB-KERNEL-20: stateless signature validation not supported)
572572
bytes memory data = abi.encode(uint48(0), uint48(1 days));
573-
vm.expectRevert("TimelockPolicy: stateless signature validation not supported");
573+
vm.expectRevert(TimelockPolicy.StatelessValidationNotSupported.selector);
574574
timelockPolicy.validateSignatureWithDataWithSender(address(0), bytes32(0), "", data);
575575
}
576576

@@ -580,7 +580,7 @@ contract TimelockTest is Test {
580580
{
581581
// it should revert (TOB-KERNEL-20: stateless signature validation not supported)
582582
bytes memory data = abi.encode(uint48(1 hours), uint48(0));
583-
vm.expectRevert("TimelockPolicy: stateless signature validation not supported");
583+
vm.expectRevert(TimelockPolicy.StatelessValidationNotSupported.selector);
584584
timelockPolicy.validateSignatureWithDataWithSender(address(0), bytes32(0), "", data);
585585
}
586586

0 commit comments

Comments
 (0)