mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Update to Substrate master (#311)
* Best effort to bring up to date. * Fix the executor stuff * Update verisons. * Finish fixing * Final fixes and warnings. * add some docs and bump Wasm versions * Fix tests * Fix final test
This commit is contained in:
@@ -19,9 +19,9 @@
|
||||
use primitives::{ed25519, sr25519, Pair, crypto::UncheckedInto};
|
||||
use polkadot_primitives::{AccountId, SessionKey};
|
||||
use polkadot_runtime::{
|
||||
GenesisConfig, CouncilSeatsConfig, DemocracyConfig, TreasuryConfig, SystemConfig, AuraConfig,
|
||||
GenesisConfig, CouncilSeatsConfig, DemocracyConfig, SystemConfig, AuraConfig,
|
||||
SessionConfig, StakingConfig, TimestampConfig, BalancesConfig, Perbill, SessionKeys,
|
||||
GrandpaConfig, SudoConfig, IndicesConfig, Permill, CuratedGrandpaConfig, StakerStatus,
|
||||
GrandpaConfig, SudoConfig, IndicesConfig, CuratedGrandpaConfig, StakerStatus,
|
||||
};
|
||||
use telemetry::TelemetryEndpoints;
|
||||
use hex_literal::hex;
|
||||
@@ -78,19 +78,13 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
system: Some(SystemConfig {
|
||||
// TODO: Change after Substrate 1252 is fixed (https://github.com/paritytech/substrate/issues/1252)
|
||||
code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm").to_vec(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
changes_trie_config: Default::default(),
|
||||
}),
|
||||
balances: Some(BalancesConfig {
|
||||
transaction_base_fee: 1 * CENTS,
|
||||
transaction_byte_fee: 10 * MILLICENTS,
|
||||
balances: endowed_accounts.iter()
|
||||
.map(|k: &AccountId| (k.clone(), ENDOWMENT))
|
||||
.chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH)))
|
||||
.collect(),
|
||||
existential_deposit: 1 * DOLLARS,
|
||||
transfer_fee: 1 * CENTS,
|
||||
creation_fee: 1 * CENTS,
|
||||
vesting: vec![],
|
||||
}),
|
||||
indices: Some(IndicesConfig {
|
||||
@@ -119,33 +113,18 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
democracy: Some(Default::default()),
|
||||
council_seats: Some(CouncilSeatsConfig {
|
||||
active_council: vec![],
|
||||
candidacy_bond: 10 * DOLLARS,
|
||||
voter_bond: 1 * DOLLARS,
|
||||
voting_fee: 2 * DOLLARS,
|
||||
present_slash_per_voter: 1 * CENTS,
|
||||
carry_count: 6,
|
||||
presentation_duration: 1 * DAYS,
|
||||
approval_voting_period: 2 * DAYS,
|
||||
term_duration: 28 * DAYS,
|
||||
desired_seats: 0,
|
||||
decay_ratio: 0,
|
||||
inactive_grace_period: 1, // one additional vote should go by before an inactive voter can be reaped.
|
||||
}),
|
||||
timestamp: Some(TimestampConfig {
|
||||
minimum_period: SECS_PER_BLOCK / 2, // due to the nature of aura the slots are 2*period
|
||||
}),
|
||||
treasury: Some(TreasuryConfig {
|
||||
proposal_bond: Permill::from_percent(5),
|
||||
proposal_bond_minimum: 1 * DOLLARS,
|
||||
spend_period: 1 * DAYS,
|
||||
burn: Permill::from_percent(50),
|
||||
}),
|
||||
sudo: Some(SudoConfig {
|
||||
key: endowed_accounts[0].clone(),
|
||||
}),
|
||||
grandpa: Some(GrandpaConfig {
|
||||
authorities: initial_authorities.iter().map(|x| (x.2.clone(), 1)).collect(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
aura: Some(AuraConfig {
|
||||
authorities: initial_authorities.iter().map(|x| x.2.clone()).collect(),
|
||||
@@ -226,18 +205,12 @@ pub fn testnet_genesis(
|
||||
system: Some(SystemConfig {
|
||||
// TODO: Change after Substrate 1252 is fixed (https://github.com/paritytech/substrate/issues/1252)
|
||||
code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm").to_vec(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
changes_trie_config: Default::default(),
|
||||
}),
|
||||
indices: Some(IndicesConfig {
|
||||
ids: endowed_accounts.clone(),
|
||||
}),
|
||||
balances: Some(BalancesConfig {
|
||||
transaction_base_fee: 1,
|
||||
transaction_byte_fee: 0,
|
||||
existential_deposit: 500,
|
||||
transfer_fee: 0,
|
||||
creation_fee: 0,
|
||||
balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(),
|
||||
vesting: vec![],
|
||||
}),
|
||||
@@ -256,42 +229,31 @@ pub fn testnet_genesis(
|
||||
session_reward: Perbill::zero(),
|
||||
current_session_reward: 0,
|
||||
offline_slash_grace: 0,
|
||||
stakers: initial_authorities.iter().map(|x| (x.0.clone(), x.1.clone(), STASH, StakerStatus::Validator)).collect(),
|
||||
stakers: initial_authorities.iter()
|
||||
.map(|x| (x.0.clone(), x.1.clone(), STASH, StakerStatus::Validator))
|
||||
.collect(),
|
||||
invulnerables: initial_authorities.iter().map(|x| x.1.clone()).collect(),
|
||||
}),
|
||||
democracy: Some(DemocracyConfig::default()),
|
||||
council_seats: Some(CouncilSeatsConfig {
|
||||
active_council: endowed_accounts.iter()
|
||||
.filter(|&endowed| initial_authorities.iter().find(|&(_, controller, _)| controller == endowed).is_none())
|
||||
.map(|a| (a.clone(), 1000000)).collect(),
|
||||
candidacy_bond: 10,
|
||||
voter_bond: 2,
|
||||
voting_fee: 5,
|
||||
present_slash_per_voter: 1,
|
||||
carry_count: 4,
|
||||
.filter(|&endowed| initial_authorities.iter()
|
||||
.find(|&(_, controller, _)| controller == endowed)
|
||||
.is_none()
|
||||
).map(|a| (a.clone(), 1000000)).collect(),
|
||||
presentation_duration: 10,
|
||||
approval_voting_period: 20,
|
||||
term_duration: 1000000,
|
||||
desired_seats: (endowed_accounts.len() - initial_authorities.len()) as u32,
|
||||
decay_ratio: council_desired_seats / 3,
|
||||
inactive_grace_period: 1,
|
||||
desired_seats: council_desired_seats,
|
||||
}),
|
||||
parachains: Some(Default::default()),
|
||||
timestamp: Some(TimestampConfig {
|
||||
minimum_period: 2, // 2*2=4 second block time.
|
||||
}),
|
||||
treasury: Some(TreasuryConfig {
|
||||
proposal_bond: Permill::from_percent(5),
|
||||
proposal_bond_minimum: 1_000_000,
|
||||
spend_period: 12 * 60 * 24,
|
||||
burn: Permill::from_percent(50),
|
||||
}),
|
||||
sudo: Some(SudoConfig {
|
||||
key: root_key,
|
||||
}),
|
||||
grandpa: Some(GrandpaConfig {
|
||||
authorities: initial_authorities.iter().map(|x| (x.2.clone(), 1)).collect(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
aura: Some(AuraConfig {
|
||||
authorities: initial_authorities.iter().map(|x| x.2.clone()).collect(),
|
||||
|
||||
Reference in New Issue
Block a user