mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 15:11:02 +00:00
add iter-from for bags-list (#11104)
* add iter-from for bags-list * Fix * Apply suggestions from code review Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
@@ -271,13 +271,19 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
|
||||
impl<T: Config<I>, I: 'static> SortedListProvider<T::AccountId> for Pallet<T, I> {
|
||||
type Error = ListError;
|
||||
|
||||
type Score = T::Score;
|
||||
|
||||
fn iter() -> Box<dyn Iterator<Item = T::AccountId>> {
|
||||
Box::new(List::<T, I>::iter().map(|n| n.id().clone()))
|
||||
}
|
||||
|
||||
fn iter_from(
|
||||
start: &T::AccountId,
|
||||
) -> Result<Box<dyn Iterator<Item = T::AccountId>>, Self::Error> {
|
||||
let iter = List::<T, I>::iter_from(start)?;
|
||||
Ok(Box::new(iter.map(|n| n.id().clone())))
|
||||
}
|
||||
|
||||
fn count() -> u32 {
|
||||
ListNodes::<T, I>::count()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user