Skip to content

Commit

Permalink
Fix missing event in Axelar adapter during id map change
Browse files Browse the repository at this point in the history
  • Loading branch information
ermyas committed Oct 8, 2023
1 parent 600a182 commit 2799a18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/adapters/axelar/AxelarSenderAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import "./interfaces/IAxelarGasService.sol";
import "./libraries/StringAddressConversion.sol";

contract AxelarSenderAdapter is BaseSenderAdapter {
event ChainIDMappingUpdated(uint256[] origIds, string[] axlIds);

string public constant name = "AXELAR";

IAxelarGateway public immutable gateway;
Expand Down Expand Up @@ -84,6 +86,7 @@ contract AxelarSenderAdapter is BaseSenderAdapter {
++i;
}
}
emit ChainIDMappingUpdated(_origIds, _axlIds);
}

/*/////////////////////////////////////////////////////////////////
Expand Down
5 changes: 5 additions & 0 deletions test/unit-tests/adapters/axelar/AxelarSenderAdapter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ contract AxelarSenderAdapterTest is Setup {
event MessageDispatched(
bytes32 indexed messageId, address indexed from, uint256 indexed receiverChainId, address to, bytes data
);
event ChainIDMappingUpdated(uint256[] origIds, string[] axlIds);

address senderAddr;
AxelarSenderAdapter adapter;
Expand Down Expand Up @@ -108,6 +109,10 @@ contract AxelarSenderAdapterTest is Setup {
origIds[0] = DST_CHAIN_ID;
string[] memory axlIds = new string[](1);
axlIds[0] = "42";

vm.expectEmit(true, true, true, true, address(adapter));
emit ChainIDMappingUpdated(origIds, axlIds);

adapter.setChainIdMap(origIds, axlIds);

assertEq(adapter.chainIdMap(DST_CHAIN_ID), "42");
Expand Down

0 comments on commit 2799a18

Please sign in to comment.