Fix compile issues in types crate

This commit is contained in:
Paul Hauner 2019-03-05 17:38:17 +11:00
parent e0ccde1ce3
commit 38a1b94f61
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6
5 changed files with 5 additions and 12 deletions

View File

@ -37,7 +37,7 @@ impl AttesterSlashingBuilder {
shard, shard,
beacon_block_root: hash_1, beacon_block_root: hash_1,
epoch_boundary_root: hash_1, epoch_boundary_root: hash_1,
shard_block_root: hash_1, crosslink_data_root: hash_1,
latest_crosslink: Crosslink { latest_crosslink: Crosslink {
epoch, epoch,
shard_block_root: hash_1, shard_block_root: hash_1,
@ -56,7 +56,7 @@ impl AttesterSlashingBuilder {
shard, shard,
beacon_block_root: hash_2, beacon_block_root: hash_2,
epoch_boundary_root: hash_2, epoch_boundary_root: hash_2,
shard_block_root: hash_2, crosslink_data_root: hash_2,
latest_crosslink: Crosslink { latest_crosslink: Crosslink {
epoch, epoch,
shard_block_root: hash_2, shard_block_root: hash_2,

View File

@ -39,7 +39,8 @@ impl BeaconBlock {
attester_slashings: vec![], attester_slashings: vec![],
attestations: vec![], attestations: vec![],
deposits: vec![], deposits: vec![],
exits: vec![], voluntary_exits: vec![],
transfers: vec![],
}, },
} }
} }

View File

@ -745,9 +745,6 @@ impl BeaconState {
/// Spec v0.4.0 /// Spec v0.4.0
pub fn process_exit_queue(&mut self, spec: &ChainSpec) { pub fn process_exit_queue(&mut self, spec: &ChainSpec) {
let current_epoch = self.current_epoch(spec); let current_epoch = self.current_epoch(spec);
let active_validator_indices =
get_active_validator_indices(&self.validator_registry, current_epoch);
let total_balance = self.get_total_balance(&active_validator_indices[..], spec);
let eligible = |index: usize| { let eligible = |index: usize| {
let validator = &self.validator_registry[index]; let validator = &self.validator_registry[index];

View File

@ -249,7 +249,7 @@ fn committee_to_pending_attestation(
shard, shard,
beacon_block_root: *state.get_block_root(slot, spec).unwrap(), beacon_block_root: *state.get_block_root(slot, spec).unwrap(),
epoch_boundary_root, epoch_boundary_root,
shard_block_root: Hash256::zero(), crosslink_data_root: Hash256::zero(),
latest_crosslink: Crosslink { latest_crosslink: Crosslink {
epoch: slot.epoch(spec.slots_per_epoch), epoch: slot.epoch(spec.slots_per_epoch),
shard_block_root: Hash256::zero(), shard_block_root: Hash256::zero(),

View File

@ -13,7 +13,6 @@ pub trait BeaconBlockReader: Debug + PartialEq {
fn slot(&self) -> Slot; fn slot(&self) -> Slot;
fn parent_root(&self) -> Hash256; fn parent_root(&self) -> Hash256;
fn state_root(&self) -> Hash256; fn state_root(&self) -> Hash256;
fn canonical_root(&self) -> Hash256;
fn into_beacon_block(self) -> Option<BeaconBlock>; fn into_beacon_block(self) -> Option<BeaconBlock>;
} }
@ -30,10 +29,6 @@ impl BeaconBlockReader for BeaconBlock {
self.state_root self.state_root
} }
fn canonical_root(&self) -> Hash256 {
self.canonical_root()
}
fn into_beacon_block(self) -> Option<BeaconBlock> { fn into_beacon_block(self) -> Option<BeaconBlock> {
Some(self) Some(self)
} }