Skip to content

Commit

Permalink
refactor: use plural in funcion name
Browse files Browse the repository at this point in the history
  • Loading branch information
andreivladbrg committed Oct 30, 2023
1 parent b389e9f commit 3c196a5
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/abstracts/SablierV2ProxyTarget.sol
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ abstract contract SablierV2ProxyTarget is
}

/// @inheritdoc ISablierV2ProxyTarget
function withdrawMultipleToRecipient(
function withdrawMultipleToRecipients(
ISablierV2Lockup lockup,
uint256[] calldata streamIds,
uint128[] calldata amounts
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/ISablierV2ProxyTarget.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ interface ISablierV2ProxyTarget {
///
/// Requirements:
/// - Must be delegate called.
function withdrawMultipleToRecipient(
function withdrawMultipleToRecipients(
ISablierV2Lockup lockup,
uint256[] calldata streamIds,
uint128[] calldata amounts
Expand Down
12 changes: 6 additions & 6 deletions test/integration/target/TargetApprove.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { Withdraw_Integration_Test } from "./withdraw/withdraw.t.sol";
import { WithdrawMax_Integration_Test } from "./withdraw-max/withdrawMax.t.sol";
import { WithdrawMaxAndTransfer_Integration_Test } from "./withdraw-max-and-transfer/withdrawMaxAndTransfer.t.sol";
import { WithdrawMultiple_Integration_Test } from "./withdraw-multiple/withdrawMultiple.t.sol";
import { WithdrawMultipleToRecipient_Integration_Test } from
"./withdraw-multiple-to-recipient/withdrawMultipleToRecipient.t.sol";
import { WithdrawMultipleToRecipients_Integration_Test } from
"./withdraw-multiple-to-recipients/withdrawMultipleToRecipients.t.sol";
import { WrapAndCreate_Integration_Test } from "./wrap-and-create/wrapAndCreate.t.sol";

abstract contract TargetApprove_Integration_Test is Integration_Test {
Expand Down Expand Up @@ -163,17 +163,17 @@ contract WithdrawMultiple_TargetApprove_Integration_Test is
}
}

contract WithdrawMultipleToRecipient_TargetApprove_Integration_Test is
contract WithdrawMultipleToRecipients_TargetApprove_Integration_Test is
TargetApprove_Integration_Test,
WithdrawMultipleToRecipient_Integration_Test
WithdrawMultipleToRecipients_Integration_Test
{
function setUp()
public
virtual
override(TargetApprove_Integration_Test, WithdrawMultipleToRecipient_Integration_Test)
override(TargetApprove_Integration_Test, WithdrawMultipleToRecipients_Integration_Test)
{
TargetApprove_Integration_Test.setUp();
WithdrawMultipleToRecipient_Integration_Test.setUp();
WithdrawMultipleToRecipients_Integration_Test.setUp();
}
}

Expand Down
12 changes: 6 additions & 6 deletions test/integration/target/TargetPermit2.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { Withdraw_Integration_Test } from "./withdraw/withdraw.t.sol";
import { WithdrawMax_Integration_Test } from "./withdraw-max/withdrawMax.t.sol";
import { WithdrawMaxAndTransfer_Integration_Test } from "./withdraw-max-and-transfer/withdrawMaxAndTransfer.t.sol";
import { WithdrawMultiple_Integration_Test } from "./withdraw-multiple/withdrawMultiple.t.sol";
import { WithdrawMultipleToRecipient_Integration_Test } from
"./withdraw-multiple-to-recipient/withdrawMultipleToRecipient.t.sol";
import { WithdrawMultipleToRecipients_Integration_Test } from
"./withdraw-multiple-to-recipients/withdrawMultipleToRecipients.t.sol";
import { WrapAndCreate_Integration_Test } from "./wrap-and-create/wrapAndCreate.t.sol";

abstract contract TargetPermit2_Integration_Test is Integration_Test {
Expand Down Expand Up @@ -163,17 +163,17 @@ contract WithdrawMultiple_TargetPermit2_Integration_Test is
}
}

contract WithdrawMultipleToRecipient_TargetPermit2_Integration_Test is
contract WithdrawMultipleToRecipients_TargetPermit2_Integration_Test is
TargetPermit2_Integration_Test,
WithdrawMultipleToRecipient_Integration_Test
WithdrawMultipleToRecipients_Integration_Test
{
function setUp()
public
virtual
override(TargetPermit2_Integration_Test, WithdrawMultipleToRecipient_Integration_Test)
override(TargetPermit2_Integration_Test, WithdrawMultipleToRecipients_Integration_Test)
{
TargetPermit2_Integration_Test.setUp();
WithdrawMultipleToRecipient_Integration_Test.setUp();
WithdrawMultipleToRecipients_Integration_Test.setUp();
}
}

Expand Down
12 changes: 6 additions & 6 deletions test/integration/target/TargetPush.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { Withdraw_Integration_Test } from "./withdraw/withdraw.t.sol";
import { WithdrawMax_Integration_Test } from "./withdraw-max/withdrawMax.t.sol";
import { WithdrawMaxAndTransfer_Integration_Test } from "./withdraw-max-and-transfer/withdrawMaxAndTransfer.t.sol";
import { WithdrawMultiple_Integration_Test } from "./withdraw-multiple/withdrawMultiple.t.sol";
import { WithdrawMultipleToRecipient_Integration_Test } from
"./withdraw-multiple-to-recipient/withdrawMultipleToRecipient.t.sol";
import { WithdrawMultipleToRecipients_Integration_Test } from
"./withdraw-multiple-to-recipients/withdrawMultipleToRecipients.t.sol";
import { WrapAndCreate_Integration_Test } from "./wrap-and-create/wrapAndCreate.t.sol";

abstract contract TargetPush_Integration_Test is Integration_Test {
Expand Down Expand Up @@ -153,17 +153,17 @@ contract WithdrawMultiple_TargetPush_Integration_Test is
}
}

contract WithdrawMultipleToRecipient_TargetPush_Integration_Test is
contract WithdrawMultipleToRecipients_TargetPush_Integration_Test is
TargetPush_Integration_Test,
WithdrawMultipleToRecipient_Integration_Test
WithdrawMultipleToRecipients_Integration_Test
{
function setUp()
public
virtual
override(TargetPush_Integration_Test, WithdrawMultipleToRecipient_Integration_Test)
override(TargetPush_Integration_Test, WithdrawMultipleToRecipients_Integration_Test)
{
TargetPush_Integration_Test.setUp();
WithdrawMultipleToRecipient_Integration_Test.setUp();
WithdrawMultipleToRecipients_Integration_Test.setUp();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import { Errors } from "src/libraries/Errors.sol";

import { Target_Integration_Test } from "../Target.t.sol";

abstract contract WithdrawMultipleToRecipient_Integration_Test is Target_Integration_Test {
abstract contract WithdrawMultipleToRecipients_Integration_Test is Target_Integration_Test {
function setUp() public virtual override { }

function test_RevertWhen_NotDelegateCalled() external {
uint256[] memory streamIds;
uint128[] memory amounts;
vm.expectRevert(Errors.CallNotDelegateCall.selector);
target.withdrawMultipleToRecipient(lockupLinear, streamIds, amounts);
target.withdrawMultipleToRecipients(lockupLinear, streamIds, amounts);
}

modifier whenDelegateCalled() {
Expand All @@ -29,46 +29,46 @@ abstract contract WithdrawMultipleToRecipient_Integration_Test is Target_Integra
Errors.SablierV2ProxyTarget_WithdrawArrayCountsNotEqual.selector, streamIds.length, amounts.length
)
);
bytes memory data = abi.encodeCall(target.withdrawMultipleToRecipient, (lockupLinear, streamIds, amounts));
bytes memory data = abi.encodeCall(target.withdrawMultipleToRecipients, (lockupLinear, streamIds, amounts));
aliceProxy.execute(address(target), data);
}

modifier whenArrayCountsAreEqual() {
_;
}

function test_WithdrawMultipleToRecipient_ArrayCountsZero() external whenDelegateCalled whenArrayCountsAreEqual {
function test_WithdrawMultipleToRecipients_ArrayCountsZero() external whenDelegateCalled whenArrayCountsAreEqual {
uint256[] memory streamIds = new uint256[](0);
uint128[] memory amounts = new uint128[](0);
bytes memory data = abi.encodeCall(target.withdrawMultipleToRecipient, (lockupLinear, streamIds, amounts));
bytes memory data = abi.encodeCall(target.withdrawMultipleToRecipients, (lockupLinear, streamIds, amounts));
aliceProxy.execute(address(target), data);
}

modifier whenArrayCountsNotZero() {
_;
}

function test_WithdrawMultipleToRecipient_LockupDynamic()
function test_WithdrawMultipleToRecipients_LockupDynamic()
external
whenDelegateCalled
whenArrayCountsAreEqual
whenArrayCountsNotZero
{
uint256[] memory streamIds = batchCreateWithMilestones();
test_WithdrawMultipleToRecipient(lockupDynamic, streamIds);
test_WithdrawMultipleToRecipients(lockupDynamic, streamIds);
}

function test_WithdrawMultipleToRecipient_LockupLinear()
function test_WithdrawMultipleToRecipients_LockupLinear()
external
whenDelegateCalled
whenArrayCountsAreEqual
whenArrayCountsNotZero
{
uint256[] memory streamIds = batchCreateWithRange();
test_WithdrawMultipleToRecipient(lockupLinear, streamIds);
test_WithdrawMultipleToRecipients(lockupLinear, streamIds);
}

function test_WithdrawMultipleToRecipient(ISablierV2Lockup lockup, uint256[] memory streamIds) internal {
function test_WithdrawMultipleToRecipients(ISablierV2Lockup lockup, uint256[] memory streamIds) internal {
// Simulate the passage of time.
vm.warp(defaults.CLIFF_TIME());

Expand All @@ -83,7 +83,7 @@ abstract contract WithdrawMultipleToRecipient_Integration_Test is Target_Integra
amounts[i] = withdrawAmount;
}

bytes memory data = abi.encodeCall(target.withdrawMultipleToRecipient, (lockup, streamIds, amounts));
bytes memory data = abi.encodeCall(target.withdrawMultipleToRecipients, (lockup, streamIds, amounts));
aliceProxy.execute(address(target), data);

// Assert that the withdrawn amount has been updated for all streams.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
withdrawMultipleToRecipient.t.sol
withdrawMultipleToRecipients.t.sol
├── when not delegate called
│ └── it should revert
└── when delegate called
Expand Down

0 comments on commit 3c196a5

Please sign in to comment.