Commit 236b7398 authored by Kelvin Fichter's avatar Kelvin Fichter

feat(ctb): last OptimismPortal nitpicks

A few final nitpicks for the OptimismPortal. Cleans up a couple comments
and improves some formatting.
parent ba3d54bc
This diff is collapsed.
This diff is collapsed.
......@@ -102,13 +102,7 @@ contract L1ERC721Bridge_Test is Messenger_Initializer {
// Bridge the token.
vm.prank(alice);
bridge.bridgeERC721(
address(localToken),
address(remoteToken),
tokenId,
1234,
hex"5678"
);
bridge.bridgeERC721(address(localToken), address(remoteToken), tokenId, 1234, hex"5678");
// Token is locked in the bridge.
assertEq(bridge.deposits(address(localToken), address(remoteToken), tokenId), true);
......@@ -120,13 +114,7 @@ contract L1ERC721Bridge_Test is Messenger_Initializer {
vm.etch(alice, hex"01");
vm.prank(alice);
vm.expectRevert("ERC721Bridge: account is not externally owned");
bridge.bridgeERC721(
address(localToken),
address(remoteToken),
tokenId,
1234,
hex"5678"
);
bridge.bridgeERC721(address(localToken), address(remoteToken), tokenId, 1234, hex"5678");
// Token is not locked in the bridge.
assertEq(bridge.deposits(address(localToken), address(remoteToken), tokenId), false);
......@@ -137,13 +125,7 @@ contract L1ERC721Bridge_Test is Messenger_Initializer {
// Bridge the token.
vm.prank(alice);
vm.expectRevert();
bridge.bridgeERC721(
address(0),
address(remoteToken),
tokenId,
1234,
hex"5678"
);
bridge.bridgeERC721(address(0), address(remoteToken), tokenId, 1234, hex"5678");
// Token is not locked in the bridge.
assertEq(bridge.deposits(address(localToken), address(remoteToken), tokenId), false);
......@@ -154,13 +136,7 @@ contract L1ERC721Bridge_Test is Messenger_Initializer {
// Bridge the token.
vm.prank(alice);
vm.expectRevert("ERC721Bridge: remote token cannot be address(0)");
bridge.bridgeERC721(
address(localToken),
address(0),
tokenId,
1234,
hex"5678"
);
bridge.bridgeERC721(address(localToken), address(0), tokenId, 1234, hex"5678");
// Token is not locked in the bridge.
assertEq(bridge.deposits(address(localToken), address(remoteToken), tokenId), false);
......@@ -171,13 +147,7 @@ contract L1ERC721Bridge_Test is Messenger_Initializer {
// Bridge the token.
vm.prank(bob);
vm.expectRevert("ERC721: transfer from incorrect owner");
bridge.bridgeERC721(
address(localToken),
address(remoteToken),
tokenId,
1234,
hex"5678"
);
bridge.bridgeERC721(address(localToken), address(remoteToken), tokenId, 1234, hex"5678");
// Token is not locked in the bridge.
assertEq(bridge.deposits(address(localToken), address(remoteToken), tokenId), false);
......@@ -194,14 +164,7 @@ contract L1ERC721Bridge_Test is Messenger_Initializer {
address(otherBridge),
abi.encodeCall(
L2ERC721Bridge.finalizeBridgeERC721,
(
address(remoteToken),
address(localToken),
alice,
bob,
tokenId,
hex"5678"
)
(address(remoteToken), address(localToken), alice, bob, tokenId, hex"5678")
),
1234
)
......@@ -239,14 +202,7 @@ contract L1ERC721Bridge_Test is Messenger_Initializer {
// Bridge the token.
vm.prank(alice);
vm.expectRevert();
bridge.bridgeERC721To(
address(0),
address(remoteToken),
bob,
tokenId,
1234,
hex"5678"
);
bridge.bridgeERC721To(address(0), address(remoteToken), bob, tokenId, 1234, hex"5678");
// Token is not locked in the bridge.
assertEq(bridge.deposits(address(localToken), address(remoteToken), tokenId), false);
......@@ -257,14 +213,7 @@ contract L1ERC721Bridge_Test is Messenger_Initializer {
// Bridge the token.
vm.prank(alice);
vm.expectRevert("ERC721Bridge: remote token cannot be address(0)");
bridge.bridgeERC721To(
address(localToken),
address(0),
bob,
tokenId,
1234,
hex"5678"
);
bridge.bridgeERC721To(address(localToken), address(0), bob, tokenId, 1234, hex"5678");
// Token is not locked in the bridge.
assertEq(bridge.deposits(address(localToken), address(remoteToken), tokenId), false);
......@@ -292,13 +241,7 @@ contract L1ERC721Bridge_Test is Messenger_Initializer {
function test_finalizeBridgeERC721_succeeds() external {
// Bridge the token.
vm.prank(alice);
bridge.bridgeERC721(
address(localToken),
address(remoteToken),
tokenId,
1234,
hex"5678"
);
bridge.bridgeERC721(address(localToken), address(remoteToken), tokenId, 1234, hex"5678");
// Expect an event to be emitted.
vm.expectEmit(true, true, true, true);
......
......@@ -2,7 +2,10 @@
pragma solidity 0.8.15;
import { Bridge_Initializer } from "./CommonTest.t.sol";
import { ILegacyMintableERC20, IOptimismMintableERC20 } from "../universal/IOptimismMintableERC20.sol";
import {
ILegacyMintableERC20,
IOptimismMintableERC20
} from "../universal/IOptimismMintableERC20.sol";
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
contract OptimismMintableERC20_Test is Bridge_Initializer {
......
......@@ -476,7 +476,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
function test_finalizeWithdrawalTransaction_ifWithdrawalNotProven_reverts() external {
uint256 bobBalanceBefore = address(bob).balance;
vm.expectRevert("OptimismPortal: withdrawal has not been proven");
vm.expectRevert("OptimismPortal: withdrawal has not been proven yet");
op.finalizeWithdrawalTransaction(_defaultTx);
assert(address(bob).balance == bobBalanceBefore);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment