pub fn new_with_quorum_voting_power(
        address_to_validator_info: BTreeMap<AccountAddress, ValidatorConsensusInfo>,
        quorum_voting_power: u64,
    ) -> Result<Self> {
        let total_voting_power = address_to_validator_info.values().fold(0, |sum, x| {
            // The voting power of any node is assumed to be small relative to u64::max_value()
            assume!(sum <= u64::max_value() - x.voting_power);
            sum + x.voting_power
        });
        ensure!(
            quorum_voting_power <= total_voting_power,
            "Quorum voting power is greater than the sum of all voting power of authors: {}, \
             quorum_size: {}.",
            quorum_voting_power,
            total_voting_power
        );
        Ok(ValidatorVerifier {
            address_to_validator_info,
            quorum_voting_power,
            total_voting_power,
        })
    }
/// Initializes a validator verifier with a specified quorum voting power.
Initializes a validator verifier with a specified quorum voting power.
Initializes a validator verifier with a specified quorum voting power .
pub fn new_with_quorum_voting_power(
        address_to_validator_info: BTreeMap<AccountAddress, ValidatorConsensusInfo>,
        quorum_voting_power: u64,
    ) -> Result<Self> {
        let total_voting_power = address_to_validator_info.values().fold(0, |sum, x| {
            // The voting power of any node is assumed to be small relative to u64::max_value()
            assume!(sum <= u64::max_value() - x.voting_power);
            sum + x.voting_power
        });
        ensure!(
            quorum_voting_power <= total_voting_power,
            "Quorum voting power is greater than the sum of all voting power of authors: {}, \
             quorum_size: {}.",
            quorum_voting_power,
            total_voting_power
        );
        Ok(ValidatorVerifier {
            address_to_validator_info,
            quorum_voting_power,
            total_voting_power,
        })
    }
pub fn new_with_quorum_voting_power ( address_to_validator_info : BTreeMap < AccountAddress , ValidatorConsensusInfo > , quorum_voting_power : u64 , ) -> Result < Self > { let total_voting_power = address_to_validator_info . values ( ) . fold ( 0 , | sum , x | { // The voting power of any node is assumed to be small relative to u64::max_value() assume ! ( sum u64 max_value ( ) x voting_power ) ; sum + x . voting_power } ) ; ensure ! ( quorum_voting_power total_voting_power " \
 " quorum_voting_power total_voting_power ) ; Ok ( ValidatorVerifier { address_to_validator_info , quorum_voting_power , total_voting_power , } ) }
Initializes a validator verifier with a specified quorum voting power.
Initializes a validator verifier with a specified quorum voting power .
address_to_validator_info
BTreeMap<AccountAddress, ValidatorConsensusInfo>
quorum_voting_power
u64
address_to_validator_info
BTreeMap<AccountAddress, ValidatorConsensusInfo>
quorum_voting_power
u64