Add method to get ValidatorRecord for testing
This commit is contained in:
parent
ca40229cb4
commit
f0d61c340a
@ -46,6 +46,20 @@ impl ValidatorRecord {
|
|||||||
switch_dynasty: 0
|
switch_dynasty: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn zero_with_thread_rand_keypair() -> (Self, Keypair) {
|
||||||
|
let mut rng = thread_rng();
|
||||||
|
let keypair = Keypair::generate(&mut rng);
|
||||||
|
let s = Self {
|
||||||
|
pubkey: keypair.public.clone(),
|
||||||
|
withdrawal_shard: 0,
|
||||||
|
withdrawal_address: Address::zero(),
|
||||||
|
randao_commitment: Sha256Digest::zero(),
|
||||||
|
balance: U256::zero(),
|
||||||
|
switch_dynasty: 0
|
||||||
|
};
|
||||||
|
(s, keypair)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Clone for ValidatorRecord {
|
impl Clone for ValidatorRecord {
|
||||||
|
Loading…
Reference in New Issue
Block a user