Skip to content

Commit

Permalink
docs(cli): minor changes to cli comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bochaco committed Feb 2, 2024
1 parent 24f0c3c commit 99bcf72
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 4 additions & 1 deletion sn_cli/src/subcommands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ use clap::Subcommand;
#[derive(Subcommand, Debug)]
pub(super) enum SubCmd {
#[clap(name = "wallet", subcommand)]
/// Commands for wallet management
/// Commands for a hot-wallet management.
/// A hot-wallet holds the secret key, thus it can be used for signing transfers/transactions.
Wallet(wallet::hot_wallet::WalletCmds),
#[clap(name = "wowallet", subcommand)]
/// Commands for watch-only wallet management
/// A watch-only wallet holds only the public key, thus it cannot be used for signing
/// transfers/transactions, but only to query balances and broadcast offline signed transactions.
WatchOnlyWallet(wallet::wo_wallet::WatchOnlyWalletCmds),
#[clap(name = "files", subcommand)]
/// Commands for file management
Expand Down
3 changes: 1 addition & 2 deletions sn_cli/src/subcommands/wallet/wo_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ pub enum WatchOnlyWalletCmds {
#[clap(name = "to")]
to: String,
},
/// Broadcast a transaction that was signed offline.
/// This command will create the cash note for the recipient and broadcast it to the network.
///
/// This command will create the cash note for the recipient.
/// This cash note can then be shared with the recipient, who can then
/// use the 'deposit' command to use/claim the funds.
Broadcast {
Expand Down
8 changes: 4 additions & 4 deletions sn_transfers/src/transfers/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ impl Transfer {
/// Creates a Transfer from the given cash_note
/// This Transfer can be sent safely to the recipients as all data in it is encrypted
/// The recipients can then decrypt the data and use it to verify and reconstruct the CashNote
pub fn transfer_from_cash_note(cash_note: &CashNote) -> Result<Transfer> {
pub fn transfer_from_cash_note(cash_note: &CashNote) -> Result<Self> {
let recipient = cash_note.main_pubkey;
let u = CashNoteRedemption::from_cash_note(cash_note)?;
let t = Transfer::create(vec![u], recipient)
let t = Self::create(vec![u], recipient)
.map_err(|_| Error::CashNoteRedemptionEncryptionFailed)?;
Ok(t)
}

/// This function is used to create a Network Royalties Transfer from a CashNote
/// can be done offline, and sent to the recipient.
/// Note that this type of transfer is not encrypted
pub(crate) fn royalties_transfer_from_cash_note(cash_note: &CashNote) -> Result<Transfer> {
pub(crate) fn royalties_transfer_from_cash_note(cash_note: &CashNote) -> Result<Self> {
let cnr = CashNoteRedemption::from_cash_note(cash_note)?;
Ok(Self::NetworkRoyalties(vec![cnr]))
}
Expand Down Expand Up @@ -108,7 +108,7 @@ impl Transfer {
pub fn from_hex(hex: &str) -> Result<Self> {
let mut bytes = hex::decode(hex).map_err(|_| Error::TransferDeserializationFailed)?;
bytes.reverse();
let transfer: Transfer =
let transfer: Self =
rmp_serde::from_slice(&bytes).map_err(|_| Error::TransferDeserializationFailed)?;
Ok(transfer)
}
Expand Down

0 comments on commit 99bcf72

Please sign in to comment.