-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change setMinimumFeeToZero to lowerMinimumFee
- Loading branch information
1 parent
2d2cd49
commit fd96c70
Showing
13 changed files
with
94 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
tests/integration/concrete/campaign/shared/lower-minimum-fee/lowerMinimumFee.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity >=0.8.22 <0.9.0; | ||
|
||
import { ISablierMerkleBase } from "src/interfaces/ISablierMerkleBase.sol"; | ||
import { Errors } from "src/libraries/Errors.sol"; | ||
|
||
import { Integration_Test } from "../../../../Integration.t.sol"; | ||
|
||
abstract contract LowerMinimumFee_Integration_Test is Integration_Test { | ||
function test_RevertWhen_CallerNotFactoryAdmin() external { | ||
resetPrank({ msgSender: users.eve }); | ||
vm.expectRevert( | ||
abi.encodeWithSelector(Errors.SablierMerkleBase_CallerNotFactoryAdmin.selector, users.admin, users.eve) | ||
); | ||
merkleBase.lowerMinimumFee(MINIMUM_FEE - 1); | ||
} | ||
|
||
function test_RevertWhen_NewFeeNotLower() external whenCallerFactoryAdmin { | ||
uint256 newFee = MINIMUM_FEE + 1; | ||
resetPrank(users.admin); | ||
vm.expectRevert(abi.encodeWithSelector(Errors.SablierMerkleBase_NewFeeNotLower.selector, MINIMUM_FEE, newFee)); | ||
merkleBase.lowerMinimumFee(newFee); | ||
} | ||
|
||
function test_WhenNewFeeNotZero() external whenCallerFactoryAdmin whenNewFeeLower { | ||
uint256 newFee = MINIMUM_FEE - 1; | ||
resetPrank(users.admin); | ||
vm.expectEmit({ emitter: address(merkleBase) }); | ||
emit ISablierMerkleBase.LowerMinimumFee(users.admin, newFee, MINIMUM_FEE); | ||
merkleBase.lowerMinimumFee(newFee); | ||
assertEq(merkleBase.minimumFee(), newFee); | ||
} | ||
|
||
function test_WhenNewFeeZero() external whenCallerFactoryAdmin whenNewFeeLower { | ||
uint256 newFee = 0; | ||
resetPrank(users.admin); | ||
vm.expectEmit({ emitter: address(merkleBase) }); | ||
emit ISablierMerkleBase.LowerMinimumFee(users.admin, newFee, MINIMUM_FEE); | ||
merkleBase.lowerMinimumFee(newFee); | ||
assertEq(merkleBase.minimumFee(), newFee); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/integration/concrete/campaign/shared/lower-minimum-fee/lowerMinimumFee.tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
LowerMinimumFee_Integration_Test | ||
├── when caller not factory admin | ||
│ └── it should revert | ||
└── when caller factory admin | ||
├── when new fee not lower | ||
│ └── it should revert | ||
└── when new fee lower | ||
├── when new fee not zero | ||
│ ├── it should set minimum fee to new fee | ||
│ └── it should emit event LowerMinimumFee | ||
└── when new fee zero | ||
├── it should set minimum fee to zero | ||
└── it should emit event LowerMinimumFee |
37 changes: 0 additions & 37 deletions
37
tests/integration/concrete/campaign/shared/set-minimum-fee-to-zero/setMinimumFeeToZero.t.sol
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
tests/integration/concrete/campaign/shared/set-minimum-fee-to-zero/setMinimumFeeToZero.tree
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters