From 7631a969b12e224aa67557713ed6e24b32ad5f2e Mon Sep 17 00:00:00 2001 From: Ermyas Abebe Date: Tue, 7 Nov 2023 21:19:38 +1100 Subject: [PATCH 1/4] Fix test naming inconsistencies --- test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol | 4 ++-- .../child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol index a2b67262..0f187841 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol @@ -135,7 +135,7 @@ contract ChildERC20BridgeWithdrawToUnitTest is Test, IChildERC20BridgeEvents, IC childBridge.withdrawTo{value: withdrawFee}(IChildERC20(address(childToken)), address(this), withdrawAmount); } - function test_withdraw_ReducesBalance() public { + function test_withdrawTo_ReducesBalance() public { uint256 withdrawFee = 300; uint256 withdrawAmount = 7 ether; @@ -147,7 +147,7 @@ contract ChildERC20BridgeWithdrawToUnitTest is Test, IChildERC20BridgeEvents, IC assertEq(postBal, preBal - withdrawAmount); } - function test_withdraw_ReducesTotalSupply() public { + function test_withdrawTo_ReducesTotalSupply() public { uint256 withdrawFee = 300; uint256 withdrawAmount = 7 ether; diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol index c8d997ea..e69be526 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol @@ -16,7 +16,7 @@ import {ChildERC20} from "../../../../src/child/ChildERC20.sol"; import {MockAdaptor} from "../../../../src/test/root/MockAdaptor.sol"; import {Utils} from "../../../utils.t.sol"; -contract ChildERC20BridgewithdrawIMXToUnitTest is Test, IChildERC20BridgeEvents, IChildERC20BridgeErrors, Utils { +contract ChildERC20BridgeWithdrawIMXToUnitTest is Test, IChildERC20BridgeEvents, IChildERC20BridgeErrors, Utils { address constant ROOT_BRIDGE = address(3); string public ROOT_BRIDGE_ADAPTOR = Strings.toHexString(address(4)); string constant ROOT_CHAIN_NAME = "test"; From cb03f92a4119fcd6d56e5091b10326187b1a76c1 Mon Sep 17 00:00:00 2001 From: Ermyas Abebe Date: Tue, 7 Nov 2023 22:01:45 +1100 Subject: [PATCH 2/4] Fix incorrect test name --- test/unit/root/RootAxelarBridgeAdaptor.t.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/root/RootAxelarBridgeAdaptor.t.sol b/test/unit/root/RootAxelarBridgeAdaptor.t.sol index 76281fce..0182e95c 100644 --- a/test/unit/root/RootAxelarBridgeAdaptor.t.sol +++ b/test/unit/root/RootAxelarBridgeAdaptor.t.sol @@ -38,20 +38,20 @@ contract RootAxelarBridgeAdaptorTest is Test, IRootAxelarBridgeAdaptorEvents, IR vm.deal(address(stubRootBridge), 99999999999); } - function test_Constructor() public { + function test_Initialize() public { assertEq(address(axelarAdaptor.rootBridge()), address(stubRootBridge), "rootBridge not set"); assertEq(axelarAdaptor.childChain(), CHILD_CHAIN_NAME, "childChain not set"); assertEq(address(axelarAdaptor.gateway()), address(mockAxelarGateway), "axelarGateway not set"); assertEq(address(axelarAdaptor.gasService()), address(axelarGasService), "axelarGasService not set"); } - function test_RevertWhen_InitializerGivenZeroAddress() public { + function test_RevertWhen_InitializeGivenZeroAddress() public { RootAxelarBridgeAdaptor newAdaptor = new RootAxelarBridgeAdaptor(address(mockAxelarGateway)); vm.expectRevert(ZeroAddresses.selector); newAdaptor.initialize(address(0), CHILD_CHAIN_NAME, address(axelarGasService)); } - function test_RevertWhen_ConstructorGivenEmptyChildChainName() public { + function test_RevertWhen_InitializeGivenEmptyChildChainName() public { RootAxelarBridgeAdaptor newAdaptor = new RootAxelarBridgeAdaptor(address(mockAxelarGateway)); vm.expectRevert(InvalidChildChain.selector); newAdaptor.initialize(address(this), "", address(axelarGasService)); From 1ae35ccfe131282d28f56c0633bb40728f33726d Mon Sep 17 00:00:00 2001 From: Ermyas Abebe Date: Tue, 7 Nov 2023 22:24:49 +1100 Subject: [PATCH 3/4] Fix incorrect test name --- test/unit/child/ChildAxelarBridgeAdaptor.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/child/ChildAxelarBridgeAdaptor.t.sol b/test/unit/child/ChildAxelarBridgeAdaptor.t.sol index 148445c6..eaea950c 100644 --- a/test/unit/child/ChildAxelarBridgeAdaptor.t.sol +++ b/test/unit/child/ChildAxelarBridgeAdaptor.t.sol @@ -34,7 +34,7 @@ contract ChildAxelarBridgeAdaptorUnitTest is Test, IChildAxelarBridgeAdaptorErro axelarAdaptor.initialize(ROOT_CHAIN_NAME, address(mockChildERC20Bridge), address(mockChildAxelarGasService)); } - function test_Constructor_SetsValues() public { + function test_Initialize() public { assertEq(address(axelarAdaptor.childBridge()), address(mockChildERC20Bridge), "childBridge not set"); assertEq(address(axelarAdaptor.gateway()), address(mockChildAxelarGateway), "gateway not set"); assertEq(axelarAdaptor.rootChain(), ROOT_CHAIN_NAME, "rootChain not set"); From c3898fd4c5b0cb3498fc73e9802b5634d7e1708f Mon Sep 17 00:00:00 2001 From: Ermyas Abebe Date: Wed, 8 Nov 2023 09:06:23 +1100 Subject: [PATCH 4/4] Fix incorrect test name --- .../child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol index e69be526..1aea350d 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol @@ -105,7 +105,7 @@ contract ChildERC20BridgeWithdrawIMXToUnitTest is Test, IChildERC20BridgeEvents, childBridge.withdrawIMXTo{value: withdrawFee + withdrawAmount}(receiver, withdrawAmount); } - function test_WithdrawIMX_ReducesBalance() public { + function test_WithdrawIMXTo_ReducesBalance() public { uint256 withdrawFee = 300; uint256 withdrawAmount = 7 ether; @@ -117,7 +117,7 @@ contract ChildERC20BridgeWithdrawIMXToUnitTest is Test, IChildERC20BridgeEvents, assertEq(postBal, preBal - withdrawAmount - withdrawFee, "Balance not reduced"); } - function test_WithdrawIMX_PaysFee() public { + function test_WithdrawIMXTo_PaysFee() public { uint256 withdrawFee = 300; uint256 withdrawAmount = 7 ether;