I've updated the ChainSpec
type from:
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig, Extensions>;
to
pub type ChainSpec = sc_service::GenericChainSpec<Result<GenesisConfig, String>, Extensions>;
But, I'm getting this error in the command.rs
:
error[E0277]: the trait bound `Result<node_template_runtime::GenesisConfig, std::string::String>: BuildStorage` is not satisfied
--> node/src/command.rs:49:12
|
49 | Ok(Box::new(spec))
| ^^^^^^^^^^^^^^ the trait `BuildStorage` is not implemented for `Result<node_template_runtime::GenesisConfig, std::string::String>`
|
= help: the following other types implement trait `BuildStorage`:
()
GenericChainSpec<G, E>
node_template_runtime::GenesisConfig
sp_runtime::Storage
= note: required for `Result<node_template_runtime::GenesisConfig, std::string::String>` to implement `RuntimeGenesis`
= note: required for `GenericChainSpec<Result<node_template_runtime::GenesisConfig, std::string::String>, Extensions>` to implement `sc_chain_spec::ChainSpec`
= note: required for the cast from `GenericChainSpec<Result<node_template_runtime::GenesisConfig, std::string::String>, Extensions>` to the object type `dyn sc_chain_spec::ChainSpec`
For more information about this error, try `rustc --explain E0277`.
Is there a way to unwrap
the ChainSpec
in the load_spec()
method?
sc_service::GenericChainSpec<Result<GenesisConfig, String>
this makes no real sense. The underlying issue is thatResult<GenesisConfig>
doesn't implement theBuildStorage
trait.