chain-spec: Make chain spec writing deterministic (#10550)

* chain-spec: Make chain spec writing deterministic

This switches the chain spec to use `BTreeMap` internally instead of `HashMap`. This ensures that
reading and writing the same chain spec always results in the same file.

* fmt
This commit is contained in:
Bastian Köcher
2021-12-23 18:45:43 +01:00
committed by GitHub
parent 9c4d61df90
commit ea30c739ea
2 changed files with 56 additions and 9 deletions
+1 -1
View File
@@ -186,7 +186,7 @@ pub trait ChainSpec: BuildStorage + Send + Sync {
/// This will be used as storage at genesis.
fn set_storage(&mut self, storage: Storage);
/// Returns code substitutes that should be used for the on chain wasm.
fn code_substitutes(&self) -> std::collections::HashMap<String, Vec<u8>>;
fn code_substitutes(&self) -> std::collections::BTreeMap<String, Vec<u8>>;
}
impl std::fmt::Debug for dyn ChainSpec {