Skip to content

Commit

Permalink
Fix and run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog committed Oct 19, 2024
1 parent f924284 commit f39a6b9
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OP_COMMIT=3056348b21a07e584225310bbc27f1adce5ca2a9
BASE_MAINNET_URL=https://mainnet.base.org
2 changes: 0 additions & 2 deletions .env.example

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Show Forge version
run: |
forge --version
- name: Run Forge fmt
run: |
forge fmt --check
id: fmt

- name: Run Forge build
run: |
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ lib/**
cache/***
out/**

.env
.gitmodules

/.idea/
Expand Down
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ fs_permissions = [ {access = "read-write", path = "./"} ]
optimizer = true
optimizer_runs = 999999
solc_version = "0.8.15"
viaIR = true

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
3 changes: 1 addition & 2 deletions remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts
@rari-capital/solmate/=lib/solmate/
solady/=lib/solady/src/
@base-contracts/=./
@solady/=lib/solady/src/
2 changes: 1 addition & 1 deletion script/deploy/l1/SetGasLimitBuilder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
MultisigBuilder,
IMulticall3,
IGnosisSafe
} from "@base-contracts/script/universal/MultisigBuilder.sol";
} from "../../universal/MultisigBuilder.sol";
import { Vm } from "forge-std/Vm.sol";

abstract contract SetGasLimitBuilder is MultisigBuilder {
Expand Down
2 changes: 1 addition & 1 deletion script/universal/MultisigBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {console} from "forge-std/console.sol";
import {IMulticall3} from "forge-std/interfaces/IMulticall3.sol";
import {IGnosisSafe, Enum} from "./IGnosisSafe.sol";
import {Bytes} from "@eth-optimism-bedrock/src/libraries/Bytes.sol";
import {LibSort} from "solady/utils/LibSort.sol";
import {LibSort} from "@solady/utils/LibSort.sol";
import "./Simulator.sol";

abstract contract MultisigBase is Simulator {
Expand Down
2 changes: 1 addition & 1 deletion test/Challenger1of2.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ contract Challenger1of2Test is Test {
NONZERO_INTEGER, // _submissionInterval
NONZERO_INTEGER, // _l2BlockTime
ZERO, // _startingBlockNumber
NONZERO_INTEGER, // _startingTimestamp
ZERO, // _startingTimestamp
proposer, // _proposer
address(challenger), // _challenger
NONZERO_INTEGER // _finalizationPeriodSeconds
Expand Down
3 changes: 2 additions & 1 deletion test/revenue-share/BalanceTracker.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ contract BalanceTrackerTest is CommonTest {
vm.expectEmit(true, true, true, true, address(balanceTracker));
emit ReceivedFunds(l1StandardBridge, NON_ZERO_VALUE);

payable(address(balanceTracker)).call{ value: NON_ZERO_VALUE }("");
(bool success, ) = payable(address(balanceTracker)).call{ value: NON_ZERO_VALUE }("");
assertTrue(success);

assertEq(address(balanceTracker).balance, NON_ZERO_VALUE);
}
Expand Down
3 changes: 2 additions & 1 deletion test/revenue-share/FeeDisburser.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ contract FeeDisburserTest is CommonTest {
function test_receive_fail_unauthorizedCaller() external {
vm.expectRevert("FeeDisburser: Only FeeVaults can send ETH to FeeDisburser");
vm.prank(alice);
payable(address(feeDisburser)).call{ value: NON_ZERO_VALUE }("");
(bool success, ) = payable(address(feeDisburser)).call{ value: NON_ZERO_VALUE }("");
assertTrue(success);
}

function test_receive_success() external {
Expand Down

0 comments on commit f39a6b9

Please sign in to comment.