From b58ed7ee87afbd1ff2a8b69aa09a4d28c3838846 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 29 May 2018 12:48:01 +0100 Subject: [PATCH] Balance is 128-bit value (#162) * Replace 128-bit shim with real type. * Remove unneeded code. * Remove superfluous deps * Reinstate deps. --- polkadot/primitives/src/lib.rs | 2 +- polkadot/service/src/lib.rs | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/polkadot/primitives/src/lib.rs b/polkadot/primitives/src/lib.rs index b9a636162c..a140e6ccee 100644 --- a/polkadot/primitives/src/lib.rs +++ b/polkadot/primitives/src/lib.rs @@ -83,4 +83,4 @@ pub type Timestamp = u64; /// for an eventual total of 10^27 units (27 significant decimal figures). /// We round denomination to 10^12 (12 sdf), and leave the other redundancy at the upper end so /// that 32 bits may be multiplied with a balance in 128 bits without worrying about overflow. -pub type Balance = runtime_primitives::U128; +pub type Balance = u128; diff --git a/polkadot/service/src/lib.rs b/polkadot/service/src/lib.rs index 3dde4242bc..5113193a36 100644 --- a/polkadot/service/src/lib.rs +++ b/polkadot/service/src/lib.rs @@ -164,8 +164,8 @@ fn poc_1_testnet_config() -> ChainConfig { staking: Some(StakingConfig { current_era: 0, intentions: initial_authorities.clone(), - transaction_fee: 100.into(), - balances: endowed_accounts.iter().map(|&k|(k, (1u128 << 60).into())).collect(), + transaction_fee: 100, + balances: endowed_accounts.iter().map(|&k|(k, 1u128 << 60)).collect(), validator_count: 12, sessions_per_era: 24, // 24 hours per era. bonding_duration: 90, // 90 days per bond. @@ -173,13 +173,13 @@ fn poc_1_testnet_config() -> ChainConfig { democracy: Some(DemocracyConfig { launch_period: 120 * 24 * 14, // 2 weeks per public referendum voting_period: 120 * 24 * 28, // 4 weeks to discuss & vote on an active referendum - minimum_deposit: 1000.into(), // 1000 as the minimum deposit for a referendum + minimum_deposit: 1000, // 1000 as the minimum deposit for a referendum }), council: Some(CouncilConfig { active_council: vec![], - candidacy_bond: 1000.into(), // 1000 to become a council candidate - voter_bond: 100.into(), // 100 down to vote for a candidate - present_slash_per_voter: 1.into(), // slash by 1 per voter for an invalid presentation. + candidacy_bond: 1000, // 1000 to become a council candidate + voter_bond: 100, // 100 down to vote for a candidate + present_slash_per_voter: 1, // slash by 1 per voter for an invalid presentation. carry_count: 24, // carry over the 24 runners-up to the next council election presentation_duration: 120 * 24, // one day for presenting winners. approval_voting_period: 7 * 120 * 24, // one week period between possible council elections. @@ -222,8 +222,8 @@ fn testnet_config(initial_authorities: Vec) -> ChainConfig { staking: Some(StakingConfig { current_era: 0, intentions: initial_authorities.clone(), - transaction_fee: 1.into(), - balances: endowed_accounts.iter().map(|&k|(k, (1u128 << 60).into())).collect(), + transaction_fee: 1, + balances: endowed_accounts.iter().map(|&k|(k, (1u128 << 60))).collect(), validator_count: 2, sessions_per_era: 5, bonding_duration: 2, @@ -231,13 +231,13 @@ fn testnet_config(initial_authorities: Vec) -> ChainConfig { democracy: Some(DemocracyConfig { launch_period: 9, voting_period: 18, - minimum_deposit: 10.into(), + minimum_deposit: 10, }), council: Some(CouncilConfig { active_council: endowed_accounts.iter().filter(|a| initial_authorities.iter().find(|b| a == b).is_none()).map(|a| (a.clone(), 1000000)).collect(), - candidacy_bond: 10.into(), - voter_bond: 2.into(), - present_slash_per_voter: 1.into(), + candidacy_bond: 10, + voter_bond: 2, + present_slash_per_voter: 1, carry_count: 4, presentation_duration: 10, approval_voting_period: 20,