upgrade to latest polkadot (#278)

* upgrade to latest polkadot

* ss58 in tests

* format

* removed unused import
This commit is contained in:
lumir-mrkva
2021-01-04 00:22:17 +01:00
committed by GitHub
parent cd0e40a6eb
commit 30021251fc
8 changed files with 409 additions and 399 deletions
+391 -390
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -335,6 +335,7 @@ mod tests {
type DbWeight = (); type DbWeight = ();
type BaseCallFilter = (); type BaseCallFilter = ();
type SystemWeightInfo = (); type SystemWeightInfo = ();
type SS58Prefix = ();
} }
impl Config for Test { impl Config for Test {
type Event = TestEvent; type Event = TestEvent;
@@ -106,6 +106,7 @@ parameter_types! {
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024; pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
pub const Version: RuntimeVersion = VERSION; pub const Version: RuntimeVersion = VERSION;
pub const ExtrinsicBaseWeight: Weight = 10_000_000; pub const ExtrinsicBaseWeight: Weight = 10_000_000;
pub const SS58Prefix: u8 = 42;
} }
impl frame_system::Config for Runtime { impl frame_system::Config for Runtime {
@@ -149,6 +150,7 @@ impl frame_system::Config for Runtime {
type MaximumExtrinsicWeight = MaximumExtrinsicWeight; type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
type BaseCallFilter = (); type BaseCallFilter = ();
type SystemWeightInfo = (); type SystemWeightInfo = ();
type SS58Prefix = SS58Prefix;
} }
parameter_types! { parameter_types! {
@@ -144,6 +144,7 @@ parameter_types! {
}) })
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic(); .build_or_panic();
pub const SS58Prefix: u8 = 42;
} }
impl frame_system::Config for Runtime { impl frame_system::Config for Runtime {
@@ -181,6 +182,7 @@ impl frame_system::Config for Runtime {
type SystemWeightInfo = (); type SystemWeightInfo = ();
type BlockWeights = RuntimeBlockWeights; type BlockWeights = RuntimeBlockWeights;
type BlockLength = RuntimeBlockLength; type BlockLength = RuntimeBlockLength;
type SS58Prefix = SS58Prefix;
} }
parameter_types! { parameter_types! {
+10 -4
View File
@@ -24,8 +24,8 @@ use log::info;
use parachain_runtime::Block; use parachain_runtime::Block;
use polkadot_parachain::primitives::AccountIdConversion; use polkadot_parachain::primitives::AccountIdConversion;
use sc_cli::{ use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams, ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, InitLoggerParams,
NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli, KeystoreParams, NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli,
}; };
use sc_service::{ use sc_service::{
config::{BasePath, PrometheusConfig}, config::{BasePath, PrometheusConfig},
@@ -217,7 +217,10 @@ pub fn run() -> Result<()> {
}) })
} }
Some(Subcommand::ExportGenesisState(params)) => { Some(Subcommand::ExportGenesisState(params)) => {
sc_cli::init_logger("", sc_tracing::TracingReceiver::Log, None, false)?; sc_cli::init_logger(InitLoggerParams {
tracing_receiver: sc_tracing::TracingReceiver::Log,
..Default::default()
})?;
let block: Block = generate_genesis_block(&load_spec( let block: Block = generate_genesis_block(&load_spec(
&params.chain.clone().unwrap_or_default(), &params.chain.clone().unwrap_or_default(),
@@ -239,7 +242,10 @@ pub fn run() -> Result<()> {
Ok(()) Ok(())
} }
Some(Subcommand::ExportGenesisWasm(params)) => { Some(Subcommand::ExportGenesisWasm(params)) => {
sc_cli::init_logger("", sc_tracing::TracingReceiver::Log, None, false)?; sc_cli::init_logger(InitLoggerParams {
tracing_receiver: sc_tracing::TracingReceiver::Log,
..Default::default()
})?;
let raw_wasm_blob = let raw_wasm_blob =
extract_genesis_wasm(&cli.load_spec(&params.chain.clone().unwrap_or_default())?)?; extract_genesis_wasm(&cli.load_spec(&params.chain.clone().unwrap_or_default())?)?;
@@ -290,10 +290,6 @@ impl<'a, B: BlockT> Externalities for WitnessExt<'a, B> {
self.inner.storage_append(key, value) self.inner.storage_append(key, value)
} }
fn chain_id(&self) -> u64 {
42
}
fn storage_root(&mut self) -> Vec<u8> { fn storage_root(&mut self) -> Vec<u8> {
self.inner.storage_root() self.inner.storage_root()
} }
+2
View File
@@ -124,6 +124,7 @@ parameter_types! {
}) })
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic(); .build_or_panic();
pub const SS58Prefix: u8 = 42;
} }
impl frame_system::Config for Runtime { impl frame_system::Config for Runtime {
@@ -160,6 +161,7 @@ impl frame_system::Config for Runtime {
type SystemWeightInfo = (); type SystemWeightInfo = ();
type BlockWeights = RuntimeBlockWeights; type BlockWeights = RuntimeBlockWeights;
type BlockLength = RuntimeBlockLength; type BlockLength = RuntimeBlockLength;
type SS58Prefix = SS58Prefix;
} }
parameter_types! { parameter_types! {
+1 -1
View File
@@ -22,7 +22,7 @@ use substrate_test_runtime_client::AccountKeyring::*;
#[substrate_test_utils::test] #[substrate_test_utils::test]
async fn test_collating_and_non_collator_mode_catching_up(task_executor: TaskExecutor) { async fn test_collating_and_non_collator_mode_catching_up(task_executor: TaskExecutor) {
sc_cli::init_logger("", Default::default(), None, false).expect("Sets up logger"); sc_cli::init_logger(Default::default()).expect("Sets up logger");
let para_id = ParaId::from(100); let para_id = ParaId::from(100);