Skip to content

Commit

Permalink
build(blockifier_reexecution): add main for tests via cli commands (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aner-starkware authored Oct 27, 2024
1 parent 3dbef1c commit ea50d56
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/blockifier_reexecution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ blockifier.workspace = true
cairo-lang-starknet-classes.workspace = true
cairo-lang-utils.workspace = true
cairo-vm.workspace = true
clap = { workspace = true, features = ["cargo", "derive"] }
flate2.workspace = true
indexmap = { workspace = true, features = ["serde"] }
papyrus_execution.workspace = true
Expand Down
39 changes: 39 additions & 0 deletions crates/blockifier_reexecution/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
use clap::{Args, Parser, Subcommand};

/// BlockifierReexecution CLI.
#[derive(Debug, Parser)]
#[clap(name = "blockifier-reexecution-cli", version)]
pub struct BlockifierReexecutionCliArgs {
#[clap(flatten)]
global_options: GlobalOptions,

#[clap(subcommand)]
command: Command,
}

#[derive(Debug, Subcommand)]
enum Command {
/// Runs the RPC test.
RpcTest {
/// Node url.
/// Default: https://free-rpc.nethermind.io/mainnet-juno/. Won't work for big tests.
#[clap(long, short = 'n', default_value = "https://free-rpc.nethermind.io/mainnet-juno/")]
node_url: String,

/// Block number.
#[clap(long, short = 'b')]
block_number: u64,
},
}

#[derive(Debug, Args)]
struct GlobalOptions {}

/// Main entry point of the blockifier reexecution CLI.
fn main() {
let args = BlockifierReexecutionCliArgs::parse();

match args.command {
Command::RpcTest { .. } => todo!(), // TODO(Aner): Move the RPC test logic here.
}
}

0 comments on commit ea50d56

Please sign in to comment.