2019-09-10 13:27:10 -07:00
|
|
|
//! Blockchain-related datastructures for Zebra. 🦓
|
2020-02-26 21:10:08 -08:00
|
|
|
|
|
|
|
#![doc(html_logo_url = "https://www.zfnd.org/images/zebra-icon.png")]
|
|
|
|
#![doc(html_root_url = "https://doc.zebra.zfnd.org/zebra_chain")]
|
2019-09-10 13:27:10 -07:00
|
|
|
#![deny(missing_docs)]
|
2020-07-14 20:21:06 -07:00
|
|
|
#![allow(clippy::try_err)]
|
2019-09-10 13:27:10 -07:00
|
|
|
|
2020-03-10 16:44:19 -07:00
|
|
|
#[macro_use]
|
|
|
|
extern crate serde;
|
|
|
|
|
2019-09-24 22:14:48 -07:00
|
|
|
mod merkle_tree;
|
2020-06-15 15:08:14 -07:00
|
|
|
mod serde_helpers;
|
2019-09-24 22:14:48 -07:00
|
|
|
mod sha256d_writer;
|
|
|
|
|
2020-03-05 17:19:10 -08:00
|
|
|
pub mod addresses;
|
2019-09-10 13:27:10 -07:00
|
|
|
pub mod block;
|
2019-09-26 19:38:18 -07:00
|
|
|
pub mod equihash_solution;
|
2020-02-25 15:14:59 -08:00
|
|
|
pub mod keys;
|
2019-09-25 23:23:04 -07:00
|
|
|
pub mod note_commitment_tree;
|
2020-04-19 11:45:25 -07:00
|
|
|
pub mod notes;
|
2020-07-01 17:57:32 -07:00
|
|
|
pub mod nullifier;
|
2019-12-05 12:56:58 -08:00
|
|
|
pub mod proofs;
|
2019-09-19 07:45:37 -07:00
|
|
|
pub mod serialization;
|
|
|
|
pub mod transaction;
|
2019-09-10 13:27:10 -07:00
|
|
|
pub mod types;
|
2019-12-12 11:23:19 -08:00
|
|
|
|
2020-06-06 15:10:32 -07:00
|
|
|
pub use ed25519_zebra;
|
2019-12-12 11:23:19 -08:00
|
|
|
pub use redjubjub;
|
2020-03-12 16:34:34 -07:00
|
|
|
|
2020-03-12 18:02:23 -07:00
|
|
|
#[cfg(test)]
|
|
|
|
use proptest_derive::Arbitrary;
|
|
|
|
|
2020-07-06 17:37:32 -07:00
|
|
|
#[cfg(test)]
|
|
|
|
pub mod test;
|
|
|
|
|
2020-03-12 16:34:34 -07:00
|
|
|
/// An enum describing the possible network choices.
|
|
|
|
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)]
|
2020-03-12 18:02:23 -07:00
|
|
|
#[cfg_attr(test, derive(Arbitrary))]
|
2020-03-12 16:34:34 -07:00
|
|
|
pub enum Network {
|
|
|
|
/// The production mainnet.
|
|
|
|
Mainnet,
|
|
|
|
/// The testnet.
|
|
|
|
Testnet,
|
|
|
|
}
|
2020-04-14 23:43:24 -07:00
|
|
|
|
|
|
|
impl Default for Network {
|
|
|
|
fn default() -> Self {
|
|
|
|
Network::Mainnet
|
|
|
|
}
|
|
|
|
}
|