From e61a6ab528ffb6998e90d213a66ad0b9c3d3aafb Mon Sep 17 00:00:00 2001 From: Raunak Singh Date: Mon, 11 Mar 2024 11:39:34 -0400 Subject: [PATCH] forge fmt --- test/Dispatcher.proof.t.sol | 3 ++- test/Dispatcher.t.sol | 14 ++++++++++---- test/TestUtils.sol | 3 ++- test/VirtualChain.sol | 3 ++- test/upgradeableProxy/Dispatcher.upgrade.t.sol | 8 ++++++-- ...trol.sol => DispatcherUUPS.accessControl.t.sol} | 7 +++++-- 6 files changed, 27 insertions(+), 11 deletions(-) rename test/upgradeableProxy/{DispatcherUUPS.accessControl.sol => DispatcherUUPS.accessControl.t.sol} (91%) diff --git a/test/Dispatcher.proof.t.sol b/test/Dispatcher.proof.t.sol index 6ce5a40e..f7aee2da 100644 --- a/test/Dispatcher.proof.t.sol +++ b/test/Dispatcher.proof.t.sol @@ -138,7 +138,8 @@ contract DispatcherIbcWithRealProofs is DispatcherIbcWithRealProofsSuite { function setUp() public override { super.setUp(); consensusStateManager = new OptimisticLightClient(1, opProofVerifier, l1BlockProvider); - (dispatcherProxy, dispatcherImplementation) = TestUtils.deployDispatcherProxyAndImpl("polyibc.eth1.", consensusStateManager); + (dispatcherProxy, dispatcherImplementation) = + TestUtils.deployDispatcherProxyAndImpl("polyibc.eth1.", consensusStateManager); mars = new Mars(dispatcherProxy); } } diff --git a/test/Dispatcher.t.sol b/test/Dispatcher.t.sol index 57feb051..b8d83920 100644 --- a/test/Dispatcher.t.sol +++ b/test/Dispatcher.t.sol @@ -184,7 +184,8 @@ abstract contract ChannelHandshakeTestSuite is Base { contract ChannelHandshakeTest is ChannelHandshakeTestSuite { function setUp() public override { - (dispatcherProxy, dispatcherImplementation) = TestUtils.deployDispatcherProxyAndImpl(portPrefix, dummyConsStateManager); + (dispatcherProxy, dispatcherImplementation) = + TestUtils.deployDispatcherProxyAndImpl(portPrefix, dummyConsStateManager); mars = new Mars(dispatcherProxy); _local = LocalEnd(mars, portId, "channel-1", connectionHops, "1.0", "1.0"); _remote = CounterParty("eth2.7E5F4552091A69125d5DfCb7b8C2659029395Bdf", "channel-2", "1.0"); @@ -203,7 +204,8 @@ contract ChannelOpenTestBaseSetup is Base { Mars mars; function setUp() public virtual override { - (dispatcherProxy, dispatcherImplementation) = TestUtils.deployDispatcherProxyAndImpl(portPrefix, dummyConsStateManager); + (dispatcherProxy, dispatcherImplementation) = + TestUtils.deployDispatcherProxyAndImpl(portPrefix, dummyConsStateManager); ChannelHandshakeSetting memory setting = ChannelHandshakeSetting(ChannelOrder.ORDERED, feeEnabled, true, validProof); @@ -362,9 +364,13 @@ contract DispatcherRecvPacketTestSuite is ChannelOpenTestBaseSetup { // cannot receive packets out of order for ordered channel function test_outOfOrder() public { - dispatcherProxy.recvPacket(IbcReceiver(mars), IbcPacket(src, dest, 1, payload, ZERO_HEIGHT, maxTimeout), validProof); + dispatcherProxy.recvPacket( + IbcReceiver(mars), IbcPacket(src, dest, 1, payload, ZERO_HEIGHT, maxTimeout), validProof + ); vm.expectRevert(abi.encodeWithSignature("unexpectedPacketSequence()")); - dispatcherProxy.recvPacket(IbcReceiver(mars), IbcPacket(src, dest, 3, payload, ZERO_HEIGHT, maxTimeout), validProof); + dispatcherProxy.recvPacket( + IbcReceiver(mars), IbcPacket(src, dest, 3, payload, ZERO_HEIGHT, maxTimeout), validProof + ); } // TODO: add tests for unordered channel, wrong port, and invalid proof diff --git a/test/TestUtils.sol b/test/TestUtils.sol index 0c65121f..a27819d6 100644 --- a/test/TestUtils.sol +++ b/test/TestUtils.sol @@ -22,7 +22,8 @@ library TestUtils { proxy = IDispatcher( address( new ERC1967Proxy( - address(dispatcherImplementation), abi.encodeWithSelector(Dispatcher.initialize.selector, initPortPrefix, lightClient) + address(dispatcherImplementation), + abi.encodeWithSelector(Dispatcher.initialize.selector, initPortPrefix, lightClient) ) ) ); diff --git a/test/VirtualChain.sol b/test/VirtualChain.sol index a93b5ad2..afa2cf0f 100644 --- a/test/VirtualChain.sol +++ b/test/VirtualChain.sol @@ -59,7 +59,8 @@ contract VirtualChain is Test, IbcEventsEmitter { constructor(uint256 seed, string memory portPrefix) { _seed = seed; - (dispatcherProxy, dispatcherImplementation) = TestUtils.deployDispatcherProxyAndImpl(portPrefix, new DummyLightClient()); + (dispatcherProxy, dispatcherImplementation) = + TestUtils.deployDispatcherProxyAndImpl(portPrefix, new DummyLightClient()); ucHandler = new UniversalChannelHandler(dispatcherProxy); mars = new Mars(dispatcherProxy); diff --git a/test/upgradeableProxy/Dispatcher.upgrade.t.sol b/test/upgradeableProxy/Dispatcher.upgrade.t.sol index b349393b..e9ade126 100644 --- a/test/upgradeableProxy/Dispatcher.upgrade.t.sol +++ b/test/upgradeableProxy/Dispatcher.upgrade.t.sol @@ -205,9 +205,13 @@ contract DispatcherRecvPacketTestSuite is ChannelOpenTestBaseSetup { // cannot receive packets out of order for ordered channel function test_outOfOrder() public { - dispatcherProxy.recvPacket(IbcReceiver(mars), IbcPacket(src, dest, 1, payload, ZERO_HEIGHT, maxTimeout), validProof); + dispatcherProxy.recvPacket( + IbcReceiver(mars), IbcPacket(src, dest, 1, payload, ZERO_HEIGHT, maxTimeout), validProof + ); vm.expectRevert(abi.encodeWithSignature("unexpectedPacketSequence()")); - dispatcherProxy.recvPacket(IbcReceiver(mars), IbcPacket(src, dest, 3, payload, ZERO_HEIGHT, maxTimeout), validProof); + dispatcherProxy.recvPacket( + IbcReceiver(mars), IbcPacket(src, dest, 3, payload, ZERO_HEIGHT, maxTimeout), validProof + ); } // TODO: add tests for unordered channel, wrong port, and invalid proof diff --git a/test/upgradeableProxy/DispatcherUUPS.accessControl.sol b/test/upgradeableProxy/DispatcherUUPS.accessControl.t.sol similarity index 91% rename from test/upgradeableProxy/DispatcherUUPS.accessControl.sol rename to test/upgradeableProxy/DispatcherUUPS.accessControl.t.sol index 3ea9c06c..82786898 100644 --- a/test/upgradeableProxy/DispatcherUUPS.accessControl.sol +++ b/test/upgradeableProxy/DispatcherUUPS.accessControl.t.sol @@ -22,7 +22,8 @@ contract DispatcherUUPSAccessControl is Base { DispatcherV2Initializable dispatcherImplementation3; function setUp() public override { - (dispatcherProxy, dispatcherImplementation) = TestUtils.deployDispatcherProxyAndImpl(portPrefix, dummyConsStateManager); + (dispatcherProxy, dispatcherImplementation) = + TestUtils.deployDispatcherProxyAndImpl(portPrefix, dummyConsStateManager); dispatcherImplementation2 = new DispatcherV2(); dispatcherImplementation3 = new DispatcherV2Initializable(); } @@ -44,7 +45,9 @@ contract DispatcherUUPSAccessControl is Base { UUPSUpgradeable(address(dispatcherProxy)).upgradeToAndCall(address(dispatcherImplementation3), initData); assertEq(address(dispatcherImplementation3), TestUtils.getProxyImplementation(address(dispatcherProxy), vm)); assertEq(dispatcherProxy.portPrefix(), portPrefix2); - assertEq(address(uint160(uint256(vm.load(address(dispatcherProxy), bytes32(uint256(110)))))), address(lightClient2)); + assertEq( + address(uint160(uint256(vm.load(address(dispatcherProxy), bytes32(uint256(110)))))), address(lightClient2) + ); } function test_Dispatcher_Prevents_Non_Owner_Updgrade() public {