Skip to content

Commit

Permalink
Consts: Add Dymension to rust sdk consts (#3764)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnjamin authored Feb 1, 2024
1 parent 7f0a2a2 commit 696cb90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sdk/rust/core/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub enum Chain {
Celestia,
Stargaze,
Seda,
Dymension,
Sepolia,

// Allow arbitrary u16s to support future chains.
Expand Down Expand Up @@ -104,6 +105,7 @@ impl From<u16> for Chain {
4004 => Chain::Celestia,
4005 => Chain::Stargaze,
4006 => Chain::Seda,
4007 => Chain::Dymension,
10002 => Chain::Sepolia,
c => Chain::Unknown(c),
}
Expand Down Expand Up @@ -155,6 +157,7 @@ impl From<Chain> for u16 {
Chain::Celestia => 4004,
Chain::Stargaze => 4005,
Chain::Seda => 4006,
Chain::Dymension => 4007,
Chain::Sepolia => 10002,
Chain::Unknown(c) => c,
}
Expand Down Expand Up @@ -207,6 +210,7 @@ impl fmt::Display for Chain {
Self::Celestia => f.write_str("Celestia"),
Self::Stargaze => f.write_str("Stargaze"),
Self::Seda => f.write_str("Seda"),
Self::Dymension => f.write_str("Dymension"),
Self::Unknown(v) => write!(f, "Unknown({v})"),
}
}
Expand Down Expand Up @@ -264,6 +268,7 @@ impl FromStr for Chain {
"Celestia" | "celestia" | "CELESTIA" => Ok(Chain::Celestia),
"Stargaze" | "stargaze" | "STARGAZE" => Ok(Chain::Stargaze),
"Seda" | "seda" | "SEDA" => Ok(Chain::Seda),
"Dymension" | "dymension" | "DYMENSION" => Ok(Chain::Dymension),
_ => {
let mut parts = s.split(&['(', ')']);
let _ = parts
Expand Down

0 comments on commit 696cb90

Please sign in to comment.