From 0ac44756376d19c950c7515c649ea496ee5dd623 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Mon, 30 Dec 2024 22:52:05 +0100 Subject: [PATCH] chore: add ChainSpec::from_genesis (#13601) --- crates/chainspec/src/spec.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/chainspec/src/spec.rs b/crates/chainspec/src/spec.rs index 1e314a0e0f..755b892d97 100644 --- a/crates/chainspec/src/spec.rs +++ b/crates/chainspec/src/spec.rs @@ -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