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
Prev Previous commit
Next Next commit
Rustfmt
  • Loading branch information
tomaka committed Nov 1, 2021
commit e55ad994f468bba5d6887a6b4643ad8faa8f34b1
10 changes: 5 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 @@ -121,7 +121,7 @@ impl<G: RuntimeGenesis, E> BuildStorage for ChainSpec<G, E> {
}),
// 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())
Genesis::StateRootHash(_) => Err("Genesis storage in hash format not supported".into()),
}
}

Expand Down Expand Up @@ -328,7 +328,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