mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 23:21:06 +00:00
fixed aux modifications on light client (#1621)
This commit is contained in:
committed by
Gav Wood
parent
aa5e0658f8
commit
a4756710c5
@@ -174,12 +174,14 @@ pub mod tests {
|
||||
|
||||
pub struct DummyStorage {
|
||||
pub changes_tries_cht_roots: HashMap<u64, Hash>,
|
||||
pub aux_store: Mutex<HashMap<Vec<u8>, Vec<u8>>>,
|
||||
}
|
||||
|
||||
impl DummyStorage {
|
||||
pub fn new() -> Self {
|
||||
DummyStorage {
|
||||
changes_tries_cht_roots: HashMap::new(),
|
||||
aux_store: Mutex::new(HashMap::new()),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -213,12 +215,15 @@ pub mod tests {
|
||||
'c: 'a,
|
||||
I: IntoIterator<Item=&'a(&'c [u8], &'c [u8])>,
|
||||
D: IntoIterator<Item=&'a &'b [u8]>,
|
||||
>(&self, _insert: I, _delete: D) -> ClientResult<()> {
|
||||
Err(ClientErrorKind::Backend("Test error".into()).into())
|
||||
>(&self, insert: I, _delete: D) -> ClientResult<()> {
|
||||
for (k, v) in insert.into_iter() {
|
||||
self.aux_store.lock().insert(k.to_vec(), v.to_vec());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_aux(&self, _key: &[u8]) -> ClientResult<Option<Vec<u8>>> {
|
||||
Err(ClientErrorKind::Backend("Test error".into()).into())
|
||||
fn get_aux(&self, key: &[u8]) -> ClientResult<Option<Vec<u8>>> {
|
||||
Ok(self.aux_store.lock().get(key).cloned())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user