Skip to content

Commit

Permalink
test: remove redundant names
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulRBerg committed Apr 11, 2024
1 parent 4520c7f commit 31688e8
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 66 deletions.
13 changes: 6 additions & 7 deletions test/fork/assets/USDC.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,25 @@ pragma solidity >=0.8.22 <0.9.0;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import { CreateWithTimestamps_LockupDynamic_Batch_Lockup_Fork_Test } from "../batch-lockup/createWithTimestampsLD.t.sol";
import { CreateWithTimestamps_LockupLinear_Batch_Lockup_Fork_Test } from "../batch-lockup/createWithTimestampsLL.t.sol";
import { CreateWithTimestamps_LockupTranched_Batch_Lockup_Fork_Test } from
"../batch-lockup/createWithTimestampsLT.t.sol";
import { CreateWithTimestamps_LockupDynamic_BatchLockup_Fork_Test } from "../batch-lockup/createWithTimestampsLD.t.sol";
import { CreateWithTimestamps_LockupLinear_BatchLockup_Fork_Test } from "../batch-lockup/createWithTimestampsLL.t.sol";
import { CreateWithTimestamps_LockupTranched_BatchLockup_Fork_Test } from "../batch-lockup/createWithTimestampsLT.t.sol";
import { MerkleLL_Fork_Test } from "../merkle-lockup/MerkleLL.t.sol";
import { MerkleLT_Fork_Test } from "../merkle-lockup/MerkleLT.t.sol";

/// @dev An ERC-20 asset with 6 decimals.
IERC20 constant usdc = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);

contract USDC_CreateWithTimestamps_LockupDynamic_Batch_Lockup_Fork_Test is
CreateWithTimestamps_LockupDynamic_Batch_Lockup_Fork_Test(usdc)
CreateWithTimestamps_LockupDynamic_BatchLockup_Fork_Test(usdc)
{ }

contract USDC_CreateWithTimestamps_LockupLinear_Batch_Lockup_Fork_Test is
CreateWithTimestamps_LockupLinear_Batch_Lockup_Fork_Test(usdc)
CreateWithTimestamps_LockupLinear_BatchLockup_Fork_Test(usdc)
{ }

contract USDC_CreateWithTimestamps_LockupTranched_Batch_Lockup_Fork_Test is
CreateWithTimestamps_LockupTranched_Batch_Lockup_Fork_Test(usdc)
CreateWithTimestamps_LockupTranched_BatchLockup_Fork_Test(usdc)
{ }

contract USDC_MerkleLL_Fork_Test is MerkleLL_Fork_Test(usdc) { }
Expand Down
19 changes: 9 additions & 10 deletions test/fork/assets/USDT.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,25 @@ pragma solidity >=0.8.22 <0.9.0;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import { CreateWithTimestamps_LockupDynamic_Batch_Lockup_Fork_Test } from "../batch-lockup/createWithTimestampsLD.t.sol";
import { CreateWithTimestamps_LockupLinear_Batch_Lockup_Fork_Test } from "../batch-lockup/createWithTimestampsLL.t.sol";
import { CreateWithTimestamps_LockupTranched_Batch_Lockup_Fork_Test } from
"../batch-lockup/createWithTimestampsLT.t.sol";
import { CreateWithTimestamps_LockupDynamic_BatchLockup_Fork_Test } from "../batch-lockup/createWithTimestampsLD.t.sol";
import { CreateWithTimestamps_LockupLinear_BatchLockup_Fork_Test } from "../batch-lockup/createWithTimestampsLL.t.sol";
import { CreateWithTimestamps_LockupTranched_BatchLockup_Fork_Test } from "../batch-lockup/createWithTimestampsLT.t.sol";
import { MerkleLL_Fork_Test } from "../merkle-lockup/MerkleLL.t.sol";
import { MerkleLT_Fork_Test } from "../merkle-lockup/MerkleLT.t.sol";

/// @dev An ERC-20 asset that suffers from the missing return value bug.
IERC20 constant usdt = IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7);

contract USDT_CreateWithTimestamps_LockupDynamic_Batch_Lockup_Fork_Test is
CreateWithTimestamps_LockupDynamic_Batch_Lockup_Fork_Test(usdt)
contract USDT_CreateWithTimestamps_LockupDynamic_BatchLockup_Fork_Test is
CreateWithTimestamps_LockupDynamic_BatchLockup_Fork_Test(usdt)
{ }

