-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cli): validate hex key provided to
wallet create --key
- Loading branch information
1 parent
0677189
commit 1379c33
Showing
3 changed files
with
13 additions
and
0 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 |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
|
||
mod acc_packet; | ||
mod files; | ||
pub mod utils; | ||
|
||
pub use acc_packet::AccountPacket; | ||
pub use files::{ | ||
|
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,4 @@ | ||
/// Returns whether a hex string is a valid secret key in hex format. | ||
pub fn is_valid_key_hex(hex: &str) -> bool { | ||
hex.len() == 64 && hex.chars().all(|c| c.is_ascii_hexdigit()) | ||
} |