Skip to content

Commit

Permalink
test: remove unneeded delegatecall test in cancelMultiple
Browse files Browse the repository at this point in the history
  • Loading branch information
andreivladbrg committed Apr 29, 2024
1 parent 1e120e7 commit cfa028a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 31 deletions.
6 changes: 0 additions & 6 deletions test/integration/cancel-multiple/cancelMultiple.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.22;

import { ISablierV2OpenEnded } from "src/interfaces/ISablierV2OpenEnded.sol";
import { Errors } from "src/libraries/Errors.sol";

import { Integration_Test } from "../Integration.t.sol";
Expand All @@ -13,11 +12,6 @@ contract CancelMultiple_Integration_Concrete_Test is Integration_Test {
vm.warp({ newTimestamp: WARP_ONE_MONTH });
}

function test_RevertWhen_DelegateCall() external {
bytes memory callData = abi.encodeCall(ISablierV2OpenEnded.cancelMultiple, (defaultStreamIds));
_test_RevertWhen_DelegateCall(callData);
}

function test_CancelMultiple_ArrayCountZero() external whenNotDelegateCalled {
uint256[] memory streamIds = new uint256[](0);
openEnded.cancelMultiple(streamIds);
Expand Down
47 changes: 22 additions & 25 deletions test/integration/cancel-multiple/cancelMultiple.tree
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
cancelMultiple.t.sol
β”œβ”€β”€ when delegate called
β”‚ └── it should revert
└── when not delegate called
β”œβ”€β”€ when the array count is zero
β”‚ └── it should do nothing
└── when the array count is not zero
β”œβ”€β”€ given the stream IDs array references only null streams
β”‚ └── it should revert
β”œβ”€β”€ given the stream IDs array references some null streams
β”‚ └── it should revert
└── given the stream IDs array references only streams that are not null
β”œβ”€β”€ when the caller is unauthorized for all streams
β”‚ β”œβ”€β”€ when the caller is a malicious third party
β”‚ β”‚ └── it should revert
β”‚ └── when the caller is the recipient
β”‚ └── it should revert
β”œβ”€β”€ when the caller is unauthorized for some streams
β”‚ β”œβ”€β”€ when the caller is a malicious third party
β”‚ β”‚ └── it should revert
β”‚ └── when the caller is the recipient
β”‚ └── it should revert
└── when the caller is authorized for all streams
β”œβ”€β”€ it should cancel the streams
β”œβ”€β”€ it should update the rate per second for each stream
└── it should emit {CancelOpenEndedStream} events
β”œβ”€β”€ when the array count is zero
β”‚ └── it should do nothing
└── when the array count is not zero
β”œβ”€β”€ given the stream IDs array references only null streams
β”‚ └── it should revert
β”œβ”€β”€ given the stream IDs array references some null streams
β”‚ └── it should revert
└── given the stream IDs array references only streams that are not null
β”œβ”€β”€ when the caller is unauthorized for all streams
β”‚ β”œβ”€β”€ when the caller is a malicious third party
β”‚ β”‚ └── it should revert
β”‚ └── when the caller is the recipient
β”‚ └── it should revert
β”œβ”€β”€ when the caller is unauthorized for some streams
β”‚ β”œβ”€β”€ when the caller is a malicious third party
β”‚ β”‚ └── it should revert
β”‚ └── when the caller is the recipient
β”‚ └── it should revert
└── when the caller is authorized for all streams
β”œβ”€β”€ it should cancel the streams
β”œβ”€β”€ it should update the rate per second for each stream
└── it should emit {CancelOpenEndedStream} events

0 comments on commit cfa028a

Please sign in to comment.