diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index 436d5a246a..9eaa7d7c12 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -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(&self, block: BeaconBlock) -> Result { + pub fn process_block(&self, block: BeaconBlock) -> Result { debug!("Processing block with slot {}...", block.slot()); let block_root = block.canonical_root(); diff --git a/beacon_node/beacon_chain/test_harness/src/harness.rs b/beacon_node/beacon_chain/test_harness/src/harness.rs index 7bc86a7e12..12ed40755c 100644 --- a/beacon_node/beacon_chain/test_harness/src/harness.rs +++ b/beacon_node/beacon_chain/test_harness/src/harness.rs @@ -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, DumpError> { + pub fn chain_dump(&self) -> Result, BeaconChainError> { self.beacon_chain.chain_dump() } diff --git a/beacon_node/beacon_chain/test_harness/src/validator/beacon_node/producer.rs b/beacon_node/beacon_chain/test_harness/src/validator/beacon_node/producer.rs index 36c82f6ccc..d188d8554f 100644 --- a/beacon_node/beacon_chain/test_harness/src/validator/beacon_node/producer.rs +++ b/beacon_node/beacon_chain/test_harness/src/validator/beacon_node/producer.rs @@ -30,7 +30,9 @@ impl BeaconBlockNode for DirectBeaconNode { 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))