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
2a40d226
Unverified
Commit
2a40d226
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 (#12937)
parent
be8c3333
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
L1ERC721Bridge.t.sol
packages/contracts-bedrock/test/L1/L1ERC721Bridge.t.sol
+8
-0
L2ERC721Bridge.t.sol
packages/contracts-bedrock/test/L2/L2ERC721Bridge.t.sol
+8
-0
No files found.
packages/contracts-bedrock/test/L1/L1ERC721Bridge.t.sol
View file @
2a40d226
...
@@ -237,6 +237,14 @@ contract L1ERC721Bridge_Test is CommonTest {
...
@@ -237,6 +237,14 @@ contract L1ERC721Bridge_Test is CommonTest {
assertEq(localToken.ownerOf(tokenId), alice);
assertEq(localToken.ownerOf(tokenId), alice);
}
}
/// @dev Tests that `bridgeERC721To` reverts if the to address is the zero address.
function test_bridgeERC721To_toZeroAddress_reverts() external {
// Bridge the token.
vm.prank(bob);
vm.expectRevert("ERC721Bridge: nft recipient cannot be address(0)");
l1ERC721Bridge.bridgeERC721To(address(localToken), address(remoteToken), address(0), tokenId, 1234, hex"5678");
}
/// @dev Tests that the ERC721 bridge successfully finalizes a withdrawal.
/// @dev Tests that the ERC721 bridge successfully finalizes a withdrawal.
function test_finalizeBridgeERC721_succeeds() external {
function test_finalizeBridgeERC721_succeeds() external {
// Bridge the token.
// Bridge the token.
...
...
packages/contracts-bedrock/test/L2/L2ERC721Bridge.t.sol
View file @
2a40d226
...
@@ -227,6 +227,14 @@ contract L2ERC721Bridge_Test is CommonTest {
...
@@ -227,6 +227,14 @@ contract L2ERC721Bridge_Test is CommonTest {
assertEq(localToken.ownerOf(tokenId), alice);
assertEq(localToken.ownerOf(tokenId), alice);
}
}
/// @dev Tests that `bridgeERC721To` reverts if the to address is the zero address.
function test_bridgeERC721To_toZeroAddress_reverts() external {
// Bridge the token.
vm.prank(bob);
vm.expectRevert("ERC721Bridge: nft recipient cannot be address(0)");
l2ERC721Bridge.bridgeERC721To(address(localToken), address(remoteToken), address(0), tokenId, 1234, hex"5678");
}
/// @dev Tests that `finalizeBridgeERC721` correctly finalizes a bridged token.
/// @dev Tests that `finalizeBridgeERC721` correctly finalizes a bridged token.
function test_finalizeBridgeERC721_succeeds() external {
function test_finalizeBridgeERC721_succeeds() external {
// Bridge the token.
// Bridge the token.
...
...
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