Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
be8c3333
Unverified
Commit
be8c3333
authored
Nov 15, 2024
by
Michael Amadi
Committed by
GitHub
Nov 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve tests (#12935)
parent
6c4751c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
OptimismMintableERC721.t.sol
...racts-bedrock/test/universal/OptimismMintableERC721.t.sol
+19
-0
No files found.
packages/contracts-bedrock/test/universal/OptimismMintableERC721.t.sol
View file @
be8c3333
...
@@ -30,6 +30,7 @@ contract OptimismMintableERC721_Test is CommonTest {
...
@@ -30,6 +30,7 @@ contract OptimismMintableERC721_Test is CommonTest {
vm.label(address(L2NFT), "L2ERC721Token");
vm.label(address(L2NFT), "L2ERC721Token");
}
}
/// @notice Tests that the constructor works as expected.
function test_constructor_succeeds() external view {
function test_constructor_succeeds() external view {
assertEq(L2NFT.name(), "L2NFT");
assertEq(L2NFT.name(), "L2NFT");
assertEq(L2NFT.symbol(), "L2T");
assertEq(L2NFT.symbol(), "L2T");
...
@@ -41,6 +42,24 @@ contract OptimismMintableERC721_Test is CommonTest {
...
@@ -41,6 +42,24 @@ contract OptimismMintableERC721_Test is CommonTest {
assertEq(L2NFT.REMOTE_CHAIN_ID(), 1);
assertEq(L2NFT.REMOTE_CHAIN_ID(), 1);
}
}
/// @notice Tests that the bridge cannot be address(0) at construction time.
function test_constructor_bridgeAsAddress0_reverts() external {
vm.expectRevert("OptimismMintableERC721: bridge cannot be address(0)");
L2NFT = new OptimismMintableERC721(address(0), 1, address(L1NFT), "L2NFT", "L2T");
}
/// @notice Tests that the remote chain ID cannot be zero at construction time.
function test_constructor_remoteChainId0_reverts() external {
vm.expectRevert("OptimismMintableERC721: remote chain id cannot be zero");
L2NFT = new OptimismMintableERC721(address(l2ERC721Bridge), 0, address(L1NFT), "L2NFT", "L2T");
}
/// @notice Tests that the remote token cannot be address(0) at construction time.
function test_constructor_remoteTokenAsAddress0_reverts() external {
vm.expectRevert("OptimismMintableERC721: remote token cannot be address(0)");
L2NFT = new OptimismMintableERC721(address(l2ERC721Bridge), 1, address(0), "L2NFT", "L2T");
}
/// @notice Ensure that the contract supports the expected interfaces.
/// @notice Ensure that the contract supports the expected interfaces.
function test_supportsInterfaces_succeeds() external view {
function test_supportsInterfaces_succeeds() external view {
// Checks if the contract supports the IOptimismMintableERC721 interface.
// Checks if the contract supports the IOptimismMintableERC721 interface.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment