From d0c9c90451ada9f1d27a963c6bb026920b8cebe3 Mon Sep 17 00:00:00 2001 From: damirka Date: Mon, 29 Mar 2021 10:57:37 +0300 Subject: [PATCH] adds constraint check (falsy) --- .circleci/config.yml | 13 +++++++++++++ .circleci/leo-check-constraints.sh | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 .circleci/leo-check-constraints.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index b8dd6eeddb..3da311c667 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -158,6 +158,19 @@ jobs: export LEO=/home/circleci/project/project/bin/leo ./project/.circleci/leo-add-remove.sh + leo-check-constraints: + docker: + - image: cimg/rust:1.50.0 + resource_class: xlarge + steps: + - attach_workspace: + at: /home/circleci/project/ + - run: + name: leo check constraints for Pedersen Hash + command: | + export LEO=/home/circleci/project/project/bin/leo + ./project/.circleci/leo-check-constraints.sh + leo-login-logout: docker: - image: cimg/rust:1.50.0 diff --git a/.circleci/leo-check-constraints.sh b/.circleci/leo-check-constraints.sh new file mode 100755 index 0000000000..398674d001 --- /dev/null +++ b/.circleci/leo-check-constraints.sh @@ -0,0 +1,17 @@ +# leo new hello-world + +cd examples/pedersen-hash + +PEDERSEH_HASH_CONSTRAINTS=1539 + +# 1. build +# 2. find lines with constraint number +# 3. find lines with $PEDERSEH_HASH_CONSTRAINTS +# 4. count lines +# 4.Er if result is 0 -> constraint number changed +# 4.Ok if result is 1 -> all good + +[[ $($LEO build | grep "Number of constraints" | grep $PEDERSEH_HASH_CONSTRAINTS | wc -l) -eq 0 ]] || { + echo >&2 "Number of constraints for Pedersen Hash is not $PEDERSEN_HASH_CONSTRAINTS"; + exit 1; +}