Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
aroralanuk committed Oct 31, 2024
1 parent 2150154 commit f4f638e
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions solidity/test/hooks/layerzero/LayerZeroV2Hook.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,25 @@ contract LayerZeroV2HookTest is Test {
);
}

// TODO: fix double refund for LayerZeroV2Hook
// function testLzV2Hook_PostDispatch_refundExtraFee(uint256 balance) public {
// (uint256 nativeFee, bytes memory metadata) = testLzV2Hook_QuoteDispatch_returnsFeeAmount();
// vm.assume(balance > nativeFee);

// uint256 extraValue = balance - nativeFee;
// vm.deal(address(this), balance);

// mailbox.dispatch{value: balance}(
// HYPERLANE_DEST_DOMAIN, address(crossChainCounterApp).addressToBytes32(), "Hello World!", metadata, hook
// );
// assertEq(address(alice).balance, extraValue);
// }
function testLzV2Hook_PostDispatch_refundExtraFee(uint256 balance) public {
(
uint256 nativeFee,
bytes memory metadata
) = testLzV2Hook_QuoteDispatch_returnsFeeAmount();
vm.assume(balance > nativeFee);

uint256 extraValue = balance - nativeFee;
vm.deal(address(this), balance);

mailbox.dispatch{value: balance}(
HYPERLANE_DEST_DOMAIN,
address(crossChainCounterApp).addressToBytes32(),
"Hello World!",
metadata,
hook
);
assertEq(address(alice).balance, extraValue);
}

function testLzV2Hook_PostDispatch_executesCrossChain() public {
(
Expand Down

0 comments on commit f4f638e

Please sign in to comment.