mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 15:11:02 +00:00
fix test collator compilation failure (#89)
* fix test collator compilation failure Closes #88. * copy method instead of using feature Using a feature gate like "test-features" is problematic because it is leaky: depending on situational considitons such as the current working directory when compilation is attempted, the feature may or may not be applied, which makes success inconsistent. It's simpler in this case to copy a dozen lines of code than to work out all the issues with test features.
This commit is contained in:
committed by
GitHub
parent
66b5c97c80
commit
00da3f46e7
@@ -23,12 +23,11 @@ use sc_cli::{
|
|||||||
CliConfiguration, Error, ImportParams, KeystoreParams, NetworkParams, Result, SharedParams,
|
CliConfiguration, Error, ImportParams, KeystoreParams, NetworkParams, Result, SharedParams,
|
||||||
SubstrateCli,
|
SubstrateCli,
|
||||||
};
|
};
|
||||||
use sc_service::client::genesis;
|
|
||||||
use sc_network::config::TransportConfig;
|
use sc_network::config::TransportConfig;
|
||||||
use sc_service::config::{NetworkConfiguration, NodeKeyConfig, PrometheusConfig};
|
use sc_service::config::{NetworkConfiguration, NodeKeyConfig, PrometheusConfig};
|
||||||
use sp_core::hexdisplay::HexDisplay;
|
use sp_core::hexdisplay::HexDisplay;
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
traits::{Block as BlockT, Hash as HashT, Header as HeaderT},
|
traits::{Block as BlockT, Hash as HashT, Header as HeaderT, Zero},
|
||||||
BuildStorage,
|
BuildStorage,
|
||||||
};
|
};
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
@@ -137,7 +136,22 @@ pub fn run() -> Result<()> {
|
|||||||
let state_root = <<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
|
let state_root = <<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
|
||||||
storage.top.clone().into_iter().chain(child_roots).collect(),
|
storage.top.clone().into_iter().chain(child_roots).collect(),
|
||||||
);
|
);
|
||||||
let block: Block = genesis::construct_genesis_block(state_root);
|
let block = {
|
||||||
|
let extrinsics_root = <<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
|
||||||
|
Vec::new(),
|
||||||
|
);
|
||||||
|
|
||||||
|
Block::new(
|
||||||
|
<<Block as BlockT>::Header as HeaderT>::new(
|
||||||
|
Zero::zero(),
|
||||||
|
extrinsics_root,
|
||||||
|
state_root,
|
||||||
|
Default::default(),
|
||||||
|
Default::default(),
|
||||||
|
),
|
||||||
|
Default::default(),
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
let header_hex = format!("0x{:?}", HexDisplay::from(&block.header().encode()));
|
let header_hex = format!("0x{:?}", HexDisplay::from(&block.header().encode()));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user