Skip to content
New issue

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

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

Already on GitHub? # to your account

fix dollar #755

Merged
merged 1 commit into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions node/service/src/chain_spec/bifrost_kusama.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ use std::{
};

use bifrost_kusama_runtime::{
AccountId, Balance, BalancesConfig, BlockNumber, CouncilConfig, CouncilMembershipConfig,
DefaultBlocksPerRound, DemocracyConfig, GenesisConfig, IndicesConfig, InflationInfo,
ParachainInfoConfig, ParachainStakingConfig, PolkadotXcmConfig, Range, Runtime, SS58Prefix,
SalpConfig, SalpLiteConfig, SessionConfig, SystemConfig, TechnicalCommitteeConfig,
constants::currency::DOLLARS, AccountId, Balance, BalancesConfig, BlockNumber, CouncilConfig,
CouncilMembershipConfig, DefaultBlocksPerRound, DemocracyConfig, GenesisConfig, IndicesConfig,
InflationInfo, ParachainInfoConfig, ParachainStakingConfig, PolkadotXcmConfig, Range, Runtime,
SS58Prefix, SalpConfig, SalpLiteConfig, SessionConfig, SystemConfig, TechnicalCommitteeConfig,
TechnicalMembershipConfig, TokensConfig, VestingConfig, WASM_BINARY,
};
use bifrost_runtime_common::{dollar, AuraId};
use bifrost_runtime_common::AuraId;
use cumulus_primitives_core::ParaId;
use frame_benchmarking::{account, whitelisted_caller};
use hex_literal::hex;
Expand All @@ -53,7 +53,7 @@ pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig, RelayExtensions

#[allow(non_snake_case)]
pub fn ENDOWMENT() -> u128 {
1_000_000 * dollar::<Runtime>(CurrencyId::Native(TokenSymbol::BNC))
1_000_000 * DOLLARS
}

pub const PARA_ID: u32 = 2001;
Expand All @@ -74,11 +74,7 @@ pub fn inflation_config() -> InflationInfo<Balance> {
};
InflationInfo {
// staking expectations
expect: Range {
min: 100_000 * dollar::<Runtime>(CurrencyId::Native(TokenSymbol::BNC)),
ideal: 200_000 * dollar::<Runtime>(CurrencyId::Native(TokenSymbol::BNC)),
max: 500_000 * dollar::<Runtime>(CurrencyId::Native(TokenSymbol::BNC)),
},
expect: Range { min: 100_000 * DOLLARS, ideal: 200_000 * DOLLARS, max: 500_000 * DOLLARS },
// annual inflation
annual,
round: to_round_inflation(annual),
Expand Down Expand Up @@ -514,11 +510,7 @@ fn bifrost_config_genesis(id: ParaId) -> GenesisConfig {
.into_iter()
.collect();

assert_eq!(
total_issuance,
32_000_000 * dollar::<Runtime>(CurrencyId::Native(TokenSymbol::BNC)),
"total issuance must be equal to 320 million"
);
assert_eq!(total_issuance, 32_000_000 * DOLLARS, "total issuance must be equal to 320 million");

let vesting_configs: Vec<VestingConfig> =
config_from_json_files(exe_dir.join("res/genesis_config/vesting")).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions node/service/src/chain_spec/bifrost_polkadot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use bifrost_polkadot_runtime::{
Runtime, SS58Prefix, SalpConfig, SessionConfig, SudoConfig, SystemConfig, TokensConfig,
VestingConfig, WASM_BINARY,
};
use bifrost_runtime_common::{dollar, AuraId};
use bifrost_runtime_common::AuraId;
use cumulus_primitives_core::ParaId;
use frame_benchmarking::{account, whitelisted_caller};
use hex_literal::hex;
Expand All @@ -43,7 +43,7 @@ pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig, RelayExtensions

#[allow(non_snake_case)]
pub fn ENDOWMENT() -> u128 {
1_000_000 * dollar::<Runtime>(CurrencyId::Native(TokenSymbol::BNC))
1_000_000 * DOLLARS
}

pub const PARA_ID: u32 = 2030;
Expand Down
3 changes: 3 additions & 0 deletions runtime/bifrost-kusama/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ pub mod currency {
use smallvec::smallvec;
pub use sp_runtime::Perbill;

pub const BNCS: Balance = 1_000_000_000_000;
pub const DOLLARS: Balance = BNCS;

pub fn deposit<Runtime: Config>(items: u32, bytes: u32) -> Balance {
items as Balance * 15 * cent::<Runtime>(CurrencyId::Native(TokenSymbol::BNC)) +
(bytes as Balance) * 6 * cent::<Runtime>(CurrencyId::Native(TokenSymbol::BNC))
Expand Down