Skip to content

Commit

Permalink
commit example files
Browse files Browse the repository at this point in the history
  • Loading branch information
collinc97 committed Aug 8, 2023
1 parent 7714f55 commit d654182
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 52 deletions.
13 changes: 12 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@ keywords = [
"zero-knowledge"
]
categories = [ "compilers", "cryptography", "web-programming" ]
include = [ "Cargo.toml", "leo", "README.md", "LICENSE.md" ]
include = [
"Cargo.toml",
"leo",
"README.md",
"LICENSE.md",
"examples/lottery/inputs/lottery.in",
"examples/lottery/src/main.leo",
"examples/tictactoe/inputs/tictactoe.in",
"examples/tictactoe/src/main.leo",
"examples/token/inputs/token.in",
"examples/token/src/main.leo",
]
license = "GPL-3.0"
edition = "2021"

Expand Down
34 changes: 25 additions & 9 deletions leo/cli/commands/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,41 @@ impl Example {

fn main_file_string(&self) -> String {
match self {
Self::Lottery => include_str!("../../../examples/lottery/src/main.leo").to_string(),
Self::TicTacToe => include_str!("../../../examples/tictactoe/src/main.leo").to_string(),
Self::Token => include_str!("../../../examples/token/src/main.leo").to_string(),
Self::Lottery => {
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/examples/lottery/src/main.leo")).to_string()
}
Self::TicTacToe => {
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/examples/tictactoe/src/main.leo")).to_string()
}
Self::Token => {
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/examples/token/src/main.leo")).to_string()
}
}
}

fn input_file_string(&self) -> String {
match self {
Self::Lottery => include_str!("../../../examples/lottery/inputs/lottery.in").to_string(),
Self::TicTacToe => include_str!("../../../examples/tictactoe/inputs/tictactoe.in").to_string(),
Self::Token => include_str!("../../../examples/token/inputs/token.in").to_string(),
Self::Lottery => {
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/examples/lottery/inputs/lottery.in")).to_string()
}
Self::TicTacToe => {
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/examples/tictactoe/inputs/tictactoe.in")).to_string()
}
Self::Token => {
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/examples/token/inputs/token.in")).to_string()
}
}
}

fn readme_file_string(&self) -> String {
match self {
Self::Lottery => include_str!("../../../examples/lottery/README.md").to_string(),
Self::TicTacToe => include_str!("../../../examples/tictactoe/README.md").to_string(),
Self::Token => include_str!("../../../examples/token/README.md").to_string(),
Self::Lottery => {
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/examples/lottery/README.md")).to_string()
}
Self::TicTacToe => {
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/examples/tictactoe/README.md")).to_string()
}
Self::Token => include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/examples/token/README.md")).to_string(),
}
}
}
42 changes: 0 additions & 42 deletions leo/package/src/example.rs

This file was deleted.

0 comments on commit d654182

Please sign in to comment.