chore(provider): migrate providers to ProviderError (#5473)

This commit is contained in:
Roman Krasiuk
2023-11-17 06:07:28 -08:00
committed by GitHub
parent b03d0106ae
commit 30dfc070e1
60 changed files with 923 additions and 804 deletions

View File

@ -355,7 +355,7 @@ where
inconsistent_stage_checkpoint = stage_checkpoint,
"Pipeline sync progress is inconsistent"
);
return self.blockchain.block_hash(first_stage_checkpoint)
return Ok(self.blockchain.block_hash(first_stage_checkpoint)?)
}
}
@ -1670,7 +1670,7 @@ where
},
Err(error) => {
error!(target: "consensus::engine", ?error, "Error getting canonical header for continuous sync");
return Some(Err(error.into()))
return Some(Err(RethError::Provider(error).into()))
}
};
self.blockchain.set_canonical_head(max_header);
@ -1836,7 +1836,10 @@ where
cx,
EngineContext {
tip_block_number: this.blockchain.canonical_tip().number,
finalized_block_number: this.blockchain.finalized_block_number()?,
finalized_block_number: this
.blockchain
.finalized_block_number()
.map_err(RethError::Provider)?,
},
)? {
this.on_hook_result(result)?;
@ -1908,7 +1911,10 @@ where
cx,
EngineContext {
tip_block_number: this.blockchain.canonical_tip().number,
finalized_block_number: this.blockchain.finalized_block_number()?,
finalized_block_number: this
.blockchain
.finalized_block_number()
.map_err(RethError::Provider)?,
},
this.sync.is_pipeline_active(),
)? {