Skip to content

Refactor: Clap attribute macros from #[clap(...)] to #[arg(...)] and #[command(...)] in v4.x #1809

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

Open
wants to merge 5 commits into
base: testnet
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions batcher/aligned-task-sender/src/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ use clap::ValueEnum;
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct TaskSenderArgs {
#[clap(subcommand)]
#[command(subcommand)]
pub command: TaskSenderCommands,
}

#[derive(Subcommand, Debug)]
pub enum TaskSenderCommands {
#[clap(about = "Genere proofs")]
#[command(about = "Genere proofs")]
GenerateProofs(GenerateProofsArgs),
#[clap(about = "Open socket connections with batcher")]
#[command(about = "Open socket connections with batcher")]
TestConnections(TestConnectionsArgs),
#[clap(about = "Send infinite proofs from a private-keys file")]
#[command(about = "Send infinite proofs from a private-keys file")]
SendInfiniteProofs(SendInfiniteProofsArgs),
#[clap(about = "Generates wallets and funds it in aligned from one wallet")]
#[command(about = "Generates wallets and funds it in aligned from one wallet")]
GenerateAndFundWallets(GenerateAndFundWalletsArgs),
}

Expand Down
21 changes: 9 additions & 12 deletions batcher/aligned/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@ use crate::AlignedCommands::VerifyProofOnchain;
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct AlignedArgs {
#[clap(subcommand)]
#[command(subcommand)]
pub command: AlignedCommands,
}

#[allow(clippy::large_enum_variant)]
#[derive(Subcommand, Debug)]
pub enum AlignedCommands {
#[clap(about = "Submit proof to the batcher")]
#[command(about = "Submit proof to the batcher")]
Submit(SubmitArgs),
#[clap(about = "Verify the proof was included in a verified batch on Ethereum")]
#[command(about = "Verify the proof was included in a verified batch on Ethereum")]
VerifyProofOnchain(VerifyProofOnchainArgs),
#[clap(about = "Get commitment for file", name = "get-vk-commitment")]
#[command(about = "Get commitment for file", name = "get-vk-commitment")]
GetVkCommitment(GetVkCommitmentArgs),
#[clap(
#[command(
about = "Deposits Ethereum in the batcher to pay for proofs",
name = "deposit-to-batcher"
)]
DepositToBatcher(DepositToBatcherArgs),
#[clap(about = "Get user balance from the batcher", name = "get-user-balance")]
#[command(about = "Get user balance from the batcher", name = "get-user-balance")]
GetUserBalance(GetUserBalanceArgs),
#[clap(about = "Get user nonce from the batcher", name = "get-user-nonce")]
#[command(about = "Get user nonce from the batcher", name = "get-user-nonce")]
GetUserNonce(GetUserNonceArgs),
}

Expand Down Expand Up @@ -219,6 +219,7 @@ pub struct GetUserNonceArgs {
}

#[derive(Debug, Clone, ValueEnum, Copy)]
#[value_enum(rename_all = "PascalCase")]
enum NetworkArg {
Devnet,
Holesky,
Expand All @@ -238,16 +239,12 @@ impl From<NetworkArg> for Network {
}

#[derive(Debug, Clone, ValueEnum)]
#[value_enum(rename_all = "PascalCase")]
pub enum ProvingSystemArg {
#[clap(name = "GnarkPlonkBls12_381")]
GnarkPlonkBls12_381,
#[clap(name = "GnarkPlonkBn254")]
GnarkPlonkBn254,
#[clap(name = "Groth16Bn254")]
Groth16Bn254,
#[clap(name = "SP1")]
SP1,
#[clap(name = "Risc0")]
Risc0,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ const ANVIL_PRIVATE_KEY: &str =

#[derive(Debug, Clone, ValueEnum, PartialEq)]
pub enum ProvingSystemArg {
#[clap(name = "SP1")]
#[value_enum(rename = "SP1")]
SP1,
#[clap(name = "Risc0")]
#[value_enum(rename = "Risc0")]
Risc0,
}

Expand Down