mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 11:38:01 +00:00
Replace DB assertion with error (#9362)
* Replace DB assert with error * Update client/db/src/lib.rs Co-authored-by: cheme <emericchevalier.pro@gmail.com> Co-authored-by: cheme <emericchevalier.pro@gmail.com>
This commit is contained in:
@@ -1306,8 +1306,12 @@ impl<Block: BlockT> Backend<Block> {
|
||||
sc_client_api::blockchain::HeaderBackend::hash(
|
||||
&self.blockchain,
|
||||
new_canonical.saturated_into(),
|
||||
)?.expect("existence of block with number `new_canonical` \
|
||||
implies existence of blocks with all numbers before it; qed")
|
||||
)?.ok_or_else(|| sp_blockchain::Error::Backend(format!(
|
||||
"Can't canonicalize missing block number #{} when importing {:?} (#{})",
|
||||
new_canonical,
|
||||
hash,
|
||||
number,
|
||||
)))?
|
||||
};
|
||||
if !sc_client_api::Backend::have_state_at(self, &hash, new_canonical.saturated_into()) {
|
||||
return Ok(())
|
||||
|
||||
Reference in New Issue
Block a user