Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix genesis chain specs #1046

Merged
merged 16 commits into from
Dec 2, 2021
19 changes: 13 additions & 6 deletions node/service/src/chain_spec/moonbase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ use moonbase_runtime::{
CouncilCollectiveConfig, CrowdloanRewardsConfig, DemocracyConfig, EVMConfig,
EthereumChainIdConfig, EthereumConfig, GenesisAccount, GenesisConfig, InflationInfo,
MaintenanceModeConfig, ParachainInfoConfig, ParachainStakingConfig, PolkadotXcmConfig,
Precompiles, Range, SchedulerConfig, SudoConfig, SystemConfig, TechCommitteeCollectiveConfig,
WASM_BINARY,
Precompiles, Range, Runtime, SchedulerConfig, SudoConfig, SystemConfig,
TechCommitteeCollectiveConfig, WASM_BINARY,
};
use nimbus_primitives::NimbusId;
use sc_service::ChainType;
Expand Down Expand Up @@ -162,21 +162,28 @@ pub fn get_chain_spec(para_id: ParaId) -> ChainSpec {

pub fn moonbeam_inflation_config() -> InflationInfo<Balance> {
InflationInfo {
// staking expectations
expect: Range {
min: 100_000 * UNIT,
ideal: 200_000 * UNIT,
max: 500_000 * UNIT,
},
// annual inflation
annual: Range {
min: Perbill::from_percent(4),
ideal: Perbill::from_percent(5),
max: Perbill::from_percent(5),
},
// 8766 rounds (hours) in a year
round: Range {
min: Perbill::from_parts(Perbill::from_percent(4).deconstruct() / 8766),
ideal: Perbill::from_parts(Perbill::from_percent(5).deconstruct() / 8766),
max: Perbill::from_parts(Perbill::from_percent(5).deconstruct() / 8766),
min: Perbill::from_parts(
Perbill::from_percent(4).deconstruct() / Runtime::DefaultBlocksPerRound::get(),
),
ideal: Perbill::from_parts(
Perbill::from_percent(5).deconstruct() / Runtime::DefaultBlocksPerRound::get(),
),
max: Perbill::from_parts(
Perbill::from_percent(5).deconstruct() / Runtime::DefaultBlocksPerRound::get(),
),
},
}
}
Expand Down
17 changes: 12 additions & 5 deletions node/service/src/chain_spec/moonbeam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use moonbeam_runtime::{
CouncilCollectiveConfig, CrowdloanRewardsConfig, DemocracyConfig, EVMConfig,
EthereumChainIdConfig, EthereumConfig, GenesisAccount, GenesisConfig, InflationInfo,
MaintenanceModeConfig, ParachainInfoConfig, ParachainStakingConfig, Precompiles, Range,
SchedulerConfig, SudoConfig, SystemConfig, TechCommitteeCollectiveConfig, WASM_BINARY,
Runtime, SchedulerConfig, SudoConfig, SystemConfig, TechCommitteeCollectiveConfig, WASM_BINARY,
};
use nimbus_primitives::NimbusId;
use sc_service::ChainType;
Expand Down Expand Up @@ -145,21 +145,28 @@ pub fn get_chain_spec(para_id: ParaId) -> ChainSpec {

pub fn moonbeam_inflation_config() -> InflationInfo<Balance> {
InflationInfo {
// staking expectations
expect: Range {
min: 100_000 * GLMR,
ideal: 200_000 * GLMR,
max: 500_000 * GLMR,
},
// annual inflation
annual: Range {
min: Perbill::from_percent(4),
ideal: Perbill::from_percent(5),
max: Perbill::from_percent(5),
},
// 8766 rounds (hours) in a year
round: Range {
min: Perbill::from_parts(Perbill::from_percent(4).deconstruct() / 8766),
ideal: Perbill::from_parts(Perbill::from_percent(5).deconstruct() / 8766),
max: Perbill::from_parts(Perbill::from_percent(5).deconstruct() / 8766),
min: Perbill::from_parts(
Perbill::from_percent(4).deconstruct() / Runtime::DefaultBlocksPerRound::get(),
),
ideal: Perbill::from_parts(
Perbill::from_percent(5).deconstruct() / Runtime::DefaultBlocksPerRound::get(),
),
max: Perbill::from_parts(
Perbill::from_percent(5).deconstruct() / Runtime::DefaultBlocksPerRound::get(),
),
},
}
}
Expand Down
17 changes: 12 additions & 5 deletions node/service/src/chain_spec/moonriver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use moonriver_runtime::{
CouncilCollectiveConfig, CrowdloanRewardsConfig, DemocracyConfig, EVMConfig,
EthereumChainIdConfig, EthereumConfig, GenesisAccount, GenesisConfig, InflationInfo,
MaintenanceModeConfig, ParachainInfoConfig, ParachainStakingConfig, Precompiles, Range,
SchedulerConfig, SystemConfig, TechCommitteeCollectiveConfig, WASM_BINARY,
Runtime, SchedulerConfig, SystemConfig, TechCommitteeCollectiveConfig, WASM_BINARY,
};
use nimbus_primitives::NimbusId;
use sc_service::ChainType;
Expand Down Expand Up @@ -141,21 +141,28 @@ pub fn get_chain_spec(para_id: ParaId) -> ChainSpec {

pub fn moonbeam_inflation_config() -> InflationInfo<Balance> {
InflationInfo {
// staking expectations
expect: Range {
min: 100_000 * MOVR,
ideal: 200_000 * MOVR,
max: 500_000 * MOVR,
},
// annual inflation
annual: Range {
min: Perbill::from_percent(4),
ideal: Perbill::from_percent(5),
max: Perbill::from_percent(5),
},
// 8766 rounds (hours) in a year
round: Range {
min: Perbill::from_parts(Perbill::from_percent(4).deconstruct() / 8766),
ideal: Perbill::from_parts(Perbill::from_percent(5).deconstruct() / 8766),
max: Perbill::from_parts(Perbill::from_percent(5).deconstruct() / 8766),
min: Perbill::from_parts(
Perbill::from_percent(4).deconstruct() / Runtime::DefaultBlocksPerRound::get(),
),
ideal: Perbill::from_parts(
Perbill::from_percent(5).deconstruct() / Runtime::DefaultBlocksPerRound::get(),
),
max: Perbill::from_parts(
Perbill::from_percent(5).deconstruct() / Runtime::DefaultBlocksPerRound::get(),
),
},
}
}
Expand Down