pub fn new(
        address_to_validator_info: BTreeMap<AccountAddress, ValidatorConsensusInfo>,
    ) -> Self {
        let total_voting_power = address_to_validator_info
            .values()
            .map(|x| x.voting_power)
            .sum();
        let quorum_voting_power = if address_to_validator_info.is_empty() {
            0
        } else {
            total_voting_power * 2 / 3 + 1
        };
        ValidatorVerifier {
            address_to_validator_info,
            quorum_voting_power,
            total_voting_power,
        }
    }
/// Initialize with a map of account address to validator info and set quorum size to
/// default (`2f + 1`) or zero if `address_to_validator_info` is empty.
Initialize with a map of account address to validator info and set quorum size to
default (`2f + 1`) or zero if `address_to_validator_info` is empty.
Initialize with a map of account address to validator info and set quorum size to default ( ` 2f + 1 ` ) or zero if ` address_to_validator_info ` is empty .
pub fn new(
        address_to_validator_info: BTreeMap<AccountAddress, ValidatorConsensusInfo>,
    ) -> Self {
        let total_voting_power = address_to_validator_info
            .values()
            .map(|x| x.voting_power)
            .sum();
        let quorum_voting_power = if address_to_validator_info.is_empty() {
            0
        } else {
            total_voting_power * 2 / 3 + 1
        };
        ValidatorVerifier {
            address_to_validator_info,
            quorum_voting_power,
            total_voting_power,
        }
    }
pub fn new ( address_to_validator_info : BTreeMap < AccountAddress , ValidatorConsensusInfo > , ) -> Self { let total_voting_power = address_to_validator_info . values ( ) . map ( | x | x . voting_power ) . sum ( ) ; let quorum_voting_power = if address_to_validator_info . is_empty ( ) { 0 } else { total_voting_power * 2 / 3 + 1 } ; ValidatorVerifier { address_to_validator_info , quorum_voting_power , total_voting_power , } }
Initialize with a map of account address to validator info and set quorum size to
default (`2f + 1`) or zero if `address_to_validator_info` is empty.
Initialize with a map of account address to validator info and set quorum size to default ( ` 2f + 1 ` ) or zero if ` address_to_validator_info ` is empty .
address_to_validator_info
BTreeMap<AccountAddress, ValidatorConsensusInfo>
address_to_validator_info
BTreeMap<AccountAddress, ValidatorConsensusInfo>