pub fn validators_diff(
    old_snapshot: &SeigniorageRecipientsSnapshot,
    new_snapshot: &SeigniorageRecipientsSnapshot,
) -> ValidatorsDiff {
    let old_validators: BTreeSet<_> = old_snapshot
        .values()
        .flat_map(BTreeMap::keys)
        .cloned()
        .collect();
    let new_validators: BTreeSet<_> = new_snapshot
        .values()
        .flat_map(BTreeMap::keys)
        .cloned()
        .collect();

    ValidatorsDiff {
        added: new_validators
            .difference(&old_validators)
            .cloned()
            .collect(),
        removed: old_validators
            .difference(&new_validators)
            .cloned()
            .collect(),
    }
}
/// Calculates the sets of added and removed validators between the two snapshots.
Calculates the sets of added and removed validators between the two snapshots.
Calculates the sets of added and removed validators between the two snapshots .
pub fn validators_diff(
    old_snapshot: &SeigniorageRecipientsSnapshot,
    new_snapshot: &SeigniorageRecipientsSnapshot,
) -> ValidatorsDiff {
    let old_validators: BTreeSet<_> = old_snapshot
        .values()
        .flat_map(BTreeMap::keys)
        .cloned()
        .collect();
    let new_validators: BTreeSet<_> = new_snapshot
        .values()
        .flat_map(BTreeMap::keys)
        .cloned()
        .collect();
    ValidatorsDiff {
        added: new_validators
            .difference(&old_validators)
            .cloned()
            .collect(),
        removed: old_validators
            .difference(&new_validators)
            .cloned()
            .collect(),
    }
}
pub fn validators_diff ( old_snapshot : & SeigniorageRecipientsSnapshot , new_snapshot : & SeigniorageRecipientsSnapshot , ) -> ValidatorsDiff { let old_validators : BTreeSet < _ > = old_snapshot . values ( ) . flat_map ( BTreeMap :: keys ) . cloned ( ) . collect ( ) ; let new_validators : BTreeSet < _ > = new_snapshot . values ( ) . flat_map ( BTreeMap :: keys ) . cloned ( ) . collect ( ) ; ValidatorsDiff { added : new_validators . difference ( & old_validators ) . cloned ( ) . collect ( ) , removed : old_validators . difference ( & new_validators ) . cloned ( ) . collect ( ) , } }
Calculates the sets of added and removed validators between the two snapshots.
Calculates the sets of added and removed validators between the two snapshots .
old_snapshot
&SeigniorageRecipientsSnapshot
new_snapshot
&SeigniorageRecipientsSnapshot
old_snapshot
&SeigniorageRecipientsSnapshot
new_snapshot
&SeigniorageRecipientsSnapshot