mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 23:01: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(
|
sc_client_api::blockchain::HeaderBackend::hash(
|
||||||
&self.blockchain,
|
&self.blockchain,
|
||||||
new_canonical.saturated_into(),
|
new_canonical.saturated_into(),
|
||||||
)?.expect("existence of block with number `new_canonical` \
|
)?.ok_or_else(|| sp_blockchain::Error::Backend(format!(
|
||||||
implies existence of blocks with all numbers before it; qed")
|
"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()) {
|
if !sc_client_api::Backend::have_state_at(self, &hash, new_canonical.saturated_into()) {
|
||||||
return Ok(())
|
return Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user