From e32905089a5d063c4135695eecf281ce3c1a8661 Mon Sep 17 00:00:00 2001 From: Dirk Brink Date: Fri, 23 Feb 2024 17:19:21 -0800 Subject: [PATCH] evm: Fix empty instructions for WH endpoint --- evm/src/WormholeEndpoint.sol | 6 ++++++ evm/test/IntegrationStandalone.t.sol | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/evm/src/WormholeEndpoint.sol b/evm/src/WormholeEndpoint.sol index aec1cda50..368a016c4 100644 --- a/evm/src/WormholeEndpoint.sol +++ b/evm/src/WormholeEndpoint.sol @@ -385,6 +385,12 @@ contract WormholeEndpoint is Endpoint, IWormholeEndpoint, IWormholeReceiver { pure returns (WormholeEndpointInstruction memory instruction) { + // If the user doesn't pass in any endpoint instructions then the default is false + if (encoded.length == 0) { + instruction.shouldSkipRelayerSend = false; + return instruction; + } + uint256 offset = 0; (instruction.shouldSkipRelayerSend, offset) = encoded.asBoolUnchecked(offset); encoded.checkLength(offset); diff --git a/evm/test/IntegrationStandalone.t.sol b/evm/test/IntegrationStandalone.t.sol index a56aaa484..17911f6fe 100755 --- a/evm/test/IntegrationStandalone.t.sol +++ b/evm/test/IntegrationStandalone.t.sol @@ -147,13 +147,7 @@ contract TestEndToEndBase is Test, IManagerEvents, IRateLimiterEvents { { uint256 managerBalanceBefore = token1.balanceOf(address(managerChain1)); uint256 userBalanceBefore = token1.balanceOf(address(userA)); - managerChain1.transfer( - sendingAmount, - chainId2, - bytes32(uint256(uint160(userB))), - false, - encodeEndpointInstruction(true) - ); + managerChain1.transfer(sendingAmount, chainId2, bytes32(uint256(uint160(userB)))); // Balance check on funds going in and out working as expected uint256 managerBalanceAfter = token1.balanceOf(address(managerChain1));