mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 01:51:02 +00:00
clean the interface of supports map (#9674)
* clean the interface of supports map, make it a bit cleaner and more efficients * Fix stiff * fix one test * Fix warnings
This commit is contained in:
@@ -17,9 +17,7 @@
|
||||
|
||||
//! Helper methods for npos-elections.
|
||||
|
||||
use crate::{
|
||||
Assignment, Error, IdentifierT, PerThing128, StakedAssignment, VoteWeight, WithApprovalOf,
|
||||
};
|
||||
use crate::{Assignment, Error, IdentifierT, PerThing128, StakedAssignment, VoteWeight};
|
||||
use sp_arithmetic::PerThing;
|
||||
use sp_std::prelude::*;
|
||||
|
||||
@@ -81,11 +79,6 @@ pub fn assignment_staked_to_ratio_normalized<A: IdentifierT, P: PerThing128>(
|
||||
Ok(ratio)
|
||||
}
|
||||
|
||||
/// consumes a vector of winners with backing stake to just winners.
|
||||
pub fn to_without_backing<A: IdentifierT>(winners: Vec<WithApprovalOf<A>>) -> Vec<A> {
|
||||
winners.into_iter().map(|(who, _)| who).collect::<Vec<A>>()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user