From 38a1b94f61ad22aeedee22aa91ae5f413dc1aff4 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Tue, 5 Mar 2019 17:38:17 +1100 Subject: [PATCH] Fix compile issues in `types` crate --- eth2/types/src/attester_slashing/builder.rs | 4 ++-- eth2/types/src/beacon_block.rs | 3 ++- eth2/types/src/beacon_state.rs | 3 --- eth2/types/src/beacon_state/builder.rs | 2 +- eth2/types/src/readers/block_reader.rs | 5 ----- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/eth2/types/src/attester_slashing/builder.rs b/eth2/types/src/attester_slashing/builder.rs index ed203d6e1..54dfae959 100644 --- a/eth2/types/src/attester_slashing/builder.rs +++ b/eth2/types/src/attester_slashing/builder.rs @@ -37,7 +37,7 @@ impl AttesterSlashingBuilder { shard, beacon_block_root: hash_1, epoch_boundary_root: hash_1, - shard_block_root: hash_1, + crosslink_data_root: hash_1, latest_crosslink: Crosslink { epoch, shard_block_root: hash_1, @@ -56,7 +56,7 @@ impl AttesterSlashingBuilder { shard, beacon_block_root: hash_2, epoch_boundary_root: hash_2, - shard_block_root: hash_2, + crosslink_data_root: hash_2, latest_crosslink: Crosslink { epoch, shard_block_root: hash_2, diff --git a/eth2/types/src/beacon_block.rs b/eth2/types/src/beacon_block.rs index d8e50d9ca..111ca1b4b 100644 --- a/eth2/types/src/beacon_block.rs +++ b/eth2/types/src/beacon_block.rs @@ -39,7 +39,8 @@ impl BeaconBlock { attester_slashings: vec![], attestations: vec![], deposits: vec![], - exits: vec![], + voluntary_exits: vec![], + transfers: vec![], }, } } diff --git a/eth2/types/src/beacon_state.rs b/eth2/types/src/beacon_state.rs index bf989b858..d62e29127 100644 --- a/eth2/types/src/beacon_state.rs +++ b/eth2/types/src/beacon_state.rs @@ -745,9 +745,6 @@ impl BeaconState { /// Spec v0.4.0 pub fn process_exit_queue(&mut self, spec: &ChainSpec) { 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 validator = &self.validator_registry[index]; diff --git a/eth2/types/src/beacon_state/builder.rs b/eth2/types/src/beacon_state/builder.rs index 94cc28a6b..36b6468fc 100644 --- a/eth2/types/src/beacon_state/builder.rs +++ b/eth2/types/src/beacon_state/builder.rs @@ -249,7 +249,7 @@ fn committee_to_pending_attestation( shard, beacon_block_root: *state.get_block_root(slot, spec).unwrap(), epoch_boundary_root, - shard_block_root: Hash256::zero(), + crosslink_data_root: Hash256::zero(), latest_crosslink: Crosslink { epoch: slot.epoch(spec.slots_per_epoch), shard_block_root: Hash256::zero(), diff --git a/eth2/types/src/readers/block_reader.rs b/eth2/types/src/readers/block_reader.rs index bcb2d0e63..93157a1a3 100644 --- a/eth2/types/src/readers/block_reader.rs +++ b/eth2/types/src/readers/block_reader.rs @@ -13,7 +13,6 @@ pub trait BeaconBlockReader: Debug + PartialEq { fn slot(&self) -> Slot; fn parent_root(&self) -> Hash256; fn state_root(&self) -> Hash256; - fn canonical_root(&self) -> Hash256; fn into_beacon_block(self) -> Option; } @@ -30,10 +29,6 @@ impl BeaconBlockReader for BeaconBlock { self.state_root } - fn canonical_root(&self) -> Hash256 { - self.canonical_root() - } - fn into_beacon_block(self) -> Option { Some(self) }