Update CI and examples

This commit is contained in:
Pranav Gaddamadugu 2023-09-29 12:25:30 -04:00 committed by Pranav Gaddamadugu
parent e8a46b7628
commit 7e145728e0
9 changed files with 256 additions and 292 deletions

View File

@ -4,255 +4,249 @@ leo() {
$LEO "$@"
}
# Build and run the auction Leo program.
echo "Building and running the \`auction\` program..."
(
cd $EXAMPLES/auction || exit
$LEO run place_bid || exit
$LEO run resolve || exit
$LEO run finish || exit
chmod +x $EXAMPLES/auction/run.sh || exit
export -f leo || exit
$EXAMPLES/auction/run.sh || exit
)
# Check that the auction program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`auction\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the basic_bank Leo program.
echo "Building and running the \`basic_bank\` program..."
(
cd $EXAMPLES/basic_bank || exit
$LEO run issue || exit
$LEO run deposit || exit
$LEO run withdraw || exit
chmod +x $EXAMPLES/basic_bank/run.sh || exit
export -f leo || exit
$EXAMPLES/basic_bank/run.sh || exit
)
# Check that the basic_bank program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`basic_bank\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the battleship Leo program.
echo "Building and running the \`battleship\` program..."
which leo
(
cd $EXAMPLES/battleship || exit
chmod +x $EXAMPLES/battleship/run.sh || exit
export -f leo || exit
$EXAMPLES/battleship/run.sh || exit
)
# Check that the battleship program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`battleship\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the bubblesort Leo program.
echo "Building and running the \`bubblesort\` program..."
(
cd $EXAMPLES/bubblesort || exit
$LEO run bubble_sort || exit
)
# Check that the bubblesort program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`bubblesort\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the core example Leo program.
echo "Building and running the \`core\` program..."
(
cd $EXAMPLES/core || exit
$LEO run main || exit
)
# Check that the core program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`core\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the groups example Leo program.
echo "Building and running the \`groups\` program..."
(
cd $EXAMPLES/groups || exit
$LEO run main || exit
)
# Check that the groups program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`groups\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the hackers-delight/ntzdebruijn program.
echo "Building and running the \`hackers-delight/ntzdebruijn\` program..."
(
cd $EXAMPLES/hackers-delight/ntzdebruijn || exit
$LEO run || exit
)
# Check that the hackers-delight/ntzdebruijn program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`hackers-delight/ntzdebruijn\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the hackers-delight/ntzgaudet program.
echo "Building and running the \`hackers-delight/ntzgaudet\` program..."
(
cd $EXAMPLES/hackers-delight/ntzgaudet || exit
$LEO run || exit
)
# Check that the hackers-delight/ntzgaudet program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`hackers-delight/ntzgaudet\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the hackers-delight/ntzloops program.
echo "Building and running the \`hackers-delight/ntzloops\` program..."
(
cd $EXAMPLES/hackers-delight/ntzloops || exit
$LEO run || exit
)
# Check that the hackers-delight/ntzloops program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`hackers-delight/ntzloops\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the hackers-delight/ntzmasks program.
echo "Building and running the \`hackers-delight/ntzmasks\` program..."
(
cd $EXAMPLES/hackers-delight/ntzmasks || exit
$LEO run || exit
)
# Check that the hackers-delight/ntzmasks program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`hackers-delight/ntzmasks\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the hackers-delight/ntzreisers program.
echo "Building and running the \`hackers-delight/ntzreisers\` program..."
(
cd $EXAMPLES/hackers-delight/ntzreisers || exit
$LEO run || exit
)
# Check that the hackers-delight/ntzreisers program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`hackers-delight/ntzreisers\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the hackers-delight/ntzseals program.
echo "Building and running the \`hackers-delight/ntzseals\` program..."
(
cd $EXAMPLES/hackers-delight/ntzseals || exit
$LEO run || exit
)
# Check that the hackers-delight/ntzseals program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`hackers-delight/ntzseals\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the hackers-delight/ntzsearchtree program.
echo "Building and running the \`hackers-delight/ntzsearchtree\` program..."
(
cd $EXAMPLES/hackers-delight/ntzsearchtree || exit
$LEO run || exit
)
# Check that the hackers-delight/ntzsearchtree program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`hackers-delight/ntzsearchtree\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the hackers-delight/ntzsmallvals program.
echo "Building and running the \`hackers-delight/ntzsmallvals\` program..."
(
cd $EXAMPLES/hackers-delight/ntzsmallvals || exit
$LEO run || exit
)
# Check that the hackers-delight/ntzsmallvals program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`hackers-delight/ntzsmallvals\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the helloworld Leo program.
echo "Building and running the \`helloworld\` program..."
(
cd $EXAMPLES/helloworld || exit
$LEO run main || exit
)
# Check that the helloworld program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`helloworld\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the interest example Leo programs.
echo "Building and running the \`interest\` programs..."
(
cd $EXAMPLES/interest || exit
# Run the fixed period interest program.
$LEO run fixed_iteration_interest || exit
# Run the bounded period interest program.
$LEO run bounded_iteration_interest || exit
)
# Check that the interest programs ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`interest\` program failed to run successfully."
exit $EXITCODE
fi
# Build and run the message example Leo program.
echo "Building and running the \`message\` program..."
(
cd $EXAMPLES/message || exit
$LEO run main || exit
)
# Check that the message program ran successfully.
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`message\` program failed to run successfully."
exit $EXITCODE
fi
## Build and run the auction Leo program.
#echo "Building and running the \`auction\` program..."
#(
# cd $EXAMPLES/auction || exit
#
# chmod +x $EXAMPLES/auction/run.sh || exit
# export -f leo || exit
# $EXAMPLES/auction/run.sh || exit
#)
## Check that the auction program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`auction\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the basic_bank Leo program.
#echo "Building and running the \`basic_bank\` program..."
#(
# cd $EXAMPLES/basic_bank || exit
#
# chmod +x $EXAMPLES/basic_bank/run.sh || exit
# export -f leo || exit
# $EXAMPLES/basic_bank/run.sh || exit
#)
## Check that the basic_bank program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`basic_bank\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the battleship Leo program.
#echo "Building and running the \`battleship\` program..."
#which leo
#(
# cd $EXAMPLES/battleship || exit
#
# chmod +x $EXAMPLES/battleship/run.sh || exit
# export -f leo || exit
# $EXAMPLES/battleship/run.sh || exit
#)
## Check that the battleship program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`battleship\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the bubblesort Leo program.
#echo "Building and running the \`bubblesort\` program..."
#(
# cd $EXAMPLES/bubblesort || exit
# cat $EXAMPLES/bubblesort/inputs/bubblesort.in | xargs $LEO run bubble_sort || exit
#)
## Check that the bubblesort program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`bubblesort\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the core example Leo program.
#echo "Building and running the \`core\` program..."
#(
# cd $EXAMPLES/core || exit
# cat $EXAMPLES/core/inputs/core.in | xargs $LEO run main || exit
#)
## Check that the core program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`core\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the groups example Leo program.
#echo "Building and running the \`groups\` program..."
#(
# cd $EXAMPLES/groups || exit
# cat $EXAMPLES/groups/inputs/groups.in | xargs $LEO run main || exit
#)
## Check that the groups program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`groups\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the hackers-delight/ntzdebruijn program.
#echo "Building and running the \`hackers-delight/ntzdebruijn\` program..."
#(
# cd $EXAMPLES/hackers-delight/ntzdebruijn || exit
# cat $EXAMPLES/hackers-delight/ntzdebruijn/inputs/ntzdebruijn.in | xargs $LEO run main || exit
#)
## Check that the hackers-delight/ntzdebruijn program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`hackers-delight/ntzdebruijn\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the hackers-delight/ntzgaudet program.
#echo "Building and running the \`hackers-delight/ntzgaudet\` program..."
#(
# cd $EXAMPLES/hackers-delight/ntzgaudet || exit
# cat $EXAMPLES/hackers-delight/ntzgaudet/inputs/ntzgaudet.in | xargs $LEO run main || exit
#)
## Check that the hackers-delight/ntzgaudet program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`hackers-delight/ntzgaudet\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the hackers-delight/ntzloops program.
#echo "Building and running the \`hackers-delight/ntzloops\` program..."
#(
# cd $EXAMPLES/hackers-delight/ntzloops || exit
# cat $EXAMPLES/hackers-delight/ntzloops/inputs/ntzloops.in | xargs $LEO run main || exit
#)
## Check that the hackers-delight/ntzloops program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`hackers-delight/ntzloops\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the hackers-delight/ntzmasks program.
#echo "Building and running the \`hackers-delight/ntzmasks\` program..."
#(
# cd $EXAMPLES/hackers-delight/ntzmasks || exit
# cat $EXAMPLES/hackers-delight/ntzmasks/inputs/ntzmasks.in | xargs $LEO run main || exit
#)
## Check that the hackers-delight/ntzmasks program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`hackers-delight/ntzmasks\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the hackers-delight/ntzreisers program.
#echo "Building and running the \`hackers-delight/ntzreisers\` program..."
#(
# cd $EXAMPLES/hackers-delight/ntzreisers || exit
# cat $EXAMPLES/hackers-delight/ntzreisers/inputs/ntzreisers.in | xargs $LEO run main || exit
#)
## Check that the hackers-delight/ntzreisers program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`hackers-delight/ntzreisers\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the hackers-delight/ntzseals program.
#echo "Building and running the \`hackers-delight/ntzseals\` program..."
#(
# cd $EXAMPLES/hackers-delight/ntzseals || exit
# cat $EXAMPLES/hackers-delight/ntzseals/inputs/ntzseals.in | xargs $LEO run main || exit
#)
## Check that the hackers-delight/ntzseals program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`hackers-delight/ntzseals\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the hackers-delight/ntzsearchtree program.
#echo "Building and running the \`hackers-delight/ntzsearchtree\` program..."
#(
# cd $EXAMPLES/hackers-delight/ntzsearchtree || exit
# cat $EXAMPLES/hackers-delight/ntzsearchtree/inputs/ntzsearchtree.in | xargs $LEO run main || exit
#)
## Check that the hackers-delight/ntzsearchtree program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`hackers-delight/ntzsearchtree\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the hackers-delight/ntzsmallvals program.
#echo "Building and running the \`hackers-delight/ntzsmallvals\` program..."
#(
# cd $EXAMPLES/hackers-delight/ntzsmallvals || exit
# cat $EXAMPLES/hackers-delight/ntzsmallvals/inputs/ntzsmallvals.in | xargs $LEO run main || exit
#)
## Check that the hackers-delight/ntzsmallvals program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`hackers-delight/ntzsmallvals\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the helloworld Leo program.
#echo "Building and running the \`helloworld\` program..."
#(
# cd $EXAMPLES/helloworld || exit
# cat $EXAMPLES/helloworld/inputs/helloworld.in | xargs $LEO run main || exit
#)
## Check that the helloworld program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`helloworld\` program failed to run successfully."
# exit $EXITCODE
#fi
#
#
## Build and run the interest example Leo programs.
#echo "Building and running the \`interest\` programs..."
#(
# cd $EXAMPLES/interest || exit
#
# # Run the fixed period interest program.
# cat $EXAMPLES/interest/inputs/fixed.in | xargs $LEO run fixed_iteration_interest || exit
#
# # Run the bounded period interest program.
# cat $EXAMPLES/interest/inputs/bounded.in | xargs $LEO run bounded_iteration_interest || exit
#)
## Check that the interest programs ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`interest\` program failed to run successfully."
# exit $EXITCODE
#fi
#
## Build and run the message example Leo program.
#echo "Building and running the \`message\` program..."
#(
# cd $EXAMPLES/message || exit
# cat $EXAMPLES/message/inputs/message.in | xargs $LEO run main || exit
#)
## Check that the message program ran successfully.
#EXITCODE=$?
#if [ $EXITCODE -ne 0 ]; then
# echo "The \`message\` program failed to run successfully."
# exit $EXITCODE
#fi
# Build and run the tic tac toe example Leo program.
echo "Building and running the \`tictactoe\` program..."
(
cd $EXAMPLES/tictactoe || exit
$LEO run new || exit
$LEO run make_move || exit
cat $EXAMPLES/tictactoe/inputs/tictactoe.in | xargs $LEO run make_move || exit
chmod +x $EXAMPLES/tictactoe/run.sh || exit
export -f leo
@ -271,10 +265,10 @@ echo "Building and running the \`simple_token\` programs..."
cd $EXAMPLES/simple_token || exit
# Run the mint program.
$LEO run mint
cat $EXAMPLES/simple_token/inputs/mint.in | xargs $LEO run mint || exit
# Run the transfer program.
$LEO run transfer
cat $EXAMPLES/simple_token/inputs/transfer.in | xargs $LEO run transfer || exit
)
# Check that the simple token programs ran successfully.
EXITCODE=$?
@ -288,23 +282,9 @@ echo "Building and running the \`token\` program..."
(
cd $EXAMPLES/token || exit
# Run the mint_public function.
$LEO run mint_public || exit
# Run the mint_private function.
$LEO run mint_private || exit
# Run the transfer_public function.
$LEO run transfer_public || exit
# Run the transfer_private function.
$LEO run transfer_private || exit
# Run the transfer_private_to_public function.
$LEO run transfer_private_to_public || exit
# Run the transfer_public_to_private function.
$LEO run transfer_public_to_private || exit
chmod +x $EXAMPLES/token/run.sh || exit
export -f leo
$EXAMPLES/token/run.sh || exit
)
# Check that the token program ran successfully.
EXITCODE=$?
@ -317,7 +297,7 @@ fi
echo "Building and running the \`twoadicity\` program..."
(
cd $EXAMPLES/twoadicity || exit
$LEO run main || exit
cat $EXAMPLES/twoadicity/inputs/twoadicity.in | xargs $LEO run main || exit
)
# Check that the two-adicity program ran successfully.
EXITCODE=$?
@ -356,4 +336,4 @@ EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`lottery\` program failed to run successfully."
exit $EXITCODE
fi
fi

View File

@ -1,3 +1 @@
13u32 2u32 4u32 3u32 5u32 10u32 7u32 1u32

View File

@ -1,5 +1 @@
"{
owner: aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau,
amount: 100u64,
_nonce: 0group,
}" aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau 50u64
"{ owner: aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau.private, amount: 100u64.private, _nonce: 0group.public }" aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau 50u64

View File

@ -1,6 +1 @@
1u8 1u8 1u8 "{
r1: Row { c1: 0u8, c2: 0u8, c3: 0u8 },
r2: Row { c1: 0u8, c2: 0u8, c3: 0u8 },
r3: Row { c1: 0u8, c2: 0u8, c3: 0u8 },
}"
1u8 1u8 1u8 "{ r1: { c1: 0u8, c2: 0u8, c3: 0u8 }, r2: { c1: 0u8, c2: 0u8, c3: 0u8 }, r3: { c1: 0u8, c2: 0u8, c3: 0u8 } }"

View File

@ -1,2 +1,4 @@
NETWORK=testnet3
PRIVATE_KEY=APrivateKey1zkpGZsYM8WQJMDDrzeAhB2SB3N9WcGt9Ks6NLBKCWyiMKv8
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR

View File

@ -1,5 +1 @@
"{
owner: aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau,
pid: 2264670486490520844857553240576860973319410481267184439818180411609250173817field,
_nonce: 1637267040221574073903539416642641433705357302885235345311606754421919550724group
}"
"{ owner: aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau.private, pid: 2264670486490520844857553240576860973319410481267184439818180411609250173817field.private, _nonce: 1637267040221574073903539416642641433705357302885235345311606754421919550724group.public }"

View File

@ -0,0 +1 @@
"{ owner: aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau.private, pid: 2264670486490520844857553240576860973319410481267184439818180411609250173817field.private, _nonce: 1637267040221574073903539416642641433705357302885235345311606754421919550724group.public }"

View File

@ -1,5 +1 @@
"{
title: 2077160157502449938194577302446444field,
content: 1452374294790018907888397545906607852827800436field,
proposer: aleo1kkk52quhnxgn2nfrcd9jqk7c9x27c23f2wvw7fyzcze56yahvcgszgttu2,
}"
"{ title: 2077160157502449938194577302446444field.private, content: 1452374294790018907888397545906607852827800436field.private, proposer: aleo1kkk52quhnxgn2nfrcd9jqk7c9x27c23f2wvw7fyzcze56yahvcgszgttu2.private }"

View File

@ -21,7 +21,7 @@ echo "
"
# Run the `propose` program function
(
leo run propose || exit
cat ./inputs/propose.in | xargs leo run propose || exit
)
echo "
@ -39,7 +39,7 @@ echo "
"
# Run the `new_ticket` program function
(
leo run new_ticket || exit
cat ./inputs/new_ticket.in | xargs leo run new_ticket || exit
)
echo "
@ -57,6 +57,6 @@ echo "
"
# Run the `agree` or `disagree` program function
(
leo run agree || exit
# leo run disagree || exit
cat ./inputs/agree.in | xargs leo run agree || exit
#cat ./inputs/disagree.in | xargs leo run disagree || exit
)