Skip to content

Commit

Permalink
Removed parent_round
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin-Radecki committed Jan 14, 2025
1 parent aef31c8 commit 008ca81
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
11 changes: 0 additions & 11 deletions consensus/src/dag/reconstruction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ impl<U: Unit> UnitWithParents for ReconstructedUnit<U> {
self.parents.get(index).map(|(hash, _)| hash)
}

#[cfg(test)]
fn parent_round(&self, index: NodeIndex) -> Option<Round> {
self.parents.get(index).map(|(_, round)| *round)
}

fn node_count(&self) -> NodeCount {
self.parents.size()
}
Expand Down Expand Up @@ -297,12 +292,6 @@ mod test {
parents.iter().zip(reconstructed_unit.parents())
{
assert_eq!(&parent.hash(), reconstructed_parent);
assert_eq!(
reconstructed_unit
.parent_round(parent.creator())
.expect("we should have round"),
round - 1
);
}
}
}
Expand Down
12 changes: 0 additions & 12 deletions consensus/src/dag/reconstruction/parents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,6 @@ mod test {
parents.iter().zip(reconstructed_unit.parents())
{
assert_eq!(&parent.hash(), reconstructed_parent);
assert_eq!(
parent.round(),
reconstructed_unit
.parent_round(parent.creator())
.expect("We should have round")
);
}
}
}
Expand Down Expand Up @@ -386,12 +380,6 @@ mod test {
Some(&parent_hash),
reconstructed_unit.parent_for(coord.creator())
);
assert_eq!(
reconstructed_unit
.parent_round(coord.creator())
.expect("we should have round"),
coord.round()
);
}
}
}
2 changes: 0 additions & 2 deletions consensus/src/units/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,6 @@ pub trait UnitWithParents: Unit {
fn direct_parents(&self) -> impl Iterator<Item = &HashFor<Self>>;
fn parent_for(&self, index: NodeIndex) -> Option<&HashFor<Self>>;

#[cfg(test)]
fn parent_round(&self, index: NodeIndex) -> Option<Round>;
fn node_count(&self) -> NodeCount;
}

Expand Down

0 comments on commit 008ca81

Please sign in to comment.