Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
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
Next Next commit
Say where you looked for the file
  • Loading branch information
gilescope committed Oct 4, 2021
commit 51de1b7f31ed8495f66f0ebf9e0fc4a15e2a5f23
8 changes: 5 additions & 3 deletions client/chain-spec/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ impl<G: RuntimeGenesis> GenesisSource<G> {

match self {
Self::File(path) => {
let file =
File::open(path).map_err(|e| format!("Error opening spec file: {}", e))?;
let file = File::open(path).map_err(|e| {
format!("Error opening spec file at `{}`: {}", &path.to_string_lossy(), e)
})?;
let genesis: GenesisContainer<G> = json::from_reader(file)
.map_err(|e| format!("Error parsing spec file: {}", e))?;
Ok(genesis.genesis)
Expand Down Expand Up @@ -284,7 +285,8 @@ impl<G, E: serde::de::DeserializeOwned> ChainSpec<G, E> {

/// Parse json file into a `ChainSpec`
pub fn from_json_file(path: PathBuf) -> Result<Self, String> {
let file = File::open(&path).map_err(|e| format!("Error opening spec file: {}", e))?;
let file = File::open(&path)
.map_err(|e| format!("Error opening spec file `{}`: {}", &path.to_string_lossy(), e))?;
let client_spec =
json::from_reader(file).map_err(|e| format!("Error parsing spec file: {}", e))?;
Ok(ChainSpec { client_spec, genesis: GenesisSource::File(path) })
Expand Down