zcash_client_backend: Renamed `DecryptedNote` to `DecryptedOutput`
This commit is contained in:
parent
74c036e870
commit
820e048898
|
@ -11,8 +11,8 @@ use memuse::DynamicUsage;
|
||||||
use zcash_note_encryption::{batch, BatchDomain, Domain, ShieldedOutput, COMPACT_NOTE_SIZE};
|
use zcash_note_encryption::{batch, BatchDomain, Domain, ShieldedOutput, COMPACT_NOTE_SIZE};
|
||||||
use zcash_primitives::{block::BlockHash, transaction::TxId};
|
use zcash_primitives::{block::BlockHash, transaction::TxId};
|
||||||
|
|
||||||
/// A decrypted note.
|
/// A decrypted transaction output.
|
||||||
pub(crate) struct DecryptedNote<A, D: Domain> {
|
pub(crate) struct DecryptedOutput<A, D: Domain> {
|
||||||
/// The tag corresponding to the incoming viewing key used to decrypt the note.
|
/// The tag corresponding to the incoming viewing key used to decrypt the note.
|
||||||
pub(crate) ivk_tag: A,
|
pub(crate) ivk_tag: A,
|
||||||
/// The recipient of the note.
|
/// The recipient of the note.
|
||||||
|
@ -21,7 +21,7 @@ pub(crate) struct DecryptedNote<A, D: Domain> {
|
||||||
pub(crate) note: D::Note,
|
pub(crate) note: D::Note,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A, D: Domain> fmt::Debug for DecryptedNote<A, D>
|
impl<A, D: Domain> fmt::Debug for DecryptedOutput<A, D>
|
||||||
where
|
where
|
||||||
A: fmt::Debug,
|
A: fmt::Debug,
|
||||||
D::IncomingViewingKey: fmt::Debug,
|
D::IncomingViewingKey: fmt::Debug,
|
||||||
|
@ -30,7 +30,7 @@ where
|
||||||
D::Memo: fmt::Debug,
|
D::Memo: fmt::Debug,
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_struct("DecryptedNote")
|
f.debug_struct("DecryptedOutput")
|
||||||
.field("ivk_tag", &self.ivk_tag)
|
.field("ivk_tag", &self.ivk_tag)
|
||||||
.field("recipient", &self.recipient)
|
.field("recipient", &self.recipient)
|
||||||
.field("note", &self.note)
|
.field("note", &self.note)
|
||||||
|
@ -46,7 +46,7 @@ struct OutputIndex<V> {
|
||||||
value: V,
|
value: V,
|
||||||
}
|
}
|
||||||
|
|
||||||
type OutputItem<A, D> = OutputIndex<DecryptedNote<A, D>>;
|
type OutputItem<A, D> = OutputIndex<DecryptedOutput<A, D>>;
|
||||||
|
|
||||||
/// The sender for the result of batch scanning a specific transaction output.
|
/// The sender for the result of batch scanning a specific transaction output.
|
||||||
struct OutputReplier<A, D: Domain>(OutputIndex<channel::Sender<OutputItem<A, D>>>);
|
struct OutputReplier<A, D: Domain>(OutputIndex<channel::Sender<OutputItem<A, D>>>);
|
||||||
|
@ -307,7 +307,7 @@ where
|
||||||
if let Some(((note, recipient), ivk_idx)) = decryption_result {
|
if let Some(((note, recipient), ivk_idx)) = decryption_result {
|
||||||
let result = OutputIndex {
|
let result = OutputIndex {
|
||||||
output_index: replier.output_index,
|
output_index: replier.output_index,
|
||||||
value: DecryptedNote {
|
value: DecryptedOutput {
|
||||||
ivk_tag: tags[ivk_idx].clone(),
|
ivk_tag: tags[ivk_idx].clone(),
|
||||||
recipient,
|
recipient,
|
||||||
note,
|
note,
|
||||||
|
@ -487,7 +487,7 @@ where
|
||||||
&mut self,
|
&mut self,
|
||||||
block_tag: BlockHash,
|
block_tag: BlockHash,
|
||||||
txid: TxId,
|
txid: TxId,
|
||||||
) -> HashMap<(TxId, usize), DecryptedNote<A, D>> {
|
) -> HashMap<(TxId, usize), DecryptedOutput<A, D>> {
|
||||||
self.pending_results
|
self.pending_results
|
||||||
.remove(&ResultKey(block_tag, txid))
|
.remove(&ResultKey(block_tag, txid))
|
||||||
// We won't have a pending result if the transaction didn't have outputs of
|
// We won't have a pending result if the transaction didn't have outputs of
|
||||||
|
|
|
@ -524,13 +524,13 @@ pub(crate) fn scan_block_with_runner<
|
||||||
let mut decrypted = runner.collect_results(cur_hash, txid);
|
let mut decrypted = runner.collect_results(cur_hash, txid);
|
||||||
(0..decoded.len())
|
(0..decoded.len())
|
||||||
.map(|i| {
|
.map(|i| {
|
||||||
decrypted.remove(&(txid, i)).map(|d_note| {
|
decrypted.remove(&(txid, i)).map(|d_out| {
|
||||||
let a = d_note.ivk_tag.0;
|
let a = d_out.ivk_tag.0;
|
||||||
let nk = vks.get(&d_note.ivk_tag).expect(
|
let nk = vks.get(&d_out.ivk_tag).expect(
|
||||||
"The batch runner and scan_block must use the same set of IVKs.",
|
"The batch runner and scan_block must use the same set of IVKs.",
|
||||||
);
|
);
|
||||||
|
|
||||||
(d_note.note, a, d_note.ivk_tag.1, (*nk).clone())
|
(d_out.note, a, d_out.ivk_tag.1, (*nk).clone())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
|
|
Loading…
Reference in New Issue