Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
wcgcyx committed Nov 13, 2023
1 parent 17ab7d4 commit dc5d718
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/child/ChildERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ contract ChildERC20Bridge is
*/
function updateBridgeAdaptor(address newBridgeAdaptor) external override {
if (!(hasRole(VARIABLE_MANAGER_ROLE, msg.sender))) {
revert NotVariableManager();
revert NotVariableManager(msg.sender);
}
if (newBridgeAdaptor == address(0)) {
revert ZeroAddress();
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/child/IChildERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ interface IChildERC20BridgeEvents {
// TODO add parameters to errors if it makes sense
interface IChildERC20BridgeErrors {
/// @notice Error when the caller is not the variable manager role.
error NotVariableManager();
error NotVariableManager(address caller);
/// @notice Error when the amount requested is less than the value sent.
error InsufficientValue();
/// @notice Error when the withdrawal amount is zero
Expand Down
4 changes: 2 additions & 2 deletions test/unit/child/ChildERC20Bridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ contract ChildERC20BridgeUnitTest is Test, IChildERC20BridgeEvents, IChildERC20B
assertEq(address(childBridge.bridgeAdaptor()), newAdaptorAddress, "bridgeAdaptor not updated");
}

function test_RevertIf_updateBridgeAdaptorCalledByNonOwner() public {
function test_RevertIf_updateBridgeAdaptorCalledByNotVariableManager() public {
vm.prank(address(0xf00f00));
vm.expectRevert(NotVariableManager.selector);
vm.expectRevert(abi.encodeWithSelector(NotVariableManager.selector, 0xf00f00));
childBridge.updateBridgeAdaptor(address(0x11111));
}

Expand Down
4 changes: 1 addition & 3 deletions test/unit/root/RootERC20Bridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,7 @@ contract RootERC20BridgeUnitTest is Test, IRootERC20BridgeEvents, IRootERC20Brid

function test_RevertIf_updateRootBridgeAdaptorCalledByNonOwner() public {
vm.prank(address(0xf00f00));
vm.expectRevert(
abi.encodeWithSelector(NotVariableManager.selector, 0xf00f00)
);
vm.expectRevert(abi.encodeWithSelector(NotVariableManager.selector, 0xf00f00));
rootBridge.updateRootBridgeAdaptor(address(0x11111));
}

Expand Down

0 comments on commit dc5d718

Please sign in to comment.