From 334442c505b8b814ef59977dce570fc559739c7a Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Wed, 17 Mar 2021 09:21:10 -0600 Subject: [PATCH] Address comments from review. --- zcash_client_sqlite/src/lib.rs | 2 +- zcash_client_sqlite/src/wallet.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zcash_client_sqlite/src/lib.rs b/zcash_client_sqlite/src/lib.rs index 02e141f9d..22825b5a2 100644 --- a/zcash_client_sqlite/src/lib.rs +++ b/zcash_client_sqlite/src/lib.rs @@ -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. diff --git a/zcash_client_sqlite/src/wallet.rs b/zcash_client_sqlite/src/wallet.rs index ff6b0c283..c9e74cb88 100644 --- a/zcash_client_sqlite/src/wallet.rs +++ b/zcash_client_sqlite/src/wallet.rs @@ -261,7 +261,7 @@ pub fn get_balance_at

( } } -/// 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

(wdb: &WalletDB

, id_note: i64) -> Result( &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, + 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(())