Skip to content

Commit

Permalink
rm extra insuff check
Browse files Browse the repository at this point in the history
  • Loading branch information
aroralanuk committed Dec 13, 2024
1 parent bab9928 commit 139ba55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion solidity/contracts/token/HypNative.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ contract HypNative is TokenRouter {
_hookMetadata,
_hook
);
require(msg.value >= _amount + quote, "HypNative: insufficient value");
// require(msg.value >= _amount + quote, "HypNative: insufficient value");

bytes memory hookMetadata = StandardHookMetadata.overrideMsgValue(
_hookMetadata,
Expand Down
7 changes: 4 additions & 3 deletions solidity/test/token/HypNative.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ contract HypNativeTest is HypTokenTest {
assertEq(address(valueHook).balance, msgValue);
}

function testRemoteTransfer_invalidAmount() public {
vm.expectRevert("HypNative: insufficient value");
// when msg.value is >= quote + amount, it should revert in
function testRemoteTransfer_insufficientValue() public {
vm.expectRevert();
vm.prank(ALICE);
localToken.transferRemote{value: TRANSFER_AMT}(
DESTINATION,
Expand Down Expand Up @@ -134,7 +135,7 @@ contract HypNativeTest is HypTokenTest {
hook.setFee(fee);

vm.prank(ALICE);
vm.expectRevert("HypNative: insufficient value");
vm.expectRevert();
localToken.transferRemote{value: msgValue - 1}(
DESTINATION,
BOB.addressToBytes32(),
Expand Down

0 comments on commit 139ba55

Please sign in to comment.