chore: bump trees from 0.2.1 to 0.4.2 (#18052)
* chore: bump trees from 0.2.1 to 0.4.2 (#18041) Bumps [trees](https://github.com/oooutlk/trees) from 0.2.1 to 0.4.2. - [Release notes](https://github.com/oooutlk/trees/releases) - [Commits](https://github.com/oooutlk/trees/commits) --- updated-dependencies: - dependency-name: trees dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Accommodate field & type changes Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1438,13 +1438,13 @@ pub mod test {
|
||||
forks: Tree<u64>,
|
||||
cluster_votes: &HashMap<Pubkey, Vec<u64>>,
|
||||
) {
|
||||
let root = forks.root().data;
|
||||
let root = *forks.root().data();
|
||||
assert!(self.bank_forks.read().unwrap().get(root).is_some());
|
||||
|
||||
let mut walk = TreeWalk::from(forks);
|
||||
|
||||
while let Some(visit) = walk.get() {
|
||||
let slot = visit.node().data;
|
||||
let slot = *visit.node().data();
|
||||
self.progress
|
||||
.entry(slot)
|
||||
.or_insert_with(|| ForkProgress::new(Hash::default(), None, None, 0, 0));
|
||||
@ -1452,7 +1452,7 @@ pub mod test {
|
||||
walk.forward();
|
||||
continue;
|
||||
}
|
||||
let parent = walk.get_parent().unwrap().data;
|
||||
let parent = *walk.get_parent().unwrap().data();
|
||||
let parent_bank = self.bank_forks.read().unwrap().get(parent).unwrap().clone();
|
||||
let new_bank = Bank::new_from_parent(&parent_bank, &Pubkey::default(), slot);
|
||||
for (pubkey, vote) in cluster_votes.iter() {
|
||||
|
@ -215,11 +215,11 @@ impl HeaviestSubtreeForkChoice {
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn new_from_tree<T: GetSlotHash>(forks: Tree<T>) -> Self {
|
||||
let root = forks.root().data.slot_hash();
|
||||
let root = forks.root().data().slot_hash();
|
||||
let mut walk = TreeWalk::from(forks);
|
||||
let mut heaviest_subtree_fork_choice = HeaviestSubtreeForkChoice::new(root);
|
||||
while let Some(visit) = walk.get() {
|
||||
let slot_hash = visit.node().data.slot_hash();
|
||||
let slot_hash = visit.node().data().slot_hash();
|
||||
if heaviest_subtree_fork_choice
|
||||
.fork_infos
|
||||
.contains_key(&slot_hash)
|
||||
@ -227,7 +227,7 @@ impl HeaviestSubtreeForkChoice {
|
||||
walk.forward();
|
||||
continue;
|
||||
}
|
||||
let parent_slot_hash = walk.get_parent().map(|n| n.data.slot_hash());
|
||||
let parent_slot_hash = walk.get_parent().map(|n| n.data().slot_hash());
|
||||
heaviest_subtree_fork_choice.add_new_leaf_slot(slot_hash, parent_slot_hash);
|
||||
walk.forward();
|
||||
}
|
||||
|
Reference in New Issue
Block a user