Enum diem_types::chain_id::NamedChain
source · #[repr(u8)]
pub enum NamedChain {
MAINNET,
TESTNET,
DEVNET,
TESTING,
PREMAINNET,
}
Expand description
A registry of named chain IDs Its main purpose is to improve human readability of reserved chain IDs in config files and CLI When signing transactions for such chains, the numerical chain ID should still be used (e.g. MAINNET has numeric chain ID 1, TESTNET has chain ID 2, etc)
Variants§
MAINNET
Users might accidentally initialize the ChainId field to 0, hence reserving ChainId 0 for accidental initialization. MAINNET is the Diem mainnet production chain and is reserved for 1
TESTNET
DEVNET
TESTING
PREMAINNET
Implementations§
source§impl NamedChain
impl NamedChain
pub fn id(&self) -> u8
pub fn from_chain_id(chain_id: &ChainId) -> Result<NamedChain, String>
Trait Implementations§
source§impl Clone for NamedChain
impl Clone for NamedChain
source§fn clone(&self) -> NamedChain
fn clone(&self) -> NamedChain
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more