This code needs to use count_leaves instead of len on the archival-MMR. And the len method on ArchivalMmr should be deleted again, as length is not a established term for MMRs.
async fn utxo_digest(self, _: context::Context, index: u64) -> Option<Digest> {
let state = self.state.lock_guard().await;
let aocl = &state.chain.archival_state().archival_mutator_set.ams().aocl;
match index > 0 && index < aocl.len().await {
true => Some(aocl.get_leaf_async(index).await),
false => None,
}
}
This code needs to use
count_leaves
instead oflen
on the archival-MMR. And thelen
method onArchivalMmr
should be deleted again, aslength
is not a established term for MMRs.