cuprate-hinto-janai/common/src/network.rs

28 lines
799 B
Rust
Raw Normal View History

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, Default)]
pub enum Network {
#[default]
2023-09-03 22:50:38 +00:00
Mainnet,
Testnet,
Stagenet,
}
impl Network {
pub fn network_id(&self) -> [u8; 16] {
match self {
2023-09-03 22:50:38 +00:00
Network::Mainnet => MAINNET_NETWORK_ID,
Network::Testnet => TESTNET_NETWORK_ID,
Network::Stagenet => STAGENET_NETWORK_ID,
}
}
}