From f85f71e324535c1b56c60b9a29ab96701f0e997c Mon Sep 17 00:00:00 2001 From: Ermyas Abebe Date: Sun, 8 Oct 2023 14:38:16 +1100 Subject: [PATCH] Fix missing event in Wormhole chain id map update --- src/adapters/axelar/AxelarSenderAdapter.sol | 1 + src/adapters/wormhole/WormholeSenderAdapter.sol | 4 ++++ .../unit-tests/adapters/wormhole/WormholeSenderAdapter.t.sol | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/src/adapters/axelar/AxelarSenderAdapter.sol b/src/adapters/axelar/AxelarSenderAdapter.sol index 53206bb..632caa3 100644 --- a/src/adapters/axelar/AxelarSenderAdapter.sol +++ b/src/adapters/axelar/AxelarSenderAdapter.sol @@ -12,6 +12,7 @@ import "./interfaces/IAxelarGasService.sol"; import "./libraries/StringAddressConversion.sol"; contract AxelarSenderAdapter is BaseSenderAdapter { + /// @notice event emitted when chain id mapping is updated event ChainIDMappingUpdated(uint256[] origIds, string[] axlIds); string public constant name = "AXELAR"; diff --git a/src/adapters/wormhole/WormholeSenderAdapter.sol b/src/adapters/wormhole/WormholeSenderAdapter.sol index f1277d1..0fa84bc 100644 --- a/src/adapters/wormhole/WormholeSenderAdapter.sol +++ b/src/adapters/wormhole/WormholeSenderAdapter.sol @@ -12,6 +12,9 @@ import "../../libraries/Types.sol"; /// @notice sender adapter for wormhole bridge contract WormholeSenderAdapter is BaseSenderAdapter { + /// @notice event emitted when chain id mapping is updated + event ChainIDMappingUpdated(uint256[] origIds, uint16[] whIds); + string public constant name = "WORMHOLE"; IWormholeRelayer public immutable relayer; @@ -86,5 +89,6 @@ contract WormholeSenderAdapter is BaseSenderAdapter { ++i; } } + emit ChainIDMappingUpdated(_origIds, _whIds); } } diff --git a/test/unit-tests/adapters/wormhole/WormholeSenderAdapter.t.sol b/test/unit-tests/adapters/wormhole/WormholeSenderAdapter.t.sol index 672c52d..d92008e 100644 --- a/test/unit-tests/adapters/wormhole/WormholeSenderAdapter.t.sol +++ b/test/unit-tests/adapters/wormhole/WormholeSenderAdapter.t.sol @@ -14,6 +14,7 @@ contract WormholeSenderAdapterTest is Setup { event MessageDispatched( bytes32 indexed messageId, address indexed from, uint256 indexed receiverChainId, address to, bytes data ); + event ChainIDMappingUpdated(uint256[] origIds, uint16[] whIds); address senderAddr; WormholeSenderAdapter adapter; @@ -105,6 +106,10 @@ contract WormholeSenderAdapterTest is Setup { origIds[0] = DST_CHAIN_ID; uint16[] memory whIds = new uint16[](1); whIds[0] = 42; + + vm.expectEmit(true, true, true, true, address(adapter)); + emit ChainIDMappingUpdated(origIds, whIds); + adapter.setChainIdMap(origIds, whIds); assertEq(adapter.chainIdMap(DST_CHAIN_ID), 42);