From e499cc319ab32ba6968f4c31615c3d16405e6844 Mon Sep 17 00:00:00 2001 From: Dzejkop Date: Wed, 2 Oct 2024 15:35:42 +0200 Subject: [PATCH] WIP: toolkit --- world-chain-builder/Cargo.lock | 36 +++++++++++++++++++++++++++++- world-chain-builder/Cargo.toml | 8 ++++++- world-chain-builder/bin/toolkit.rs | 28 +++++++++++++++++++++++ 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 world-chain-builder/bin/toolkit.rs diff --git a/world-chain-builder/Cargo.lock b/world-chain-builder/Cargo.lock index cc7dd80c..7934321e 100644 --- a/world-chain-builder/Cargo.lock +++ b/world-chain-builder/Cargo.lock @@ -3464,7 +3464,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -9514,6 +9514,39 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "test-case" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2550dd13afcd286853192af8601920d959b14c401fcece38071d53bf0768a8" +dependencies = [ + "test-case-macros", +] + +[[package]] +name = "test-case-core" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "test-case-macros" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", + "test-case-core", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -11151,6 +11184,7 @@ dependencies = [ "strum", "strum_macros", "tempfile", + "test-case", "thiserror", "tikv-jemallocator", "tokio", diff --git a/world-chain-builder/Cargo.toml b/world-chain-builder/Cargo.toml index 1722ebe2..7d8e8b5c 100644 --- a/world-chain-builder/Cargo.toml +++ b/world-chain-builder/Cargo.toml @@ -3,7 +3,7 @@ name = "world-chain-builder" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +default-run = "world-chain-builder" [dependencies] # reth @@ -61,6 +61,7 @@ op-alloy-network = "0.2" alloy-consensus = "0.3" alloy-network = "0.3" alloy-primitives = "0.8" +# alloy-provider = "0.3" alloy-rpc-types-eth = "0.3" alloy-rpc-types = "0.3" alloy-rlp = "0.3" @@ -92,6 +93,7 @@ tikv-jemallocator = { version = "0.6.0", optional = true } [dev-dependencies] tempfile = "3" +test-case = "3" ethers-core = { git = "https://github.com/gakonst/ethers-rs", default-features = false } reth-provider = { git = "https://github.com/ewoolsey/reth", rev = "b2848f", features = [ "test-utils", @@ -107,3 +109,7 @@ jemalloc = ["tikv-jemallocator"] [[bin]] name = "world-chain-builder" path = "bin/world-chain-builder.rs" + +[[bin]] +name = "toolkit" +path = "bin/toolkit.rs" diff --git a/world-chain-builder/bin/toolkit.rs b/world-chain-builder/bin/toolkit.rs new file mode 100644 index 00000000..8dffbce4 --- /dev/null +++ b/world-chain-builder/bin/toolkit.rs @@ -0,0 +1,28 @@ +use clap::Parser; + +#[derive(Debug, Clone, Parser)] +struct Args { + #[clap(subcommand)] + cmd: Cmd, +} + +#[derive(Debug, Clone, Parser)] +enum Cmd { + Prove(ProveArgs), +} + +#[derive(Debug, Clone, Parser)] +struct ProveArgs { + #[clap(short, long)] + tx_index: usize, +} + +#[tokio::main] +async fn main() -> eyre::Result<()> { + dotenvy::dotenv().ok(); + + let args = Args::parse(); + println!("{:?}", args); + + Ok(()) +}