diff --git a/Cargo.toml b/Cargo.toml index 864220577..fa8547e3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,3 +17,8 @@ overflow-checks = true lto = true opt-level = "z" #strip = true + +[patch.crates-io] +# temporary solution to funty@1.2.0 being yanked, we should propose bitvec upgrade to upstream filecoin crates +# tracking issue: https://github.com/bitvecto-rs/funty/issues/7 +funty = { git = "https://github.com/bitvecto-rs/funty/", rev = "7ef0d890fbcd8b3def1635ac1a877fc298488446" } diff --git a/fvm/src/blockstore/buffered.rs b/fvm/src/blockstore/buffered.rs index 422b8f072..f1f5e4253 100644 --- a/fvm/src/blockstore/buffered.rs +++ b/fvm/src/blockstore/buffered.rs @@ -42,14 +42,13 @@ where { /// Flushes the buffered cache based on the root node. /// This will recursively traverse the cache and write all data connected by links to this - /// root Cid. + /// root Cid. Calling flush will not reset the write buffer. fn flush(&self, root: &Cid) -> Result<()> { let mut buffer = Vec::new(); - let mut s = self.write.borrow_mut(); + let s = self.write.borrow(); copy_rec(&s, *root, &mut buffer)?; self.base.put_many_keyed(buffer)?; - *s = Default::default(); Ok(()) } @@ -290,7 +289,6 @@ mod tests { buf_store.flush(&cid).unwrap(); assert_eq!(buf_store.get_cbor::(&cid).unwrap(), Some(8)); assert_eq!(mem.get_cbor::(&cid).unwrap(), Some(8)); - assert!(buf_store.write.borrow().get(&cid).is_none()); } #[test] @@ -361,6 +359,5 @@ mod tests { assert_eq!(buf_store.get(&unsealed_comm_cid).unwrap(), None); assert_eq!(buf_store.get(&sealed_comm_cid).unwrap(), None); assert_eq!(mem.get_cbor::(&unconnected).unwrap(), None); - assert_eq!(buf_store.get_cbor::(&unconnected).unwrap(), None); } }