fix(rolldb): fix find wal sequence semantics (#310)

This commit is contained in:
Santiago Carmuega 2023-10-15 12:02:21 -03:00 committed by GitHub
parent d1ac056142
commit 919529eaa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -303,9 +303,12 @@ impl Store {
}
}
pub fn find_wal_seq(&self, block: Option<(BlockSlot, BlockHash)>) -> Result<Seq, Error> {
pub fn find_wal_seq(
&self,
block: Option<(BlockSlot, BlockHash)>,
) -> Result<Option<Seq>, Error> {
if block.is_none() {
return Ok(0);
return Ok(None);
}
let (slot, hash) = block.unwrap();
@ -322,7 +325,7 @@ impl Store {
})?;
match found {
Some(DBInt(seq)) => Ok(seq),
Some(DBInt(seq)) => Ok(Some(seq)),
None => Err(Error::NotFound),
}
}