From 139ba55d57cf2642c69c31d5ba8402b38e502319 Mon Sep 17 00:00:00 2001 From: -f Date: Fri, 13 Dec 2024 16:23:56 +0530 Subject: [PATCH] rm extra insuff check --- solidity/contracts/token/HypNative.sol | 2 +- solidity/test/token/HypNative.t.sol | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/solidity/contracts/token/HypNative.sol b/solidity/contracts/token/HypNative.sol index aa473c6e33..81480e77f8 100644 --- a/solidity/contracts/token/HypNative.sol +++ b/solidity/contracts/token/HypNative.sol @@ -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, diff --git a/solidity/test/token/HypNative.t.sol b/solidity/test/token/HypNative.t.sol index 6428ec186e..eae4a8f21a 100644 --- a/solidity/test/token/HypNative.t.sol +++ b/solidity/test/token/HypNative.t.sol @@ -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, @@ -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(),