-
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 b640028
Showing
25 changed files
with
1,154 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,28 @@ | ||
pub(crate) mod collect; | ||
pub(crate) mod submit; | ||
|
||
use clap::Subcommand; | ||
use color_eyre::eyre; | ||
|
||
/// Interact with a Sequencer node | ||
#[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.