Skip to content

Commit 7c01427

Browse files
authored
evm: Fix empty instructions for WH endpoint (#182)
1 parent c5f4370 commit 7c01427

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

evm/src/WormholeEndpoint.sol

+6
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,12 @@ contract WormholeEndpoint is Endpoint, IWormholeEndpoint, IWormholeReceiver {
429429
pure
430430
returns (WormholeEndpointInstruction memory instruction)
431431
{
432+
// If the user doesn't pass in any endpoint instructions then the default is false
433+
if (encoded.length == 0) {
434+
instruction.shouldSkipRelayerSend = false;
435+
return instruction;
436+
}
437+
432438
uint256 offset = 0;
433439
(instruction.shouldSkipRelayerSend, offset) = encoded.asBoolUnchecked(offset);
434440
encoded.checkLength(offset);

evm/test/IntegrationStandalone.t.sol

+1-7
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,7 @@ contract TestEndToEndBase is Test, IManagerEvents, IRateLimiterEvents {
147147
{
148148
uint256 managerBalanceBefore = token1.balanceOf(address(managerChain1));
149149
uint256 userBalanceBefore = token1.balanceOf(address(userA));
150-
managerChain1.transfer(
151-
sendingAmount,
152-
chainId2,
153-
bytes32(uint256(uint160(userB))),
154-
false,
155-
encodeEndpointInstruction(true)
156-
);
150+
managerChain1.transfer(sendingAmount, chainId2, bytes32(uint256(uint160(userB))));
157151

158152
// Balance check on funds going in and out working as expected
159153
uint256 managerBalanceAfter = token1.balanceOf(address(managerChain1));

0 commit comments

Comments
 (0)