From a48befdd6cb6bdc8561133429a2bdb1f3b8c71e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lz=2Esir=CE=94rthurmoney=28=29?= <95722332+sirarthurmoney@users.noreply.github.com> Date: Thu, 25 Jan 2024 14:41:12 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=A8=F0=9F=8F=BE=E2=80=8D=F0=9F=94=A7?= =?UTF-8?q?=F0=9F=94=A8Updating=20Test=20Helper=20(#249)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/plenty-days-walk.md | 5 +++++ .../contracts/TestHelper.sol | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .changeset/plenty-days-walk.md diff --git a/.changeset/plenty-days-walk.md b/.changeset/plenty-days-walk.md new file mode 100644 index 000000000..6b5d98f5a --- /dev/null +++ b/.changeset/plenty-days-walk.md @@ -0,0 +1,5 @@ +--- +"@layerzerolabs/test-devtools-evm-foundry": patch +--- + +Updating Test Helper to include setDstConfig for dvns diff --git a/tests/test-devtools-evm-foundry/contracts/TestHelper.sol b/tests/test-devtools-evm-foundry/contracts/TestHelper.sol index 07b4b09e6..a9b467d9b 100644 --- a/tests/test-devtools-evm-foundry/contracts/TestHelper.sol +++ b/tests/test-devtools-evm-foundry/contracts/TestHelper.sol @@ -8,6 +8,7 @@ import { DoubleEndedQueue } from "@openzeppelin/contracts/utils/structs/DoubleEn import { UlnConfig, SetDefaultUlnConfigParam } from "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/UlnBase.sol"; import { SetDefaultExecutorConfigParam, ExecutorConfig } from "@layerzerolabs/lz-evm-messagelib-v2/contracts/SendLibBase.sol"; import { ReceiveUln302 } from "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/uln302/ReceiveUln302.sol"; +import { IDVN } from "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/interfaces/IDVN.sol"; import { DVN, ExecuteParam } from "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/dvn/DVN.sol"; import { DVNFeeLib } from "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/dvn/DVNFeeLib.sol"; import { IExecutor } from "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IExecutor.sol"; @@ -137,9 +138,9 @@ contract TestHelper is Test, OptionsHelper { dvn.setWorkerFeeLib(address(dvnLib)); } - //todo: setDstGas uint32 endpointNum = _endpointNum; IExecutor.DstConfigParam[] memory dstConfigParams = new IExecutor.DstConfigParam[](endpointNum); + IDVN.DstConfigParam[] memory dvnConfigParams = new IDVN.DstConfigParam[](endpointNum); for (uint8 j = 0; j < endpointNum; j++) { if (i == j) continue; uint32 dstEid = j + 1; @@ -192,6 +193,14 @@ contract TestHelper is Test, OptionsHelper { nativeCap: executorValueCap }); + // dvn config + dvnConfigParams[j] = IDVN.DstConfigParam({ + dstEid: dstEid, + gas: 5000, + multiplierBps: 10000, + floorMarginUSD: 1e10 + }); + uint128 denominator = priceFeed.getPriceRatioDenominator(); ILayerZeroPriceFeed.UpdatePrice[] memory prices = new ILayerZeroPriceFeed.UpdatePrice[](1); prices[0] = ILayerZeroPriceFeed.UpdatePrice( @@ -201,6 +210,7 @@ contract TestHelper is Test, OptionsHelper { priceFeed.setPrice(prices); } executor.setDstConfig(dstConfigParams); + dvn.setDstConfig(dvnConfigParams); } else if (_libraryType == LibraryType.SimpleMessageLib) { SimpleMessageLibMock messageLib = new SimpleMessageLibMock(payable(this), address(endpointList[i])); endpointList[i].registerLibrary(address(messageLib));