Skip to content

Commit 1365923

Browse files
fedgiacmfw78
andauthored
chore: move test contract to GPv2Signing folder (#208)
## Description Last nail in the coffin for GPv2Signing tests. ## Test Plan CI. ## Related Issues Closes #120. --------- Co-authored-by: mfw78 <[email protected]>
1 parent af90c59 commit 1365923

File tree

4 files changed

+13
-37
lines changed

4 files changed

+13
-37
lines changed

test/GPv2Signing.test.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

test/GPv2Signing/CalldataManipulation.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {Vm} from "forge-std/Test.sol";
55

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

8-
import {GPv2SigningTestInterface, Helper} from "./Helper.sol";
8+
import {Harness, Helper} from "./Helper.sol";
99

1010
import {Bytes} from "test/libraries/Bytes.sol";
1111
import {Order} from "test/libraries/Order.sol";
@@ -47,7 +47,7 @@ contract CalldataManipulation is Helper {
4747

4848
IERC20[] memory tokens = encoder.tokens();
4949
bytes memory encodedTransactionData =
50-
abi.encodeCall(GPv2SigningTestInterface.recoverOrderFromTradeTest, (tokens, encoder.trades[0]));
50+
abi.encodeCall(Harness.recoverOrderFromTradeTest, (tokens, encoder.trades[0]));
5151

5252
// calldata encoding:
5353
// - 4 bytes: signature

test/GPv2Signing/Helper.sol

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ pragma solidity ^0.8;
33

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

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

88
import {Sign} from "test/libraries/Sign.sol";
9-
import {GPv2SigningTestInterface} from "test/src/GPv2SigningTestInterface.sol";
109

11-
// TODO: move the content of `GPv2SigningTestInterface` here once all tests have
12-
// been removed.
13-
// solhint-disable-next-line no-empty-blocks
14-
contract Harness is GPv2SigningTestInterface {
10+
contract Harness is GPv2Signing {
11+
function recoverOrderFromTradeTest(IERC20[] calldata tokens, GPv2Trade.Data calldata trade)
12+
external
13+
view
14+
returns (GPv2Signing.RecoveredOrder memory recoveredOrder)
15+
{
16+
recoveredOrder = allocateRecoveredOrder();
17+
recoverOrderFromTrade(recoveredOrder, tokens, trade);
18+
}
19+
1520
function recoverOrderSignerTest(GPv2Order.Data memory order, Sign.Signature calldata signature)
1621
public
1722
view

test/src/GPv2SigningTestInterface.sol

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)