Commit abe9d790 authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: fixup

parent 943ca86f
......@@ -17,7 +17,7 @@
"build": "forge build",
"build:go-ffi": "(cd scripts/go-ffi && go build)",
"autogen:invariant-docs": "npx tsx scripts/invariant-doc-gen.ts",
"test": "pnpm build:go-ffi && pnpm genesis && forge test",
"test": "pnpm build:go-ffi && forge test",
"genesis": "./scripts/generate-l2-genesis.sh",
"coverage": "pnpm build:go-ffi && forge coverage",
"coverage:lcov": "pnpm build:go-ffi && forge coverage --report lcov",
......
......@@ -16,20 +16,17 @@ TESTDATA_DIR="$CONTRACTS_DIR/.testdata"
OUTFILE_L2="$TESTDATA_DIR/genesis.json"
OUTFILE_ROLLUP="$TESTDATA_DIR/rollup.json"
mkdir -p "$TESTDATA_DIR"
if [ ! -f "$DEPLOY_ARTIFACT" ]; then
forge script $CONTRACTS_DIR/scripts/Deploy.s.sol:Deploy
forge script $CONTRACTS_DIR/scripts/Deploy.s.sol:Deploy > /dev/null 2>&1
fi
mkdir -p "$TESTDATA_DIR"
if [ ! -f "$OUTFILE_L2" ]; then
echo "Generating L2 genesis"
go run $OP_NODE genesis l2 \
--deploy-config "$CONTRACTS_DIR/deploy-config/hardhat.json" \
--l1-deployments "$DEPLOY_ARTIFACT" \
--l1-starting-block "$L1_STARTING_BLOCK_PATH" \
--outfile.l2 "$OUTFILE_L2" \
--outfile.rollup "$OUTFILE_ROLLUP"
--outfile.rollup "$OUTFILE_ROLLUP" > /dev/null 2>&1
fi
......@@ -28,6 +28,7 @@ import { L1StandardBridge } from "src/L1/L1StandardBridge.sol";
import { AddressManager } from "src/legacy/AddressManager.sol";
import { L1ERC721Bridge } from "src/L1/L1ERC721Bridge.sol";
import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
import { Executables } from "scripts/Executables.sol";
/// @title Setup
/// @dev This contact is responsible for setting up the contracts in state. It currently
......@@ -108,6 +109,12 @@ contract Setup is Deploy {
/// @dev Sets up the L2 contracts. Depends on `L1()` being called first.
function L2(DeployConfig cfg) public {
string[] memory args = new string[](3);
args[0] = Executables.bash;
args[1] = "-c";
args[2] = string.concat(vm.projectRoot(), "/scripts/generate-l2-genesis.sh");
vm.ffi(args);
string memory allocsPath = string.concat(vm.projectRoot(), "/.testdata/genesis.json");
vm.loadAllocs(allocsPath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment