Skip to content

Commit 8f33aa6

Browse files
authored
feat: impl diff function for fvm_ipld_amt (#1788)
Add a method for diffing two AMTs. This method only works with AMTs with equal bitwidths.
1 parent 9c16cf5 commit 8f33aa6

File tree

6 files changed

+739
-3
lines changed

6 files changed

+739
-3
lines changed

Cargo.lock

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ipld/amt/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ go-interop = []
2222

2323
[dev-dependencies]
2424
criterion = "0.5.1"
25+
quickcheck = "1"
26+
quickcheck_macros = "1"
2527

2628
[[bench]]
2729
name = "amt_benchmark"

ipld/amt/src/amt.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use crate::{
2323
#[derive(Debug)]
2424
#[doc(hidden)]
2525
pub struct AmtImpl<V, BS, Ver> {
26-
root: RootImpl<V, Ver>,
27-
block_store: BS,
26+
pub(super) root: RootImpl<V, Ver>,
27+
pub(super) block_store: BS,
2828
/// Remember the last flushed CID until it changes.
2929
flushed_cid: Option<Cid>,
3030
}
@@ -78,7 +78,7 @@ where
7878
}
7979
}
8080

81-
fn bit_width(&self) -> u32 {
81+
pub(super) fn bit_width(&self) -> u32 {
8282
self.root.bit_width
8383
}
8484

0 commit comments

Comments
 (0)