Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move test contract to GPv2Signing folder #208

Merged
merged 34 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d0173f0
chore: migrate GPv2Signing domain separator tests to Foundry
fedgiac Aug 9, 2024
c7d4149
Fix unused import
fedgiac Aug 9, 2024
bc7f235
Remove duplicated import
fedgiac Aug 12, 2024
0721892
chore: migrate GPv2Signing set pre-signature tests to Foundry
fedgiac Aug 12, 2024
56ff598
chore: migrate GPv2Signing recoverOrderFromTrade tests to Foundry
fedgiac Aug 12, 2024
f71e28d
Merge branch 'main' into migrate-test-signing-domain-separator
fedgiac Aug 12, 2024
2816827
Add explanatory comment on domain separator struct
fedgiac Aug 12, 2024
585703d
Reuse existing PRE_SIGNED variable from library
fedgiac Aug 12, 2024
d51fced
Merge branch 'main' into migrate-test-signing-domain-separator
fedgiac Aug 12, 2024
e233612
Merge branch 'migrate-test-signing-domain-separator' into migrate-tes…
fedgiac Aug 12, 2024
84eb7fc
Fix missing setting of pre-signature at start of test
fedgiac Aug 12, 2024
6e618dc
Clean up imports
fedgiac Aug 14, 2024
a8c8b45
chore: migrate GPv2Signing calldata manipulation tests to Foundry
fedgiac Aug 14, 2024
ac6bcae
chore: migrate GPv2Signing recoverOrderSigner tests to Foundry
fedgiac Aug 14, 2024
e68b367
chore: move test contract to GPv2Signing foldedr
fedgiac Aug 14, 2024
483e8f2
Fix fuzz test case where buy and sell tokens are the same
fedgiac Aug 14, 2024
61a0da9
Merge branch 'main' into migrate-test-signing-set-pre-signature
fedgiac Aug 15, 2024
a16ab67
Merge branch 'main' into migrate-test-signing-set-pre-signature
fedgiac Aug 15, 2024
2ebcc44
Merge branch 'migrate-test-signing-set-pre-signature' into migrate-te…
fedgiac Aug 15, 2024
8dd66e7
Merge fuzzed order library into order library
fedgiac Aug 15, 2024
21e12c1
Merge branch 'migrate-test-signing-recover-order-from-trade' into mig…
fedgiac Aug 15, 2024
46fcb81
Update fuzz library usage
fedgiac Aug 15, 2024
db2a861
Merge branch 'migrate-test-signing-calldata-manipulation' into migrat…
fedgiac Aug 15, 2024
16d5d65
Fix invalid signing scheme test to involve a call
fedgiac Aug 15, 2024
6e97dce
Prefer EIP1271Verifier.isValidSignature.selector to static constant
fedgiac Aug 15, 2024
cc09214
Merge branch 'main' into migrate-test-signing-recover-order-from-trade
fedgiac Aug 15, 2024
a34bc31
Merge branch 'migrate-test-signing-recover-order-from-trade' into mig…
fedgiac Aug 15, 2024
53ef88b
Merge branch 'main' into migrate-test-signing-calldata-manipulation
fedgiac Aug 15, 2024
6d96620
Merge branch 'migrate-test-signing-calldata-manipulation' into migrat…
fedgiac Aug 15, 2024
6a9506f
Merge branch 'migrate-test-signing-recoverOrderSigner' into migrate-t…
fedgiac Aug 15, 2024
a467ea6
Remove test of Solidity enum parsing
fedgiac Aug 15, 2024
94bf104
Remove unused import
fedgiac Aug 15, 2024
7435b2a
Merge branch 'main' into migrate-test-signing-recoverOrderSigner
fedgiac Aug 15, 2024
56221d9
Merge branch 'migrate-test-signing-recoverOrderSigner' into migrate-t…
fedgiac Aug 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions test/GPv2Signing.test.ts

This file was deleted.

4 changes: 2 additions & 2 deletions test/GPv2Signing/CalldataManipulation.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Vm} from "forge-std/Test.sol";

import {GPv2Order, GPv2Signing, IERC20} from "src/contracts/mixins/GPv2Signing.sol";

import {GPv2SigningTestInterface, Helper} from "./Helper.sol";
import {Harness, Helper} from "./Helper.sol";

import {Bytes} from "test/libraries/Bytes.sol";
import {Order} from "test/libraries/Order.sol";
Expand Down Expand Up @@ -47,7 +47,7 @@ contract CalldataManipulation is Helper {

IERC20[] memory tokens = encoder.tokens();
bytes memory encodedTransactionData =
abi.encodeCall(GPv2SigningTestInterface.recoverOrderFromTradeTest, (tokens, encoder.trades[0]));
abi.encodeCall(Harness.recoverOrderFromTradeTest, (tokens, encoder.trades[0]));

// calldata encoding:
// - 4 bytes: signature
Expand Down
17 changes: 11 additions & 6 deletions test/GPv2Signing/Helper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ pragma solidity ^0.8;

import {Test} from "forge-std/Test.sol";

import {GPv2Order} from "src/contracts/mixins/GPv2Signing.sol";
import {GPv2Order, GPv2Signing, GPv2Trade, IERC20} from "src/contracts/mixins/GPv2Signing.sol";

import {Sign} from "test/libraries/Sign.sol";
import {GPv2SigningTestInterface} from "test/src/GPv2SigningTestInterface.sol";

// TODO: move the content of `GPv2SigningTestInterface` here once all tests have
// been removed.
// solhint-disable-next-line no-empty-blocks
contract Harness is GPv2SigningTestInterface {
contract Harness is GPv2Signing {
function recoverOrderFromTradeTest(IERC20[] calldata tokens, GPv2Trade.Data calldata trade)
external
view
returns (GPv2Signing.RecoveredOrder memory recoveredOrder)
{
recoveredOrder = allocateRecoveredOrder();
recoverOrderFromTrade(recoveredOrder, tokens, trade);
}

function recoverOrderSignerTest(GPv2Order.Data memory order, Sign.Signature calldata signature)
public
view
Expand Down
27 changes: 0 additions & 27 deletions test/src/GPv2SigningTestInterface.sol

This file was deleted.

Loading