diff --git a/node/service/src/chain_spec/bifrost_kusama.rs b/node/service/src/chain_spec/bifrost_kusama.rs index f474c371d4..fb0f2f520f 100644 --- a/node/service/src/chain_spec/bifrost_kusama.rs +++ b/node/service/src/chain_spec/bifrost_kusama.rs @@ -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; @@ -53,7 +53,7 @@ pub type ChainSpec = sc_service::GenericChainSpec u128 { - 1_000_000 * dollar::(CurrencyId::Native(TokenSymbol::BNC)) + 1_000_000 * DOLLARS } pub const PARA_ID: u32 = 2001; @@ -74,11 +74,7 @@ pub fn inflation_config() -> InflationInfo { }; InflationInfo { // staking expectations - expect: Range { - min: 100_000 * dollar::(CurrencyId::Native(TokenSymbol::BNC)), - ideal: 200_000 * dollar::(CurrencyId::Native(TokenSymbol::BNC)), - max: 500_000 * dollar::(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), @@ -514,11 +510,7 @@ fn bifrost_config_genesis(id: ParaId) -> GenesisConfig { .into_iter() .collect(); - assert_eq!( - total_issuance, - 32_000_000 * dollar::(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 = config_from_json_files(exe_dir.join("res/genesis_config/vesting")).unwrap(); diff --git a/node/service/src/chain_spec/bifrost_polkadot.rs b/node/service/src/chain_spec/bifrost_polkadot.rs index 314c975678..adb4179b4c 100644 --- a/node/service/src/chain_spec/bifrost_polkadot.rs +++ b/node/service/src/chain_spec/bifrost_polkadot.rs @@ -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; @@ -43,7 +43,7 @@ pub type ChainSpec = sc_service::GenericChainSpec u128 { - 1_000_000 * dollar::(CurrencyId::Native(TokenSymbol::BNC)) + 1_000_000 * DOLLARS } pub const PARA_ID: u32 = 2030; diff --git a/runtime/bifrost-kusama/src/constants.rs b/runtime/bifrost-kusama/src/constants.rs index 66c36cdb38..d2341864c3 100644 --- a/runtime/bifrost-kusama/src/constants.rs +++ b/runtime/bifrost-kusama/src/constants.rs @@ -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(items: u32, bytes: u32) -> Balance { items as Balance * 15 * cent::(CurrencyId::Native(TokenSymbol::BNC)) + (bytes as Balance) * 6 * cent::(CurrencyId::Native(TokenSymbol::BNC))