mirror of
https://github.com/hinto-janai/cuprate.git
synced 2025-01-08 03:49:26 +00:00
27 lines
775 B
Rust
27 lines
775 B
Rust
|
const MAINNET_NETWORK_ID: [u8; 16] = [
|
||
|
0x12, 0x30, 0xF1, 0x71, 0x61, 0x04, 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x10,
|
||
|
];
|
||
|
const TESTNET_NETWORK_ID: [u8; 16] = [
|
||
|
0x12, 0x30, 0xF1, 0x71, 0x61, 0x04, 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x11,
|
||
|
];
|
||
|
const STAGENET_NETWORK_ID: [u8; 16] = [
|
||
|
0x12, 0x30, 0xF1, 0x71, 0x61, 0x04, 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x12,
|
||
|
];
|
||
|
|
||
|
#[derive(Debug, Clone, Copy)]
|
||
|
pub enum Network {
|
||
|
MainNet,
|
||
|
TestNet,
|
||
|
StageNet,
|
||
|
}
|
||
|
|
||
|
impl Network {
|
||
|
pub fn network_id(&self) -> [u8; 16] {
|
||
|
match self {
|
||
|
Network::MainNet => MAINNET_NETWORK_ID,
|
||
|
Network::TestNet => TESTNET_NETWORK_ID,
|
||
|
Network::StageNet => STAGENET_NETWORK_ID,
|
||
|
}
|
||
|
}
|
||
|
}
|