pub fn generate_entries_removing_withdraws(
    builder: &mut LmdbWasmTestBuilder,
    validators_diff: &ValidatorsDiff,
) -> BTreeMap<Key, StoredValue> {
    let withdraws = builder.get_withdraws();
    let withdraw_keys: BTreeSet<_> = withdraws.keys().collect();
    validators_diff
        .removed
        .iter()
        .map(PublicKey::to_account_hash)
        .filter(|acc| withdraw_keys.contains(&acc))
        .map(|acc| (Key::Withdraw(acc), StoredValue::Withdraw(vec![])))
        .collect()
}
/// Generates the writes to the global state that will remove the pending withdraws of all the old
/// validators that will cease to be validators.
Generates the writes to the global state that will remove the pending withdraws of all the old
validators that will cease to be validators.
Generates the writes to the global state that will remove the pending withdraws of all the old validators that will cease to be validators .
pub fn generate_entries_removing_withdraws(
    builder: &mut LmdbWasmTestBuilder,
    validators_diff: &ValidatorsDiff,
) -> BTreeMap<Key, StoredValue> {
    let withdraws = builder.get_withdraws();
    let withdraw_keys: BTreeSet<_> = withdraws.keys().collect();
    validators_diff
        .removed
        .iter()
        .map(PublicKey::to_account_hash)
        .filter(|acc| withdraw_keys.contains(&acc))
        .map(|acc| (Key::Withdraw(acc), StoredValue::Withdraw(vec![])))
        .collect()
}
pub fn generate_entries_removing_withdraws ( builder : & mut LmdbWasmTestBuilder , validators_diff : & ValidatorsDiff , ) -> BTreeMap < Key , StoredValue > { let withdraws = builder . get_withdraws ( ) ; let withdraw_keys : BTreeSet < _ > = withdraws . keys ( ) . collect ( ) ; validators_diff . removed . iter ( ) . map ( PublicKey :: to_account_hash ) . filter ( | acc | withdraw_keys . contains ( & acc ) ) . map ( | acc | ( Key :: Withdraw ( acc ) , StoredValue :: Withdraw ( vec ! [ ] ) ) ) . collect ( ) }
Generates the writes to the global state that will remove the pending withdraws of all the old
validators that will cease to be validators.
Generates the writes to the global state that will remove the pending withdraws of all the old validators that will cease to be validators .
builder
&mut LmdbWasmTestBuilder
validators_diff
&ValidatorsDiff
builder
&mut LmdbWasmTestBuilder
validators_diff
&ValidatorsDiff