-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit tests for new pricing mechanism
- Loading branch information
1 parent
65de742
commit a65e73b
Showing
6 changed files
with
55 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.23; | ||
|
||
import {RegistrarControllerBase} from "./RegistrarControllerBase.t.sol"; | ||
import {Ownable} from "solady/auth/Ownable.sol"; | ||
|
||
contract SetLaunchTime is RegistrarControllerBase { | ||
function test_reverts_ifCalledByNonOwner(address caller) public { | ||
vm.assume(caller != owner); | ||
vm.expectRevert(Ownable.Unauthorized.selector); | ||
vm.prank(caller); | ||
controller.setLaunchTime(launchTime); | ||
} | ||
|
||
function test_allowsTheOwnerToSetTheLaunchTime() public { | ||
uint256 before_launchTime = controller.launchTime(); | ||
assertEq(before_launchTime, 0); | ||
|
||
vm.prank(owner); | ||
controller.setLaunchTime(launchTime); | ||
|
||
uint256 after_launchTime = controller.launchTime(); | ||
assertEq(after_launchTime, launchTime); | ||
} | ||
} |
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