Parse compact blocks to find wallet transactions

This commit is contained in:
Jack Grigg
2018-10-12 18:24:25 +01:00
parent af7e263bcc
commit 591b1fc28f
5 changed files with 244 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
//! Structs representing transaction data scanned from the block chain by a wallet or
//! light client.
use pairing::bls12_381::{Bls12, Fr};
use zcash_primitives::{
jubjub::{edwards, PrimeOrder},
transaction::TxId,
};
pub struct EncCiphertextFrag(pub [u8; 52]);
/// A subset of a [`Transaction`] relevant to wallets and light clients.
///
/// [`Transaction`]: zcash_primitives::transaction::Transaction
pub struct WalletTx {
pub txid: TxId,
pub num_spends: usize,
pub num_outputs: usize,
pub shielded_outputs: Vec<WalletShieldedOutput>,
}
/// A subset of an [`OutputDescription`] relevant to wallets and light clients.
///
/// [`OutputDescription`]: zcash_primitives::transaction::components::OutputDescription
pub struct WalletShieldedOutput {
pub index: usize,
pub cmu: Fr,
pub epk: edwards::Point<Bls12, PrimeOrder>,
pub enc_ct: EncCiphertextFrag,
pub account: usize,
pub value: u64,
}