Skip to content

Commit

Permalink
Address further comments
Browse files Browse the repository at this point in the history
Nit fixes
  • Loading branch information
Dominator008 committed Sep 13, 2023
1 parent 3a8b8b6 commit 5688add
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
3 changes: 0 additions & 3 deletions src/libraries/Error.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
30 changes: 15 additions & 15 deletions test/Setup.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}

Expand All @@ -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";
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 5688add

Please sign in to comment.