From 35289f5e1436e61bdd8406fecea32b4e14ba57bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Tue, 23 Apr 2024 13:39:17 +0200 Subject: [PATCH] From for OrderedUnit uses new traits for units instead of processing individual fields --- consensus/src/dag/reconstruction/mod.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/consensus/src/dag/reconstruction/mod.rs b/consensus/src/dag/reconstruction/mod.rs index 964834b9..1db709dd 100644 --- a/consensus/src/dag/reconstruction/mod.rs +++ b/consensus/src/dag/reconstruction/mod.rs @@ -81,18 +81,22 @@ impl From { fn from(unit: ReconstructedUnit, 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, } } }