mirror of
https://github.com/AleoHQ/leo.git
synced 2024-09-11 15:05:33 +03:00
Update examples and CI
This commit is contained in:
parent
829a1e801e
commit
5fea268d04
@ -4,7 +4,7 @@ ls -la
|
||||
cd foo && ls -la
|
||||
|
||||
# Run `leo run`.
|
||||
$LEO run || exit
|
||||
$LEO run main 0u32 1u32 || exit
|
||||
|
||||
# Assert that the 'build' folder exists.
|
||||
if [ "$(ls -A build)" ]; then
|
||||
|
@ -4,11 +4,10 @@
|
||||
ls -la
|
||||
cd lottery && ls -la
|
||||
|
||||
# Run the play function.
|
||||
$LEO run play || exit
|
||||
|
||||
# Execute the play function.
|
||||
$LEO execute play || exit
|
||||
# Run the script.
|
||||
chmod +x ./run.sh || exit
|
||||
export -f leo
|
||||
./run.sh || exit
|
||||
)
|
||||
|
||||
(
|
||||
@ -17,14 +16,10 @@
|
||||
ls -la
|
||||
cd tictactoe && ls -la
|
||||
|
||||
# Create a new game.
|
||||
$LEO run new || exit
|
||||
|
||||
# Run the make_move function.
|
||||
$LEO run make_move || exit
|
||||
|
||||
# Execute the make_move function.
|
||||
$LEO execute make_move || exit
|
||||
# Run the script.
|
||||
chmod +x ./run.sh || exit
|
||||
export -f leo
|
||||
./run.sh || exit
|
||||
)
|
||||
|
||||
(
|
||||
@ -33,9 +28,8 @@
|
||||
ls -la
|
||||
cd token && ls -la
|
||||
|
||||
# Run the mint_public function.
|
||||
$LEO run mint_public || exit
|
||||
|
||||
# Execute the mint_public function.
|
||||
$LEO execute mint_public || exit
|
||||
# Run the script.
|
||||
chmod +x ./run.sh || exit
|
||||
export -f leo
|
||||
./run.sh || exit
|
||||
)
|
||||
|
@ -20,7 +20,7 @@ do
|
||||
done
|
||||
|
||||
# Try to run `leo run`.
|
||||
$LEO run || exit
|
||||
$LEO run main 0u32 1u32 || exit
|
||||
|
||||
# Remove the dummy program.
|
||||
cd .. && rm -rf dummy
|
||||
|
@ -4,242 +4,242 @@ leo() {
|
||||
$LEO "$@"
|
||||
}
|
||||
|
||||
## 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 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..."
|
||||
|
@ -18,13 +18,10 @@ include = [
|
||||
"leo",
|
||||
"README.md",
|
||||
"LICENSE.md",
|
||||
"examples/lottery/inputs/lottery.in",
|
||||
"examples/lottery/src/main.leo",
|
||||
"examples/lottery/run.sh",
|
||||
"examples/tictactoe/inputs/tictactoe.in",
|
||||
"examples/tictactoe/src/main.leo",
|
||||
"examples/tictactoe/run.sh",
|
||||
"examples/token/inputs/token.in",
|
||||
"examples/token/src/main.leo",
|
||||
"examples/token/run.sh"
|
||||
]
|
||||
|
@ -87,7 +87,7 @@ leo new helloworld
|
||||
cd helloworld
|
||||
|
||||
# build & setup & prove & verify
|
||||
leo run
|
||||
leo run main 0u32 1u32
|
||||
```
|
||||
|
||||
The `leo new` command creates a new Leo project with a given name.
|
||||
|
@ -4,14 +4,14 @@
|
||||
|
||||
To run this program, run:
|
||||
```bash
|
||||
leo run bubble_sort
|
||||
leo run bubble_sort <inputs>
|
||||
```
|
||||
|
||||
## Execute Guide
|
||||
|
||||
To execute this program, run:
|
||||
```bash
|
||||
leo execute bubble_sort
|
||||
leo execute bubble_sort <inputs>
|
||||
```
|
||||
|
||||
## Overview
|
||||
|
@ -4,12 +4,12 @@
|
||||
|
||||
To run this program, run:
|
||||
```bash
|
||||
leo run main
|
||||
leo run main <inputs>
|
||||
```
|
||||
|
||||
## Execute Guide
|
||||
|
||||
To execute this program, run:
|
||||
```bash
|
||||
leo execute main
|
||||
leo execute main <inputs>
|
||||
```
|
||||
|
@ -4,17 +4,17 @@
|
||||
|
||||
To run this program, run:
|
||||
```bash
|
||||
leo run fibonacci
|
||||
leo run fibonacci <inputs>
|
||||
```
|
||||
|
||||
## Execute Guide
|
||||
|
||||
To execute this program, run:
|
||||
```bash
|
||||
leo execute fibonacci
|
||||
leo execute fibonacci <inputs>
|
||||
```
|
||||
|
||||
## Overview
|
||||
This example shows how to calculate Fibonacci number using the [fast-doubling method](https://math.stackexchange.com/questions/1124590/need-help-understanding-fibonacci-fast-doubling-proof).
|
||||
|
||||
It takes the input data from `inputs/fibonacci.in`
|
||||
It takes the input data from `inputs/fibonacci.in`
|
||||
|
@ -4,14 +4,14 @@
|
||||
|
||||
To run this program, run:
|
||||
```bash
|
||||
leo run main
|
||||
leo run main <inputs>
|
||||
```
|
||||
|
||||
## Execute Guide
|
||||
|
||||
To execute this program, run:
|
||||
```bash
|
||||
leo execute main
|
||||
leo execute main <inputs>
|
||||
```
|
||||
|
||||
## Overview
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
To compile and run this Leo program, run:
|
||||
```bash
|
||||
leo run
|
||||
leo run <function-name> <inputs>
|
||||
```
|
||||
|
||||
## The Algorithm
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
To compile and run this Leo program, run:
|
||||
```bash
|
||||
leo run
|
||||
leo run <function-name> <inputs>
|
||||
```
|
||||
|
||||
## The Algorithm
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
To compile and run this Leo program, run:
|
||||
```bash
|
||||
leo run
|
||||
leo run <function-name> <inputs>
|
||||
```
|
||||
|
||||
## The Algorithm
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
To compile and run this Leo program, run:
|
||||
```bash
|
||||
leo run
|
||||
leo run <function-name> <inputs>
|
||||
```
|
||||
|
||||
## The Algorithm
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
To compile and run this Leo program, run:
|
||||
```bash
|
||||
leo run
|
||||
leo run <function-name> <inputs>
|
||||
```
|
||||
|
||||
## The Algorithm
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
To compile and run this Leo program, run:
|
||||
```bash
|
||||
leo run
|
||||
leo run <function-name> <inputs>
|
||||
```
|
||||
## The Algorithm
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
To compile and run this Leo program, run:
|
||||
```bash
|
||||
leo run
|
||||
leo run <function-name> <inputs>
|
||||
```
|
||||
|
||||
## The Algorithm
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
To compile and run this Leo program, run:
|
||||
```bash
|
||||
leo run
|
||||
leo run <function-name> <inputs>
|
||||
```
|
||||
|
||||
## The Algorithm
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
To run this program, run:
|
||||
```bash
|
||||
leo run main
|
||||
leo run <function-name> <inputs>
|
||||
```
|
||||
|
||||
## Execute Guide
|
||||
@ -18,4 +18,4 @@ leo execute main
|
||||
|
||||
This example shows how to sum two u32 numbers.
|
||||
|
||||
It takes the input data from inputs/helloworld.in
|
||||
It takes the input data from inputs/helloworld.in
|
||||
|
@ -6,7 +6,7 @@ This program provides utilities for calculating interest over a fixed or bounded
|
||||
|
||||
To run this program, run:
|
||||
```bash
|
||||
leo run <function_name>
|
||||
leo run <function-name> <inputs>
|
||||
```
|
||||
where `<function_name>` is one of the following:
|
||||
* `fixed_iteration_interest`
|
||||
@ -18,10 +18,10 @@ Be sure to update `inputs/interest.in` with the desired inputs.
|
||||
|
||||
To execute this program, run:
|
||||
```bash
|
||||
leo execute <function_name>
|
||||
leo execute <function_name> <inputs>
|
||||
```
|
||||
where `<function_name>` is one of the following:
|
||||
* `fixed_iteration_interest`
|
||||
* `bounded_iteration_interest`
|
||||
|
||||
Be sure to update `inputs/interest.in` with the desired inputs.
|
||||
Be sure to update `inputs/interest.in` with the desired inputs.
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
To run this program, run:
|
||||
```bash
|
||||
leo run play
|
||||
leo run play <inputs>
|
||||
|
||||
or
|
||||
|
||||
@ -15,5 +15,5 @@ or
|
||||
|
||||
To execute this program, run:
|
||||
```bash
|
||||
leo execute play
|
||||
leo execute play <inputs>
|
||||
```
|
||||
|
@ -5,12 +5,12 @@ A basic example showing how to declare a struct in the Leo language.
|
||||
|
||||
To run this program, run:
|
||||
```bash
|
||||
leo run main
|
||||
leo run main <inputs>
|
||||
```
|
||||
|
||||
## Execute Guide
|
||||
|
||||
To execute this program, run:
|
||||
```bash
|
||||
leo execute main
|
||||
leo execute main <inputs>
|
||||
```
|
||||
|
@ -4,14 +4,14 @@
|
||||
|
||||
To run this program, run:
|
||||
```bash
|
||||
leo run mint
|
||||
leo run transfer # update private key first
|
||||
leo run mint <mint-inputs>
|
||||
leo run transfer <transfer-inputs> # update private key first
|
||||
```
|
||||
|
||||
## Execute Guide
|
||||
|
||||
To execute this program, run:
|
||||
```bash
|
||||
leo execute mint
|
||||
leo execute transfer # update private key first
|
||||
leo execute mint <mint-inputs>
|
||||
leo execute transfer <transfer-inputs> # update private key first
|
||||
```
|
||||
|
@ -4,12 +4,12 @@
|
||||
|
||||
To run this program, run:
|
||||
```bash
|
||||
leo run main
|
||||
leo run main <inputs>
|
||||
```
|
||||
|
||||
## Execute Guide
|
||||
|
||||
To execute this program, run:
|
||||
```bash
|
||||
leo execute main
|
||||
leo execute main <inputs>
|
||||
```
|
||||
|
@ -33,7 +33,7 @@ Anyone can issue a new proposal publicly by calling `propose` function.
|
||||
Run `propose`:
|
||||
|
||||
```
|
||||
leo run propose
|
||||
leo run propose <inputs>
|
||||
```
|
||||
|
||||
Output sample:
|
||||
@ -62,7 +62,7 @@ and can only be used(voted) by the ticket `owner`.
|
||||
Run `new_ticket`:
|
||||
|
||||
```
|
||||
leo run new_ticket
|
||||
leo run new_ticket <inputs>
|
||||
```
|
||||
|
||||
Output sample:
|
||||
@ -84,11 +84,11 @@ Since the ticket record can be used as an input privately, the voter's privacy i
|
||||
Run `agree`:
|
||||
|
||||
```
|
||||
leo run agree
|
||||
leo run agree <inputs>
|
||||
```
|
||||
|
||||
Run `disagree`:
|
||||
|
||||
```
|
||||
leo run disagree
|
||||
leo run disagree <inputs>
|
||||
```
|
||||
|
@ -1 +1 @@
|
||||
"{ title: 2077160157502449938194577302446444field.private, content: 1452374294790018907888397545906607852827800436field.private, proposer: aleo1kkk52quhnxgn2nfrcd9jqk7c9x27c23f2wvw7fyzcze56yahvcgszgttu2.private }"
|
||||
"{ title: 2077160157502449938194577302446444field, content: 1452374294790018907888397545906607852827800436field, proposer: aleo1kkk52quhnxgn2nfrcd9jqk7c9x27c23f2wvw7fyzcze56yahvcgszgttu2 }"
|
||||
|
Loading…
Reference in New Issue
Block a user