-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the keygen a crate that can be implemented and extended from other places (like a forc-plugin). Upgraded its dependencies to avoid depending on protoc for building
- Loading branch information
Showing
5 changed files
with
71 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,3 @@ | ||
//! Keygen crate | ||
|
||
pub mod keygen; |
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 |
---|---|---|
@@ -1,10 +1,25 @@ | ||
//! A simple keygen cli utility tool for configuring fuel-core | ||
|
||
use clap::Parser; | ||
use fuel_core_keygen::keygen; | ||
|
||
pub mod keygen; | ||
/// Key management utilities for configuring fuel-core | ||
#[derive(Debug, Parser)] | ||
pub(crate) enum Command { | ||
New(keygen::NewKey), | ||
Parse(keygen::ParseSecret), | ||
} | ||
|
||
impl Command { | ||
pub(crate) fn exec(&self) -> anyhow::Result<()> { | ||
match self { | ||
Command::New(cmd) => cmd.exec(), | ||
Command::Parse(cmd) => cmd.exec(), | ||
} | ||
} | ||
} | ||
|
||
fn main() -> anyhow::Result<()> { | ||
let cmd = keygen::Command::parse(); | ||
let cmd = Command::parse(); | ||
cmd.exec() | ||
} |