Add a Magic type for network magics.
This commit is contained in:
parent
42cb9c1ff9
commit
cf63f00171
|
@ -2,5 +2,14 @@
|
||||||
|
|
||||||
use crate::types::*;
|
use crate::types::*;
|
||||||
|
|
||||||
/// The Zcash version used on mainnet.
|
/// The Zcash network protocol version used on mainnet.
|
||||||
pub const ZCASH_VERSION: Version = Version(170_007);
|
pub const CURRENT_VERSION: Version = Version(170_007);
|
||||||
|
|
||||||
|
/// Magic numbers used to identify different Zcash networks.
|
||||||
|
pub mod magics {
|
||||||
|
use super::*;
|
||||||
|
/// The production mainnet.
|
||||||
|
pub const MAINNET: Magic = Magic(0x6427e924);
|
||||||
|
/// The testnet.
|
||||||
|
pub const TESTNET: Magic = Magic(0xbff91afa);
|
||||||
|
}
|
|
@ -1,8 +1,9 @@
|
||||||
//! Newtype wrappers assigning semantic meaning to primitive types.
|
//! Newtype wrappers assigning semantic meaning to primitive types.
|
||||||
|
|
||||||
use std::net::SocketAddr;
|
/// A magic number identifying the network.
|
||||||
|
pub struct Magic(pub u32);
|
||||||
|
|
||||||
/// A protocol version magic number.
|
/// A protocol version number.
|
||||||
pub struct Version(pub u32);
|
pub struct Version(pub u32);
|
||||||
|
|
||||||
/// Bitfield of features to be enabled for this connection.
|
/// Bitfield of features to be enabled for this connection.
|
||||||
|
|
Loading…
Reference in New Issue