Skip to content

Commit

Permalink
test: rename modifier in CreateHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
andreivladbrg committed Jun 6, 2024
1 parent 07092d6 commit 3f265cd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/invariant/handlers/FlowCreateHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ contract FlowCreateHandler is BaseHandler {
_;
}

modifier validateFuzzedInputs(CreateParams memory params) {
// We don't want to create more than a certain number of streams.
vm.assume(flowStore.lastStreamId() < MAX_STREAM_COUNT);

modifier checkUsers(CreateParams memory params) {
// The protocol doesn't allow the sender or recipient to be the zero address.
vm.assume(params.sender != address(0) && params.recipient != address(0));

Expand Down Expand Up @@ -75,9 +72,11 @@ contract FlowCreateHandler is BaseHandler {
public
instrument("create")
adjustTimestamp(params.timeJumpSeed)
checkUsers(params)
useFuzzedAsset(params.assetIndexSeed)
validateFuzzedInputs(params)
{
vm.assume(flowStore.lastStreamId() < MAX_STREAM_COUNT);

// Bound the stream parameters.
params.ratePerSecond = uint128(_bound(params.ratePerSecond, 0.0001e18, 1e18));

Expand All @@ -96,9 +95,11 @@ contract FlowCreateHandler is BaseHandler {
public
instrument("createAndDeposit")
adjustTimestamp(params.timeJumpSeed)
checkUsers(params)
useFuzzedAsset(params.assetIndexSeed)
validateFuzzedInputs(params)
{
vm.assume(flowStore.lastStreamId() < MAX_STREAM_COUNT);

uint8 decimals = IERC20Metadata(address(currentAsset)).decimals();

// Calculate the upper bound, based on the asset decimals, for the transfer amount.
Expand Down

0 comments on commit 3f265cd

Please sign in to comment.