Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

New CurrencyToPower and PowerToVotes #261

Merged
merged 11 commits into from
Feb 14, 2020
Prev Previous commit
Next Next commit
remove: unused type
  • Loading branch information
aurexav committed Feb 13, 2020
commit c8423ad5c52cf2acfaeb1e5859f9855390167777
3 changes: 0 additions & 3 deletions bin/node/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ pub type Balance = u128;
/// Power of an account.
pub type Power = u32;

/// Votes of an account.
pub type Votes = u32;

/// Type used for expressing timestamp.
pub type Moment = u64;

Expand Down
24 changes: 1 addition & 23 deletions bin/node/runtime/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use sp_runtime::{
};

use crate::{Authorship, Balances, MaximumBlockWeight, NegativeImbalance, System};
use node_primitives::{Balance, Power, Votes};
use node_primitives::Balance;

pub struct Author;
impl OnUnbalanced<NegativeImbalance> for Author {
Expand All @@ -35,28 +35,6 @@ impl OnUnbalanced<NegativeImbalance> for Author {
}
}

///// Struct that handles the conversion of Balance -> `u64`. This is used for staking's election
///// calculation.
//pub struct PowerToVotesHandler;
//
//impl PowerToVotesHandler {
// fn factor() -> Power {
// 1
// }
//}
//
//impl Convert<Power, Votes> for PowerToVotesHandler {
// fn convert(x: Power) -> Votes {
// (x / Self::factor()) as Power
// }
//}
//
////impl Convert<Vote, Power> for PowerToVoteHandler {
//// fn convert(x: Vote) -> Power {
//// x as Vote * Self::factor()
//// }
////}

/// Convert from weight to balance via a simple coefficient multiplication
/// The associated type C encapsulates a constant in units of balance per weight
pub struct LinearWeightToFee<C>(sp_std::marker::PhantomData<C>);
Expand Down