Balance is 128-bit value (#162)

* Replace 128-bit shim with real type.

* Remove unneeded code.

* Remove superfluous deps

* Reinstate deps.
This commit is contained in:
Gav Wood
2018-05-29 12:48:01 +01:00
committed by Arkadiy Paronyan
parent 72eaf324a4
commit b58ed7ee87
2 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -83,4 +83,4 @@ pub type Timestamp = u64;
/// for an eventual total of 10^27 units (27 significant decimal figures). /// 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 /// 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. /// 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;
+12 -12
View File
@@ -164,8 +164,8 @@ fn poc_1_testnet_config() -> ChainConfig {
staking: Some(StakingConfig { staking: Some(StakingConfig {
current_era: 0, current_era: 0,
intentions: initial_authorities.clone(), intentions: initial_authorities.clone(),
transaction_fee: 100.into(), transaction_fee: 100,
balances: endowed_accounts.iter().map(|&k|(k, (1u128 << 60).into())).collect(), balances: endowed_accounts.iter().map(|&k|(k, 1u128 << 60)).collect(),
validator_count: 12, validator_count: 12,
sessions_per_era: 24, // 24 hours per era. sessions_per_era: 24, // 24 hours per era.
bonding_duration: 90, // 90 days per bond. bonding_duration: 90, // 90 days per bond.
@@ -173,13 +173,13 @@ fn poc_1_testnet_config() -> ChainConfig {
democracy: Some(DemocracyConfig { democracy: Some(DemocracyConfig {
launch_period: 120 * 24 * 14, // 2 weeks per public referendum launch_period: 120 * 24 * 14, // 2 weeks per public referendum
voting_period: 120 * 24 * 28, // 4 weeks to discuss & vote on an active 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 { council: Some(CouncilConfig {
active_council: vec![], active_council: vec![],
candidacy_bond: 1000.into(), // 1000 to become a council candidate candidacy_bond: 1000, // 1000 to become a council candidate
voter_bond: 100.into(), // 100 down to vote for a candidate voter_bond: 100, // 100 down to vote for a candidate
present_slash_per_voter: 1.into(), // slash by 1 per voter for an invalid presentation. 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 carry_count: 24, // carry over the 24 runners-up to the next council election
presentation_duration: 120 * 24, // one day for presenting winners. presentation_duration: 120 * 24, // one day for presenting winners.
approval_voting_period: 7 * 120 * 24, // one week period between possible council elections. approval_voting_period: 7 * 120 * 24, // one week period between possible council elections.
@@ -222,8 +222,8 @@ fn testnet_config(initial_authorities: Vec<AuthorityId>) -> ChainConfig {
staking: Some(StakingConfig { staking: Some(StakingConfig {
current_era: 0, current_era: 0,
intentions: initial_authorities.clone(), intentions: initial_authorities.clone(),
transaction_fee: 1.into(), transaction_fee: 1,
balances: endowed_accounts.iter().map(|&k|(k, (1u128 << 60).into())).collect(), balances: endowed_accounts.iter().map(|&k|(k, (1u128 << 60))).collect(),
validator_count: 2, validator_count: 2,
sessions_per_era: 5, sessions_per_era: 5,
bonding_duration: 2, bonding_duration: 2,
@@ -231,13 +231,13 @@ fn testnet_config(initial_authorities: Vec<AuthorityId>) -> ChainConfig {
democracy: Some(DemocracyConfig { democracy: Some(DemocracyConfig {
launch_period: 9, launch_period: 9,
voting_period: 18, voting_period: 18,
minimum_deposit: 10.into(), minimum_deposit: 10,
}), }),
council: Some(CouncilConfig { 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(), 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(), candidacy_bond: 10,
voter_bond: 2.into(), voter_bond: 2,
present_slash_per_voter: 1.into(), present_slash_per_voter: 1,
carry_count: 4, carry_count: 4,
presentation_duration: 10, presentation_duration: 10,
approval_voting_period: 20, approval_voting_period: 20,