Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
proletesseract committed Oct 25, 2023
1 parent 853c365 commit 1335e14
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
7 changes: 5 additions & 2 deletions test/integration/root/RootERC20Bridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ contract RootERC20BridgeIntegrationTest is Test, IRootERC20BridgeEvents, IRootAx
MockAxelarGasService public axelarGasService;

function setUp() public {

deployCodeTo("WETH.sol", abi.encode("Wrapped ETH", "WETH"), WRAPPED_ETH);

(imxToken, token, rootBridge, axelarAdaptor, mockAxelarGateway, axelarGasService) =
Expand Down Expand Up @@ -267,7 +266,11 @@ contract RootERC20BridgeIntegrationTest is Test, IRootERC20BridgeEvents, IRootAx
rootBridge.deposit{value: depositFee}(IERC20Metadata(WRAPPED_ETH), tokenAmount);

// Check that tokens are transferred
assertEq(thisPreBal - tokenAmount, IERC20Metadata(WRAPPED_ETH).balanceOf(address(this)), "Tokens not transferred from user");
assertEq(
thisPreBal - tokenAmount,
IERC20Metadata(WRAPPED_ETH).balanceOf(address(this)),
"Tokens not transferred from user"
);
assertEq(bridgePreBal + tokenAmount, address(rootBridge).balance, "ETH not transferred to Bridge");
// Check that native asset transferred to gas service
assertEq(thisNativePreBal - depositFee, address(this).balance, "ETH for fee not paid from user");
Expand Down
14 changes: 10 additions & 4 deletions test/unit/root/RootERC20Bridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,12 @@ contract RootERC20BridgeUnitTest is Test, IRootERC20BridgeEvents, IRootERC20Brid
rootBridge.deposit{value: depositFee}(IERC20Metadata(WRAPPED_ETH), amount);

// Check that tokens are transferred
assertEq(thisPreBal - amount, IERC20Metadata(WRAPPED_ETH).balanceOf(address(this)), "Tokens not transferred from user");
assertEq(
thisPreBal - amount,
IERC20Metadata(WRAPPED_ETH).balanceOf(address(this)),
"Tokens not transferred from user"
);
assertEq(bridgePreBal + amount, address(rootBridge).balance, "ETH not transferred to Bridge");

}

function test_depositToWETHTransfersTokens() public {
Expand All @@ -380,9 +383,12 @@ contract RootERC20BridgeUnitTest is Test, IRootERC20BridgeEvents, IRootERC20Brid
rootBridge.depositTo{value: depositFee}(IERC20Metadata(WRAPPED_ETH), receiver, amount);

// Check that tokens are transferred
assertEq(thisPreBal - amount, IERC20Metadata(WRAPPED_ETH).balanceOf(address(this)), "Tokens not transferred from user");
assertEq(
thisPreBal - amount,
IERC20Metadata(WRAPPED_ETH).balanceOf(address(this)),
"Tokens not transferred from user"
);
assertEq(bridgePreBal + amount, address(rootBridge).balance, "ETH not transferred to Bridge");

}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/utils.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ contract Utils is Test {
bool saveTokenMapping
) public returns (address childToken, bytes memory predictedPayload) {
predictedPayload = abi.encode(rootBridge.DEPOSIT_SIG(), token, address(this), to, tokenAmount);

if (saveTokenMapping) {
childToken = rootBridge.mapToken{value: mapTokenFee}(ERC20PresetMinterPauser(token));
}
Expand Down

0 comments on commit 1335e14

Please sign in to comment.