Skip to content

Commit

Permalink
fix role on tests and minor comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tsnewnami committed Nov 14, 2023
1 parent c91df75 commit 319d0a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/child/ChildERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ contract ChildERC20Bridge is
}

/**
* @notice Private function to handle withdrawal process for all ERC20 token types.
* @notice Private function to handle withdrawal process for all ERC20 and native token types.
* @param childTokenAddr The address of the child token to withdraw.
* @param receiver The address to withdraw the tokens to.
* @param amount The amount of tokens to withdraw.
Expand Down Expand Up @@ -312,7 +312,7 @@ contract ChildERC20Bridge is
}

/**
* @notice Private function to handle mapping of root ERC20 tokens to child ERC20 tokens. When mapping messages are recieved.
* @notice Private function to handle mapping of root ERC20 tokens to child ERC20 tokens.
* @param data The data payload of the message.
*
* Requirements:
Expand Down Expand Up @@ -355,7 +355,7 @@ contract ChildERC20Bridge is
}

/**
* @notice Private function to handle depositing of tokens to the child chain. When deposit messages are recieved.
* @notice Private function to handle depositing of ERC20 and native tokens to the child chain.
* @param data The data payload of the message.
*
* Requirements:
Expand Down
2 changes: 0 additions & 2 deletions src/interfaces/child/IChildERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ interface IChildERC20BridgeErrors {
error ZeroValue();
/// @notice Error when the contract to mint had no bytecode.
error EmptyTokenContract();
/// @notice Error when contract clone failed.
error CloneFailed();
/// @notice Error when the mint operation failed.
error MintFailed();
/// @notice Error when the given root chain name is invalid.
Expand Down
4 changes: 2 additions & 2 deletions test/unit/root/RootERC20Bridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {Utils} from "../../utils.t.sol";
import {WETH} from "../../../src/test/root/WETH.sol";

contract RootERC20BridgeUnitTest is Test, IRootERC20BridgeEvents, IRootERC20BridgeErrors, Utils {
// TODO: move me to roles contract
bytes32 constant ADAPTOR_MANAGER_ROLE = keccak256("ADAPTOR_MANAGER_ROLE");
address constant CHILD_BRIDGE = address(3);
address constant CHILD_BRIDGE_ADAPTOR = address(4);
Expand Down Expand Up @@ -529,13 +528,14 @@ contract RootERC20BridgeUnitTest is Test, IRootERC20BridgeEvents, IRootERC20Brid

function test_RevertIf_updateRootBridgeAdaptorCalledByNonOwner() public {
address caller = address(0xf00f00);
bytes32 role = rootBridge.ADAPTOR_MANAGER_ROLE();
vm.prank(caller);
vm.expectRevert(
abi.encodePacked(
"AccessControl: account ",
StringsUpgradeable.toHexString(caller),
" is missing role ",
StringsUpgradeable.toHexString(uint256(ADAPTOR_MANAGER_ROLE), 32)
StringsUpgradeable.toHexString(uint256(role), 32)
)
);
rootBridge.updateRootBridgeAdaptor(address(0x11111));
Expand Down

0 comments on commit 319d0a1

Please sign in to comment.