1- all :
1+ SECRETCLI = docker exec -it secretdev /usr/bin/secretcli
2+
3+ .PHONY : all
4+ all : clippy test
5+
6+ .PHONY : check
7+ check :
8+ cargo check
9+
10+ .PHONY : check-receiver
11+ check-receiver :
12+ $(MAKE ) -C tests/example-receiver check
13+
14+ .PHONY : clippy
15+ clippy :
16+ cargo clippy
17+
18+ .PHONY : clippy-receiver
19+ clippy-receiver :
20+ $(MAKE ) -C tests/example-receiver clippy
21+
22+ .PHONY : test
23+ test : unit-test unit-test-receiver integration-test
24+
25+ .PHONY : unit-test
26+ unit-test :
27+ cargo test
28+
29+ .PHONY : unit-test-receiver
30+ unit-test-receiver :
31+ $(MAKE ) -C tests/example-receiver unit-test
32+
33+ .PHONY : integration-test
34+ integration-test : compile-optimized compile-optimized-receiver
35+ tests/integration.sh
36+
37+ compile-optimized-receiver :
38+ $(MAKE ) -C tests/example-receiver compile-optimized
39+
40+ .PHONY : list-code
41+ list-code :
42+ $(SECRETCLI ) query compute list-code
43+
44+ .PHONY : compile _compile
45+ compile : _compile contract.wasm.gz
46+ _compile :
47+ cargo build --target wasm32-unknown-unknown --locked
48+ cp ./target/wasm32-unknown-unknown/debug/* .wasm ./contract.wasm
49+
50+ .PHONY : compile-optimized _compile-optimized
51+ compile-optimized : _compile-optimized contract.wasm.gz
52+ _compile-optimized :
253 RUSTFLAGS=' -C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --locked
3- # # The following line is not necessary, may work only on linux (extra size optimization)
54+ @ # The following line is not necessary, may work only on linux (extra size optimization)
455 wasm-opt -Os ./target/wasm32-unknown-unknown/release/* .wasm -o ./contract.wasm
5- cat ./contract.wasm | gzip -9 > ./contract.wasm.gz
656
57+ .PHONY : compile-optimized-reproducible
58+ compile-optimized-reproducible :
59+ docker run --rm -v " $$ (pwd)" :/contract \
60+ --mount type=volume,source=" $$ (basename " $$(pwd ) " )_cache" ,target=/code/target \
61+ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
62+ enigmampc/secret-contract-optimizer:1.0.3
63+
64+ contract.wasm.gz : contract.wasm
65+ cat ./contract.wasm | gzip -9 > ./contract.wasm.gz
66+
67+ .PHONY : start-server
68+ start-server : # CTRL+C to stop
69+ docker run -it --rm \
70+ -p 26657:26657 -p 26656:26656 -p 1317:1317 \
71+ -v $$(pwd ) :/root/code \
72+ --name secretdev enigmampc/secret-network-sw-dev:v1.0.2
73+
74+ .PHONY : schema
75+ schema :
76+ cargo run --example schema
77+
78+ .PHONY : clean
779clean :
880 cargo clean
9- -rm -f ./contract.wasm ./contract.wasm.gz
81+ rm -f ./contract.wasm ./contract.wasm.gz
82+ $(MAKE ) -C tests/example-receiver clean
0 commit comments