Address comments from review.

This commit is contained in:
Kris Nuttycombe 2021-03-17 09:21:10 -06:00
parent 8a84203685
commit 334442c505
2 changed files with 6 additions and 6 deletions

View File

@ -486,7 +486,7 @@ impl<'a, P: consensus::Parameters> WalletWrite for DataConnStmtCache<'a, P> {
sent_tx.account,
sent_tx.recipient_address,
sent_tx.value,
&sent_tx.memo,
sent_tx.memo.as_ref(),
)?;
// Return the row number of the transaction, so the caller can fetch it for sending.

View File

@ -261,7 +261,7 @@ pub fn get_balance_at<P>(
}
}
/// Returns the memo for a received note, if it is known and a valid UTF-8 string.
/// Returns the memo for a received note.
///
/// The note is identified by its row index in the `received_notes` table within the wdb
/// database.
@ -294,7 +294,7 @@ pub fn get_received_memo<P>(wdb: &WalletDB<P>, id_note: i64) -> Result<Memo, Sql
.map_err(SqliteClientError::from)
}
/// Returns the memo for a sent note, if it is known and a valid UTF-8 string.
/// Returns the memo for a sent note.
///
/// The note is identified by its row index in the `sent_notes` table within the wdb
/// database.
@ -693,7 +693,7 @@ pub fn put_sent_note<'a, P: consensus::Parameters>(
&RecipientAddress::Shielded(output.to.clone()),
Amount::from_u64(output.note.value)
.map_err(|_| SqliteClientError::CorruptedData("Note value invalid.".to_string()))?,
&Some(output.memo.clone()),
Some(&output.memo),
)?
}
@ -707,7 +707,7 @@ pub fn insert_sent_note<'a, P: consensus::Parameters>(
account: AccountId,
to: &RecipientAddress,
value: Amount,
memo: &Option<MemoBytes>,
memo: Option<&MemoBytes>,
) -> Result<(), SqliteClientError> {
let to_str = to.encode(&stmts.wallet_db.params);
let ivalue: i64 = value.into();
@ -717,7 +717,7 @@ pub fn insert_sent_note<'a, P: consensus::Parameters>(
account.0,
to_str,
ivalue,
memo.as_ref().map(|m| m.as_slice().to_vec()),
memo.map(|m| m.as_slice().to_vec()),
])?;
Ok(())