Skip to content

Commit

Permalink
add devnet support
Browse files Browse the repository at this point in the history
  • Loading branch information
chcmedeiros committed Nov 26, 2024
1 parent e3eb12e commit f4a191f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/rust/src/parser/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ pub const NETWORK_ID_MAINNET: u32 = 1;
pub const NETWORK_ID_FUJI: u32 = 5;
pub const NETWORK_ID_LOCAL: u32 = 12345;
pub const NETWORK_ID_CUSTOM: u32 = 1337;
pub const NETWORK_ID_DEVNET: u32 = 76;
pub const ETH_MAINNET_ID: u64 = 1;

// hrp
pub const HRP_MAINNET: &str = "avax";
pub const HRP_TESTNET: &str = "fuji";
pub const HRP_LOCAL: &str = "local";
pub const HRP_CUSTOM: &str = "custom";

pub const HRP_DEVNET: &str = "custom";
pub const TRANSFER_TX: u32 = 0;

// pvm transaction types
Expand Down
3 changes: 3 additions & 0 deletions app/rust/src/parser/network_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub enum NetworkId {
Fuji,
Local,
Custom,
Devnet,
}

impl NetworkId {
Expand All @@ -40,6 +41,7 @@ impl NetworkId {
Self::Fuji => PIC::new(HRP_TESTNET).into_inner(),
Self::Local => PIC::new(HRP_LOCAL).into_inner(),
Self::Custom => PIC::new(HRP_CUSTOM).into_inner(),
Self::Devnet => PIC::new(HRP_DEVNET).into_inner(),
}
}
}
Expand All @@ -53,6 +55,7 @@ impl TryFrom<u32> for NetworkId {
NETWORK_ID_FUJI => Ok(Self::Fuji),
NETWORK_ID_LOCAL => Ok(Self::Local),
NETWORK_ID_CUSTOM => Ok(Self::Custom),
NETWORK_ID_DEVNET => Ok(Self::Devnet),
_ => Err(ParserError::InvalidNetworkId),
}
}
Expand Down

0 comments on commit f4a191f

Please sign in to comment.