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
e9cea338
Unverified
Commit
e9cea338
authored
Dec 15, 2022
by
Kelvin Fichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ctb): linting errors
Fixes a few small linting errors.
parent
13a72cb2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
68 deletions
+13
-68
L2ERC721Bridge.t.sol
...ges/contracts-bedrock/contracts/test/L2ERC721Bridge.t.sol
+12
-67
MerkleTrie.t.sol
packages/contracts-bedrock/contracts/test/MerkleTrie.t.sol
+1
-1
No files found.
packages/contracts-bedrock/contracts/test/L2ERC721Bridge.t.sol
View file @
e9cea338
...
@@ -16,7 +16,9 @@ contract TestERC721 is ERC721 {
...
@@ -16,7 +16,9 @@ contract TestERC721 is ERC721 {
}
}
contract TestMintableERC721 is OptimismMintableERC721 {
contract TestMintableERC721 is OptimismMintableERC721 {
constructor(address _bridge, address _remoteToken) OptimismMintableERC721(_bridge, 1, _remoteToken, "Test", "TST") {}
constructor(address _bridge, address _remoteToken)
OptimismMintableERC721(_bridge, 1, _remoteToken, "Test", "TST")
{}
function mint(address to, uint256 tokenId) public {
function mint(address to, uint256 tokenId) public {
_mint(to, tokenId);
_mint(to, tokenId);
...
@@ -111,13 +113,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
...
@@ -111,13 +113,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
// Bridge the token.
// Bridge the token.
vm.prank(alice);
vm.prank(alice);
bridge.bridgeERC721(
bridge.bridgeERC721(address(localToken), address(remoteToken), tokenId, 1234, hex"5678");
address(localToken),
address(remoteToken),
tokenId,
1234,
hex"5678"
);
// Token is burned.
// Token is burned.
vm.expectRevert("ERC721: invalid token ID");
vm.expectRevert("ERC721: invalid token ID");
...
@@ -129,13 +125,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
...
@@ -129,13 +125,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
vm.etch(alice, hex"01");
vm.etch(alice, hex"01");
vm.prank(alice);
vm.prank(alice);
vm.expectRevert("ERC721Bridge: account is not externally owned");
vm.expectRevert("ERC721Bridge: account is not externally owned");
bridge.bridgeERC721(
bridge.bridgeERC721(address(localToken), address(remoteToken), tokenId, 1234, hex"5678");
address(localToken),
address(remoteToken),
tokenId,
1234,
hex"5678"
);
// Token is not locked in the bridge.
// Token is not locked in the bridge.
assertEq(localToken.ownerOf(tokenId), alice);
assertEq(localToken.ownerOf(tokenId), alice);
...
@@ -145,13 +135,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
...
@@ -145,13 +135,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
// Bridge the token.
// Bridge the token.
vm.prank(alice);
vm.prank(alice);
vm.expectRevert();
vm.expectRevert();
bridge.bridgeERC721(
bridge.bridgeERC721(address(0), address(remoteToken), tokenId, 1234, hex"5678");
address(0),
address(remoteToken),
tokenId,
1234,
hex"5678"
);
// Token is not locked in the bridge.
// Token is not locked in the bridge.
assertEq(localToken.ownerOf(tokenId), alice);
assertEq(localToken.ownerOf(tokenId), alice);
...
@@ -161,13 +145,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
...
@@ -161,13 +145,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
// Bridge the token.
// Bridge the token.
vm.prank(alice);
vm.prank(alice);
vm.expectRevert("ERC721Bridge: remote token cannot be address(0)");
vm.expectRevert("ERC721Bridge: remote token cannot be address(0)");
bridge.bridgeERC721(
bridge.bridgeERC721(address(localToken), address(0), tokenId, 1234, hex"5678");
address(localToken),
address(0),
tokenId,
1234,
hex"5678"
);
// Token is not locked in the bridge.
// Token is not locked in the bridge.
assertEq(localToken.ownerOf(tokenId), alice);
assertEq(localToken.ownerOf(tokenId), alice);
...
@@ -177,13 +155,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
...
@@ -177,13 +155,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
// Bridge the token.
// Bridge the token.
vm.prank(bob);
vm.prank(bob);
vm.expectRevert("Withdrawal is not being initiated by NFT owner");
vm.expectRevert("Withdrawal is not being initiated by NFT owner");
bridge.bridgeERC721(
bridge.bridgeERC721(address(localToken), address(remoteToken), tokenId, 1234, hex"5678");
address(localToken),
address(remoteToken),
tokenId,
1234,
hex"5678"
);
// Token is not locked in the bridge.
// Token is not locked in the bridge.
assertEq(localToken.ownerOf(tokenId), alice);
assertEq(localToken.ownerOf(tokenId), alice);
...
@@ -199,14 +171,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
...
@@ -199,14 +171,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
address(otherBridge),
address(otherBridge),
abi.encodeCall(
abi.encodeCall(
L1ERC721Bridge.finalizeBridgeERC721,
L1ERC721Bridge.finalizeBridgeERC721,
(
(address(remoteToken), address(localToken), alice, bob, tokenId, hex"5678")
address(remoteToken),
address(localToken),
alice,
bob,
tokenId,
hex"5678"
)
),
),
1234
1234
)
)
...
@@ -244,14 +209,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
...
@@ -244,14 +209,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
// Bridge the token.
// Bridge the token.
vm.prank(alice);
vm.prank(alice);
vm.expectRevert();
vm.expectRevert();
bridge.bridgeERC721To(
bridge.bridgeERC721To(address(0), address(remoteToken), bob, tokenId, 1234, hex"5678");
address(0),
address(remoteToken),
bob,
tokenId,
1234,
hex"5678"
);
// Token is not locked in the bridge.
// Token is not locked in the bridge.
assertEq(localToken.ownerOf(tokenId), alice);
assertEq(localToken.ownerOf(tokenId), alice);
...
@@ -261,14 +219,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
...
@@ -261,14 +219,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
// Bridge the token.
// Bridge the token.
vm.prank(alice);
vm.prank(alice);
vm.expectRevert("ERC721Bridge: remote token cannot be address(0)");
vm.expectRevert("ERC721Bridge: remote token cannot be address(0)");
bridge.bridgeERC721To(
bridge.bridgeERC721To(address(localToken), address(0), bob, tokenId, 1234, hex"5678");
address(localToken),
address(0),
bob,
tokenId,
1234,
hex"5678"
);
// Token is not locked in the bridge.
// Token is not locked in the bridge.
assertEq(localToken.ownerOf(tokenId), alice);
assertEq(localToken.ownerOf(tokenId), alice);
...
@@ -294,13 +245,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
...
@@ -294,13 +245,7 @@ contract L2ERC721Bridge_Test is Messenger_Initializer {
function test_finalizeBridgeERC721_succeeds() external {
function test_finalizeBridgeERC721_succeeds() external {
// Bridge the token.
// Bridge the token.
vm.prank(alice);
vm.prank(alice);
bridge.bridgeERC721(
bridge.bridgeERC721(address(localToken), address(remoteToken), tokenId, 1234, hex"5678");
address(localToken),
address(remoteToken),
tokenId,
1234,
hex"5678"
);
// Expect an event to be emitted.
// Expect an event to be emitted.
vm.expectEmit(true, true, true, true);
vm.expectEmit(true, true, true, true);
...
...
packages/contracts-bedrock/contracts/test/MerkleTrie.t.sol
View file @
e9cea338
...
@@ -305,7 +305,7 @@ contract MerkleTrie_Test is CommonTest {
...
@@ -305,7 +305,7 @@ contract MerkleTrie_Test is CommonTest {
}
}
/// @notice The `bytes4` parameter is to enable parallel fuzz runs; it is ignored.
/// @notice The `bytes4` parameter is to enable parallel fuzz runs; it is ignored.
function testFuzz_get_validProofs_succe
s
s(bytes4) external {
function testFuzz_get_validProofs_succe
ed
s(bytes4) external {
// Generate a test case with a valid proof of inclusion for the k/v pair in the trie.
// Generate a test case with a valid proof of inclusion for the k/v pair in the trie.
(bytes32 root, bytes memory key, bytes memory val, bytes[] memory proof) = ffi
(bytes32 root, bytes memory key, bytes memory val, bytes[] memory proof) = ffi
.getMerkleTrieFuzzCase("valid");
.getMerkleTrieFuzzCase("valid");
...
...
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