Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Release #339

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";
emmanuelm41 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading