Skip to content

Commit e329050

Browse files
committed
evm: Fix empty instructions for WH endpoint
1 parent a2417f8 commit e329050

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
@@ -385,6 +385,12 @@ contract WormholeEndpoint is Endpoint, IWormholeEndpoint, IWormholeReceiver {
385385
pure
386386
returns (WormholeEndpointInstruction memory instruction)
387387
{
388+
// If the user doesn't pass in any endpoint instructions then the default is false
389+
if (encoded.length == 0) {
390+
instruction.shouldSkipRelayerSend = false;
391+
return instruction;
392+
}
393+
388394
uint256 offset = 0;
389395
(instruction.shouldSkipRelayerSend, offset) = encoded.asBoolUnchecked(offset);
390396
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)