Skip to content

Commit

Permalink
Add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Oct 6, 2023
1 parent 65f8a49 commit 4b65beb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/contracts-core/test/suite/GasOracle.GasData.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity 0.8.17;

import {InterfaceDestination} from "../../contracts/interfaces/InterfaceDestination.sol";
import {SummitTipTooHigh} from "../../contracts/libs/Errors.sol";

import {RawGasData, RawGasData256} from "../utils/libs/SynapseStructs.t.sol";
import {Random, GasOracle, GasOracleTest} from "./GasOracle.t.sol";
Expand All @@ -24,6 +25,16 @@ contract GasOracleGasDataTest is GasOracleTest {
GasOracle(gasOracle).setSummitTip(0);
}

function test_setSummitTip_allowsUpperBound() public {
GasOracle(gasOracle).setSummitTip(0.01 ether);
assertEq(GasOracle(gasOracle).summitTipWei(), 0.01 ether);
}

function test_setSummitTip_revert_higherThanUpperBound() public {
vm.expectRevert(SummitTipTooHigh.selector);
GasOracle(gasOracle).setSummitTip(0.01 ether + 1 wei);
}

function test_getGasData(RawGasData256 memory rgd256) public {
setGasData(localDomain(), rgd256);
RawGasData memory rgd = rgd256.compress();
Expand Down

0 comments on commit 4b65beb

Please sign in to comment.