Update state transition as per spec
This commit is contained in:
parent
298f9acd6a
commit
b29934aed4
@ -4,7 +4,7 @@ use bls::Signature;
|
|||||||
use slot_clock::TestingSlotClockError;
|
use slot_clock::TestingSlotClockError;
|
||||||
use types::{
|
use types::{
|
||||||
readers::{BeaconBlockReader, BeaconStateReader},
|
readers::{BeaconBlockReader, BeaconStateReader},
|
||||||
BeaconBlock, BeaconBlockBody, BeaconState, Hash256,
|
BeaconBlock, BeaconBlockBody, BeaconState, Eth1Data, Hash256,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
@ -46,7 +46,11 @@ where
|
|||||||
parent_root,
|
parent_root,
|
||||||
state_root: Hash256::zero(), // Updated after the state is calculated.
|
state_root: Hash256::zero(), // Updated after the state is calculated.
|
||||||
randao_reveal: randao_reveal,
|
randao_reveal: randao_reveal,
|
||||||
candidate_pow_receipt_root: Hash256::zero(), // TODO: replace w/ eth1 data.
|
eth1_data: Eth1Data {
|
||||||
|
// TODO: replace with real data
|
||||||
|
deposit_root: Hash256::zero(),
|
||||||
|
block_hash: Hash256::zero(),
|
||||||
|
},
|
||||||
signature: self.spec.empty_signature.clone(), // To be completed by a validator.
|
signature: self.spec.empty_signature.clone(), // To be completed by a validator.
|
||||||
body: BeaconBlockBody {
|
body: BeaconBlockBody {
|
||||||
proposer_slashings: vec![],
|
proposer_slashings: vec![],
|
||||||
|
@ -4,9 +4,8 @@ use boolean_bitfield::BooleanBitfield;
|
|||||||
use slot_clock::{SystemTimeSlotClockError, TestingSlotClockError};
|
use slot_clock::{SystemTimeSlotClockError, TestingSlotClockError};
|
||||||
use ssz::ssz_encode;
|
use ssz::ssz_encode;
|
||||||
use types::{
|
use types::{
|
||||||
readers::{BeaconBlockReader, BeaconStateReader},
|
readers::BeaconBlockReader, AttestationData, AttestationDataAndCustodyBit, BeaconBlock,
|
||||||
AttestationData, AttestationDataAndCustodyBit, BeaconBlock, BeaconState, Exit, ForkData,
|
BeaconState, Exit, Fork, Hash256, PendingAttestation, ProposalSignedData,
|
||||||
Hash256, PendingAttestationRecord, ProposalSignedData,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: define elsehwere.
|
// TODO: define elsehwere.
|
||||||
@ -283,7 +282,7 @@ where
|
|||||||
attestation.data.shard_block_root == self.spec.zero_hash,
|
attestation.data.shard_block_root == self.spec.zero_hash,
|
||||||
Error::BadAttestation
|
Error::BadAttestation
|
||||||
);
|
);
|
||||||
let pending_attestation = PendingAttestationRecord {
|
let pending_attestation = PendingAttestation {
|
||||||
data: attestation.data.clone(),
|
data: attestation.data.clone(),
|
||||||
aggregation_bitfield: attestation.aggregation_bitfield.clone(),
|
aggregation_bitfield: attestation.aggregation_bitfield.clone(),
|
||||||
custody_bitfield: attestation.custody_bitfield.clone(),
|
custody_bitfield: attestation.custody_bitfield.clone(),
|
||||||
@ -426,7 +425,7 @@ fn hash<T>(_input: &T) -> Hash256 {
|
|||||||
Hash256::zero()
|
Hash256::zero()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_domain(_fork: &ForkData, _slot: u64, _domain_type: u64) -> u64 {
|
fn get_domain(_fork: &Fork, _slot: u64, _domain_type: u64) -> u64 {
|
||||||
// TODO: stubbed out.
|
// TODO: stubbed out.
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user