Skip to content

Commit

Permalink
chore: move test contract to GPv2Signing foldedr
Browse files Browse the repository at this point in the history
  • Loading branch information
fedgiac committed Aug 14, 2024
1 parent ac6bcae commit e68b367
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 37 deletions.
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 {OrderFuzz} from "test/libraries/OrderFuzz.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.

0 comments on commit e68b367

Please sign in to comment.