-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (44 loc) · 1.84 KB
/
Makefile
File metadata and controls
62 lines (44 loc) · 1.84 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
TEST_FLAGS ?= -p 1 -v
all:
@echo "make <cmd>:"
@echo ""
@echo "commands:"
@awk -F'[ :]' '/^#+/ {comment=$$0; gsub(/^#+[ ]*/, "", comment)} !/^(_|all:)/ && /^([A-Za-z_-]+):/ && !seen[$$1]++ {printf " %-24s %s\n", $$1, (comment ? "- " comment : ""); comment=""} !/^#+/ {comment=""}' Makefile
build:
go build ./...
test: wait-on-chain check-testchain-running go-test
go-test:
go clean -testcache && go test $(TEST_FLAGS) -run=$(TEST) ./...
clean:
@go clean -testcache
.PHONY: mock
mock:
go generate ./lib/mock
#
# Testchain
#
init-testchain:
cd ./testutil/testchain && pnpm install
start-testchain:
cd ./testutil/testchain && pnpm start:hardhat
start-testchain-verbose:
cd ./testutil/testchain && pnpm start:hardhat:verbose
start-testchain-geth:
cd ./testutil/testchain && pnpm start:geth
start-testchain-geth-verbose:
cd ./testutil/testchain && pnpm start:geth:verbose
start-testchain-anvil:
cd ./testutil/testchain && pnpm start:anvil
start-testchain-anvil-verbose:
cd ./testutil/testchain && pnpm start:anvil:verbose
# Fork a chain: make start-testchain-fork FORK_URL=https://nodes.sequence.app/polygon-zkevm
FORK_URL ?= https://nodes.sequence.app/polygon-zkevm
start-testchain-fork:
cd ./testutil/testchain && FORK_URL="$(FORK_URL)" pnpm start:anvil:fork -- "$(FORK_URL)"
start-testchain-fork-verbose:
cd ./testutil/testchain && FORK_URL="$(FORK_URL)" pnpm start:anvil:fork:verbose -- "$(FORK_URL)"
check-testchain-running:
@curl http://localhost:8545 -H"Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' --write-out '%{http_code}' --silent --output /dev/null | grep 200 > /dev/null \
|| { echo "*****"; echo "Oops! testchain is not running. Please run 'make start-testchain' in another terminal."; echo "*****"; exit 1; }
wait-on-chain:
cd ./testutil/testchain && pnpm wait:server