Support custom genesis block (#12291)

* Set genesis block data using the built genesis block

* Make resolve_state_version_from_wasm a separate function and some small refactorings

Useful for the commit following.

* Introduce trait BuildGenesisBlock

Substrate users can use this trait to implement their custom genesis block when constructing the
client.

* Make call_executor test compile

* cargo +nightly fmt --all

* Fix test

* Remove unnecessary clone

* FMT

* Apply review suggestions

* Revert changes to new_full_client() and new_full_parts() signature

* Remove needless `Block` type in `resolve_state_version_from_wasm`
This commit is contained in:
Liu-Cheng Xu
2022-12-19 22:26:31 +08:00
committed by GitHub
parent 1be51ccb5c
commit b92aa3dbdc
10 changed files with 260 additions and 112 deletions
+4 -1
View File
@@ -57,7 +57,10 @@ pub use self::{
new_full_parts, spawn_tasks, BuildNetworkParams, KeystoreContainer, NetworkStarter,
SpawnTasksParams, TFullBackend, TFullCallExecutor, TFullClient,
},
client::{ClientConfig, LocalCallExecutor},
client::{
genesis::{BuildGenesisBlock, GenesisBlockBuilder},
resolve_state_version_from_wasm, ClientConfig, LocalCallExecutor,
},
error::Error,
};
pub use config::{