mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
update kvdb & co (#6111)
* toml changes * REVERTME: patch * adapt parachains db interface * fix Cargo.toml patch after master rebase * fix av-store * fix chain-selection * fix parachains-db? * Revert "fix Cargo.toml patch after master rebase" This reverts commit 3afcbf033c86027b3f2b909d83ec703591bdd287. * Revert "REVERTME: patch" This reverts commit 464b717cf4142d3d09c3d77b83700b632d8c5f54. * Use `Ok` imported from prelude Co-authored-by: Bastian Köcher <info@kchr.de> * update lockfile for {"substrate"} * Revert "update lockfile for {"substrate"}" This reverts commit fdc623de226f7645741b86c4b1a7d030fed2172d. * cargo update -p sp-io Co-authored-by: Bastian Köcher <info@kchr.de> Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -235,16 +235,21 @@ impl Backend for DbBackend {
|
||||
self.inner.iter_with_prefix(self.config.col_data, &STAGNANT_AT_PREFIX[..]);
|
||||
|
||||
let val = stagnant_at_iter
|
||||
.filter_map(|(k, v)| {
|
||||
match (decode_stagnant_at_key(&mut &k[..]), <Vec<_>>::decode(&mut &v[..]).ok()) {
|
||||
(Some(at), Some(stagnant_at)) => Some((at, stagnant_at)),
|
||||
_ => None,
|
||||
}
|
||||
.filter_map(|r| match r {
|
||||
Ok((k, v)) =>
|
||||
match (decode_stagnant_at_key(&mut &k[..]), <Vec<_>>::decode(&mut &v[..]).ok())
|
||||
{
|
||||
(Some(at), Some(stagnant_at)) => Some(Ok((at, stagnant_at))),
|
||||
_ => None,
|
||||
},
|
||||
Err(e) => Some(Err(e)),
|
||||
})
|
||||
.enumerate()
|
||||
.take_while(|(idx, (at, _))| *at <= up_to.into() && *idx < max_elements)
|
||||
.take_while(|(idx, r)| {
|
||||
r.as_ref().map_or(true, |(at, _)| *at <= up_to.into() && *idx < max_elements)
|
||||
})
|
||||
.map(|(_, v)| v)
|
||||
.collect::<Vec<_>>();
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
|
||||
Ok(val)
|
||||
}
|
||||
@@ -254,10 +259,13 @@ impl Backend for DbBackend {
|
||||
self.inner.iter_with_prefix(self.config.col_data, &BLOCK_HEIGHT_PREFIX[..]);
|
||||
|
||||
let val = blocks_at_height_iter
|
||||
.filter_map(|(k, _)| decode_block_height_key(&k[..]))
|
||||
.filter_map(|r| match r {
|
||||
Ok((k, _)) => decode_block_height_key(&k[..]).map(Ok),
|
||||
Err(e) => Some(Err(e)),
|
||||
})
|
||||
.next();
|
||||
|
||||
Ok(val)
|
||||
val.transpose().map_err(Error::from)
|
||||
}
|
||||
|
||||
fn load_blocks_by_number(&self, number: BlockNumber) -> Result<Vec<Hash>, Error> {
|
||||
|
||||
Reference in New Issue
Block a user