-
Notifications
You must be signed in to change notification settings - Fork 161
Expand file tree
/
Copy pathJustfile
More file actions
78 lines (62 loc) · 2 KB
/
Justfile
File metadata and controls
78 lines (62 loc) · 2 KB
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
help:
@just --list
# Bootstrap the crate, will vendor contracts, generate the bindings crates and format everything
setup:
cd contracts && \
cargo r -r -- vendor && \
cargo r -r -- generate
just _format_generated_contracts
# Generate contract bindings
generate-contracts:
cd contracts && \
cargo r -r -- generate
just _format_generated_contracts
_format_generated_contracts:
cd contracts && cargo +nightly fmt --all && \
cd generated && cargo +nightly fmt --all && \
cd ../.. && \
tombi format
# Run unit tests
test-unit:
cargo nextest run
# Run doc tests
test-doc:
cargo test --doc
# Run database tests
test-db:
cargo nextest run postgres --test-threads 1 --run-ignored ignored-only
# Run End-to-end tests on local node (this machine)
test-e2e-local: (test-e2e "local_node")
# Run End-to-end tests on forked node
#
# FORK_URL_MAINNET and FORK_URL_GNOSIS env variables have to be provided.
test-e2e-forked: (test-e2e "forked_node")
# Run End-to-end tests with custom filters
test-e2e filters="" *extra="":
cargo nextest run -p e2e '{{filters}}' --test-threads 1 --failure-output final --run-ignored ignored-only {{extra}}
test-driver:
RUST_MIN_STACK=3145728 cargo nextest run -p driver --test-threads 1 --run-ignored ignored-only
# Run clippy
clippy:
cargo clippy --locked --workspace --all-features --all-targets -- -D warnings
# Format the repository
fmt *extra:
cargo +nightly fmt --all -- {{extra}}
cd contracts && cargo +nightly fmt --all -- {{extra}}
# Format .toml files in the repository
fmt-toml *extra:
tombi format {{extra}}
# Start database for E2E tests
start-db:
docker compose up -d
# Properly formats all ABI files that we generate bindings for to make them human readable
format-abi-files:
#!/bin/sh
cd ./crates/contracts/artifacts
for f in *.json; do
if [ -L "$f" ]; then
echo "Skipping symlink: $f"
continue
fi
jq . "$f" > "$f.tmp" && mv "$f.tmp" "$f"
done