Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Deprecate] Input files. #2630

Merged
merged 23 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/leo-clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 12 additions & 18 deletions .circleci/leo-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

(
Expand All @@ -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
)

(
Expand All @@ -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
)
2 changes: 1 addition & 1 deletion .circleci/leo-new.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
68 changes: 24 additions & 44 deletions .circleci/test-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ leo() {
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
Expand All @@ -27,9 +24,6 @@ fi
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
Expand Down Expand Up @@ -63,7 +57,7 @@ fi
echo "Building and running the \`bubblesort\` program..."
(
cd $EXAMPLES/bubblesort || exit
$LEO run bubble_sort || exit
$LEO run bubble_sort --file $EXAMPLES/bubblesort/inputs/bubblesort.in || exit
)
# Check that the bubblesort program ran successfully.
EXITCODE=$?
Expand All @@ -76,7 +70,7 @@ fi
echo "Building and running the \`core\` program..."
(
cd $EXAMPLES/core || exit
$LEO run main || exit
$LEO run main --file $EXAMPLES/core/inputs/core.in || exit
)
# Check that the core program ran successfully.
EXITCODE=$?
Expand All @@ -89,7 +83,7 @@ fi
echo "Building and running the \`groups\` program..."
(
cd $EXAMPLES/groups || exit
$LEO run main || exit
$LEO run main --file $EXAMPLES/groups/inputs/groups.in || exit
)
# Check that the groups program ran successfully.
EXITCODE=$?
Expand All @@ -102,7 +96,7 @@ fi
echo "Building and running the \`hackers-delight/ntzdebruijn\` program..."
(
cd $EXAMPLES/hackers-delight/ntzdebruijn || exit
$LEO run || exit
$LEO run main --file $EXAMPLES/hackers-delight/ntzdebruijn/inputs/ntzdebruijn.in || exit
)
# Check that the hackers-delight/ntzdebruijn program ran successfully.
EXITCODE=$?
Expand All @@ -115,7 +109,7 @@ fi
echo "Building and running the \`hackers-delight/ntzgaudet\` program..."
(
cd $EXAMPLES/hackers-delight/ntzgaudet || exit
$LEO run || exit
$LEO run main --file $EXAMPLES/hackers-delight/ntzgaudet/inputs/ntzgaudet.in || exit
)
# Check that the hackers-delight/ntzgaudet program ran successfully.
EXITCODE=$?
Expand All @@ -128,7 +122,7 @@ fi
echo "Building and running the \`hackers-delight/ntzloops\` program..."
(
cd $EXAMPLES/hackers-delight/ntzloops || exit
$LEO run || exit
$LEO run main --file $EXAMPLES/hackers-delight/ntzloops/inputs/ntzloops.in || exit
)
# Check that the hackers-delight/ntzloops program ran successfully.
EXITCODE=$?
Expand All @@ -141,7 +135,7 @@ fi
echo "Building and running the \`hackers-delight/ntzmasks\` program..."
(
cd $EXAMPLES/hackers-delight/ntzmasks || exit
$LEO run || exit
$LEO run main --file $EXAMPLES/hackers-delight/ntzmasks/inputs/ntzmasks.in || exit
)
# Check that the hackers-delight/ntzmasks program ran successfully.
EXITCODE=$?
Expand All @@ -154,7 +148,7 @@ fi
echo "Building and running the \`hackers-delight/ntzreisers\` program..."
(
cd $EXAMPLES/hackers-delight/ntzreisers || exit
$LEO run || exit
$LEO run main --file $EXAMPLES/hackers-delight/ntzreisers/inputs/ntzreisers.in || exit
)
# Check that the hackers-delight/ntzreisers program ran successfully.
EXITCODE=$?
Expand All @@ -167,7 +161,7 @@ fi
echo "Building and running the \`hackers-delight/ntzseals\` program..."
(
cd $EXAMPLES/hackers-delight/ntzseals || exit
$LEO run || exit
$LEO run main --file $EXAMPLES/hackers-delight/ntzseals/inputs/ntzseals.in || exit
)
# Check that the hackers-delight/ntzseals program ran successfully.
EXITCODE=$?
Expand All @@ -180,7 +174,7 @@ fi
echo "Building and running the \`hackers-delight/ntzsearchtree\` program..."
(
cd $EXAMPLES/hackers-delight/ntzsearchtree || exit
$LEO run || exit
$LEO run main --file $EXAMPLES/hackers-delight/ntzsearchtree/inputs/ntzsearchtree.in || exit
)
# Check that the hackers-delight/ntzsearchtree program ran successfully.
EXITCODE=$?
Expand All @@ -193,7 +187,7 @@ fi
echo "Building and running the \`hackers-delight/ntzsmallvals\` program..."
(
cd $EXAMPLES/hackers-delight/ntzsmallvals || exit
$LEO run || exit
$LEO run main --file $EXAMPLES/hackers-delight/ntzsmallvals/inputs/ntzsmallvals.in || exit
)
# Check that the hackers-delight/ntzsmallvals program ran successfully.
EXITCODE=$?
Expand All @@ -206,7 +200,7 @@ fi
echo "Building and running the \`helloworld\` program..."
(
cd $EXAMPLES/helloworld || exit
$LEO run main || exit
$LEO run main --file $EXAMPLES/helloworld/inputs/helloworld.in || exit
)
# Check that the helloworld program ran successfully.
EXITCODE=$?
Expand All @@ -222,10 +216,10 @@ echo "Building and running the \`interest\` programs..."
cd $EXAMPLES/interest || exit

# Run the fixed period interest program.
$LEO run fixed_iteration_interest || exit
$LEO run fixed_iteration_interest --file $EXAMPLES/interest/inputs/fixed.in || exit

# Run the bounded period interest program.
$LEO run bounded_iteration_interest || exit
$LEO run bounded_iteration_interest --file $EXAMPLES/interest/inputs/bounded.in || exit
)
# Check that the interest programs ran successfully.
EXITCODE=$?
Expand All @@ -238,7 +232,7 @@ fi
echo "Building and running the \`message\` program..."
(
cd $EXAMPLES/message || exit
$LEO run main || exit
$LEO run main --file $EXAMPLES/message/inputs/message.in || exit
)
# Check that the message program ran successfully.
EXITCODE=$?
Expand All @@ -252,7 +246,7 @@ echo "Building and running the \`tictactoe\` program..."
(
cd $EXAMPLES/tictactoe || exit
$LEO run new || exit
$LEO run make_move || exit
$LEO run make_move --file $EXAMPLES/tictactoe/inputs/tictactoe.in || exit

chmod +x $EXAMPLES/tictactoe/run.sh || exit
export -f leo
Expand All @@ -271,10 +265,10 @@ echo "Building and running the \`simple_token\` programs..."
cd $EXAMPLES/simple_token || exit

# Run the mint program.
$LEO run mint
$LEO run mint --file $EXAMPLES/simple_token/inputs/mint.in || exit

# Run the transfer program.
$LEO run transfer
$LEO run transfer --file $EXAMPLES/simple_token/inputs/transfer.in || exit
)
# Check that the simple token programs ran successfully.
EXITCODE=$?
Expand All @@ -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=$?
Expand All @@ -317,7 +297,7 @@ fi
echo "Building and running the \`twoadicity\` program..."
(
cd $EXAMPLES/twoadicity || exit
$LEO run main || exit
$LEO run main --file $EXAMPLES/twoadicity/inputs/twoadicity.in || exit
)
# Check that the two-adicity program ran successfully.
EXITCODE=$?
Expand All @@ -332,7 +312,7 @@ echo "Building and running the \`vote\` program..."
cd $EXAMPLES/vote || exit

chmod +x $EXAMPLES/vote/run.sh || exit
export -f leo
export -f leo || exit
$EXAMPLES/vote/run.sh || exit
)
# Check that the vote program ran successfully.
Expand All @@ -356,4 +336,4 @@ EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
echo "The \`lottery\` program failed to run successfully."
exit $EXITCODE
fi
fi
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
29 changes: 0 additions & 29 deletions compiler/ast/src/input/definition.rs

This file was deleted.

Loading
Loading