Skip to content

Commit

Permalink
add constructor tests for receivers
Browse files Browse the repository at this point in the history
  • Loading branch information
hexonaut committed Apr 24, 2024
1 parent b01bbb2 commit 3dde53f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/DSROracleIntegrationArbitrum.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ contract DSROracleIntegrationArbitrumTest is DSROracleXChainIntegrationBaseTest
assertEq(address(receiver), expectedReceiver);
}

function test_constructor() public {
DSROracleReceiverArbitrum receiver = new DSROracleReceiverArbitrum(address(forwarder), oracle);

assertEq(address(receiver.oracle()), address(oracle));
assertEq(receiver.l1Authority(), address(forwarder));
}

function doRefresh() internal override {
DSROracleForwarderArbitrumOne(address(forwarder)).refresh{value:1 ether}(500_000, 1 gwei, block.basefee + 10 gwei);
}
Expand Down
9 changes: 9 additions & 0 deletions test/DSROracleIntegrationGnosis.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ contract DSROracleIntegrationGnosisTest is DSROracleXChainIntegrationBaseTest {

oracle.grantRole(oracle.DATA_PROVIDER_ROLE(), address(receiver));
}

function test_constructor() public {
DSROracleReceiverGnosis receiver = new DSROracleReceiverGnosis(AMB, 1, address(forwarder), oracle);

assertEq(address(receiver.oracle()), address(oracle));
assertEq(address(receiver.l2CrossDomain()), address(AMB));
assertEq(receiver.chainId(), bytes32(uint256(1)));
assertEq(receiver.l1Authority(), address(forwarder));
}

function doRefresh() internal override {
DSROracleForwarderGnosis(address(forwarder)).refresh(500_000);
Expand Down
7 changes: 7 additions & 0 deletions test/DSROracleIntegrationOptimism.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ contract DSROracleIntegrationOptimismTest is DSROracleXChainIntegrationBaseTest
assertEq(address(receiver), expectedReceiver);
}

function test_constructor() public {
DSROracleReceiverOptimism receiver = new DSROracleReceiverOptimism(address(forwarder), oracle);

assertEq(address(receiver.oracle()), address(oracle));
assertEq(receiver.l1Authority(), address(forwarder));
}

function doRefresh() internal override {
DSROracleForwarderOptimism(address(forwarder)).refresh(500_000);
}
Expand Down

0 comments on commit 3dde53f

Please sign in to comment.