forked from ethereum-optimism/superchain-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
94 lines (74 loc) · 3.12 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
set positional-arguments
# Adding a chain
add-chain:
go run ./add-chain
go run ./add-chain check-rollup-config
go run ./add-chain compress-genesis
go run ./add-chain check-genesis
just codegen
# Promote a standard candidate chain to a standard chain, example: just promote-to-standard 10
promote-to-standard CHAIN:
go run ./add-chain promote-to-standard --chain-id={{CHAIN}}
just codegen
# Generate auto-generated files
codegen: clean-add-chain
CODEGEN=true go run superchain/internal/codegen/main.go
# Lint all Go code
lint-all:
golangci-lint run superchain/... validation/... add-chain/... --fix
# Test all Go code
test-all: test-add-chain test-superchain test-validation
# Test all Go code in the add-chain module
test-add-chain:
# We separate the first test from the rest because it generates artifacts
# Which need to exist before the remaining tests run.
TEST_DIRECTORY=./add-chain go run gotest.tools/gotestsum@latest --format testname -- -run TestAddChain_Main
TEST_DIRECTORY=./add-chain go run gotest.tools/gotestsum@latest --format testname -- -run '[^TestAddChain_Main]'
# Test all Go code in the superchain module
test-superchain:
TEST_DIRECTORY=./superchain go run gotest.tools/gotestsum@latest --format testname
# Unit test all Go code in the validation module, and do not run validation checks themselves
test-validation: clean-add-chain
TEST_DIRECTORY=./validation go run gotest.tools/gotestsum@latest --format testname -- -run='[^TestValidation]'
# Runs validation checks for any chain whose config changed
validate-modified-chains REF:
# Running validation checks only for chains whose config has changed:
git diff --merge-base {{REF}} --name-only 'superchain/configs/*.toml' ':(exclude)superchain/**/superchain.toml' | xargs -r awk '/chain_id/ {print $3}' | xargs -I {} just validate {}
# Run validation checks for chains with a name or chain ID matching the supplied regex, example: just validate 10
validate CHAIN_ID:
TEST_DIRECTORY=./validation go run gotest.tools/gotestsum@latest --format testname -- -run=TestValidation/{{CHAIN_ID}} -count=1
# Clean test files generated by the add-chain tooling
clean-add-chain:
rm -f superchain/configs/sepolia/testchain_*.toml
# Tidying all go.mod files
tidy-all: tidy-add-chain tidy-superchain tidy-validation
# Tidy the add-chain go.mod file
tidy-add-chain:
cd add-chain && go mod tidy
# Tidy the superchain go.mod file
tidy-superchain:
cd superchain && go mod tidy
# Tidy the validation go.mod file
tidy-validation:
cd validation && go mod tidy
# Removing a chain, example: just remove-chain sepolia op
remove-chain SUPERCHAIN_TARGET CHAIN:
rm superchain/configs/{{SUPERCHAIN_TARGET}}/{{CHAIN}}.toml
rm superchain/extra/genesis/{{SUPERCHAIN_TARGET}}/{{CHAIN}}.json.gz
just codegen
# Run cargo tests
cargo-tests:
just bindings/rust-primitives/tests
just bindings/rust-bindings/tests
# Run cargo lints
cargo-lint:
just bindings/rust-primitives/lint
just bindings/rust-bindings/lint
# Cargo build
cargo-build:
just bindings/rust-primitives/build
just bindings/rust-bindings/build
# Release
release:
just bindings/rust-primitives/release
just bindings/rust-bindings/release