diff --git a/zebra-network/src/constants.rs b/zebra-network/src/constants.rs index ce97177e1..0b543154c 100644 --- a/zebra-network/src/constants.rs +++ b/zebra-network/src/constants.rs @@ -2,5 +2,14 @@ use crate::types::*; -/// The Zcash version used on mainnet. -pub const ZCASH_VERSION: Version = Version(170_007); +/// The Zcash network protocol version used on mainnet. +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); +} \ No newline at end of file diff --git a/zebra-network/src/types.rs b/zebra-network/src/types.rs index 6325a44ae..996f16bd6 100644 --- a/zebra-network/src/types.rs +++ b/zebra-network/src/types.rs @@ -1,8 +1,9 @@ //! 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); /// Bitfield of features to be enabled for this connection.