Skip to content

Commit

Permalink
From for OrderedUnit uses new traits for units instead of processing …
Browse files Browse the repository at this point in the history
…individual fields
  • Loading branch information
fixxxedpoint committed Apr 23, 2024
1 parent e239c7a commit 35289f5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions consensus/src/dag/reconstruction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,22 @@ 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(|(ix, hash)| (ix, *hash))
.collect();
let unit = unit.unpack();
let creator = unit.creator();
let round = unit.round();
let hash = unit.hash();
let (_, data) = unit.into_signable().into();
let data = unit.into_signable().data().clone();
OrderedUnit {
data,
parents,
hash,
creator,
round,
hash,
data,
}
}
}
Expand Down

0 comments on commit 35289f5

Please sign in to comment.