diem_types/
validator_config.rs1use diem_crypto::{
9 bls::{BLSPrivateKey, BLSPublicKey, BLSSignature},
10 ec_vrf::{EcVrfPrivateKey, EcVrfProof, EcVrfPublicKey},
11 multi_bls::{MultiBLSPrivateKey, MultiBLSPublicKey, MultiBLSSignature},
12};
13#[cfg(any(test, feature = "fuzzing"))]
14use proptest_derive::Arbitrary;
15use serde::{Deserialize, Serialize};
16
17#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
18#[cfg_attr(any(test, feature = "fuzzing"), derive(Arbitrary))]
19pub struct ValidatorConfig {
20 pub consensus_public_key: ConsensusPublicKey,
21 pub vrf_public_key: Option<ConsensusVRFPublicKey>,
23 pub validator_network_addresses: Vec<u8>,
29 pub fullnode_network_addresses: Vec<u8>,
30}
31
32impl ValidatorConfig {
33 pub fn new(
34 consensus_public_key: ConsensusPublicKey,
35 vrf_public_key: Option<ConsensusVRFPublicKey>,
36 validator_network_addresses: Vec<u8>,
37 fullnode_network_addresses: Vec<u8>,
38 ) -> Self {
39 ValidatorConfig {
40 consensus_public_key,
41 vrf_public_key,
42 validator_network_addresses,
43 fullnode_network_addresses,
44 }
45 }
46}
47
48pub type ConsensusPublicKey = BLSPublicKey;
50pub type ConsensusPrivateKey = BLSPrivateKey;
51pub type ConsensusSignature = BLSSignature;
52pub type ConsensusVRFPublicKey = EcVrfPublicKey;
53pub type ConsensusVRFPrivateKey = EcVrfPrivateKey;
54pub type ConsensusVRFProof = EcVrfProof;
55pub type MultiConsensusPublicKey = MultiBLSPublicKey;
56pub type MultiConsensusPrivateKey = MultiBLSPrivateKey;
57pub type MultiConsensusSignature = MultiBLSSignature;