Skip to content

Commit

Permalink
upd: events; fxRoot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaSethi committed May 25, 2023
1 parent 2a2bd82 commit f9bf56d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/FxRoot.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
pragma solidity ^0.8.0;

import {FxBase, MockMessageProcessor} from "@utils/FxBase.sol";
import {FxRoot} from "contracts/FxRoot.sol";
import {FxChild} from "contracts/FxChild.sol";

contract FxRootTest is FxBase {
address public alice = makeAddr("alice");
Expand All @@ -14,8 +16,14 @@ contract FxRootTest is FxBase {
}

function test_SetFxChildAndStateSender() public {
assertEq(address(fxRoot.fxChild()), address(fxChild));
assertEq(address(fxRoot.stateSender()), address(stateSender));
FxChild fxChild2 = new FxChild();
FxRoot fxRoot2 = new FxRoot(address(stateSender));

fxRoot2.setFxChild(address(fxChild2));
fxChild2.setFxRoot(address(fxRoot2));

assertEq(address(fxRoot2.fxChild()), address(fxChild2));
assertEq(address(fxRoot2.stateSender()), address(stateSender));
}

function test_CannotSetFxChild() public {
Expand Down
1 change: 1 addition & 0 deletions test/utils/Events.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity ^0.8.0;

abstract contract Events {
event TokenMappedERC20(address indexed rootToken, address indexed childToken); // root chain
event TokenMappedERC721(address indexed rootToken, address indexed childToken);
event TokenMapped(address indexed rootToken, address indexed childToken); // child chain

event FxWithdrawERC20(
Expand Down

0 comments on commit f9bf56d

Please sign in to comment.