Skip to content

Commit

Permalink
chore: add ChainSpec::from_genesis (#13601)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Dec 30, 2024
1 parent 4110493 commit 0ac4475
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/chainspec/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ impl Default for ChainSpec {
}

impl ChainSpec {
/// Converts the given [`Genesis`] into a [`ChainSpec`].
pub fn from_genesis(genesis: Genesis) -> Self {
genesis.into()
}

/// Get information about the chain itself
pub const fn chain(&self) -> Chain {
self.chain
Expand Down

0 comments on commit 0ac4475

Please sign in to comment.