From 4b65beb2f8655bbdc00dd1c348c987df6b7f849d Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:13:10 +0100 Subject: [PATCH] Add coverage --- .../contracts-core/test/suite/GasOracle.GasData.t.sol | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/contracts-core/test/suite/GasOracle.GasData.t.sol b/packages/contracts-core/test/suite/GasOracle.GasData.t.sol index e3528de575..80197b7e26 100644 --- a/packages/contracts-core/test/suite/GasOracle.GasData.t.sol +++ b/packages/contracts-core/test/suite/GasOracle.GasData.t.sol @@ -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"; @@ -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();