forked from 0xPolygon/fx-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFxChild.t.sol
31 lines (23 loc) · 841 Bytes
/
FxChild.t.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {FxBase, MockMessageProcessor} from "@utils/FxBase.sol";
contract FxChildTest is FxBase {
address public alice = makeAddr("alice");
function setUp() public override {
super.setUp();
}
function test_SetFxRoot() public {
assertEq(address(fxChild.fxRoot()), address(fxRoot));
vm.expectRevert();
fxChild.setFxRoot(makeAddr("rand"));
}
function test_InvalidSenderOnStateReceive() public {
vm.startPrank(alice);
MockMessageProcessor bob = new MockMessageProcessor();
bytes memory data = new bytes(0);
stateSender.updateStateReceiver(address(stateReceiver));
vm.expectRevert("Invalid sender");
fxRoot.sendMessageToChild(address(bob), data);
vm.stopPrank();
}
}