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
|
|
|
|
2021-03-29 23:09:52 +03:00
|
|
|
export PEDERSEN_HASH_CONSTRAINTS=1539;
|
2021-03-29 10:57:37 +03:00
|
|
|
|
2021-03-29 23:09:52 +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
|
|
|
|
2021-03-29 23:09:52 +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";
|
2021-03-29 23:09:52 +03:00
|
|
|
echo >&2 "Real number of constraints is $ACTUAL_CONSTRAINTS";
|
2021-03-29 10:57:37 +03:00
|
|
|
exit 1;
|
2021-03-29 18:44:46 +03:00
|
|
|
}
|