Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test naming inconsistencies #26

Merged
merged 4 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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