diff --git a/lib/lyra-utils b/lib/lyra-utils index f64d5e3ba..c81cdc390 160000 --- a/lib/lyra-utils +++ b/lib/lyra-utils @@ -1 +1 @@ -Subproject commit f64d5e3bab9da4807003d505fbd19b364ef64671 +Subproject commit c81cdc3905a83c42bc55741a0d57a51c9260be0b diff --git a/src/libraries/PermitAllowanceLib.sol b/src/libraries/PermitAllowanceLib.sol index 5f459d9bb..c4fa32e02 100644 --- a/src/libraries/PermitAllowanceLib.sol +++ b/src/libraries/PermitAllowanceLib.sol @@ -9,15 +9,15 @@ import {IAllowances} from "../interfaces/IAllowances.sol"; * @notice hash function for PermitAllowance object */ library PermitAllowanceLib { - bytes32 public constant _PERMIT_ALLOWANCE_TYPEHASH = keccak256( - "PermitAllowance(address delegate,uint256 nonce,uint256 accountId,uint256 deadline,AssetAllowance[] assetAllowances,SubIdAllowance[] subIdAllowances)" + bytes32 public constant PERMIT_ALLOWANCE_TYPEHASH = keccak256( + "PermitAllowance(address delegate,uint256 nonce,uint256 accountId,uint256 deadline,(address asset,uint256 positive,uint256 negative)[] assetAllowances,(address asset,uint256 subId,uint256 positive,uint256 negative)[] subIdAllowances)" ); - bytes32 public constant _ASSET_ALLOWANCE_TYPEHASH = - keccak256("AssetAllowance(address delegate,uint256 positive,uint256 negative)"); + bytes32 public constant ASSET_ALLOWANCE_TYPEHASH = + keccak256("AssetAllowance(address asset,uint256 positive,uint256 negative)"); - bytes32 public constant _SUBID_ALLOWANCE_TYPEHASH = - keccak256("SubIdAllowance(address delegate,uint256 subId,uint256 positive,uint256 negative)"); + bytes32 public constant SUBID_ALLOWANCE_TYPEHASH = + keccak256("SubIdAllowance(address asset,uint256 subId,uint256 positive,uint256 negative)"); /** * @dev hash the permit struct @@ -41,7 +41,7 @@ library PermitAllowanceLib { return keccak256( abi.encode( - _PERMIT_ALLOWANCE_TYPEHASH, + PERMIT_ALLOWANCE_TYPEHASH, permit.delegate, permit.nonce, permit.accountId, @@ -53,10 +53,10 @@ library PermitAllowanceLib { } function _hashAssetAllowance(IAllowances.AssetAllowance memory allowance) private pure returns (bytes32) { - return keccak256(abi.encode(_ASSET_ALLOWANCE_TYPEHASH, allowance)); + return keccak256(abi.encode(ASSET_ALLOWANCE_TYPEHASH, allowance)); } function _hashSubIdAllowance(IAllowances.SubIdAllowance memory allowance) private pure returns (bytes32) { - return keccak256(abi.encode(_SUBID_ALLOWANCE_TYPEHASH, allowance)); + return keccak256(abi.encode(SUBID_ALLOWANCE_TYPEHASH, allowance)); } } diff --git a/test/feed/unit-tests/LyraForwardFeed.t.sol b/test/feed/unit-tests/LyraForwardFeed.t.sol index f311648e5..1296c2333 100644 --- a/test/feed/unit-tests/LyraForwardFeed.t.sol +++ b/test/feed/unit-tests/LyraForwardFeed.t.sol @@ -268,7 +268,7 @@ contract UNIT_LyraForwardFeed is LyraFeedTestUtils { feed.acceptData(data); } - function testEncodeFwdFeedData() public { + function testEncodeFwdFeedData() public view { uint64 expiry_ = 1698998400; uint settlementStartAggregate_ = 1; uint currentSpotAggregate_ = 3211595747743195673395200;