pub fn new(
        state_root_hash: Digest,
        block_height: u64,
        era_validators: EraValidators,
        bids: Bids,
    ) -> Self {
        let mut json_era_validators: Vec<JsonEraValidators> = Vec::new();
        for (era_id, validator_weights) in era_validators.iter() {
            let mut json_validator_weights: Vec<JsonValidatorWeights> = Vec::new();
            for (public_key, weight) in validator_weights.iter() {
                json_validator_weights.push(JsonValidatorWeights {
                    public_key: public_key.clone(),
                    weight: *weight,
                });
            }
            json_era_validators.push(JsonEraValidators {
                era_id: *era_id,
                validator_weights: json_validator_weights,
            });
        }

        let mut json_bids: Vec<JsonBids> = Vec::new();
        for (public_key, bid) in bids.iter() {
            let json_bid = JsonBid::from(bid.clone());
            json_bids.push(JsonBids {
                public_key: public_key.clone(),
                bid: json_bid,
            });
        }

        AuctionState {
            state_root_hash,
            block_height,
            era_validators: json_era_validators,
            bids: json_bids,
        }
    }
/// Create new instance of `AuctionState`
Create new instance of `AuctionState`
Create new instance of ` AuctionState `
pub fn new(
        state_root_hash: Digest,
        block_height: u64,
        era_validators: EraValidators,
        bids: Bids,
    ) -> Self {
        let mut json_era_validators: Vec<JsonEraValidators> = Vec::new();
        for (era_id, validator_weights) in era_validators.iter() {
            let mut json_validator_weights: Vec<JsonValidatorWeights> = Vec::new();
            for (public_key, weight) in validator_weights.iter() {
                json_validator_weights.push(JsonValidatorWeights {
                    public_key: public_key.clone(),
                    weight: *weight,
                });
            }
            json_era_validators.push(JsonEraValidators {
                era_id: *era_id,
                validator_weights: json_validator_weights,
            });
        }
        let mut json_bids: Vec<JsonBids> = Vec::new();
        for (public_key, bid) in bids.iter() {
            let json_bid = JsonBid::from(bid.clone());
            json_bids.push(JsonBids {
                public_key: public_key.clone(),
                bid: json_bid,
            });
        }
        AuctionState {
            state_root_hash,
            block_height,
            era_validators: json_era_validators,
            bids: json_bids,
        }
    }
pub fn new ( state_root_hash : Digest , block_height : u64 , era_validators : EraValidators , bids : Bids , ) -> Self { let mut json_era_validators : Vec < JsonEraValidators > = Vec :: new ( ) ; for ( era_id , validator_weights ) in era_validators . iter ( ) { let mut json_validator_weights : Vec < JsonValidatorWeights > = Vec :: new ( ) ; for ( public_key , weight ) in validator_weights . iter ( ) { json_validator_weights . push ( JsonValidatorWeights { public_key : public_key . clone ( ) , weight : * weight , } ) ; } json_era_validators . push ( JsonEraValidators { era_id : * era_id , validator_weights : json_validator_weights , } ) ; } let mut json_bids : Vec < JsonBids > = Vec :: new ( ) ; for ( public_key , bid ) in bids . iter ( ) { let json_bid = JsonBid :: from ( bid . clone ( ) ) ; json_bids . push ( JsonBids { public_key : public_key . clone ( ) , bid : json_bid , } ) ; } AuctionState { state_root_hash , block_height , era_validators : json_era_validators , bids : json_bids , } }
Create new instance of `AuctionState`
Create new instance of ` AuctionState `
state_root_hash
Digest
block_height
u64
era_validators
EraValidators
bids
Bids
state_root_hash
Digest
block_height
u64
era_validators
EraValidators
bids
Bids