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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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