mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 20:48:02 +00:00
Use DB backend in test client (#1779)
* use DB backend in test client * Update core/client/db/src/lib.rs Co-Authored-By: svyatonik <svyatonik@gmail.com>
This commit is contained in:
committed by
Bastian Köcher
parent
cf71350186
commit
6a6c3155a6
@@ -40,6 +40,9 @@ pub fn key_changes<'a, S: Storage<H>, H: Hasher>(
|
||||
max: u64,
|
||||
key: &'a [u8],
|
||||
) -> Result<DrilldownIterator<'a, S, S, H>, String> where H::Out: HeapSizeOf {
|
||||
// we can't query any roots before root
|
||||
let max = ::std::cmp::min(max, end.number);
|
||||
|
||||
Ok(DrilldownIterator {
|
||||
essence: DrilldownIteratorEssence {
|
||||
key,
|
||||
@@ -67,6 +70,9 @@ pub fn key_changes_proof<S: Storage<H>, H: Hasher>(
|
||||
max: u64,
|
||||
key: &[u8],
|
||||
) -> Result<Vec<Vec<u8>>, String> where H::Out: HeapSizeOf {
|
||||
// we can't query any roots before root
|
||||
let max = ::std::cmp::min(max, end.number);
|
||||
|
||||
let mut iter = ProvingDrilldownIterator {
|
||||
essence: DrilldownIteratorEssence {
|
||||
key,
|
||||
@@ -104,6 +110,9 @@ pub fn key_changes_proof_check<S: RootsStorage<H>, H: Hasher>(
|
||||
max: u64,
|
||||
key: &[u8]
|
||||
) -> Result<Vec<(u64, u32)>, String> where H::Out: HeapSizeOf {
|
||||
// we can't query any roots before root
|
||||
let max = ::std::cmp::min(max, end.number);
|
||||
|
||||
let mut proof_db = MemoryDB::<H>::default();
|
||||
for item in proof {
|
||||
proof_db.insert(&item);
|
||||
|
||||
Reference in New Issue
Block a user