Skip to content

Commit

Permalink
test: basic reversability
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatil12 committed Nov 22, 2024
1 parent efe8e2e commit 343b44e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/unit/PermissionControllerUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,16 @@ contract PermissionControllerUnitTests_RemoveAppointee is PermissionControllerUn
_validateRemoveAppointee(account, appointee2, target1, selector1);
}

// Tests that the encoding from adding an appointee is properly decoded
function test_symmetricalTargetSelector() public {
// Test Decoding
(address[] memory targets, bytes4[] memory selectors) = permissionController.getAppointeePermissions(account, appointee2);
assertEq(targets.length, 1, "Incorrect number of targets");
assertEq(selectors.length, 1, "Incorrect number of selectors");
assertEq(targets[0], target1, "Incorrect target");
assertEq(selectors[0], selector1, "Incorrect selector");
}


function _validateRemoveAppointee(address accountToCheck, address appointee, address target, bytes4 selector) internal view {
assertFalse(permissionController.canCall(accountToCheck, appointee, target, selector));
Expand Down

0 comments on commit 343b44e

Please sign in to comment.