Fix compiler errors from BeaconChain refactor.

I accidentally forgot to include this in the last commit, my bad!
This commit is contained in:
Paul Hauner 2019-02-05 05:26:47 +11:00
parent c1ed5cd2d8
commit d83bafae10
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6
3 changed files with 6 additions and 4 deletions

View File

@ -415,7 +415,7 @@ where
/// Accept some block and attempt to add it to block DAG.
///
/// Will accept blocks from prior slots, however it will reject any block from a future slot.
pub fn process_block<V>(&self, block: BeaconBlock) -> Result<BlockProcessingOutcome, Error> {
pub fn process_block(&self, block: BeaconBlock) -> Result<BlockProcessingOutcome, Error> {
debug!("Processing block with slot {}...", block.slot());
let block_root = block.canonical_root();

View File

@ -1,6 +1,6 @@
use super::TestValidator;
use beacon_chain::BeaconChain;
pub use beacon_chain::{dump::Error as DumpError, CheckPoint};
pub use beacon_chain::{CheckPoint, Error as BeaconChainError};
use db::{
stores::{BeaconBlockStore, BeaconStateStore},
MemoryDB,
@ -219,7 +219,7 @@ impl BeaconChainHarness {
}
/// Dump all blocks and states from the canonical beacon chain.
pub fn chain_dump(&self) -> Result<Vec<CheckPoint>, DumpError> {
pub fn chain_dump(&self) -> Result<Vec<CheckPoint>, BeaconChainError> {
self.beacon_chain.chain_dump()
}

View File

@ -30,7 +30,9 @@ impl<T: ClientDB, U: SlotClock> BeaconBlockNode for DirectBeaconNode<T, U> {
let (block, _state) = self
.beacon_chain
.produce_block(randao_reveal.clone())
.map_err(|e| BeaconBlockNodeError::RemoteFailure(format!("{:?}", e)))?;
.ok_or_else(|| {
BeaconBlockNodeError::RemoteFailure(format!("Did not produce block."))
})?;
if block.slot == slot {
Ok(Some(block))