deposit and validator_record type changes
This commit is contained in:
parent
5fa251943b
commit
7065454b5c
@ -1,4 +1,5 @@
|
|||||||
use super::{Hash256};
|
use super::{Hash256};
|
||||||
|
use super::deposit_data::DepositData;
|
||||||
|
|
||||||
pub struct Deposit {
|
pub struct Deposit {
|
||||||
pub merkle_branch: Vec<Hash256>,
|
pub merkle_branch: Vec<Hash256>,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use super::deposit_parameters::DepositParameters;
|
use super::deposit_input::DepositInput;
|
||||||
|
|
||||||
pub struct DepositData {
|
pub struct DepositData {
|
||||||
pub deposit_parameter: DepositInput,
|
pub deposit_input: DepositInput,
|
||||||
pub value: u64,
|
pub value: u64,
|
||||||
pub timestamp: u64
|
pub timestamp: u64
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
use super::bls::{Keypair, PublicKey, AggregateSignature};
|
use super::bls::{PublicKey, Signature};
|
||||||
use super::{Hash256};
|
use super::{Hash256};
|
||||||
|
|
||||||
pub struct DepositParameters {
|
pub struct DepositInput {
|
||||||
pub pubkey: PublicKey,
|
pub pubkey: PublicKey,
|
||||||
pub withdrawal_credentials: Hash256,
|
pub withdrawal_credentials: Hash256,
|
||||||
pub randao_commitment: Hash256,
|
pub randao_commitment: Hash256,
|
||||||
pub proof_of_possession: AggregateSignature
|
pub proof_of_possession: Signature
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,9 @@ pub mod candidate_pow_receipt_root_record;
|
|||||||
pub mod chain_config;
|
pub mod chain_config;
|
||||||
pub mod crosslink_record;
|
pub mod crosslink_record;
|
||||||
pub mod crystallized_state;
|
pub mod crystallized_state;
|
||||||
|
pub mod deposit;
|
||||||
|
pub mod deposit_data;
|
||||||
|
pub mod deposit_input;
|
||||||
pub mod fork_data;
|
pub mod fork_data;
|
||||||
pub mod pending_attestation_record;
|
pub mod pending_attestation_record;
|
||||||
pub mod shard_and_committee;
|
pub mod shard_and_committee;
|
||||||
@ -30,6 +33,9 @@ pub use beacon_state::BeaconState;
|
|||||||
pub use chain_config::ChainConfig;
|
pub use chain_config::ChainConfig;
|
||||||
pub use crosslink_record::CrosslinkRecord;
|
pub use crosslink_record::CrosslinkRecord;
|
||||||
pub use crystallized_state::CrystallizedState;
|
pub use crystallized_state::CrystallizedState;
|
||||||
|
pub use deposit::Deposit;
|
||||||
|
pub use deposit_data::DepositData;
|
||||||
|
pub use deposit_input::DepositInput;
|
||||||
pub use fork_data::ForkData;
|
pub use fork_data::ForkData;
|
||||||
pub use pending_attestation_record::PendingAttestationRecord;
|
pub use pending_attestation_record::PendingAttestationRecord;
|
||||||
pub use shard_and_committee::ShardAndCommittee;
|
pub use shard_and_committee::ShardAndCommittee;
|
||||||
|
@ -33,7 +33,7 @@ pub struct ValidatorRecord {
|
|||||||
pub randao_commitment: Hash256,
|
pub randao_commitment: Hash256,
|
||||||
pub randao_layers: u64,
|
pub randao_layers: u64,
|
||||||
pub balance: u64,
|
pub balance: u64,
|
||||||
pub status: u64,
|
pub status: ValidatorStatus,
|
||||||
pub latest_status_change_slot: u64,
|
pub latest_status_change_slot: u64,
|
||||||
pub exit_count: u64
|
pub exit_count: u64
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ impl ValidatorRecord {
|
|||||||
randao_commitment: Hash256::zero(),
|
randao_commitment: Hash256::zero(),
|
||||||
randao_layers: 0,
|
randao_layers: 0,
|
||||||
balance: 0,
|
balance: 0,
|
||||||
status: 0,
|
status: From::from(0),
|
||||||
latest_status_change_slot: 0,
|
latest_status_change_slot: 0,
|
||||||
exit_count: 0
|
exit_count: 0
|
||||||
};
|
};
|
||||||
@ -74,7 +74,7 @@ mod tests {
|
|||||||
assert!(v.randao_commitment.is_zero());
|
assert!(v.randao_commitment.is_zero());
|
||||||
assert_eq!(v.randao_layers, 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, From::from(0));
|
||||||
assert_eq!(v.latest_status_change_slot, 0);
|
assert_eq!(v.latest_status_change_slot, 0);
|
||||||
assert_eq!(v.exit_count, 0);
|
assert_eq!(v.exit_count, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user