contract USDT_CreateWithTimestamps_LockupLinear_Batch_Lockup_Fork_Test is
CreateWithTimestamps_LockupLinear_Batch_Lockup_Fork_Test(usdt)
contract USDT_CreateWithTimestamps_LockupLinear_BatchLockup_Fork_Test is
CreateWithTimestamps_LockupLinear_BatchLockup_Fork_Test(usdt)
{ }

contract USDT_CreateWithTimestamps_LockupTranched_Batch_Lockup_Fork_Test is
CreateWithTimestamps_LockupTranched_Batch_Lockup_Fork_Test(usdt)
contract USDT_CreateWithTimestamps_LockupTranched_BatchLockup_Fork_Test is
CreateWithTimestamps_LockupTranched_BatchLockup_Fork_Test(usdt)
{ }

contract USDT_MerkleLL_Fork_Test is MerkleLL_Fork_Test(usdt) { }
Expand Down
4 changes: 2 additions & 2 deletions test/fork/batch-lockup/createWithTimestampsLD.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { BatchLockupBuilder } from "../../utils/BatchLockupBuilder.sol";
import { Fork_Test } from "../Fork.t.sol";

/// @dev Runs against multiple fork assets.
abstract contract CreateWithTimestamps_LockupDynamic_Batch_Lockup_Fork_Test is Fork_Test {
abstract contract CreateWithTimestamps_LockupDynamic_BatchLockup_Fork_Test is Fork_Test {
constructor(IERC20 asset_) Fork_Test(asset_) { }

function setUp() public virtual override {
Expand Down Expand Up @@ -62,7 +62,7 @@ abstract contract CreateWithTimestamps_LockupDynamic_Batch_Lockup_Fork_Test is F
broker: defaults.broker()
});
BatchLockup.CreateWithTimestampsLD[] memory batchParams =
BatchLockupBuilder.fillBatchLockup(createWithTimestamps, params.batchSize);
BatchLockupBuilder.fillBatch(createWithTimestamps, params.batchSize);

expectCallToTransferFrom({
asset_: address(ASSET),
Expand Down
4 changes: 2 additions & 2 deletions test/fork/batch-lockup/createWithTimestampsLL.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { BatchLockupBuilder } from "../../utils/BatchLockupBuilder.sol";
import { Fork_Test } from "../Fork.t.sol";

/// @dev Runs against multiple fork assets.
abstract contract CreateWithTimestamps_LockupLinear_Batch_Lockup_Fork_Test is Fork_Test {
abstract contract CreateWithTimestamps_LockupLinear_BatchLockup_Fork_Test is Fork_Test {
constructor(IERC20 asset_) Fork_Test(asset_) { }

function setUp() public virtual override {
Expand Down Expand Up @@ -56,7 +56,7 @@ abstract contract CreateWithTimestamps_LockupLinear_Batch_Lockup_Fork_Test is Fo
broker: defaults.broker()
});
BatchLockup.CreateWithTimestampsLL[] memory batchParams =
BatchLockupBuilder.fillBatchLockup(createParams, params.batchSize);
BatchLockupBuilder.fillBatch(createParams, params.batchSize);

// Asset flow: sender → batch → Sablier
expectCallToTransferFrom({
Expand Down
4 changes: 2 additions & 2 deletions test/fork/batch-lockup/createWithTimestampsLT.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { BatchLockupBuilder } from "../../utils/BatchLockupBuilder.sol";
import { Fork_Test } from "../Fork.t.sol";

/// @dev Runs against multiple fork assets.
abstract contract CreateWithTimestamps_LockupTranched_Batch_Lockup_Fork_Test is Fork_Test {
abstract contract CreateWithTimestamps_LockupTranched_BatchLockup_Fork_Test is Fork_Test {
constructor(IERC20 asset_) Fork_Test(asset_) { }

function setUp() public virtual override {
Expand Down Expand Up @@ -62,7 +62,7 @@ abstract contract CreateWithTimestamps_LockupTranched_Batch_Lockup_Fork_Test is
broker: defaults.broker()
});
BatchLockup.CreateWithTimestampsLT[] memory batchParams =
BatchLockupBuilder.fillBatchLockup(createWithTimestamps, params.batchSize);
BatchLockupBuilder.fillBatch(createWithTimestamps, params.batchSize);

expectCallToTransferFrom({
asset_: address(ASSET),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract CreateWithDurations_LockupDynamic_Integration_Test is Integration_Test

// Assert that the batch of streams has been created successfully.
uint256[] memory actualStreamIds =
batchLockup.createWithDurationsLD(lockupDynamic, dai, defaults.batchLockupCreateWithDurationsLD());
batchLockup.createWithDurationsLD(lockupDynamic, dai, defaults.batchCreateWithDurationsLD());
uint256[] memory expectedStreamIds = defaults.incrementalStreamIds();
assertEq(actualStreamIds, expectedStreamIds, "stream ids mismatch");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract CreateWithTimestamps_LockupDynamic_Integration_Test is Integration_Test

// Assert that the batch of streams has been created successfully.
uint256[] memory actualStreamIds =
batchLockup.createWithTimestampsLD(lockupDynamic, dai, defaults.batchLockupCreateWithTimestampsLD());
batchLockup.createWithTimestampsLD(lockupDynamic, dai, defaults.batchCreateWithTimestampsLD());
uint256[] memory expectedStreamIds = defaults.incrementalStreamIds();
assertEq(actualStreamIds, expectedStreamIds, "stream ids mismatch");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract CreateWithDurations_LockupLinear_Integration_Test is Integration_Test {

// Assert that the batch of streams has been created successfully.
uint256[] memory actualStreamIds =
batchLockup.createWithDurationsLL(lockupLinear, dai, defaults.batchLockupCreateWithDurationsLL());
batchLockup.createWithDurationsLL(lockupLinear, dai, defaults.batchCreateWithDurationsLL());
uint256[] memory expectedStreamIds = defaults.incrementalStreamIds();
assertEq(actualStreamIds, expectedStreamIds, "stream ids mismatch");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract CreateWithTimestamps_LockupLinear_Integration_Test is Integration_Test

// Assert that the batch of streams has been created successfully.
uint256[] memory actualStreamIds =
batchLockup.createWithTimestampsLL(lockupLinear, dai, defaults.batchLockupCreateWithTimestampsLL());
batchLockup.createWithTimestampsLL(lockupLinear, dai, defaults.batchCreateWithTimestampsLL());
uint256[] memory expectedStreamIds = defaults.incrementalStreamIds();
assertEq(actualStreamIds, expectedStreamIds, "stream ids mismatch");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract CreateWithDurations_LockupTranched_Integration_Test is Integration_Test

// Assert that the batch of streams has been created successfully.
uint256[] memory actualStreamIds =
batchLockup.createWithDurationsLT(lockupTranched, dai, defaults.batchLockupCreateWithDurationsLT());
batchLockup.createWithDurationsLT(lockupTranched, dai, defaults.batchCreateWithDurationsLT());
uint256[] memory expectedStreamIds = defaults.incrementalStreamIds();
assertEq(actualStreamIds, expectedStreamIds, "stream ids mismatch");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract CreateWithTimestamps_LockupTranched_Integration_Test is Integration_Tes

// Assert that the batch of streams has been created successfully.
uint256[] memory actualStreamIds =
batchLockup.createWithTimestampsLT(lockupTranched, dai, defaults.batchLockupCreateWithTimestampsLT());
batchLockup.createWithTimestampsLT(lockupTranched, dai, defaults.batchCreateWithTimestampsLT());
uint256[] memory expectedStreamIds = defaults.incrementalStreamIds();
assertEq(actualStreamIds, expectedStreamIds, "stream ids mismatch");
}
Expand Down
36 changes: 18 additions & 18 deletions test/utils/BatchLockupBuilder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { BatchLockup } from "../../src/types/DataTypes.sol";

library BatchLockupBuilder {
/// @notice Generates an array containing `batchSize` copies of `batchSingle`.
function fillBatchLockup(
function fillBatch(
BatchLockup.CreateWithDurationsLD memory batchSingle,
uint256 batchSize
)
Expand All @@ -22,7 +22,7 @@ library BatchLockupBuilder {
}

/// @notice Turns the `params` into an array of `BatchLockup.CreateWithDurationsLD` structs.
function fillBatchLockup(
function fillBatch(
LockupDynamic.CreateWithDurations memory params,
uint256 batchSize
)
Expand All @@ -40,11 +40,11 @@ library BatchLockupBuilder {
segments: params.segments,
broker: params.broker
});
batchLockup = fillBatchLockup(batchSingle, batchSize);
batchLockup = fillBatch(batchSingle, batchSize);
}

/// @notice Generates an array containing `batchSize` copies of `batchSingle`.
function fillBatchLockup(
function fillBatch(
BatchLockup.CreateWithDurationsLL memory batchSingle,
uint256 batchSize
)
Expand All @@ -59,7 +59,7 @@ library BatchLockupBuilder {
}

/// @notice Turns the `params` into an array of `BatchLockup.CreateWithDurationsLL` structs.
function fillBatchLockup(
function fillBatch(
LockupLinear.CreateWithDurations memory params,
uint256 batchSize
)
Expand All @@ -77,11 +77,11 @@ library BatchLockupBuilder {
durations: params.durations,
broker: params.broker
});
batchLockup = fillBatchLockup(batchSingle, batchSize);
batchLockup = fillBatch(batchSingle, batchSize);
}

/// @notice Generates an array containing `batchSize` copies of `batchSingle`.
function fillBatchLockup(
function fillBatch(
BatchLockup.CreateWithDurationsLT memory batchSingle,
uint256 batchSize
)
Expand All @@ -96,7 +96,7 @@ library BatchLockupBuilder {
}

/// @notice Turns the `params` into an array of `BatchLockup.CreateWithDurationsLT` structs.
function fillBatchLockup(
function fillBatch(
LockupTranched.CreateWithDurations memory params,
uint256 batchSize
)
Expand All @@ -114,11 +114,11 @@ library BatchLockupBuilder {
tranches: params.tranches,
broker: params.broker
});
batchLockup = fillBatchLockup(batchSingle, batchSize);
batchLockup = fillBatch(batchSingle, batchSize);
}

/// @notice Generates an array containing `batchSize` copies of `batchSingle`.
function fillBatchLockup(
function fillBatch(
BatchLockup.CreateWithTimestampsLD memory batchSingle,
uint256 batchSize
)
Expand All @@ -133,7 +133,7 @@ library BatchLockupBuilder {
}

/// @notice Turns the `params` into an array of `BatchLockup.CreateWithTimestampsLDs` structs.
function fillBatchLockup(
function fillBatch(
LockupDynamic.CreateWithTimestamps memory params,
uint256 batchSize
)
Expand All @@ -152,11 +152,11 @@ library BatchLockupBuilder {
segments: params.segments,
broker: params.broker
});
batchLockup = fillBatchLockup(batchSingle, batchSize);
batchLockup = fillBatch(batchSingle, batchSize);
}

/// @notice Generates an array containing `batchSize` copies of `batchSingle`.
function fillBatchLockup(
function fillBatch(
BatchLockup.CreateWithTimestampsLL memory batchSingle,
uint256 batchSize
)
Expand All @@ -171,7 +171,7 @@ library BatchLockupBuilder {
}

/// @notice Turns the `params` into an array of `BatchLockup.CreateWithTimestampsLL` structs.
function fillBatchLockup(
function fillBatch(
LockupLinear.CreateWithTimestamps memory params,
uint256 batchSize
)
Expand All @@ -189,11 +189,11 @@ library BatchLockupBuilder {
range: params.range,
broker: params.broker
});
batchLockup = fillBatchLockup(batchSingle, batchSize);
batchLockup = fillBatch(batchSingle, batchSize);
}

/// @notice Generates an array containing `batchSize` copies of `batchSingle`.
function fillBatchLockup(
function fillBatch(
BatchLockup.CreateWithTimestampsLT memory batchSingle,
uint256 batchSize
)
Expand All @@ -208,7 +208,7 @@ library BatchLockupBuilder {
}

/// @notice Turns the `params` into an array of `BatchLockup.CreateWithTimestampsLT` structs.
function fillBatchLockup(
function fillBatch(
LockupTranched.CreateWithTimestamps memory params,
uint256 batchSize
)
Expand All @@ -227,6 +227,6 @@ library BatchLockupBuilder {
tranches: params.tranches,
broker: params.broker
});
batchLockup = fillBatchLockup(batchSingle, batchSize);
batchLockup = fillBatch(batchSingle, batchSize);
}
}
Loading

0 comments on commit 31688e8

Please sign in to comment.