Skip to content

Commit

Permalink
Fix fuzz test case where buy and sell tokens are the same
Browse files Browse the repository at this point in the history
  • Loading branch information
fedgiac committed Aug 14, 2024
1 parent a8c8b45 commit 483e8f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/GPv2Signing/CalldataManipulation.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ contract CalldataManipulation is Helper {
uint256 startNumTokenWord = 4 + 2 * 32;
uint256 startFirstTokenWord = startNumTokenWord + 32;
uint256 encodedNumTokens = abi.decode(encodedTransactionData.slice(startNumTokenWord, 32), (uint256));
require(encodedNumTokens == 2, "invalid test setup; has the transaction encoding changed?");
require(
encodedNumTokens == ((order.sellToken == order.buyToken) ? 1 : 2),
"invalid test setup; has the transaction encoding changed?"
);
bytes memory encodedFirstToken = encodedTransactionData.slice(startFirstTokenWord, 32);
uint256 tokenPaddingSize = 12;
for (uint256 i = 0; i < tokenPaddingSize; i++) {
Expand Down

0 comments on commit 483e8f2

Please sign in to comment.