diff --git a/solidity/test/unit/modules/dispute/BondEscalationModule.t.sol b/solidity/test/unit/modules/dispute/BondEscalationModule.t.sol index 3906818..1f747e9 100644 --- a/solidity/test/unit/modules/dispute/BondEscalationModule.t.sol +++ b/solidity/test/unit/modules/dispute/BondEscalationModule.t.sol @@ -23,6 +23,7 @@ import { } from '../../../../contracts/utils/Typehash.sol'; import {IAccountingExtension} from '../../../../interfaces/extensions/IAccountingExtension.sol'; import {IBondEscalationAccounting} from '../../../../interfaces/extensions/IBondEscalationAccounting.sol'; +import {IModuleAccessController} from '../../../../interfaces/modules/access/IModuleAccessController.sol'; /** * @dev Harness to set an entry in the requestData mapping, without triggering setup request hooks @@ -1507,7 +1508,7 @@ contract BondEscalationModule_Unit_AccessControl is BaseTest { super.setUp(); } - function test_pledgeForDispute_accessControl( + function test_pledgeForDispute_accessControl_granted( address _caller, address _user, bytes memory _data, @@ -1552,12 +1553,7 @@ contract BondEscalationModule_Unit_AccessControl is BaseTest { sender: _caller, accessControl: _accessControl, typehash: _PLEDGE_FOR_DISPUTE_TYPEHASH, -<<<<<<< HEAD typehashParams: abi.encode(mockRequest, _dispute) -======= - typehashParams: abi.encode(mockRequest, _dispute), - accessControl: _accessControl ->>>>>>> 1045a6d (refactor: rename modules/accessControl to modules/access) }) ) ) @@ -1577,7 +1573,29 @@ contract BondEscalationModule_Unit_AccessControl is BaseTest { bondEscalationModule.pledgeForDispute(mockRequest, _dispute, _accessControl); } - function test_pledgeAgainstDispute_accessControl( + function test_pledgeForDispute_accessControl_notGranted( + address _caller, + address _user, + bytes memory _data, + IBondEscalationModule.RequestParameters memory _params + ) public assumeFuzzable(address(_params.accountingExtension)) { + vm.assume(_caller != _user); + + // mock and expect a call checking whether the access module has been approved by the user + _mockAndExpect( + address(oracle), + abi.encodeCall(IOracleAccessController.isAccessModuleApproved, (_user, _accessModule)), + abi.encode(false) + ); + + IAccessController.AccessControl memory _accessControl = IAccessController.AccessControl({user: _user, data: _data}); + + vm.expectRevert(IModuleAccessController.ModuleAccessController_AccessModuleNotApproved.selector); + vm.prank(_caller); + bondEscalationModule.pledgeForDispute(mockRequest, mockDispute, _accessControl); + } + + function test_pledgeAgainstDispute_accessControl_granted( address _caller, address _user, bytes memory _data,