Skip to content

Commit

Permalink
Add a trie_root_hash variant for chain specs genesis (paritytech#10140
Browse files Browse the repository at this point in the history
)

* Add a `hash` variant for chain specs

* Add doc

* Rename to TrieRootHash

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <[email protected]>

* Rustfmt

* More cargo fmt I guess

* Ok I have to use nightly cargo fmt

Co-authored-by: Bastian Köcher <[email protected]>
  • Loading branch information
2 people authored and grishasobol committed Mar 28, 2022
1 parent a756d90 commit d2b45f7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/chain-spec/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
}
}

Expand All @@ -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.
Expand Down

0 comments on commit d2b45f7

Please sign in to comment.