Skip to content

Commit

Permalink
evm: Fix empty instructions for WH endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
djb15 authored and kcsongor committed Feb 24, 2024
1 parent c5f4370 commit 5b0c88d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 6 additions & 0 deletions evm/src/WormholeEndpoint.sol
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,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);
Expand Down
8 changes: 1 addition & 7 deletions evm/test/IntegrationStandalone.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 5b0c88d

Please sign in to comment.