validator registration removed
This commit is contained in:
parent
1d48aa280b
commit
071e099203
@ -1,4 +1,4 @@
|
|||||||
use super::ValidatorRegistration;
|
use super::ValidatorRecord;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct ChainConfig {
|
pub struct ChainConfig {
|
||||||
@ -9,7 +9,8 @@ pub struct ChainConfig {
|
|||||||
pub max_validator_churn_quotient: u64,
|
pub max_validator_churn_quotient: u64,
|
||||||
pub genesis_time: u64,
|
pub genesis_time: u64,
|
||||||
pub slot_duration_millis: u64,
|
pub slot_duration_millis: u64,
|
||||||
pub initial_validators: Vec<ValidatorRegistration>,
|
// TODO: revisit this
|
||||||
|
pub initial_validators: Vec<ValidatorRecord>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -18,7 +18,6 @@ pub mod shard_and_committee;
|
|||||||
pub mod shard_reassignment_record;
|
pub mod shard_reassignment_record;
|
||||||
pub mod special_record;
|
pub mod special_record;
|
||||||
pub mod validator_record;
|
pub mod validator_record;
|
||||||
pub mod validator_registration;
|
|
||||||
|
|
||||||
use self::ethereum_types::{H160, H256, U256};
|
use self::ethereum_types::{H160, H256, U256};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
@ -36,7 +35,6 @@ pub use pending_attestation_record::PendingAttestationRecord;
|
|||||||
pub use shard_and_committee::ShardAndCommittee;
|
pub use shard_and_committee::ShardAndCommittee;
|
||||||
pub use special_record::{SpecialRecord, SpecialRecordKind};
|
pub use special_record::{SpecialRecord, SpecialRecordKind};
|
||||||
pub use validator_record::{ValidatorRecord, ValidatorStatus};
|
pub use validator_record::{ValidatorRecord, ValidatorStatus};
|
||||||
pub use validator_registration::ValidatorRegistration;
|
|
||||||
|
|
||||||
pub type Hash256 = H256;
|
pub type Hash256 = H256;
|
||||||
pub type Address = H160;
|
pub type Address = H160;
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
use super::{Address, Hash256};
|
|
||||||
use bls::{create_proof_of_possession, Keypair, PublicKey, Signature};
|
|
||||||
|
|
||||||
/// The information gathered from the PoW chain validator registration function.
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
|
||||||
pub struct ValidatorRegistration {
|
|
||||||
pub pubkey: PublicKey,
|
|
||||||
pub withdrawal_shard: u16,
|
|
||||||
pub withdrawal_address: Address,
|
|
||||||
pub randao_commitment: Hash256,
|
|
||||||
pub proof_of_possession: Signature,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ValidatorRegistration {
|
|
||||||
pub fn random() -> Self {
|
|
||||||
let keypair = Keypair::random();
|
|
||||||
|
|
||||||
Self {
|
|
||||||
pubkey: keypair.pk.clone(),
|
|
||||||
withdrawal_shard: 0,
|
|
||||||
withdrawal_address: Address::random(),
|
|
||||||
randao_commitment: Hash256::random(),
|
|
||||||
proof_of_possession: create_proof_of_possession(&keypair),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user