mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
Introduce a PhantomData field in GenesisConfig (#1116)
This makes it possible to support `GenesisConfig`s that to do not use generic parameter.
This commit is contained in:
@@ -59,6 +59,7 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
consensus: Some(ConsensusConfig {
|
||||
code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm").to_vec(), // TODO change
|
||||
authorities: initial_authorities.clone(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
system: None,
|
||||
balances: Some(BalancesConfig {
|
||||
@@ -69,10 +70,12 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
transfer_fee: 1 * CENTS,
|
||||
creation_fee: 1 * CENTS,
|
||||
reclaim_rebate: 1 * CENTS,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
session: Some(SessionConfig {
|
||||
validators: initial_authorities.iter().cloned().map(Into::into).collect(),
|
||||
session_length: 5 * MINUTES,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
staking: Some(StakingConfig {
|
||||
current_era: 0,
|
||||
@@ -86,11 +89,13 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
bonding_duration: 1 * DAYS,
|
||||
offline_slash_grace: 4,
|
||||
minimum_validator_count: 4,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
democracy: Some(DemocracyConfig {
|
||||
launch_period: 5 * MINUTES, // 1 day per public referendum
|
||||
voting_period: 5 * MINUTES, // 3 days to discuss & vote on an active referendum
|
||||
minimum_deposit: 50 * DOLLARS, // 12000 as the minimum deposit for a referendum
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
council_seats: Some(CouncilSeatsConfig {
|
||||
active_council: vec![],
|
||||
@@ -103,19 +108,23 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
term_duration: 28 * DAYS,
|
||||
desired_seats: 0,
|
||||
inactive_grace_period: 1, // one additional vote should go by before an inactive voter can be reaped.
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
council_voting: Some(CouncilVotingConfig {
|
||||
cooloff_period: 4 * DAYS,
|
||||
voting_period: 1 * DAYS,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
timestamp: Some(TimestampConfig {
|
||||
period: SECS_PER_BLOCK,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
treasury: Some(TreasuryConfig {
|
||||
proposal_bond: Permill::from_percent(5),
|
||||
proposal_bond_minimum: 1 * DOLLARS,
|
||||
spend_period: 1 * DAYS,
|
||||
burn: Permill::from_percent(50),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
contract: Some(ContractConfig {
|
||||
contract_fee: 1 * CENTS,
|
||||
@@ -125,9 +134,11 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
max_depth: 1024,
|
||||
block_gas_limit: 10_000_000,
|
||||
current_schedule: Default::default(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
upgrade_key: Some(UpgradeKeyConfig {
|
||||
key: endowed_accounts[0].clone(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
}
|
||||
}
|
||||
@@ -175,6 +186,7 @@ pub fn testnet_genesis(
|
||||
consensus: Some(ConsensusConfig {
|
||||
code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm").to_vec(),
|
||||
authorities: initial_authorities.clone(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
system: None,
|
||||
balances: Some(BalancesConfig {
|
||||
@@ -185,10 +197,12 @@ pub fn testnet_genesis(
|
||||
creation_fee: 0,
|
||||
reclaim_rebate: 0,
|
||||
balances: endowed_accounts.iter().map(|&k| (k.into(), (1 << 60))).collect(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
session: Some(SessionConfig {
|
||||
validators: initial_authorities.iter().cloned().map(Into::into).collect(),
|
||||
session_length: 10,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
staking: Some(StakingConfig {
|
||||
current_era: 0,
|
||||
@@ -202,11 +216,13 @@ pub fn testnet_genesis(
|
||||
current_offline_slash: 0,
|
||||
current_session_reward: 0,
|
||||
offline_slash_grace: 0,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
democracy: Some(DemocracyConfig {
|
||||
launch_period: 9,
|
||||
voting_period: 18,
|
||||
minimum_deposit: 10,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
council_seats: Some(CouncilSeatsConfig {
|
||||
active_council: endowed_accounts.iter()
|
||||
@@ -221,19 +237,23 @@ pub fn testnet_genesis(
|
||||
term_duration: 1000000,
|
||||
desired_seats: (endowed_accounts.len() - initial_authorities.len()) as u32,
|
||||
inactive_grace_period: 1,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
council_voting: Some(CouncilVotingConfig {
|
||||
cooloff_period: 75,
|
||||
voting_period: 20,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
timestamp: Some(TimestampConfig {
|
||||
period: 5, // 5 second block time.
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
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),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
contract: Some(ContractConfig {
|
||||
contract_fee: 21,
|
||||
@@ -243,9 +263,11 @@ pub fn testnet_genesis(
|
||||
max_depth: 1024,
|
||||
block_gas_limit: 10_000_000,
|
||||
current_schedule: Default::default(),
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
upgrade_key: Some(UpgradeKeyConfig {
|
||||
key: upgrade_key,
|
||||
_genesis_phantom_data: Default::default(),
|
||||
}),
|
||||
}
|
||||
}
|
||||
@@ -289,7 +311,7 @@ mod tests {
|
||||
|
||||
fn local_testnet_genesis_instant() -> GenesisConfig {
|
||||
let mut genesis = local_testnet_genesis();
|
||||
genesis.timestamp = Some(TimestampConfig { period: 0 });
|
||||
genesis.timestamp = Some(TimestampConfig { period: 0, _genesis_phantom_data: Default::default() });
|
||||
genesis
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user