From 5688addc6bcc8e931c0e9e236f3ffd16ed69e466 Mon Sep 17 00:00:00 2001 From: Michael Zhou Date: Tue, 12 Sep 2023 21:43:36 -0700 Subject: [PATCH] Address further comments Nit fixes --- src/libraries/Error.sol | 3 --- test/Setup.t.sol | 30 +++++++++++++++--------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/libraries/Error.sol b/src/libraries/Error.sol index 3c5d2a7..655e3fd 100644 --- a/src/libraries/Error.sol +++ b/src/libraries/Error.sol @@ -32,9 +32,6 @@ library Error { /// @dev is thrown if msg id is already executed error MSG_ID_ALREADY_EXECUTED(); - /// @dev is thrown if message conflicts with current storage - error NEW_MESSAGE_CONFLICTS_WITH_OLD_DATA(); - /// @dev is thrown if bridge adapter already delivered the message to multi message receiver error DUPLICATE_MESSAGE_DELIVERY_BY_ADAPTER(); diff --git a/test/Setup.t.sol b/test/Setup.t.sol index e28cb4f..e4b8add 100644 --- a/test/Setup.t.sol +++ b/test/Setup.t.sol @@ -286,16 +286,16 @@ abstract contract Setup is Test { /// setup receiver adapters vm.selectFork(fork[chainId]); - address[] memory _recieverAdapters = new address[](2); - _recieverAdapters[0] = contractAddress[chainId][bytes("WORMHOLE_RECEIVER_ADAPTER")]; - _recieverAdapters[1] = contractAddress[chainId][bytes("AXELAR_RECEIVER_ADAPTER")]; + address[] memory _receiverAdapters = new address[](2); + _receiverAdapters[0] = contractAddress[chainId][bytes("WORMHOLE_RECEIVER_ADAPTER")]; + _receiverAdapters[1] = contractAddress[chainId][bytes("AXELAR_RECEIVER_ADAPTER")]; bool[] memory _operations = new bool[](2); _operations[0] = true; _operations[1] = true; MultiMessageReceiver(contractAddress[DST_CHAINS[i]][bytes("MMA_RECEIVER")]).initialize( - _recieverAdapters, _operations, 2, contractAddress[chainId]["TIMELOCK"] + _receiverAdapters, _operations, 2, contractAddress[chainId]["TIMELOCK"] ); unchecked { @@ -345,11 +345,11 @@ abstract contract Setup is Test { vm.selectFork(fork[chainId]); WormholeReceiverAdapter(contractAddress[chainId]["WORMHOLE_RECEIVER_ADAPTER"]).updateSenderAdapter( - contractAddress[1]["WORMHOLE_SENDER_ADAPTER"] + contractAddress[ETHEREUM_CHAIN_ID]["WORMHOLE_SENDER_ADAPTER"] ); AxelarReceiverAdapter(contractAddress[chainId]["AXELAR_RECEIVER_ADAPTER"]).updateSenderAdapter( - contractAddress[1]["AXELAR_SENDER_ADAPTER"] + contractAddress[ETHEREUM_CHAIN_ID]["AXELAR_SENDER_ADAPTER"] ); unchecked { @@ -377,15 +377,15 @@ abstract contract Setup is Test { /// @dev returns the chain id of wormhole for local chain id function _wormholeChainId(uint256 _chainId) internal pure returns (uint16) { - if (_chainId == 1) { + if (_chainId == ETHEREUM_CHAIN_ID) { return uint16(2); } - if (_chainId == 56) { + if (_chainId == BSC_CHAIN_ID) { return uint16(4); } - if (_chainId == 137) { + if (_chainId == POLYGON_CHAIN_ID) { return uint16(5); } @@ -394,15 +394,15 @@ abstract contract Setup is Test { /// @dev returns the chain id of axelar for local chain id function _axelarChainId(uint256 _chainId) internal pure returns (string memory) { - if (_chainId == 1) { + if (_chainId == ETHEREUM_CHAIN_ID) { return "ethereum"; } - if (_chainId == 56) { + if (_chainId == BSC_CHAIN_ID) { return "binance"; } - if (_chainId == 137) { + if (_chainId == POLYGON_CHAIN_ID) { return "polygon"; } @@ -428,15 +428,15 @@ abstract contract Setup is Test { /// @dev returns the gateway of axelar for chain id function _axelarGateway(uint256 _chainId) internal pure returns (address) { - if (_chainId == 1) { + if (_chainId == ETHEREUM_CHAIN_ID) { return ETH_GATEWAY; } - if (_chainId == 56) { + if (_chainId == BSC_CHAIN_ID) { return BSC_GATEWAY; } - if (_chainId == 137) { + if (_chainId == POLYGON_CHAIN_ID) { return POLYGON_GATEWAY; }