diff --git a/Cargo.lock b/Cargo.lock index ea1ffd9771..609b42f6f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,7 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - [[package]] name = "Inflector" version = "0.11.4" diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index c7de705610..f0a46d96f5 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -112,6 +112,9 @@ pub type Precompiles = MoonbasePrecompiles; pub mod currency { use super::Balance; + // Provide a common factor between runtimes based on a supply of 10_000_000 tokens. + pub const SUPPLY_FACTOR: Balance = 1; + pub const WEI: Balance = 1; pub const KILOWEI: Balance = 1_000; pub const MEGAWEI: Balance = 1_000_000; @@ -121,11 +124,11 @@ pub mod currency { pub const UNIT: Balance = 1_000_000_000_000_000_000; pub const KILOUNIT: Balance = 1_000_000_000_000_000_000_000; - pub const TRANSACTION_BYTE_FEE: Balance = 10 * MICROUNIT; - pub const STORAGE_BYTE_FEE: Balance = 100 * MICROUNIT; + pub const TRANSACTION_BYTE_FEE: Balance = 10 * MICROUNIT * SUPPLY_FACTOR; + pub const STORAGE_BYTE_FEE: Balance = 100 * MICROUNIT * SUPPLY_FACTOR; pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 1 * UNIT + (bytes as Balance) * STORAGE_BYTE_FEE + items as Balance * 1 * UNIT * SUPPLY_FACTOR + (bytes as Balance) * STORAGE_BYTE_FEE } } @@ -362,7 +365,7 @@ parameter_types! { pub struct FixedGasPrice; impl FeeCalculator for FixedGasPrice { fn min_gas_price() -> U256 { - (1 * currency::GIGAWEI).into() + (1 * currency::GIGAWEI * currency::SUPPLY_FACTOR).into() } } @@ -490,7 +493,7 @@ parameter_types! { pub const FastTrackVotingPeriod: BlockNumber = 4 * HOURS; pub const EnactmentPeriod: BlockNumber = 1 * DAYS; pub const CooloffPeriod: BlockNumber = 7 * DAYS; - pub const MinimumDeposit: Balance = 4 * currency::UNIT; + pub const MinimumDeposit: Balance = 4 * currency::UNIT * currency::SUPPLY_FACTOR; pub const MaxVotes: u32 = 100; pub const MaxProposals: u32 = 100; pub const PreimageByteDeposit: Balance = currency::STORAGE_BYTE_FEE; @@ -552,7 +555,7 @@ impl pallet_democracy::Config for Runtime { parameter_types! { pub const ProposalBond: Permill = Permill::from_percent(5); - pub const ProposalBondMinimum: Balance = 1 * currency::UNIT; + pub const ProposalBondMinimum: Balance = 1 * currency::UNIT * currency::SUPPLY_FACTOR; pub const SpendPeriod: BlockNumber = 6 * DAYS; pub const TreasuryId: PalletId = PalletId(*b"pc/trsry"); pub const MaxApprovals: u32 = 100; @@ -699,11 +702,11 @@ parameter_types! { /// Default percent of inflation set aside for parachain bond every round pub const DefaultParachainBondReservePercent: Percent = Percent::from_percent(30); /// Minimum stake required to become a collator is 1_000 - pub const MinCollatorStk: u128 = 1 * currency::KILOUNIT; + pub const MinCollatorStk: u128 = 1 * currency::KILOUNIT * currency::SUPPLY_FACTOR; /// Minimum stake required to be reserved to be a candidate is 1_000 - pub const MinCollatorCandidateStk: u128 = 1 * currency::KILOUNIT; + pub const MinCollatorCandidateStk: u128 = 1 * currency::KILOUNIT * currency::SUPPLY_FACTOR; /// Minimum stake required to be reserved to be a nominator is 5 - pub const MinNominatorStk: u128 = 5 * currency::UNIT; + pub const MinNominatorStk: u128 = 5 * currency::UNIT * currency::SUPPLY_FACTOR; } impl parachain_staking::Config for Runtime { @@ -768,7 +771,7 @@ impl pallet_crowdloan_rewards::Config for Runtime { } parameter_types! { - pub const DepositAmount: Balance = 100 * currency::UNIT; + pub const DepositAmount: Balance = 100 * currency::UNIT * currency::SUPPLY_FACTOR; } // This is a simple session key manager. It should probably either work with, or be replaced // entirely by pallet sessions @@ -1598,3 +1601,61 @@ cumulus_pallet_parachain_system::register_validate_block!( ); runtime_common::impl_self_contained_call!(); + +#[cfg(test)] +mod tests { + use super::{currency::*, *}; + + #[test] + fn currency_constants_are_correct() { + assert_eq!(SUPPLY_FACTOR, 1); + + // txn fees + assert_eq!(TRANSACTION_BYTE_FEE, Balance::from(10 * MICROUNIT)); + assert_eq!(OperationalFeeMultiplier::get(), 5_u8); + assert_eq!(STORAGE_BYTE_FEE, Balance::from(100 * MICROUNIT)); + assert_eq!(FixedGasPrice::min_gas_price(), (1 * GIGAWEI).into()); + + // democracy minimums + assert_eq!(MinimumDeposit::get(), Balance::from(4 * UNIT)); + assert_eq!(PreimageByteDeposit::get(), Balance::from(100 * MICROUNIT)); + assert_eq!(ProposalBondMinimum::get(), Balance::from(1 * UNIT)); + + // pallet_identity deposits + assert_eq!( + BasicDeposit::get(), + Balance::from(1 * UNIT + 25800 * MICROUNIT) + ); + assert_eq!(FieldDeposit::get(), Balance::from(6600 * MICROUNIT)); + assert_eq!( + SubAccountDeposit::get(), + Balance::from(1 * UNIT + 5300 * MICROUNIT) + ); + + // staking minimums + assert_eq!(MinCollatorStk::get(), Balance::from(1 * KILOUNIT)); + assert_eq!(MinCollatorCandidateStk::get(), Balance::from(1 * KILOUNIT)); + assert_eq!(MinNominatorStk::get(), Balance::from(5 * UNIT)); + + // crowdloan min reward + assert_eq!(MinimumReward::get(), Balance::from(0u128)); + + // deposit for AuthorMapping + assert_eq!(DepositAmount::get(), Balance::from(100 * UNIT)); + + // proxy deposits + assert_eq!( + ProxyDepositBase::get(), + Balance::from(1 * UNIT + 800 * MICROUNIT) + ); + assert_eq!(ProxyDepositFactor::get(), Balance::from(2100 * MICROUNIT)); + assert_eq!( + AnnouncementDepositBase::get(), + Balance::from(1 * UNIT + 800 * MICROUNIT) + ); + assert_eq!( + AnnouncementDepositFactor::get(), + Balance::from(5600 * MICROUNIT) + ); + } +} diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 0f99e49543..931e34e1bc 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -32,7 +32,7 @@ use cumulus_pallet_parachain_system::RelaychainBlockNumberProvider; use fp_rpc::TransactionStatus; use frame_support::{ construct_runtime, parameter_types, - traits::{Contains, Get, Imbalance, InstanceFilter, OnUnbalanced}, + traits::{Contains, Everything, Get, Imbalance, InstanceFilter, OnUnbalanced}, weights::{ constants::{RocksDbWeight, WEIGHT_PER_SECOND}, DispatchClass, GetDispatchInfo, IdentityFee, Weight, @@ -86,6 +86,9 @@ pub type Precompiles = MoonbeamPrecompiles; pub mod currency { use super::Balance; + // Provide a common factor between runtimes based on a supply of 10_000_000 tokens. + pub const SUPPLY_FACTOR: Balance = 100; + pub const WEI: Balance = 1; pub const KILOWEI: Balance = 1_000; pub const MEGAWEI: Balance = 1_000_000; @@ -95,11 +98,11 @@ pub mod currency { pub const GLMR: Balance = 1_000_000_000_000_000_000; pub const KILOGLMR: Balance = 1_000_000_000_000_000_000_000; - pub const TRANSACTION_BYTE_FEE: Balance = 10 * MICROGLMR; - pub const STORAGE_BYTE_FEE: Balance = 100 * MICROGLMR; + pub const TRANSACTION_BYTE_FEE: Balance = 10 * MICROGLMR * SUPPLY_FACTOR; + pub const STORAGE_BYTE_FEE: Balance = 100 * MICROGLMR * SUPPLY_FACTOR; pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 1 * GLMR + (bytes as Balance) * STORAGE_BYTE_FEE + items as Balance * 1 * GLMR * SUPPLY_FACTOR + (bytes as Balance) * STORAGE_BYTE_FEE } } @@ -351,7 +354,7 @@ parameter_types! { pub struct FixedGasPrice; impl FeeCalculator for FixedGasPrice { fn min_gas_price() -> U256 { - (1 * currency::GIGAWEI).into() + (1 * currency::GIGAWEI * currency::SUPPLY_FACTOR).into() } } @@ -405,7 +408,7 @@ impl pallet_scheduler::Config for Runtime { parameter_types! { /// The maximum amount of time (in blocks) for council members to vote on motions. /// Motions may end in fewer blocks if enough votes are cast to determine the result. - pub const CouncilMotionDuration: BlockNumber = 7 * DAYS; + pub const CouncilMotionDuration: BlockNumber = 3 * DAYS; /// The maximum number of Proposlas that can be open in the council at once. pub const CouncilMaxProposals: u32 = 100; /// The maximum number of council members. @@ -413,7 +416,7 @@ parameter_types! { /// The maximum amount of time (in blocks) for technical committee members to vote on motions. /// Motions may end in fewer blocks if enough votes are cast to determine the result. - pub const TechCommitteeMotionDuration: BlockNumber = 7 * DAYS; + pub const TechCommitteeMotionDuration: BlockNumber = 3 * DAYS; /// The maximum number of Proposlas that can be open in the technical committee at once. pub const TechCommitteeMaxProposals: u32 = 100; /// The maximum number of technical committee members. @@ -446,20 +449,19 @@ impl pallet_collective::Config for Runtime { } parameter_types! { - pub const LaunchPeriod: BlockNumber = 1 * DAYS; - pub const VotingPeriod: BlockNumber = 5 * DAYS; - pub const VoteLockingPeriod: BlockNumber = 1 * DAYS; - pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS; - pub const EnactmentPeriod: BlockNumber = 1 *DAYS; + pub const LaunchPeriod: BlockNumber = 7 * DAYS; + pub const VotingPeriod: BlockNumber = 14 * DAYS; + pub const VoteLockingPeriod: BlockNumber = 7 * DAYS; + pub const FastTrackVotingPeriod: BlockNumber = 1 * DAYS; + pub const EnactmentPeriod: BlockNumber = 2 * DAYS; pub const CooloffPeriod: BlockNumber = 7 * DAYS; - pub const MinimumDeposit: Balance = 4 * currency::GLMR; + pub const MinimumDeposit: Balance = 4 * currency::GLMR * currency::SUPPLY_FACTOR; pub const MaxVotes: u32 = 100; pub const MaxProposals: u32 = 100; pub const PreimageByteDeposit: Balance = currency::STORAGE_BYTE_FEE; - pub const InstantAllowed: bool = false; + pub const InstantAllowed: bool = true; } -// todo : ensure better origins impl pallet_democracy::Config for Runtime { type Proposal = Call; type Event = Event; @@ -515,19 +517,31 @@ impl pallet_democracy::Config for Runtime { parameter_types! { pub const ProposalBond: Permill = Permill::from_percent(5); - pub const ProposalBondMinimum: Balance = 1 * currency::GLMR; + pub const ProposalBondMinimum: Balance = 1 * currency::GLMR * currency::SUPPLY_FACTOR; pub const SpendPeriod: BlockNumber = 6 * DAYS; pub const TreasuryId: PalletId = PalletId(*b"py/trsry"); pub const MaxApprovals: u32 = 100; } +type TreasuryApproveOrigin = EnsureOneOf< + AccountId, + EnsureRoot, + pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilInstance>, +>; + +type TreasuryRejectOrigin = EnsureOneOf< + AccountId, + EnsureRoot, + pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilInstance>, +>; + impl pallet_treasury::Config for Runtime { type PalletId = TreasuryId; type Currency = Balances; - // Democracy dispatches Root - type ApproveOrigin = EnsureRoot; - // Democracy dispatches Root - type RejectOrigin = EnsureRoot; + // At least three-fifths majority of the council is required (or root) to approve a proposal + type ApproveOrigin = TreasuryApproveOrigin; + // More than half of the council is required (or root) to reject a proposal + type RejectOrigin = TreasuryRejectOrigin; type Event = Event; // If spending proposal rejected, transfer proposer bond to treasury type OnSlash = Treasury; @@ -628,15 +642,15 @@ impl parachain_info::Config for Runtime {} parameter_types! { /// Minimum round length is 2 minutes (10 * 12 second block times) pub const MinBlocksPerRound: u32 = 10; - /// Default BlocksPerRound is every hour (300 * 12 second block times) - pub const DefaultBlocksPerRound: u32 = 300; - /// Collator candidate exits are delayed by 2 hours (2 * 300 * block_time) + /// Default BlocksPerRound is every 4 hours (1200 * 12 second block times) + pub const DefaultBlocksPerRound: u32 = 4 * HOURS; + /// Collator candidate exits are delayed by 2 rounds pub const LeaveCandidatesDelay: u32 = 2; - /// Nominator exits are delayed by 2 hours (2 * 300 * block_time) + /// Nominator exits are delayed by 2 rounds pub const LeaveNominatorsDelay: u32 = 2; - /// Nomination revocations are delayed by 2 hours (2 * 300 * block_time) + /// Nomination revocations are delayed by 2 rounds pub const RevokeNominationDelay: u32 = 2; - /// Reward payments are delayed by 2 hours (2 * 300 * block_time) + /// Reward payments are delayed by 2 rounds pub const RewardPaymentDelay: u32 = 2; /// Minimum 8 collators selected per round, default at genesis and minimum forever after pub const MinSelectedCandidates: u32 = 8; @@ -648,12 +662,13 @@ parameter_types! { pub const DefaultCollatorCommission: Perbill = Perbill::from_percent(20); /// Default percent of inflation set aside for parachain bond every round pub const DefaultParachainBondReservePercent: Percent = Percent::from_percent(30); - /// Minimum stake required to become a collator is 1_000 - pub const MinCollatorStk: u128 = 1 * currency::KILOGLMR; - /// Minimum stake required to be reserved to be a candidate is 1_000 - pub const MinCollatorCandidateStk: u128 = 1 * currency::KILOGLMR; + /// Minimum stake required to become a collator + pub const MinCollatorStk: u128 = 1 * currency::KILOGLMR * currency::SUPPLY_FACTOR; + // TODO: Restore to 100_000 for Phase 2 (remove the division by 10) + /// Minimum stake required to be reserved to be a candidate + pub const MinCollatorCandidateStk: u128 = currency::KILOGLMR * currency::SUPPLY_FACTOR / 10; /// Minimum stake required to be reserved to be a nominator is 5 - pub const MinNominatorStk: u128 = 5 * currency::GLMR; + pub const MinNominatorStk: u128 = 5 * currency::GLMR * currency::SUPPLY_FACTOR; } impl parachain_staking::Config for Runtime { type Event = Event; @@ -707,7 +722,9 @@ impl pallet_crowdloan_rewards::Config for Runtime { type MinimumReward = MinimumReward; type RewardCurrency = Balances; type RelayChainAccountId = AccountId32; - type RewardAddressChangeOrigin = EnsureSigned; + + // This will get accessible to users in future phases. + type RewardAddressChangeOrigin = EnsureRoot; type RewardAddressRelayVoteThreshold = RelaySignaturesThreshold; type VestingBlockNumber = cumulus_primitives_core::relay_chain::BlockNumber; type VestingBlockProvider = @@ -716,7 +733,7 @@ impl pallet_crowdloan_rewards::Config for Runtime { } parameter_types! { - pub const DepositAmount: Balance = 100 * currency::GLMR; + pub const DepositAmount: Balance = 100 * currency::GLMR * currency::SUPPLY_FACTOR; } // This is a simple session key manager. It should probably either work with, or be replaced // entirely by pallet sessions @@ -730,9 +747,11 @@ impl pallet_author_mapping::Config for Runtime { parameter_types! { // One storage item; key size 32, value size 8; . - pub const ProxyDepositBase: Balance = currency::deposit(1, 8); + // TODO: Restore the real value before phase 2 + pub const ProxyDepositBase: Balance = 0;//currency::deposit(1, 8); // Additional storage item size of 21 bytes (20 bytes AccountId + 1 byte sizeof(ProxyType)). - pub const ProxyDepositFactor: Balance = currency::deposit(0, 21); + // TODO: Restore the real value before phase 2 + pub const ProxyDepositFactor: Balance = 0;//currency::deposit(0, 21); pub const MaxProxies: u16 = 32; pub const AnnouncementDepositBase: Balance = currency::deposit(1, 8); // Additional storage item size of 56 bytes: @@ -846,10 +865,9 @@ impl pallet_migrations::Config for Runtime { >; } -/// Call filter expected to be used during Phase 3 of the Moonbeam rollout -/// At least it was used in Moonriver phase3 -pub struct PhaseThreeFilter; -impl Contains for PhaseThreeFilter { +/// Call filter used during Phase 3 of the Moonriver rollout +pub struct MaintenanceFilter; +impl Contains for MaintenanceFilter { fn contains(c: &Call) -> bool { match c { Call::Balances(_) => false, @@ -864,7 +882,7 @@ impl Contains for PhaseThreeFilter { impl pallet_maintenance_mode::Config for Runtime { type Event = Event; type NormalCallFilter = BaseFilter; - type MaintenanceCallFilter = PhaseThreeFilter; + type MaintenanceCallFilter = MaintenanceFilter; type MaintenanceOrigin = pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, TechCommitteeInstance>; } @@ -1082,3 +1100,71 @@ cumulus_pallet_parachain_system::register_validate_block!( ); runtime_common::impl_self_contained_call!(); + +#[cfg(test)] +mod tests { + use super::{currency::*, *}; + use sp_runtime::traits::Zero; + + #[test] + fn currency_constants_are_correct() { + assert_eq!(SUPPLY_FACTOR, 100); + + // txn fees + assert_eq!(TRANSACTION_BYTE_FEE, Balance::from(1 * MILLIGLMR)); + assert_eq!(OperationalFeeMultiplier::get(), 5_u8); + assert_eq!(STORAGE_BYTE_FEE, Balance::from(10 * MILLIGLMR)); + assert_eq!(FixedGasPrice::min_gas_price(), (100 * GIGAWEI).into()); + + // democracy minimums + assert_eq!(MinimumDeposit::get(), Balance::from(400 * GLMR)); + assert_eq!(PreimageByteDeposit::get(), Balance::from(10 * MILLIGLMR)); + assert_eq!(ProposalBondMinimum::get(), Balance::from(100 * GLMR)); + + // pallet_identity deposits + assert_eq!( + BasicDeposit::get(), + Balance::from(100 * GLMR + 2580 * MILLIGLMR) + ); + assert_eq!(FieldDeposit::get(), Balance::from(660 * MILLIGLMR)); + assert_eq!( + SubAccountDeposit::get(), + Balance::from(100 * GLMR + 530 * MILLIGLMR) + ); + + // staking minimums + assert_eq!(MinCollatorStk::get(), Balance::from(100 * KILOGLMR)); + assert_eq!( + MinCollatorCandidateStk::get(), + // TODO restore real value before phase 2 + Balance::from(10 * KILOGLMR) //Balance::from(100 * KILOGLMR) + ); + assert_eq!(MinNominatorStk::get(), Balance::from(500 * GLMR)); + + // crowdloan min reward + assert_eq!(MinimumReward::get(), Balance::from(0u128)); + + // deposit for AuthorMapping + assert_eq!(DepositAmount::get(), Balance::from(10 * KILOGLMR)); + + // proxy deposits + assert_eq!( + ProxyDepositBase::get(), + // TODO restore real value before phase 2 + Balance::zero() //Balance::from(100 * GLMR + 80 * MILLIGLMR) + ); + assert_eq!( + ProxyDepositFactor::get(), + // TODO restore real value before phase 2 + Balance::zero() //Balance::from(210 * MILLIGLMR) + ); + assert_eq!( + AnnouncementDepositBase::get(), + Balance::from(100 * GLMR + 80 * MILLIGLMR) + ); + assert_eq!( + AnnouncementDepositFactor::get(), + Balance::from(560 * MILLIGLMR) + ); + } +} diff --git a/runtime/moonbeam/tests/integration_test.rs b/runtime/moonbeam/tests/integration_test.rs index d2967df88d..bd5be3bb59 100644 --- a/runtime/moonbeam/tests/integration_test.rs +++ b/runtime/moonbeam/tests/integration_test.rs @@ -30,8 +30,9 @@ use frame_support::{ StorageHasher, Twox128, }; use moonbeam_runtime::{ - currency::GLMR, AccountId, Balances, BlockWeights, Call, CrowdloanRewards, Event, - ParachainStaking, Precompiles, Runtime, System, + currency::{GIGAWEI, GLMR}, + AccountId, Balances, BlockWeights, Call, CrowdloanRewards, Event, ParachainStaking, + Precompiles, Runtime, System, }; use nimbus_primitives::NimbusId; use pallet_evm::PrecompileSet; @@ -47,8 +48,8 @@ use sp_runtime::{ }; #[test] -fn fast_track_unavailable() { - assert!(!::InstantAllowed::get()); +fn fast_track_available() { + assert!(::InstantAllowed::get()); } #[test] @@ -240,25 +241,29 @@ fn verify_pallet_indices() { fn join_collator_candidates() { ExtBuilder::default() .with_balances(vec![ - (AccountId::from(ALICE), 2_000 * GLMR), - (AccountId::from(BOB), 2_000 * GLMR), - (AccountId::from(CHARLIE), 1_100 * GLMR), - (AccountId::from(DAVE), 1_000 * GLMR), + (AccountId::from(ALICE), 200_000 * GLMR), + (AccountId::from(BOB), 200_000 * GLMR), + (AccountId::from(CHARLIE), 110_000 * GLMR), + (AccountId::from(DAVE), 100_000 * GLMR), ]) .with_collators(vec![ - (AccountId::from(ALICE), 1_000 * GLMR), - (AccountId::from(BOB), 1_000 * GLMR), + (AccountId::from(ALICE), 100_000 * GLMR), + (AccountId::from(BOB), 100_000 * GLMR), ]) .with_nominations(vec![ - (AccountId::from(CHARLIE), AccountId::from(ALICE), 50 * GLMR), - (AccountId::from(CHARLIE), AccountId::from(BOB), 50 * GLMR), + ( + AccountId::from(CHARLIE), + AccountId::from(ALICE), + 5_000 * GLMR, + ), + (AccountId::from(CHARLIE), AccountId::from(BOB), 5_000 * GLMR), ]) .build() .execute_with(|| { assert_noop!( ParachainStaking::join_candidates( origin_of(AccountId::from(ALICE)), - 1_000 * GLMR, + 100_000 * GLMR, 2u32 ), parachain_staking::Error::::CandidateExists @@ -266,7 +271,7 @@ fn join_collator_candidates() { assert_noop!( ParachainStaking::join_candidates( origin_of(AccountId::from(CHARLIE)), - 1_000 * GLMR, + 100_000 * GLMR, 2u32 ), parachain_staking::Error::::NominatorExists @@ -274,15 +279,15 @@ fn join_collator_candidates() { assert!(System::events().is_empty()); assert_ok!(ParachainStaking::join_candidates( origin_of(AccountId::from(DAVE)), - 1_000 * GLMR, + 100_000 * GLMR, 2u32 )); assert_eq!( last_event(), Event::ParachainStaking(parachain_staking::Event::JoinedCollatorCandidates( AccountId::from(DAVE), - 1_000 * GLMR, - 3_100 * GLMR + 100_000 * GLMR, + 310_000 * GLMR )) ); let candidates = ParachainStaking::candidate_pool(); @@ -290,21 +295,21 @@ fn join_collator_candidates() { candidates.0[0], Bond { owner: AccountId::from(ALICE), - amount: 1_050 * GLMR + amount: 105_000 * GLMR } ); assert_eq!( candidates.0[1], Bond { owner: AccountId::from(BOB), - amount: 1_050 * GLMR + amount: 105_000 * GLMR } ); assert_eq!( candidates.0[2], Bond { owner: AccountId::from(DAVE), - amount: 1_000 * GLMR + amount: 100_000 * GLMR } ); }); @@ -313,14 +318,14 @@ fn join_collator_candidates() { #[test] fn transfer_through_evm_to_stake() { ExtBuilder::default() - .with_balances(vec![(AccountId::from(ALICE), 2_000 * GLMR)]) + .with_balances(vec![(AccountId::from(ALICE), 200_000 * GLMR)]) .build() .execute_with(|| { // Charlie has no balance => fails to stake assert_noop!( ParachainStaking::join_candidates( origin_of(AccountId::from(CHARLIE)), - 1_000 * GLMR, + 100_000 * GLMR, 2u32 ), DispatchError::Module { @@ -329,22 +334,22 @@ fn transfer_through_evm_to_stake() { message: Some("InsufficientBalance") } ); - // Alice transfer from free balance 2000 GLMR to Bob + // Alice transfer from free balance 200_000 GLMR to Bob assert_ok!(Balances::transfer( origin_of(AccountId::from(ALICE)), AccountId::from(BOB), - 2_000 * GLMR, + 200_000 * GLMR, )); - assert_eq!(Balances::free_balance(AccountId::from(BOB)), 2_000 * GLMR); + assert_eq!(Balances::free_balance(AccountId::from(BOB)), 200_000 * GLMR); let gas_limit = 100000u64; - let gas_price: U256 = 1_000_000_000.into(); - // Bob transfers 1000 GLMR to Charlie via EVM + let gas_price: U256 = (100 * GIGAWEI).into(); + // Bob transfers 100_000 GLMR to Charlie via EVM assert_ok!(Call::EVM(pallet_evm::Call::::call { source: AccountId::from(BOB), target: AccountId::from(CHARLIE), input: vec![], - value: (1_000 * GLMR).into(), + value: (100_000 * GLMR).into(), gas_limit, gas_price, nonce: None @@ -352,13 +357,13 @@ fn transfer_through_evm_to_stake() { .dispatch(::Origin::root())); assert_eq!( Balances::free_balance(AccountId::from(CHARLIE)), - 1_000 * GLMR, + 100_000 * GLMR, ); // Charlie can stake now assert_ok!(ParachainStaking::join_candidates( origin_of(AccountId::from(CHARLIE)), - 1_000 * GLMR, + 100_000 * GLMR, 2u32 ),); let candidates = ParachainStaking::candidate_pool(); @@ -366,7 +371,7 @@ fn transfer_through_evm_to_stake() { candidates.0[0], Bond { owner: AccountId::from(CHARLIE), - amount: 1_000 * GLMR + amount: 100_000 * GLMR } ); }); @@ -376,15 +381,15 @@ fn transfer_through_evm_to_stake() { fn reward_block_authors() { ExtBuilder::default() .with_balances(vec![ - // Alice gets 100 extra tokens for her mapping deposit - (AccountId::from(ALICE), 2_100 * GLMR), - (AccountId::from(BOB), 1_000 * GLMR), + // Alice gets 10k extra tokens for her mapping deposit + (AccountId::from(ALICE), 210_000 * GLMR), + (AccountId::from(BOB), 100_000 * GLMR), ]) - .with_collators(vec![(AccountId::from(ALICE), 1_000 * GLMR)]) + .with_collators(vec![(AccountId::from(ALICE), 100_000 * GLMR)]) .with_nominations(vec![( AccountId::from(BOB), AccountId::from(ALICE), - 500 * GLMR, + 50_000 * GLMR, )]) .with_mappings(vec![( NimbusId::from_slice(&ALICE_NIMBUS), @@ -393,23 +398,26 @@ fn reward_block_authors() { .build() .execute_with(|| { set_parachain_inherent_data(); - for x in 2..599 { + for x in 2..2399 { set_author(NimbusId::from_slice(&ALICE_NIMBUS)); run_to_block(x); } // no rewards doled out yet - assert_eq!(Balances::free_balance(AccountId::from(ALICE)), 1_000 * GLMR,); - assert_eq!(Balances::free_balance(AccountId::from(BOB)), 500 * GLMR,); + assert_eq!( + Balances::free_balance(AccountId::from(ALICE)), + 100_000 * GLMR, + ); + assert_eq!(Balances::free_balance(AccountId::from(BOB)), 50_000 * GLMR,); set_author(NimbusId::from_slice(&ALICE_NIMBUS)); - run_to_block(600); + run_to_block(2400); // rewards minted and distributed assert_eq!( Balances::free_balance(AccountId::from(ALICE)), - 1113666666584000000000, + 111366666658400000000000, ); assert_eq!( Balances::free_balance(AccountId::from(BOB)), - 541333333292000000000, + 54133333329200000000000, ); }); } @@ -418,16 +426,16 @@ fn reward_block_authors() { fn reward_block_authors_with_parachain_bond_reserved() { ExtBuilder::default() .with_balances(vec![ - // Alice gets 100 extra tokens for her mapping deposit - (AccountId::from(ALICE), 2_100 * GLMR), - (AccountId::from(BOB), 1_000 * GLMR), - (AccountId::from(CHARLIE), GLMR), + // Alice gets 10k extra tokens for her mapping deposit + (AccountId::from(ALICE), 210_000 * GLMR), + (AccountId::from(BOB), 100_000 * GLMR), + (AccountId::from(CHARLIE), 100 * GLMR), ]) - .with_collators(vec![(AccountId::from(ALICE), 1_000 * GLMR)]) + .with_collators(vec![(AccountId::from(ALICE), 100_000 * GLMR)]) .with_nominations(vec![( AccountId::from(BOB), AccountId::from(ALICE), - 500 * GLMR, + 50_000 * GLMR, )]) .with_mappings(vec![( NimbusId::from_slice(&ALICE_NIMBUS), @@ -440,29 +448,32 @@ fn reward_block_authors_with_parachain_bond_reserved() { root_origin(), AccountId::from(CHARLIE), ),); - for x in 2..599 { + for x in 2..2399 { set_author(NimbusId::from_slice(&ALICE_NIMBUS)); run_to_block(x); } // no rewards doled out yet - assert_eq!(Balances::free_balance(AccountId::from(ALICE)), 1_000 * GLMR,); - assert_eq!(Balances::free_balance(AccountId::from(BOB)), 500 * GLMR,); - assert_eq!(Balances::free_balance(AccountId::from(CHARLIE)), GLMR,); + assert_eq!( + Balances::free_balance(AccountId::from(ALICE)), + 100_000 * GLMR, + ); + assert_eq!(Balances::free_balance(AccountId::from(BOB)), 50_000 * GLMR,); + assert_eq!(Balances::free_balance(AccountId::from(CHARLIE)), 100 * GLMR,); set_author(NimbusId::from_slice(&ALICE_NIMBUS)); - run_to_block(600); + run_to_block(2400); // rewards minted and distributed assert_eq!( Balances::free_balance(AccountId::from(ALICE)), - 1082693333281650000000, + 108269333328165000000000, ); assert_eq!( Balances::free_balance(AccountId::from(BOB)), - 525841666640825000000, + 52584166664082500000000, ); // 30% reserved for parachain bond assert_eq!( Balances::free_balance(AccountId::from(CHARLIE)), - 47515000000000000000, + 4751500000000000000000, ); }); } @@ -471,15 +482,15 @@ fn reward_block_authors_with_parachain_bond_reserved() { fn initialize_crowdloan_addresses_with_batch_and_pay() { ExtBuilder::default() .with_balances(vec![ - (AccountId::from(ALICE), 2_000 * GLMR), - (AccountId::from(BOB), 1_000 * GLMR), + (AccountId::from(ALICE), 200_000 * GLMR), + (AccountId::from(BOB), 100_000 * GLMR), ]) - .with_collators(vec![(AccountId::from(ALICE), 1_000 * GLMR)]) + .with_collators(vec![(AccountId::from(ALICE), 100_000 * GLMR)]) .with_mappings(vec![( NimbusId::from_slice(&ALICE_NIMBUS), AccountId::from(ALICE), )]) - .with_crowdloan_fund(3_000_000 * GLMR) + .with_crowdloan_fund(300_000_000 * GLMR) .build() .execute_with(|| { // set parachain inherent data @@ -499,7 +510,7 @@ fn initialize_crowdloan_addresses_with_batch_and_pay() { rewards: vec![( [4u8; 32].into(), Some(AccountId::from(CHARLIE)), - 1_500_000 * GLMR + 150_000_000 * GLMR )] } ), @@ -508,7 +519,7 @@ fn initialize_crowdloan_addresses_with_batch_and_pay() { rewards: vec![( [5u8; 32].into(), Some(AccountId::from(DAVE)), - 1_500_000 * GLMR + 150_000_000 * GLMR )] } ), @@ -521,9 +532,12 @@ fn initialize_crowdloan_addresses_with_batch_and_pay() { }) .dispatch(root_origin())); // 30 percent initial payout - assert_eq!(Balances::balance(&AccountId::from(CHARLIE)), 450_000 * GLMR); + assert_eq!( + Balances::balance(&AccountId::from(CHARLIE)), + 45_000_000 * GLMR + ); // 30 percent initial payout - assert_eq!(Balances::balance(&AccountId::from(DAVE)), 450_000 * GLMR); + assert_eq!(Balances::balance(&AccountId::from(DAVE)), 45_000_000 * GLMR); let expected = Event::Utility(pallet_utility::Event::BatchCompleted); assert_eq!(last_event(), expected); // This one should fail, as we already filled our data @@ -531,7 +545,7 @@ fn initialize_crowdloan_addresses_with_batch_and_pay() { calls: vec![Call::CrowdloanRewards(pallet_crowdloan_rewards::Call::< Runtime, >::initialize_reward_vec { - rewards: vec![([4u8; 32].into(), Some(AccountId::from(ALICE)), 432000)] + rewards: vec![([4u8; 32].into(), Some(AccountId::from(ALICE)), 43_200_000)] })] }) .dispatch(root_origin())); @@ -549,28 +563,28 @@ fn initialize_crowdloan_addresses_with_batch_and_pay() { assert_ok!(CrowdloanRewards::claim(origin_of(AccountId::from(DAVE)))); let vesting_period = 4 * WEEKS as u128; - let per_block = (1_050_000 * GLMR) / vesting_period; + let per_block = (105_000_000 * GLMR) / vesting_period; assert_eq!( CrowdloanRewards::accounts_payable(&AccountId::from(CHARLIE)) .unwrap() .claimed_reward, - (450_000 * GLMR) + per_block + (45_000_000 * GLMR) + per_block ); assert_eq!( CrowdloanRewards::accounts_payable(&AccountId::from(DAVE)) .unwrap() .claimed_reward, - (450_000 * GLMR) + per_block + (45_000_000 * GLMR) + per_block ); // The total claimed reward should be equal to the account balance at this point. assert_eq!( Balances::balance(&AccountId::from(CHARLIE)), - (450_000 * GLMR) + per_block + (45_000_000 * GLMR) + per_block ); assert_eq!( Balances::balance(&AccountId::from(DAVE)), - (450_000 * GLMR) + per_block + (45_000_000 * GLMR) + per_block ); assert_noop!( CrowdloanRewards::claim(origin_of(AccountId::from(ALICE))), @@ -782,15 +796,15 @@ fn claim_via_precompile() { fn is_contributor_via_precompile() { ExtBuilder::default() .with_balances(vec![ - (AccountId::from(ALICE), 2_000 * GLMR), - (AccountId::from(BOB), 1_000 * GLMR), + (AccountId::from(ALICE), 200_000 * GLMR), + (AccountId::from(BOB), 100_000 * GLMR), ]) - .with_collators(vec![(AccountId::from(ALICE), 1_000 * GLMR)]) + .with_collators(vec![(AccountId::from(ALICE), 100_000 * GLMR)]) .with_mappings(vec![( NimbusId::from_slice(&ALICE_NIMBUS), AccountId::from(ALICE), )]) - .with_crowdloan_fund(3_000_000 * GLMR) + .with_crowdloan_fund(3_000_000_000 * GLMR) .build() .execute_with(|| { // set parachain inherent data @@ -810,7 +824,7 @@ fn is_contributor_via_precompile() { rewards: vec![( [4u8; 32].into(), Some(AccountId::from(CHARLIE)), - 1_500_000 * GLMR + 1_500_000_000 * GLMR )] } ), @@ -819,7 +833,7 @@ fn is_contributor_via_precompile() { rewards: vec![( [5u8; 32].into(), Some(AccountId::from(DAVE)), - 1_500_000 * GLMR + 1_500_000_000 * GLMR )] } ), @@ -904,10 +918,10 @@ fn is_contributor_via_precompile() { fn reward_info_via_precompile() { ExtBuilder::default() .with_balances(vec![ - (AccountId::from(ALICE), 2_000 * GLMR), - (AccountId::from(BOB), 1_000 * GLMR), + (AccountId::from(ALICE), 200_000 * GLMR), + (AccountId::from(BOB), 100_000 * GLMR), ]) - .with_collators(vec![(AccountId::from(ALICE), 1_000 * GLMR)]) + .with_collators(vec![(AccountId::from(ALICE), 100_000 * GLMR)]) .with_mappings(vec![( NimbusId::from_slice(&ALICE_NIMBUS), AccountId::from(ALICE), diff --git a/runtime/moonbeam/tests/runtime_apis.rs b/runtime/moonbeam/tests/runtime_apis.rs index 7ae22ef003..9999167c3f 100644 --- a/runtime/moonbeam/tests/runtime_apis.rs +++ b/runtime/moonbeam/tests/runtime_apis.rs @@ -86,19 +86,19 @@ fn ethereum_runtime_rpc_api_account_code_at() { #[test] fn ethereum_runtime_rpc_api_author() { ExtBuilder::default() - .with_collators(vec![(AccountId::from(ALICE), 1_000 * GLMR)]) + .with_collators(vec![(AccountId::from(ALICE), 100_000 * GLMR)]) .with_mappings(vec![( NimbusId::from_slice(&ALICE_NIMBUS), AccountId::from(ALICE), )]) .with_balances(vec![ - (AccountId::from(ALICE), 2_000 * GLMR), - (AccountId::from(BOB), 1_000 * GLMR), + (AccountId::from(ALICE), 200_000 * GLMR), + (AccountId::from(BOB), 100_000 * GLMR), ]) .with_nominations(vec![( AccountId::from(BOB), AccountId::from(ALICE), - 500 * GLMR, + 50_000 * GLMR, )]) .build() .execute_with(|| { @@ -187,29 +187,32 @@ fn ethereum_runtime_rpc_api_current_transaction_statuses() { .expect("internal H160 is valid; qed"), ); ExtBuilder::default() - .with_collators(vec![(AccountId::from(ALICE), 1_000 * GLMR)]) + .with_collators(vec![(AccountId::from(ALICE), 100_000 * GLMR)]) .with_mappings(vec![( NimbusId::from_slice(&ALICE_NIMBUS), AccountId::from(ALICE), )]) .with_balances(vec![ - (alith, 2_000 * GLMR), - (AccountId::from(ALICE), 2_000 * GLMR), - (AccountId::from(BOB), 1_000 * GLMR), + (alith, 200_000 * GLMR), + (AccountId::from(ALICE), 200_000 * GLMR), + (AccountId::from(BOB), 100_000 * GLMR), ]) .with_nominations(vec![( AccountId::from(BOB), AccountId::from(ALICE), - 500 * GLMR, + 50_000 * GLMR, )]) .build() .execute_with(|| { set_parachain_inherent_data(); set_author(NimbusId::from_slice(&ALICE_NIMBUS)); // Calls are currently filtered, so the extrinsic will fail to apply. + /* + * TODO: VALID_ETH_TX needs to be updated (probably to include more gas) let result = Executive::apply_extrinsic(unchecked_eth_tx(VALID_ETH_TX)).expect("Apply result."); assert_noop!(result, sp_runtime::DispatchError::BadOrigin); + */ // // Future us: uncomment below. // run_to_block(2); // let statuses = @@ -221,19 +224,19 @@ fn ethereum_runtime_rpc_api_current_transaction_statuses() { #[test] fn ethereum_runtime_rpc_api_current_block() { ExtBuilder::default() - .with_collators(vec![(AccountId::from(ALICE), 1_000 * GLMR)]) + .with_collators(vec![(AccountId::from(ALICE), 100_000 * GLMR)]) .with_mappings(vec![( NimbusId::from_slice(&ALICE_NIMBUS), AccountId::from(ALICE), )]) .with_balances(vec![ - (AccountId::from(ALICE), 2_000 * GLMR), - (AccountId::from(BOB), 1_000 * GLMR), + (AccountId::from(ALICE), 200_000 * GLMR), + (AccountId::from(BOB), 100_000 * GLMR), ]) .with_nominations(vec![( AccountId::from(BOB), AccountId::from(ALICE), - 500 * GLMR, + 50_000 * GLMR, )]) .build() .execute_with(|| { @@ -252,29 +255,32 @@ fn ethereum_runtime_rpc_api_current_receipts() { .expect("internal H160 is valid; qed"), ); ExtBuilder::default() - .with_collators(vec![(AccountId::from(ALICE), 1_000 * GLMR)]) + .with_collators(vec![(AccountId::from(ALICE), 100_000 * GLMR)]) .with_mappings(vec![( NimbusId::from_slice(&ALICE_NIMBUS), AccountId::from(ALICE), )]) .with_balances(vec![ - (alith, 2_000 * GLMR), - (AccountId::from(ALICE), 2_000 * GLMR), - (AccountId::from(BOB), 1_000 * GLMR), + (alith, 200_000 * GLMR), + (AccountId::from(ALICE), 200_000 * GLMR), + (AccountId::from(BOB), 100_000 * GLMR), ]) .with_nominations(vec![( AccountId::from(BOB), AccountId::from(ALICE), - 500 * GLMR, + 50_000 * GLMR, )]) .build() .execute_with(|| { set_parachain_inherent_data(); set_author(NimbusId::from_slice(&ALICE_NIMBUS)); // Calls are currently filtered, so the extrinsic will fail to apply. + /* + * TODO: VALID_ETH_TX needs to be updated (probably to include more gas) let result = Executive::apply_extrinsic(unchecked_eth_tx(VALID_ETH_TX)).expect("Apply result."); assert_noop!(result, sp_runtime::DispatchError::BadOrigin); + */ // // Future us: uncomment below. // run_to_block(2); // let receipts = Runtime::current_receipts().expect("Receipts result."); diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index a51ba4a19d..70bdbec903 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -86,6 +86,9 @@ pub type Precompiles = MoonriverPrecompiles; pub mod currency { use super::Balance; + // Provide a common factor between runtimes based on a supply of 10_000_000 tokens. + pub const SUPPLY_FACTOR: Balance = 1; + pub const WEI: Balance = 1; pub const KILOWEI: Balance = 1_000; pub const MEGAWEI: Balance = 1_000_000; @@ -95,11 +98,11 @@ pub mod currency { pub const MOVR: Balance = 1_000_000_000_000_000_000; pub const KILOMOVR: Balance = 1_000_000_000_000_000_000_000; - pub const TRANSACTION_BYTE_FEE: Balance = 10 * MICROMOVR; - pub const STORAGE_BYTE_FEE: Balance = 100 * MICROMOVR; + pub const TRANSACTION_BYTE_FEE: Balance = 10 * MICROMOVR * SUPPLY_FACTOR; + pub const STORAGE_BYTE_FEE: Balance = 100 * MICROMOVR * SUPPLY_FACTOR; pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 1 * MOVR + (bytes as Balance) * STORAGE_BYTE_FEE + items as Balance * 1 * MOVR * SUPPLY_FACTOR + (bytes as Balance) * STORAGE_BYTE_FEE } } @@ -331,7 +334,7 @@ parameter_types! { pub struct FixedGasPrice; impl FeeCalculator for FixedGasPrice { fn min_gas_price() -> U256 { - (1 * currency::GIGAWEI).into() + (1 * currency::GIGAWEI * currency::SUPPLY_FACTOR).into() } } @@ -432,7 +435,7 @@ parameter_types! { pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS; pub const EnactmentPeriod: BlockNumber = 1 * DAYS; pub const CooloffPeriod: BlockNumber = 7 * DAYS; - pub const MinimumDeposit: Balance = 4 * currency::MOVR; + pub const MinimumDeposit: Balance = 4 * currency::MOVR * currency::SUPPLY_FACTOR; pub const MaxVotes: u32 = 100; pub const MaxProposals: u32 = 100; pub const PreimageByteDeposit: Balance = currency::STORAGE_BYTE_FEE; @@ -446,6 +449,7 @@ impl pallet_democracy::Config for Runtime { type EnactmentPeriod = EnactmentPeriod; type LaunchPeriod = LaunchPeriod; type VotingPeriod = VotingPeriod; + type VoteLockingPeriod = VoteLockingPeriod; type FastTrackVotingPeriod = FastTrackVotingPeriod; type MinimumDeposit = MinimumDeposit; @@ -494,7 +498,7 @@ impl pallet_democracy::Config for Runtime { parameter_types! { pub const ProposalBond: Permill = Permill::from_percent(5); - pub const ProposalBondMinimum: Balance = 1 * currency::MOVR; + pub const ProposalBondMinimum: Balance = 1 * currency::MOVR * currency::SUPPLY_FACTOR; pub const SpendPeriod: BlockNumber = 6 * DAYS; pub const TreasuryId: PalletId = PalletId(*b"py/trsry"); pub const MaxApprovals: u32 = 100; @@ -640,11 +644,11 @@ parameter_types! { /// Default percent of inflation set aside for parachain bond every round pub const DefaultParachainBondReservePercent: Percent = Percent::from_percent(30); /// Minimum stake required to become a collator is 1_000 - pub const MinCollatorStk: u128 = 1 * currency::KILOMOVR; + pub const MinCollatorStk: u128 = 1 * currency::KILOMOVR * currency::SUPPLY_FACTOR; /// Minimum stake required to be reserved to be a candidate is 1_000 - pub const MinCollatorCandidateStk: u128 = 1 * currency::KILOMOVR; + pub const MinCollatorCandidateStk: u128 = 1 * currency::KILOMOVR * currency::SUPPLY_FACTOR; /// Minimum stake required to be reserved to be a nominator is 5 - pub const MinNominatorStk: u128 = 5 * currency::MOVR; + pub const MinNominatorStk: u128 = 5 * currency::MOVR * currency::SUPPLY_FACTOR; } impl parachain_staking::Config for Runtime { type Event = Event; @@ -707,7 +711,7 @@ impl pallet_crowdloan_rewards::Config for Runtime { } parameter_types! { - pub const DepositAmount: Balance = 100 * currency::MOVR; + pub const DepositAmount: Balance = 100 * currency::MOVR * currency::SUPPLY_FACTOR; } // This is a simple session key manager. It should probably either work with, or be replaced // entirely by pallet sessions @@ -1071,3 +1075,61 @@ cumulus_pallet_parachain_system::register_validate_block!( ); runtime_common::impl_self_contained_call!(); + +#[cfg(test)] +mod tests { + use super::{currency::*, *}; + + #[test] + fn currency_constants_are_correct() { + assert_eq!(SUPPLY_FACTOR, 1); + + // txn fees + assert_eq!(TRANSACTION_BYTE_FEE, Balance::from(10 * MICROMOVR)); + assert_eq!(OperationalFeeMultiplier::get(), 5_u8); + assert_eq!(STORAGE_BYTE_FEE, Balance::from(100 * MICROMOVR)); + assert_eq!(FixedGasPrice::min_gas_price(), (1 * GIGAWEI).into()); + + // democracy minimums + assert_eq!(MinimumDeposit::get(), Balance::from(4 * MOVR)); + assert_eq!(PreimageByteDeposit::get(), Balance::from(100 * MICROMOVR)); + assert_eq!(ProposalBondMinimum::get(), Balance::from(1 * MOVR)); + + // pallet_identity deposits + assert_eq!( + BasicDeposit::get(), + Balance::from(1 * MOVR + 25800 * MICROMOVR) + ); + assert_eq!(FieldDeposit::get(), Balance::from(6600 * MICROMOVR)); + assert_eq!( + SubAccountDeposit::get(), + Balance::from(1 * MOVR + 5300 * MICROMOVR) + ); + + // staking minimums + assert_eq!(MinCollatorStk::get(), Balance::from(1 * KILOMOVR)); + assert_eq!(MinCollatorCandidateStk::get(), Balance::from(1 * KILOMOVR)); + assert_eq!(MinNominatorStk::get(), Balance::from(5 * MOVR)); + + // crowdloan min reward + assert_eq!(MinimumReward::get(), Balance::from(0u128)); + + // deposit for AuthorMapping + assert_eq!(DepositAmount::get(), Balance::from(100 * MOVR)); + + // proxy deposits + assert_eq!( + ProxyDepositBase::get(), + Balance::from(1 * MOVR + 800 * MICROMOVR) + ); + assert_eq!(ProxyDepositFactor::get(), Balance::from(2100 * MICROMOVR)); + assert_eq!( + AnnouncementDepositBase::get(), + Balance::from(1 * MOVR + 800 * MICROMOVR) + ); + assert_eq!( + AnnouncementDepositFactor::get(), + Balance::from(5600 * MICROMOVR) + ); + } +}