Skip to content

Commit

Permalink
Enhancing public interface (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
kroist authored Feb 27, 2024
1 parent cee6f97 commit 54e2c32
Show file tree
Hide file tree
Showing 31 changed files with 8,347 additions and 5,941 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: cargo install cargo-contract --version 4.0.0-rc.2

- name: Run checks for `shielder/contract`
run: cd shielder/ && make check-shielder
run: cd shielder/ && make check

- name: Run tests for `shielder/contract`
run: cd shielder/ && make tests
42 changes: 35 additions & 7 deletions shielder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,27 @@
help: # Show help for each of the Makefile recipes.
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done

.PHONY: check-shielder
check-shielder: ## Run cargo checks on shielder contract.
.PHONY: check-contract
check-contract: ## Run cargo checks on shielder contract.
@echo "Checking shielder contract" ; \
cargo clippy --manifest-path contract/Cargo.toml -- -D warnings ; \
cargo clippy --all-targets --manifest-path contract/Cargo.toml -- -D warnings ; \
cargo fmt --quiet --all --check --manifest-path contract/Cargo.toml ; \

.PHONY: check-mocked-zk
check-mocked-zk: ## Run cargo checks on mocked relations.
@echo "Checking shielder mocked relations" ; \
cargo clippy --all-targets --manifest-path mocked_zk/Cargo.toml -- -D warnings ; \
cargo fmt --quiet --all --check --manifest-path mocked_zk/Cargo.toml ; \

.PHONY: check-drink-tests
check-drink-tests: ## Run cargo checks on drink tests.
@echo "Checking shielder drink tests" ; \
cargo clippy --all-targets --manifest-path drink_tests/Cargo.toml -- -D warnings ; \
cargo fmt --quiet --all --check --manifest-path drink_tests/Cargo.toml ; \


.PHONY: check
check: check-contract check-mocked-zk check-drink-tests ## Run cargo checks

.PHONY: build-psp22
build-psp22: ## Builds psp22 contracts.
Expand All @@ -25,10 +40,23 @@ build-shielder: ## Builds shielder contracts.
.PHONY: setup-tests
setup-tests: build-psp22 build-shielder ## Builds contracts and generates wrappers.

.PHONY: tests
tests: setup-tests ## Runs tests for contract.
@echo "Running drink tests" ; \
.PHONY: shielder-unit-tests
shielder-unit-tests: ## Runs unit tests for contract.
@echo "Running shielder unit tests" ; \
cargo test --quiet --manifest-path contract/Cargo.toml --release -- --nocapture ; \

.PHONY: mocked-zk-unit-tests
mocked-zk-unit-tests: ## Runs unit tests for contract.
@echo "Running mocked_zk unit tests" ; \
cargo test --quiet --manifest-path mocked_zk/Cargo.toml --release -- --nocapture ; \

.PHONY: shielder-drink-tests
shielder-drink-tests: setup-tests ## Runs drink tests for contract.
@echo "Running shielder drink tests" ; \
cargo test --quiet --manifest-path drink_tests/Cargo.toml --release -- --nocapture ; \

.PHONY: tests
tests: shielder-unit-tests mocked-zk-unit-tests shielder-drink-tests ## Runs tests for contract.

.PHONY:
all: check-shielder tests
all: check tests
Loading

0 comments on commit 54e2c32

Please sign in to comment.