@@ -7,6 +7,7 @@ import { ComposeMsgCodec } from "contracts/periphery/mintburn/sponsored-oft/Comp
77contract ComposeMsgCodecTest is Test {
88 function test_EncodeDecode () public {
99 bytes32 nonce = keccak256 ("nonce " );
10+ uint256 amountLD = 100 ether ;
1011 uint256 deadline = 1234567890 ;
1112 uint256 maxBpsToSponsor = 500 ;
1213 uint256 maxUserSlippageBps = 100 ;
@@ -19,6 +20,7 @@ contract ComposeMsgCodecTest is Test {
1920
2021 bytes memory encoded = ComposeMsgCodec._encode (
2122 nonce,
23+ amountLD,
2224 deadline,
2325 maxBpsToSponsor,
2426 maxUserSlippageBps,
@@ -31,6 +33,7 @@ contract ComposeMsgCodecTest is Test {
3133 );
3234
3335 assertEq (ComposeMsgCodec._getNonce (encoded), nonce, "Nonce mismatch " );
36+ assertEq (ComposeMsgCodec._getAmountLD (encoded), amountLD, "AmountLD mismatch " );
3437 assertEq (ComposeMsgCodec._getDeadline (encoded), deadline, "Deadline mismatch " );
3538 assertEq (ComposeMsgCodec._getMaxBpsToSponsor (encoded), maxBpsToSponsor, "MaxBpsToSponsor mismatch " );
3639 assertEq (ComposeMsgCodec._getMaxUserSlippageBps (encoded), maxUserSlippageBps, "MaxUserSlippageBps mismatch " );
@@ -45,6 +48,7 @@ contract ComposeMsgCodecTest is Test {
4548
4649 function testFuzz_EncodeDecode (
4750 bytes32 nonce ,
51+ uint256 amountLD ,
4852 uint256 deadline ,
4953 uint256 maxBpsToSponsor ,
5054 uint256 maxUserSlippageBps ,
@@ -57,6 +61,7 @@ contract ComposeMsgCodecTest is Test {
5761 ) public {
5862 bytes memory encoded = ComposeMsgCodec._encode (
5963 nonce,
64+ amountLD,
6065 deadline,
6166 maxBpsToSponsor,
6267 maxUserSlippageBps,
@@ -69,6 +74,7 @@ contract ComposeMsgCodecTest is Test {
6974 );
7075
7176 assertEq (ComposeMsgCodec._getNonce (encoded), nonce, "Nonce mismatch " );
77+ assertEq (ComposeMsgCodec._getAmountLD (encoded), amountLD, "AmountLD mismatch " );
7278 assertEq (ComposeMsgCodec._getDeadline (encoded), deadline, "Deadline mismatch " );
7379 assertEq (ComposeMsgCodec._getMaxBpsToSponsor (encoded), maxBpsToSponsor, "MaxBpsToSponsor mismatch " );
7480 assertEq (ComposeMsgCodec._getMaxUserSlippageBps (encoded), maxUserSlippageBps, "MaxUserSlippageBps mismatch " );
@@ -82,13 +88,13 @@ contract ComposeMsgCodecTest is Test {
8288 }
8389
8490 function test_IsValidComposeMsgBytelength_Boundary () public pure {
85- // Minimum length is 352 bytes (9 static params + actionData offset + actionData length + 0 bytes actionData)
86- // 9 * 32 + 32 + 32 = 352 bytes
91+ // Minimum length is 384 bytes (10 static params + actionData offset + actionData length + 0 bytes actionData)
92+ // 10 * 32 + 32 + 32 = 384 bytes
8793
88- bytes memory data = new bytes (352 );
94+ bytes memory data = new bytes (384 );
8995 assertTrue (ComposeMsgCodec._isValidComposeMsgBytelength (data));
9096
91- bytes memory tooShort = new bytes (351 );
97+ bytes memory tooShort = new bytes (383 );
9298 assertFalse (ComposeMsgCodec._isValidComposeMsgBytelength (tooShort));
9399 }
94100}
0 commit comments