Skip to content

Commit

Permalink
Merge pull request #26 from immutable/fix/test-naming-inconsistencies
Browse files Browse the repository at this point in the history
Fix test naming inconsistencies
  • Loading branch information
ermyas authored Nov 7, 2023
2 parents fabfe75 + c3898fd commit 95ddd11
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/unit/child/ChildAxelarBridgeAdaptor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions test/unit/root/RootAxelarBridgeAdaptor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 95ddd11

Please sign in to comment.