updated deposit structs and validator record accrding to spec
This commit is contained in:
parent
8974d8e1df
commit
5fa251943b
@ -1,14 +1,7 @@
|
|||||||
use super::deposit_parameters::DepositParameters;
|
|
||||||
use super::{Hash256};
|
use super::{Hash256};
|
||||||
|
|
||||||
pub struct Deposit {
|
pub struct Deposit {
|
||||||
pub merkle_branch: Hash256,
|
pub merkle_branch: Vec<Hash256>,
|
||||||
pub merkle_tree_index: u64,
|
pub merkle_tree_index: u64,
|
||||||
pub deposit_data: DepositData
|
pub deposit_data: DepositData
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct DepositData {
|
|
||||||
pub deposit_parameters: DepositParameters,
|
|
||||||
pub value: u64,
|
|
||||||
pub timestamp: u64
|
|
||||||
}
|
|
||||||
|
7
beacon_chain/types/src/deposit_data.rs
Normal file
7
beacon_chain/types/src/deposit_data.rs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
use super::deposit_parameters::DepositParameters;
|
||||||
|
|
||||||
|
pub struct DepositData {
|
||||||
|
pub deposit_parameter: DepositInput,
|
||||||
|
pub value: u64,
|
||||||
|
pub timestamp: u64
|
||||||
|
}
|
@ -3,7 +3,7 @@ use super::{Hash256};
|
|||||||
|
|
||||||
pub struct DepositParameters {
|
pub struct DepositParameters {
|
||||||
pub pubkey: PublicKey,
|
pub pubkey: PublicKey,
|
||||||
pub proof_of_possession: AggregateSignature,
|
|
||||||
pub withdrawal_credentials: Hash256,
|
pub withdrawal_credentials: Hash256,
|
||||||
pub randao_commitment: Hash256
|
pub randao_commitment: Hash256,
|
||||||
|
pub proof_of_possession: AggregateSignature
|
||||||
}
|
}
|
@ -31,7 +31,7 @@ pub struct ValidatorRecord {
|
|||||||
pub pubkey: PublicKey,
|
pub pubkey: PublicKey,
|
||||||
pub withdrawal_credentials: Hash256,
|
pub withdrawal_credentials: Hash256,
|
||||||
pub randao_commitment: Hash256,
|
pub randao_commitment: Hash256,
|
||||||
pub randao_skips: u64,
|
pub randao_layers: u64,
|
||||||
pub balance: u64,
|
pub balance: u64,
|
||||||
pub status: u64,
|
pub status: u64,
|
||||||
pub latest_status_change_slot: u64,
|
pub latest_status_change_slot: u64,
|
||||||
@ -49,7 +49,7 @@ impl ValidatorRecord {
|
|||||||
pubkey: keypair.pk.clone(),
|
pubkey: keypair.pk.clone(),
|
||||||
withdrawal_credentials: Hash256::zero(),
|
withdrawal_credentials: Hash256::zero(),
|
||||||
randao_commitment: Hash256::zero(),
|
randao_commitment: Hash256::zero(),
|
||||||
randao_skips: 0,
|
randao_layers: 0,
|
||||||
balance: 0,
|
balance: 0,
|
||||||
status: 0,
|
status: 0,
|
||||||
latest_status_change_slot: 0,
|
latest_status_change_slot: 0,
|
||||||
@ -72,7 +72,7 @@ mod tests {
|
|||||||
let (v, _kp) = ValidatorRecord::zero_with_thread_rand_keypair();
|
let (v, _kp) = ValidatorRecord::zero_with_thread_rand_keypair();
|
||||||
assert!(v.withdrawal_credentials.is_zero());
|
assert!(v.withdrawal_credentials.is_zero());
|
||||||
assert!(v.randao_commitment.is_zero());
|
assert!(v.randao_commitment.is_zero());
|
||||||
assert_eq!(v.randao_skips, 0);
|
assert_eq!(v.randao_layers, 0);
|
||||||
assert_eq!(v.balance, 0);
|
assert_eq!(v.balance, 0);
|
||||||
assert_eq!(v.status, 0);
|
assert_eq!(v.status, 0);
|
||||||
assert_eq!(v.latest_status_change_slot, 0);
|
assert_eq!(v.latest_status_change_slot, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user