zakura-client-backend 0.1.0-rc2

APIs for creating shielded Zcash light clients
Documentation
//! *A crate for implementing Zcash light clients.*
//!
//! `zcash_client_backend` contains Rust structs and traits for creating shielded Zcash
//! light clients.
//!
//! # Design
//!
//! ## Wallet sync
//!
//! The APIs in the [`data_api::chain`] module can be used to implement the following
//! synchronization flow:
//!
//! ```text
//!                          ┌─────────────┐  ┌─────────────┐
//!                          │Get required │  │   Update    │
//!                          │subtree root │─▶│subtree roots│
//!                          │    range    │  └─────────────┘
//!                          └─────────────┘         │
//!//!                                             ┌─────────┐
//!                                             │ Update  │
//!           ┌────────────────────────────────▶│chain tip│◀──────┐
//!           │                                 └─────────┘       │
//!           │                                      │            │
//!           │                                      ▼            │
//!    ┌─────────────┐        ┌────────────┐  ┌─────────────┐     │
//!    │  Truncate   │        │Split range │  │Get suggested│     │
//!    │  wallet to  │        │into batches│◀─│ scan ranges │     │
//!    │rewind height│        └────────────┘  └─────────────┘     │
//!    └─────────────┘               │                            │
//!           ▲                     ╱│╲                           │
//!           │      ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─              │
//!      ┌────────┐         ┌───────────────┐       │             │
//!      │ Choose │  │      │Download blocks│                     │
//!      │ rewind │         │   to cache    │       │             │
//!      │ height │  │      └───────────────┘           .───────────────────.
//!      └────────┘                 │               │  ( Scan ranges updated )
//!           ▲      │              ▼                   `───────────────────'
//!           │               ┌───────────┐         │             ▲
//!  .───────────────┴─.      │Scan cached│    .─────────.        │
//! ( Continuity error  )◀────│  blocks   │──▶(  Success  )───────┤
//!  `───────────────┬─'      └───────────┘    `─────────'        │
//!                                 │               │             │
//!                  │       ┌──────┴───────┐                     │
//!                          ▼              ▼       │             ▼
//!                  │┌─────────────┐┌─────────────┐  ┌──────────────────────┐
//!                   │Delete blocks││   Enhance   ││ │Update wallet balance │
//!                  ││ from cache  ││transactions │  │  and sync progress   │
//!                   └─────────────┘└─────────────┘│ └──────────────────────┘
//!                  └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
//! ```
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
//!

#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, doc(auto_cfg))]
// Catch documentation errors caused by code changes.
#![deny(rustdoc::broken_intra_doc_links)]

pub mod data_api;
mod decrypt;
pub mod fees;
pub mod proposal;
pub mod proto;
pub mod scan;
pub mod scanning;
pub mod wallet;

#[cfg(any(feature = "sync", feature = "sync-decryptor"))]
pub mod sync;

#[cfg(feature = "unstable-serialization")]
pub mod serialization;

#[cfg(feature = "sync-decryptor")]
mod task;

#[cfg(feature = "tor")]
pub mod tor;

pub use decrypt::{DecryptedOutput, TransferType, decrypt_transaction};

#[deprecated(note = "This module is deprecated; use `::zcash_keys::address` instead.")]
pub mod address {
    pub use zcash_keys::address::*;
}
#[deprecated(note = "This module is deprecated; use `::zcash_keys::encoding` instead.")]
pub mod encoding {
    pub use zcash_keys::encoding::*;
}
#[deprecated(note = "This module is deprecated; use `::zcash_keys::keys` instead.")]
pub mod keys {
    pub use zcash_keys::keys::*;
}
#[deprecated(note = "use ::zcash_protocol::PoolType instead")]
pub type PoolType = zcash_protocol::PoolType;
#[deprecated(note = "use ::zcash_protocol::ShieldedPool instead")]
pub type ShieldedPool = zcash_protocol::ShieldedPool;
#[deprecated(note = "This module is deprecated; use the `zip321` crate instead.")]
pub mod zip321 {
    pub use zip321::*;
}

#[cfg(test)]
#[macro_use]
extern crate assert_matches;