Add a trie_root_hash variant for chain specs genesis (#10140)

* Add a `hash` variant for chain specs

* Add doc

* Rename to TrieRootHash

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Rustfmt

* More cargo fmt I guess

* Ok I have to use nightly cargo fmt

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Pierre Krieger
2021-11-03 10:12:50 +01:00
committed by GitHub
parent 63289ce084
commit 281d58cb0d
@@ -119,6 +119,10 @@ impl<G: RuntimeGenesis, E> BuildStorage for ChainSpec<G, E> {
})
.collect(),
}),
// The `StateRootHash` variant exists as a way to keep note that other clients support
// it, but Substrate itself isn't capable of loading chain specs with just a hash at the
// moment.
Genesis::StateRootHash(_) => Err("Genesis storage in hash format not supported".into()),
}
}
@@ -144,6 +148,8 @@ pub struct RawGenesis {
enum Genesis<G> {
Runtime(G),
Raw(RawGenesis),
/// State root hash of the genesis storage.
StateRootHash(StorageData),
}
/// A configuration of a client. Does not include runtime storage initialization.