Implemented From for chain_vote::TallyResult => jormungandr_lib::TallyResult
@@ -287,7 +287,6 @@ pub enum Tally {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)]
pub struct TallyResult {
results: Vec<u64>,
-
options: Range<u8>,
}
@@ -369,6 +368,16 @@ impl From<vote::TallyResult> for TallyResult {
}
}
+impl From<chain_vote::TallyResult> for TallyResult {
+ fn from(this: chain_vote::TallyResult) -> Self {
+ // TODO: is it safe to unwrap here?
+ Self {
+ results: this.votes.iter().map(|w| w.unwrap().into()).collect(),
+ options: this.options,
+ }
+ }
+}
+
impl From<vote::Tally> for Tally {
fn from(this: vote::Tally) -> Self {
match this {
