Skip to content

Commit

Permalink
units in external api: more review changes, removed NodeIndex from Or…
Browse files Browse the repository at this point in the history
…deredUnit::parents
  • Loading branch information
fixxxedpoint committed Apr 29, 2024
1 parent 1effa2c commit f52f918
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions consensus/src/dag/reconstruction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,7 @@ impl<D: Data, H: Hasher, K: MultiKeychain> From<ReconstructedUnit<Signed<FullUni
for OrderedUnit<D, H>
{
fn from(unit: ReconstructedUnit<Signed<FullUnit<H, D>, K>>) -> Self {
let parents = unit
.parents()
.into_iter()
.map(|(ix, hash)| (ix, *hash))
.collect();
let parents = unit.parents().into_iter().map(|(_, hash)| *hash).collect();
let unit = unit.unpack();
let creator = unit.creator();
let round = unit.round();
Expand Down
2 changes: 1 addition & 1 deletion consensus/src/member.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl<DP: DataProvider, FH: FinalizationHandler<DP::Output>, US: AsyncWrite, UL:
}
}

pub fn new_using_unit_finalization_handler<
pub fn new_with_unit_finalization_handler<
H: Hasher,
UFH: FinalizationHandler<BatchOfUnits<DP::Output, H>>,
>(
Expand Down
2 changes: 1 addition & 1 deletion types/src/dataio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub trait FinalizationHandler<D>: Sync + Send + 'static {
/// which can be then used for example for the purpose of node's performance evaluation.
pub struct OrderedUnit<D: Data, H: Hasher> {
pub data: Option<D>,
pub parents: Vec<(NodeIndex, H::Hash)>,
pub parents: Vec<H::Hash>,
pub hash: H::Hash,
pub creator: NodeIndex,
pub round: Round,
Expand Down

0 comments on commit f52f918

Please sign in to comment.