pub fn gen_snapshot(
    validators: Vec<(String, String)>,
    starting_era_id: EraId,
    count: u64,
) -> SeigniorageRecipientsSnapshot {
    let mut new_snapshot = BTreeMap::new();
    let mut era_validators = BTreeMap::new();
    for (pub_key_str, bonded_amount_str) in &validators {
        let validator_pub_key = PublicKey::from_hex(pub_key_str.as_bytes()).unwrap();
        let bonded_amount = U512::from_dec_str(bonded_amount_str).unwrap();
        let seigniorage_recipient =
            SeigniorageRecipient::new(bonded_amount, Default::default(), Default::default());
        let _ = era_validators.insert(validator_pub_key, seigniorage_recipient);
    }
    for era_id in starting_era_id.iter(count) {
        let _ = new_snapshot.insert(era_id, era_validators.clone());
    }

    new_snapshot
}
/// Generates a new `SeigniorageRecipientsSnapshot` based on:
/// - The list of validators, in format (validator_public_key,stake), both expressed as strings.
/// - The starting era ID (the era ID at which the snapshot should start).
/// - Count - the number of eras to be included in the snapshot.
Generates a new `SeigniorageRecipientsSnapshot` based on:
The list of validators, in format (validator_public_key,stake), both expressed as strings.
The starting era ID (the era ID at which the snapshot should start).
Count - the number of eras to be included in the snapshot.
Generates a new ` SeigniorageRecipientsSnapshot ` based on : The list of validators in format ( validator_public_key stake ) both expressed as strings . The starting era ID ( the era ID at which the snapshot should start ) . Count - the number of eras to be included in the snapshot .
pub fn gen_snapshot(
    validators: Vec<(String, String)>,
    starting_era_id: EraId,
    count: u64,
) -> SeigniorageRecipientsSnapshot {
    let mut new_snapshot = BTreeMap::new();
    let mut era_validators = BTreeMap::new();
    for (pub_key_str, bonded_amount_str) in &validators {
        let validator_pub_key = PublicKey::from_hex(pub_key_str.as_bytes()).unwrap();
        let bonded_amount = U512::from_dec_str(bonded_amount_str).unwrap();
        let seigniorage_recipient =
            SeigniorageRecipient::new(bonded_amount, Default::default(), Default::default());
        let _ = era_validators.insert(validator_pub_key, seigniorage_recipient);
    }
    for era_id in starting_era_id.iter(count) {
        let _ = new_snapshot.insert(era_id, era_validators.clone());
    }
    new_snapshot
}
pub fn gen_snapshot ( validators : Vec < ( String , String ) > , starting_era_id : EraId , count : u64 , ) -> SeigniorageRecipientsSnapshot { let mut new_snapshot = BTreeMap :: new ( ) ; let mut era_validators = BTreeMap :: new ( ) ; for ( pub_key_str , bonded_amount_str ) in & validators { let validator_pub_key = PublicKey :: from_hex ( pub_key_str . as_bytes ( ) ) . unwrap ( ) ; let bonded_amount = U512 :: from_dec_str ( bonded_amount_str ) . unwrap ( ) ; let seigniorage_recipient = SeigniorageRecipient :: new ( bonded_amount , Default :: default ( ) , Default :: default ( ) ) ; let _ = era_validators . insert ( validator_pub_key , seigniorage_recipient ) ; } for era_id in starting_era_id . iter ( count ) { let _ = new_snapshot . insert ( era_id , era_validators . clone ( ) ) ; } new_snapshot }
Generates a new `SeigniorageRecipientsSnapshot` based on:
 The list of validators, in format (validator_public_key,stake), both expressed as strings.
Generates a new ` SeigniorageRecipientsSnapshot ` based on : The list of validators in format ( validator_public_key stake ) both expressed as strings .
validators
Vec<(String, String)>
starting_era_id
EraId
count
u64
validators
Vec<(String, String)>
starting_era_id
EraId
count
u64