Add Chain enum for identifying message sources

Change-Id: Iefb96f32ef929a6073b523d511b9c4033e33522f
This commit is contained in:
Reisen 2021-04-27 12:51:27 +00:00
parent ed98d9d346
commit 888c461d73
1 changed files with 10 additions and 0 deletions

View File

@ -6,6 +6,16 @@ mod api;
use account::BridgeInfo; use account::BridgeInfo;
use account::GuardianSetInfo; use account::GuardianSetInfo;
/// An enum with labeled network identifiers. These must be consistent accross all wormhole
/// contracts deployed on each chain.
#[repr(u8)]
pub enum Chain {
Solana = 1u8,
}
/// chain id of this chain
pub const CHAIN_ID_SOLANA: u8 = Chain::Solana as u8;
/// maximum number of guardians
pub const MAX_LEN_GUARDIAN_KEYS: usize = 20; pub const MAX_LEN_GUARDIAN_KEYS: usize = 20;
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, Debug)] #[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, Debug)]