Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancing public interface #49

Merged
merged 11 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading