Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
178 lines (144 loc) · 8.79 KB
/
Copy pathMakefile
File metadata and controls
178 lines (144 loc) · 8.79 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
.PHONY: generate-daml-codecs
generate-daml-codecs:
cd ./contracts && go run ./cmd/damlcodecs
.PHONY: compile-contracts
compile-contracts: generate-daml-codecs
@echo "Compiling contracts..."
cd ./contracts && go run ./cmd/compile -root . -artifacts ./dars
.PHONY: generate-bindings
generate-bindings:
cd ./contracts && go run ./cmd/bindings
.PHONY: inspect-dars
inspect-dars:
@echo "Inspecting DARs..."
cd ./contracts && go run ./cmd/inspect -output ./dars/dev/PACKAGE_INFO.md ./dars/dev/*.dar
cd ./contracts && go run ./cmd/inspect -output ./dars/legacy/PACKAGE_INFO.md ./dars/legacy/*.dar
cd ./contracts && go run ./cmd/inspect -output ./dars/released/PACKAGE_INFO.md ./dars/released/*.dar
.PHONY: upgrade-check
upgrade-check:
@echo "Checking Dars for upgradeability..."
dpm upgrade-check --both ./contracts/dars/released/*.dar ./contracts/dars/dev/*.dar
.PHONY: check-frozen-release-artifacts
check-frozen-release-artifacts: ## Fail if the branch changes frozen release DARs or legacy v1_* bindings.
@chmod +x ./contracts/scripts/check-frozen-release-artifacts.sh
@./contracts/scripts/check-frozen-release-artifacts.sh
.PHONY: clean-codecs
clean-codecs: ## Remove auto-generated *CodecGen.daml files (regenerated by generate-daml-codecs).
@find contracts -path '*/daml/CCIP/*CodecGen.daml' -not -path '*/.daml/*' -delete 2>/dev/null || true
.PHONY: contracts
contracts: clean-codecs compile-contracts inspect-dars upgrade-check generate-bindings
.PHONY: go-generate
go-generate:
go run github.com/jmank88/gomods@v0.1.7 -go generate ./...
.PHONY: gomodtidy
gomodtidy: ## Run go mod tidy on all modules.
go run github.com/jmank88/gomods@v0.1.7 tidy
.PHONY: test-daml-contracts
test-daml-contracts:
cd ./contracts && go run ./cmd/test --root .
# GolangCI-Lint targets
.PHONY: golangci-lint-main golangci-lint-authentication golangci-lint-contracts golangci-lint-eds golangci-lint-integration-tests golangci-lint-party-ceremony golangci-lint-party-ceremony-integration-tests golangci-lint-registry-kit
golangci-lint-main: ## Run golangci-lint on the main module.
golangci-lint run
golanci-lint-authentication:
cd authentication && golangci-lint run
golangci-lint-contracts:
cd contracts && golangci-lint run
golanci-lint-eds:
cd eds && golangci-lint run
golangci-lint-integration-tests: ## Run golangci-lint on the integration-tests module.
cd integration-tests && golangci-lint run
golangci-lint-party-ceremony: ## Run golangci-lint on the party-ceremony module.
cd party-ceremony && golangci-lint run
golangci-lint-party-ceremony-integration-tests: ## Run golangci-lint on the party-ceremony/integration-tests module.
cd party-ceremony/integration-tests && golangci-lint run
golangci-lint-registry-kit: ## Run golangci-lint on the registry-kit module.
cd registry-kit && golangci-lint run
.PHONY: golangci-lint-all
golangci-lint-all: golangci-lint-main golangci-lint-authentication golangci-lint-contracts golangci-lint-eds golangci-lint-integration-tests golangci-lint-party-ceremony golangci-lint-party-ceremony-integration-tests golangci-lint-registry-kit ## Run golangci-lint on all modules.
.PHONY: golangci-lint-fix-main golangci-lint-fix-authentication golangci-lint-fix-eds golangci-lint-fix-integration-tests golangci-lint-fix-party-ceremony golangci-lint-fix-party-ceremony-integration-tests golangci-lint-fix-registry-kit
golangci-lint-fix-main: ## Run golangci-lint --fix on the main module.
golangci-lint run --fix
golangci-lint-fix-authentication:
cd authentication && golangci-lint run --fix
golangci-lint-fix-contracts:
cd contracts && golangci-lint run --fix
golangci-lint-fix-eds:
cd eds && golangci-lint run --fix
golangci-lint-fix-integration-tests: ## Run golangci-lint --fix on the integration-tests module.
cd integration-tests && golangci-lint run --fix
golangci-lint-fix-party-ceremony: ## Run golangci-lint --fix on the party-ceremony module.
cd party-ceremony && golangci-lint run --fix
golangci-lint-fix-party-ceremony-integration-tests: ## Run golangci-lint --fix on the party-ceremony/integration-tests module.
cd party-ceremony/integration-tests && golangci-lint run --fix
golangci-lint-fix-registry-kit: ## Run golangci-lint --fix on the registry-kit module.
cd registry-kit && golangci-lint run --fix
.PHONY: golangci-lint-fix-all
golangci-lint-fix-all: golangci-lint-fix-main golangci-lint-fix-authentication golangci-lint-fix-contracts golangci-lint-fix-eds golangci-lint-fix-integration-tests golangci-lint-fix-party-ceremony golangci-lint-fix-party-ceremony-integration-tests golangci-lint-fix-registry-kit ## Run golangci-lint --fix on all modules.
## Run all fix targets.
## Compiles contracts, generates bindings, runs all go generates, runs go mod tidy, and runs golangci-lint --fix on all modules.
.PHONY: fix-all
fix-all: contracts go-generate gomodtidy golangci-lint-fix-all
.PHONY: build-committeeverifier
build-committeeverifier:
docker build -t committeeverifier-canton:latest -f ccip/committee_verifier.Dockerfile .
.PHONY: build-eds
build-eds:
docker build -t canton-eds:latest -f eds/eds.Dockerfile .
## Assuming chainlink-ccv is checked out in ../chainlink-ccv.
.PHONY: build-ccv-images
build-ccv-images:
cd ../chainlink-ccv/build/devenv && just build-docker
.PHONY: start-devenv
start-devenv: build-ccv-images build-committeeverifier build-eds
cd ccip/devenv && go run cmd/ccv/main.go down && go run cmd/ccv/main.go up env-canton-evm.toml
.PHONY: run-e2e-tests
run-e2e-tests:
cd ccip/devenv/tests/e2e && go test -timeout 5m -v -count 1 -run TestEVM2Canton_Basic && go test -timeout 5m -v -count 1 -run 'TestCanton2EVM_(Basic|SendValidation)'
.PHONY: run-canton2evm-load
run-canton2evm-load: ## Canton→EVM WASP load (requires running devenv + env-canton-evm-out.toml).
cd ccip/devenv/tests/load && go test -timeout 15m -v -count 1 -run '^TestCanton2EVM_Load$$'
.PHONY: run-evm2canton-load
run-evm2canton-load: ## EVM→Canton WASP load (requires running devenv + env-canton-evm-out.toml).
cd ccip/devenv/tests/load && go test -timeout 15m -v -count 1 -run '^TestEVM2Canton_Load$$'
.PHONY: run-evm2canton-load-prod
run-evm2canton-load-prod: ## EVM→Canton WASP load on prod-testnet (Canton TestNet + Sepolia; set CANTON_* and PRIVATE_KEY).
cd ccip/devenv/tests/load && CCIP_CONFIG_FILE=env-prod-testnet.ci.toml go test -tags=prodledger -timeout 45m -v -count 1 -ccip-env=prod-testnet -run '^TestEVM2Canton_Load$$'
.PHONY: run-canton2evm-load-prod
run-canton2evm-load-prod: ## Canton→EVM WASP load on prod-testnet (send-only; set CANTON_* and PRIVATE_KEY).
cd ccip/devenv/tests/load && CCIP_CONFIG_FILE=env-prod-testnet.ci.toml CANTON_LOAD_SKIP_EXEC_CONFIRM=true go test -tags=prodledger -timeout 30m -v -count=1 \
-ccip-env=prod-testnet -run '^TestCanton2EVM_Load$$'
.PHONY: run-canton2evm-token-load
run-canton2evm-token-load: ## Canton→EVM token WASP load (requires running devenv + env-canton-evm-out.toml).
cd ccip/devenv/tests/load && go test -timeout 20m -v -count 1 -run '^TestCanton2EVM_TokenLoad$$'
.PHONY: run-evm2canton-token-load
run-evm2canton-token-load: ## EVM→Canton token WASP load (requires running devenv + env-canton-evm-out.toml).
cd ccip/devenv/tests/load && go test -timeout 20m -v -count 1 -run '^TestEVM2Canton_TokenLoad$$'
.PHONY: run-canton2evm-token-load-prod
run-canton2evm-token-load-prod: ## Canton→EVM token WASP load on prod-testnet (set CANTON_* and PRIVATE_KEY).
cd ccip/devenv/tests/load && CCIP_CONFIG_FILE=env-prod-testnet.ci.toml go test -tags=prodledger -timeout 30m -v -count=1 \
-ccip-env=prod-testnet -run '^TestCanton2EVM_TokenLoad$$'
.PHONY: run-evm2canton-token-load-prod
run-evm2canton-token-load-prod: ## EVM→Canton token WASP load on prod-testnet (set CANTON_* and PRIVATE_KEY).
cd ccip/devenv/tests/load && CCIP_CONFIG_FILE=env-prod-testnet.ci.toml go test -tags=prodledger -timeout 45m -v -count=1 \
-ccip-env=prod-testnet -run '^TestEVM2Canton_TokenLoad$$'
.PHONY: run-evm2canton-token-e2e-prod
run-evm2canton-token-e2e-prod: ## EVM→Canton token e2e on prod-testnet.
cd ccip/devenv/tests/e2e && CCIP_CONFIG_FILE=env-prod-testnet.ci.toml go test -tags=prodledger -timeout 15m -v -count=1 \
-ccip-env=prod-testnet \
-run '^TestEVM2Canton_Basic$/^token_transfer$$'
.PHONY: run-canton2evm-token-e2e-prod
run-canton2evm-token-e2e-prod: ## Canton→EVM token e2e on prod-testnet.
cd ccip/devenv/tests/e2e && CCIP_CONFIG_FILE=env-prod-testnet.ci.toml go test -tags=prodledger -timeout 15m -v -count=1 \
-ccip-env=prod-testnet \
-run '^TestCanton2EVM_Basic$/^EOA receiver and default committee verifier token transfer$$'
.PHONY: build-run-e2e-tests
build-run-e2e-tests: start-devenv run-e2e-tests
.PHONY: mocks
mocks:
go run github.com/vektra/mockery/v3@v3.8.1
.PHONY: git-generated-merge-config
git-generated-merge-config:
echo 'bindings/generated/** merge=ours' >> .git/info/attributes
echo 'contracts/dars/** merge=ours' >> .git/info/attributes
git config --local merge.ours.driver true