-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cli): merge argument parsing and command execution
- Loading branch information
1 parent
2da3a48
commit f90d3e3
Showing
25 changed files
with
1,142 additions
and
1,136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
pub(crate) mod collect; | ||
pub(crate) mod submit; | ||
|
||
use clap::Subcommand; | ||
use color_eyre::eyre; | ||
|
||
/// Interact with a Sequencer node | ||
#[expect( | ||
clippy::large_enum_variant, | ||
reason = "these are fire-and-forget types that are instantiated once and consumed, so | ||
that their size does not matter" | ||
)] | ||
#[derive(Debug, clap::Args)] | ||
pub(super) struct Args { | ||
#[command(subcommand)] | ||
command: Command, | ||
} | ||
|
||
impl Args { | ||
pub(super) async fn run(self) -> eyre::Result<()> { | ||
match self.command { | ||
Command::CollectWithdrawals(args) => args.run().await, | ||
Command::SubmitWithdrawals(args) => args.run().await, | ||
} | ||
} | ||
} | ||
|
||
#[derive(Debug, Subcommand)] | ||
enum Command { | ||
/// Commands for interacting with Sequencer accounts | ||
CollectWithdrawals(collect::WithdrawalEventsArgs), | ||
SubmitWithdrawals(submit::WithdrawalEventsArgs), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.