Skip to content

Commit ad4492d

Browse files
committed
tests assert equality, not greater than
1 parent a44029d commit ad4492d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

evm/test/ExecutorQuoter.t.sol

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ contract ExecutorQuoterTest is Test {
181181
emit log_named_uint("quote result", quote);
182182
emit log_named_uint("quote in ETH (approx)", quote / 1e18);
183183

184-
assertGt(quote, maxGas, "Quote should be non-zero");
184+
assertEq(quote, 34028236692093846346337460743176823942600000000, "Quote should match expected value");
185185
}
186186

187187
/// @notice Test that max uint128 msgValue is handled without overflow.
@@ -197,7 +197,7 @@ contract ExecutorQuoterTest is Test {
197197
relayInstructions
198198
);
199199

200-
assertGt(quote, maxMsgValue, "Quote should be greater than u128.max");
200+
assertEq(quote, 340282366920938463463374635228868211455, "Quote should match expected value");
201201
}
202202

203203
/// @notice Test with extreme price values - all max uint64.
@@ -231,7 +231,7 @@ contract ExecutorQuoterTest is Test {
231231
emit log_named_uint("quote result", quote);
232232
emit log_named_uint("quote in ETH (approx)", quote / 1e18);
233233

234-
assertGt(quote, type(uint64).max, "Quote should be greater than a max price");
234+
assertEq(quote, 1849286093389382549403750000, "Quote should match expected value for extreme prices");
235235
}
236236

237237
/// @notice Test quote with max msgValue AND max dropoff to verify they sum correctly.
@@ -262,8 +262,7 @@ contract ExecutorQuoterTest is Test {
262262
emit log_named_uint("type(uint256).max", type(uint256).max);
263263
emit log_named_uint("type(uint128).max * 3", uint256(type(uint128).max) * 3);
264264

265-
// Verify quote is not capped at uint256 max (i.e., it's a real sum)
266-
assertGt(quote, uint256(type(uint128).max), "Quote should be greater than a single max uint128");
265+
assertEq(quote, 34028237372658580188214387669926038806136422910, "Quote should match expected value for max values");
267266
}
268267

269268
/// @notice Test quote calculation with zero prices (division by zero protection).
@@ -307,7 +306,7 @@ contract ExecutorQuoterTest is Test {
307306
// With zero gas, quote should be just the normalized base fee
308307
// baseFee = 27971 (in 10^10 decimals), normalized to 18 decimals
309308
// 27971 * 10^(18-10) = 27971 * 10^8 = 2797100000000
310-
require(quote >= 2797100000000, "Quote should include base fee");
309+
assertEq(quote, 2797100000000, "Quote should equal normalized base fee");
311310
}
312311

313312
/// @notice Test normalize function with from > to (division path).
@@ -339,8 +338,7 @@ contract ExecutorQuoterTest is Test {
339338
relayInstructions
340339
);
341340

342-
// Quote should be non-zero and scaled down due to 8 decimals
343-
assertGt(quote, 0, "Quote should be non-zero");
341+
assertEq(quote, 100002779, "Quote should match expected value for 8 decimal token");
344342
}
345343

346344
/// @notice Test normalize function with from == to (identity path).

0 commit comments

Comments
 (0)