leo/.circleci/leo-check-constraints.sh

17 lines
530 B
Bash
Raw Normal View History

2021-03-29 10:57:37 +03:00
# leo new hello-world
2021-03-29 23:20:41 +03:00
cd ./project/examples/pedersen-hash
2021-03-29 10:57:37 +03:00
export PEDERSEN_HASH_CONSTRAINTS=1539;
2021-03-29 10:57:37 +03:00
# line that we're searching for is:
# `Build Number of constraints - 1539`
export ACTUAL_CONSTRAINTS=$($LEO build | grep constraints | awk '{print $NF}')
2021-03-29 10:57:37 +03:00
# if else expression with only else block
[[ PEDERSEN_HASH_CONSTRAINTS -eq ACTUAL_CONSTRAINTS ]] || {
2021-03-29 10:57:37 +03:00
echo >&2 "Number of constraints for Pedersen Hash is not $PEDERSEN_HASH_CONSTRAINTS";
echo >&2 "Real number of constraints is $ACTUAL_CONSTRAINTS";
2021-03-29 10:57:37 +03:00
exit 1;
}