Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Ok I have to use nightly cargo fmt
  • Loading branch information
tomaka committed Nov 1, 2021
commit 050b9b1eb287aae347e53cd2c749d4632b97a2e6
11 changes: 6 additions & 5 deletions client/chain-spec/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ impl<G: RuntimeGenesis> GenesisSource<G> {
let genesis: GenesisContainer<G> = json::from_reader(file)
.map_err(|e| format!("Error parsing spec file: {}", e))?;
Ok(genesis.genesis)
}
},
Self::Binary(buf) => {
let genesis: GenesisContainer<G> = json::from_reader(buf.as_ref())
.map_err(|e| format!("Error parsing embedded file: {}", e))?;
Ok(genesis.genesis)
}
},
Self::Factory(f) => Ok(Genesis::Runtime(f())),
Self::Storage(storage) => {
let top = storage
Expand All @@ -94,7 +94,7 @@ impl<G: RuntimeGenesis> GenesisSource<G> {
.collect();

Ok(Genesis::Raw(RawGenesis { top, children_default }))
}
},
}
}
}
Expand All @@ -120,7 +120,8 @@ 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.
// 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 Down Expand Up @@ -328,7 +329,7 @@ impl<G: RuntimeGenesis, E: serde::Serialize + Clone + 'static> ChainSpec<G, E> {
.collect();

Genesis::Raw(RawGenesis { top, children_default })
}
},
(_, genesis) => genesis,
};
Ok(JsonContainer { client_spec: self.client_spec.clone(), genesis })
Expand Down
2 changes: 1 addition & 1 deletion client/chain-spec/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl<T: Fork> Fork for Option<T> {
(Some(mut a), Some(b)) => {
a.combine_with(b);
Some(a)
}
},
(a, b) => a.or(b),
};
}
Expand Down