@@ -11,7 +11,13 @@ import {MockSigner} from "../mock/MockSigner.sol";
1111import {IValidator} from "src/interfaces/IERC7579Modules.sol " ;
1212import {validatorToIdentifier, permissionToIdentifier} from "src/lib/Utils.sol " ;
1313import {PermissionId} from "src/types/Types.sol " ;
14- import {Unauthorized, NotImplemented, InvalidPermissionUninstallOrder, InvalidPermissionId} from "src/types/Error.sol " ;
14+ import {
15+ Unauthorized,
16+ NotImplemented,
17+ InvalidPermissionUninstallOrder,
18+ InvalidPermissionId,
19+ InvalidVid
20+ } from "src/types/Error.sol " ;
1521
1622/// @title Kernel.uninstallModule BTT Tests
1723/// @notice Tests for uninstallModule following Branching Tree Technique
@@ -69,17 +75,14 @@ abstract contract Kernel_uninstallModule is BTTModifiers {
6975 whenTheCallerIsTheEntryPointOrSelfUninstall
7076 givenModuleTypeIsValidatorUninstall
7177 {
72- // it should be a no-op and leave root unchanged
78+ // it should revert with InvalidVid (TOB-KERNEL-12: no onUninstall callback may reach a
79+ // module that is not installed under the given type)
7380 MockValidator mockValidator = new MockValidator ();
7481
75- // Validator is NOT installed - uninstall should be a no-op
76- kernel.uninstallModule (1 , address (mockValidator), abi.encode (hex "" , hex "" ));
77-
78- // Verify it remains uninstalled (hook is still address(0))
79- assertFalse (
80- kernel.validationInfo (validatorToIdentifier (IValidator (address (mockValidator)))).installed,
81- "Validator should remain uninstalled "
82+ vm.expectRevert (
83+ abi.encodeWithSelector (InvalidVid.selector , validatorToIdentifier (IValidator (address (mockValidator))))
8284 );
85+ kernel.uninstallModule (1 , address (mockValidator), abi.encode (hex "" , hex "" ));
8386 }
8487
8588 function test_GivenModuleTypeIsValidatorUninstall ()
0 commit comments