Skip to content

Commit

Permalink
doc: comment send-to-many outputs parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-da committed Jul 12, 2024
1 parent 4f1f026 commit a70adbc
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/bin/neptune-cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,26 @@ struct TransactionOutput {
amount: NeptuneCoins,
}

/// We impl FromStr deserialization so that clap can parse the --outputs arg of
/// send-to-many command.
///
/// We do not bother with serialization via `impl Display` because that is
/// not presently needed and would just be unused code.
impl FromStr for TransactionOutput {
type Err = anyhow::Error;

// parses address:amount into TransactionOutput{address, amount}
/// parses address:amount into TransactionOutput{address, amount}
///
/// This is used by the outputs arg of send-to-many command.
/// Usage looks like:
///
/// <OUTPUTS>... format: address:amount address:amount ...
///
/// So each output is space delimited and the two fields are
/// colon delimted.
///
/// This format was chosen because it should be simple for humans
/// to generate on the command-line.
fn from_str(s: &str) -> Result<Self, Self::Err> {
let parts = s.split(':').collect::<Vec<_>>();

Expand Down

0 comments on commit a70adbc

Please sign in to comment.