2018-10-22 09:36:23 -07:00
|
|
|
//! *A crate for implementing Zcash light clients.*
|
|
|
|
//!
|
|
|
|
//! `zcash_client_backend` contains Rust structs and traits for creating shielded Zcash
|
|
|
|
//! light clients.
|
2024-01-03 12:14:41 -08:00
|
|
|
//!
|
|
|
|
//! ## Feature flags
|
|
|
|
#![doc = document_features::document_features!()]
|
|
|
|
//!
|
2018-10-22 09:36:23 -07:00
|
|
|
|
2024-01-04 11:03:11 -08:00
|
|
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
|
|
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
2019-09-24 02:31:04 -07:00
|
|
|
// Catch documentation errors caused by code changes.
|
2022-07-29 14:56:44 -07:00
|
|
|
#![deny(rustdoc::broken_intra_doc_links)]
|
2021-03-26 22:54:29 -07:00
|
|
|
// Temporary until we have addressed all Result<T, ()> cases.
|
|
|
|
#![allow(clippy::result_unit_err)]
|
2019-09-24 02:31:04 -07:00
|
|
|
|
2024-01-14 09:47:26 -08:00
|
|
|
pub use zcash_keys::address;
|
2020-07-22 19:44:06 -07:00
|
|
|
pub mod data_api;
|
2019-11-27 07:45:13 -08:00
|
|
|
mod decrypt;
|
2024-01-14 09:47:26 -08:00
|
|
|
pub use zcash_keys::encoding;
|
2022-09-26 09:59:50 -07:00
|
|
|
pub mod fees;
|
2024-01-14 09:47:26 -08:00
|
|
|
pub use zcash_keys::keys;
|
2018-10-12 10:22:58 -07:00
|
|
|
pub mod proto;
|
2022-08-18 15:45:45 -07:00
|
|
|
pub mod scan;
|
2023-07-01 17:16:23 -07:00
|
|
|
pub mod scanning;
|
2018-10-12 10:24:25 -07:00
|
|
|
pub mod wallet;
|
2020-10-15 06:03:40 -07:00
|
|
|
pub mod zip321;
|
2019-11-27 07:45:13 -08:00
|
|
|
|
2023-09-11 16:02:42 -07:00
|
|
|
#[cfg(feature = "unstable-serialization")]
|
|
|
|
pub mod serialization;
|
|
|
|
|
2023-10-31 09:03:37 -07:00
|
|
|
use std::fmt;
|
|
|
|
|
2022-09-26 09:59:50 -07:00
|
|
|
pub use decrypt::{decrypt_transaction, DecryptedOutput, TransferType};
|
2022-11-09 07:13:34 -08:00
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
#[macro_use]
|
|
|
|
extern crate assert_matches;
|
2023-10-31 09:03:37 -07:00
|
|
|
|
2024-01-03 08:17:24 -08:00
|
|
|
/// A shielded transfer protocol known to the wallet.
|
2023-10-31 09:03:37 -07:00
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
|
|
|
pub enum ShieldedProtocol {
|
|
|
|
/// The Sapling protocol
|
|
|
|
Sapling,
|
|
|
|
/// The Orchard protocol
|
|
|
|
Orchard,
|
|
|
|
}
|
|
|
|
|
|
|
|
/// A value pool to which the wallet supports sending transaction outputs.
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
|
|
|
pub enum PoolType {
|
|
|
|
/// The transparent value pool
|
|
|
|
Transparent,
|
|
|
|
/// A shielded value pool.
|
|
|
|
Shielded(ShieldedProtocol),
|
|
|
|
}
|
|
|
|
|
|
|
|
impl fmt::Display for PoolType {
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
|
|
match self {
|
|
|
|
PoolType::Transparent => f.write_str("Transparent"),
|
|
|
|
PoolType::Shielded(ShieldedProtocol::Sapling) => f.write_str("Sapling"),
|
|
|
|
PoolType::Shielded(ShieldedProtocol::Orchard) => f.write_str("Orchard"),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|