mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Update to latest Substrate (#377)
* Update to latest substrate * Propagate substrate#3225 * Fixes * Build * Fix
This commit is contained in:
committed by
Bastian Köcher
parent
1054a531b5
commit
2c6409a942
Generated
+158
-187
File diff suppressed because it is too large
Load Diff
@@ -128,7 +128,7 @@ impl SignedExtension for OnlyStakingAndClaims {
|
|||||||
-> Result<ValidTransaction, DispatchError>
|
-> Result<ValidTransaction, DispatchError>
|
||||||
{
|
{
|
||||||
match call {
|
match call {
|
||||||
Call::Staking(_) | Call::Claims(_) => Ok(Default::default()),
|
Call::Staking(_) | Call::Claims(_) | Call::Sudo(_) => Ok(Default::default()),
|
||||||
_ => Err(DispatchError::NoPermission),
|
_ => Err(DispatchError::NoPermission),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -491,7 +491,7 @@ construct_runtime!(
|
|||||||
Session: session::{Module, Call, Storage, Event, Config<T>},
|
Session: session::{Module, Call, Storage, Event, Config<T>},
|
||||||
FinalityTracker: finality_tracker::{Module, Call, Inherent},
|
FinalityTracker: finality_tracker::{Module, Call, Inherent},
|
||||||
Grandpa: grandpa::{Module, Call, Storage, Config, Event},
|
Grandpa: grandpa::{Module, Call, Storage, Config, Event},
|
||||||
ImOnline: im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config<T>},
|
ImOnline: im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config},
|
||||||
|
|
||||||
// Governance stuff; uncallable initially.
|
// Governance stuff; uncallable initially.
|
||||||
Democracy: democracy::{Module, Call, Storage, Config, Event<T>},
|
Democracy: democracy::{Module, Call, Storage, Config, Event<T>},
|
||||||
@@ -658,6 +658,7 @@ impl_runtime_apis! {
|
|||||||
epoch_index: Babe::epoch_index(),
|
epoch_index: Babe::epoch_index(),
|
||||||
randomness: Babe::randomness(),
|
randomness: Babe::randomness(),
|
||||||
duration: EpochDuration::get(),
|
duration: EpochDuration::get(),
|
||||||
|
secondary_slots: Babe::secondary_slots().0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -839,11 +839,17 @@ impl<T: Trait> Module<T> {
|
|||||||
impl<T: Trait> session::OneSessionHandler<T::AccountId> for Module<T> {
|
impl<T: Trait> session::OneSessionHandler<T::AccountId> for Module<T> {
|
||||||
type Key = ValidatorId;
|
type Key = ValidatorId;
|
||||||
|
|
||||||
|
fn on_genesis_session<'a, I: 'a>(validators: I)
|
||||||
|
where I: Iterator<Item=(&'a T::AccountId, Self::Key)>
|
||||||
|
{
|
||||||
|
<Self as Store>::Authorities::put(&validators.map(|(_, key)| key).collect::<Vec<_>>())
|
||||||
|
}
|
||||||
|
|
||||||
fn on_new_session<'a, I: 'a>(changed: bool, validators: I, _queued: I)
|
fn on_new_session<'a, I: 'a>(changed: bool, validators: I, _queued: I)
|
||||||
where I: Iterator<Item=(&'a T::AccountId, Self::Key)>
|
where I: Iterator<Item=(&'a T::AccountId, Self::Key)>
|
||||||
{
|
{
|
||||||
if changed {
|
if changed {
|
||||||
<Self as Store>::Authorities::put(&validators.map(|(_, key)| key).collect::<Vec<_>>())
|
Self::on_genesis_session(validators)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1080,7 +1086,7 @@ mod tests {
|
|||||||
|
|
||||||
babe::GenesisConfig {
|
babe::GenesisConfig {
|
||||||
authorities: babe_authorities,
|
authorities: babe_authorities,
|
||||||
}.assimilate_storage(&mut t).unwrap();
|
}.assimilate_storage::<Test>(&mut t).unwrap();
|
||||||
|
|
||||||
balances::GenesisConfig::<Test> {
|
balances::GenesisConfig::<Test> {
|
||||||
balances,
|
balances,
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
use primitives::{Pair, Public, crypto::UncheckedInto};
|
use primitives::{Pair, Public, crypto::UncheckedInto};
|
||||||
use polkadot_primitives::{AccountId, parachain::ValidatorId};
|
use polkadot_primitives::{AccountId, parachain::ValidatorId};
|
||||||
use polkadot_runtime::{
|
use polkadot_runtime::{
|
||||||
GenesisConfig, CouncilConfig, ElectionsConfig, DemocracyConfig, SystemConfig, BabeConfig,
|
GenesisConfig, CouncilConfig, ElectionsConfig, DemocracyConfig, SystemConfig,
|
||||||
SessionConfig, StakingConfig, BalancesConfig, Perbill, SessionKeys, TechnicalCommitteeConfig,
|
SessionConfig, StakingConfig, BalancesConfig, Perbill, SessionKeys, TechnicalCommitteeConfig,
|
||||||
GrandpaConfig, SudoConfig, IndicesConfig, StakerStatus, WASM_BINARY,
|
SudoConfig, IndicesConfig, StakerStatus, WASM_BINARY,
|
||||||
ClaimsConfig, ImOnlineConfig, ParachainsConfig
|
ClaimsConfig, ParachainsConfig
|
||||||
};
|
};
|
||||||
use polkadot_runtime::constants::{currency::DOTS, time::*};
|
use polkadot_runtime::constants::{currency::DOTS, time::*};
|
||||||
use telemetry::TelemetryEndpoints;
|
use telemetry::TelemetryEndpoints;
|
||||||
@@ -144,18 +144,11 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
|||||||
desired_seats: 0,
|
desired_seats: 0,
|
||||||
}),
|
}),
|
||||||
membership_Instance1: Some(Default::default()),
|
membership_Instance1: Some(Default::default()),
|
||||||
babe: Some(BabeConfig {
|
babe: Some(Default::default()),
|
||||||
authorities: initial_authorities.iter().map(|x| (x.2.clone(), 1)).collect(),
|
grandpa: Some(Default::default()),
|
||||||
}),
|
im_online: Some(Default::default()),
|
||||||
grandpa: Some(GrandpaConfig {
|
|
||||||
authorities: initial_authorities.iter().map(|x| (x.3.clone(), 1)).collect(),
|
|
||||||
}),
|
|
||||||
im_online: Some(ImOnlineConfig {
|
|
||||||
gossip_at: 0,
|
|
||||||
keys: initial_authorities.iter().map(|x| x.4.clone()).collect(),
|
|
||||||
}),
|
|
||||||
parachains: Some(ParachainsConfig {
|
parachains: Some(ParachainsConfig {
|
||||||
authorities: initial_authorities.iter().map(|x| x.5.clone()).collect(),
|
authorities: vec![],
|
||||||
parachains: vec![],
|
parachains: vec![],
|
||||||
_phdata: Default::default(),
|
_phdata: Default::default(),
|
||||||
}),
|
}),
|
||||||
@@ -288,18 +281,11 @@ pub fn testnet_genesis(
|
|||||||
desired_seats,
|
desired_seats,
|
||||||
}),
|
}),
|
||||||
membership_Instance1: Some(Default::default()),
|
membership_Instance1: Some(Default::default()),
|
||||||
babe: Some(BabeConfig {
|
babe: Some(Default::default()),
|
||||||
authorities: initial_authorities.iter().map(|x| (x.2.clone(), 1)).collect(),
|
grandpa: Some(Default::default()),
|
||||||
}),
|
im_online: Some(Default::default()),
|
||||||
grandpa: Some(GrandpaConfig {
|
|
||||||
authorities: initial_authorities.iter().map(|x| (x.3.clone(), 1)).collect(),
|
|
||||||
}),
|
|
||||||
im_online: Some(ImOnlineConfig {
|
|
||||||
gossip_at: 0,
|
|
||||||
keys: initial_authorities.iter().map(|x| x.4.clone()).collect(),
|
|
||||||
}),
|
|
||||||
parachains: Some(ParachainsConfig {
|
parachains: Some(ParachainsConfig {
|
||||||
authorities: initial_authorities.iter().map(|x| x.5.clone()).collect(),
|
authorities: vec![],
|
||||||
parachains: vec![],
|
parachains: vec![],
|
||||||
_phdata: Default::default(),
|
_phdata: Default::default(),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -382,7 +382,12 @@ service::construct_service_factory! {
|
|||||||
LightService = LightComponents<Self>
|
LightService = LightComponents<Self>
|
||||||
{ |config| <LightComponents<Factory>>::new(config) },
|
{ |config| <LightComponents<Factory>>::new(config) },
|
||||||
FullImportQueue = BabeImportQueue<Self::Block>
|
FullImportQueue = BabeImportQueue<Self::Block>
|
||||||
{ |config: &mut FactoryFullConfiguration<Self>, client: Arc<FullClient<Self>>, select_chain: Self::SelectChain| {
|
{ |
|
||||||
|
config: &mut FactoryFullConfiguration<Self>,
|
||||||
|
client: Arc<FullClient<Self>>,
|
||||||
|
select_chain: Self::SelectChain,
|
||||||
|
transaction_pool: Option<Arc<TransactionPool<Self::FullTransactionPoolApi>>>
|
||||||
|
| {
|
||||||
let (block_import, link_half) =
|
let (block_import, link_half) =
|
||||||
grandpa::block_import::<_, _, _, RuntimeApi, FullClient<Self>, _>(
|
grandpa::block_import::<_, _, _, RuntimeApi, FullClient<Self>, _>(
|
||||||
client.clone(), client.clone(), select_chain
|
client.clone(), client.clone(), select_chain
|
||||||
@@ -397,6 +402,7 @@ service::construct_service_factory! {
|
|||||||
client.clone(),
|
client.clone(),
|
||||||
client,
|
client,
|
||||||
config.custom.inherent_data_providers.clone(),
|
config.custom.inherent_data_providers.clone(),
|
||||||
|
transaction_pool,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
config.custom.import_setup = Some((babe_block_import.clone(), link_half, babe_link));
|
config.custom.import_setup = Some((babe_block_import.clone(), link_half, babe_link));
|
||||||
@@ -419,7 +425,7 @@ service::construct_service_factory! {
|
|||||||
let finality_proof_request_builder = finality_proof_import.create_finality_proof_request_builder();
|
let finality_proof_request_builder = finality_proof_import.create_finality_proof_request_builder();
|
||||||
|
|
||||||
// FIXME: pruning task isn't started since light client doesn't do `AuthoritySetup`.
|
// FIXME: pruning task isn't started since light client doesn't do `AuthoritySetup`.
|
||||||
let (import_queue, ..) = import_queue(
|
let (import_queue, ..) = import_queue::<_, _, _, _, _, _, TransactionPool<Self::FullTransactionPoolApi>>(
|
||||||
Config::get_or_compute(&*client)?,
|
Config::get_or_compute(&*client)?,
|
||||||
block_import,
|
block_import,
|
||||||
None,
|
None,
|
||||||
@@ -427,6 +433,7 @@ service::construct_service_factory! {
|
|||||||
client.clone(),
|
client.clone(),
|
||||||
client,
|
client,
|
||||||
config.custom.inherent_data_providers.clone(),
|
config.custom.inherent_data_providers.clone(),
|
||||||
|
None,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
Ok((import_queue, finality_proof_request_builder))
|
Ok((import_queue, finality_proof_request_builder))
|
||||||
|
|||||||
Reference in New Issue
Block a user