the tests work now

This commit is contained in:
2023-02-12 00:31:34 +01:00
parent bd016130b8
commit 21b9434d18
2 changed files with 213 additions and 38 deletions

View File

@ -257,6 +257,14 @@ pub trait PoolProvider {
/// Delete data inside the pool given a [StoreAddr]
fn delete(&mut self, addr: StoreAddr) -> Result<(), StoreError>;
fn has_element_at(&self, addr: &StoreAddr) -> Result<bool, StoreError>;
/// Retrieve the length of the data at the given store address.
fn len_of_data(&self, addr: &StoreAddr) -> Result<usize, StoreError> {
if !self.has_element_at(addr)? {
return Err(StoreError::DataDoesNotExist(*addr));
}
return Ok(self.read(addr)?.len());
}
}
impl LocalPool {