Skip to content

Commit

Permalink
Merge pull request fedimint#5806 from joschisan/lnv2_ci_default
Browse files Browse the repository at this point in the history
chore: add encodable default for lnv2 ci
  • Loading branch information
joschisan authored Aug 6, 2024
2 parents acd2297 + 902463e commit ad7b24b
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions modules/fedimint-lnv2-common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -123,6 +123,11 @@ pub enum LightningOutputError {
pub enum LightningConsensusItem {
BlockCountVote(u64),
UnixTimeVote(u64),
#[encodable_default]
Default {
variant: u64,
bytes: Vec<u8>,
},
}

impl std::fmt::Display for LightningConsensusItem {
5 changes: 4 additions & 1 deletion modules/fedimint-lnv2-server/src/lib.rs
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ mod db;
use std::collections::BTreeMap;
use std::time::Duration;

use anyhow::ensure;
use anyhow::{anyhow, ensure};
use bls12_381::{G1Projective, Scalar};
use fedimint_bitcoind::{create_bitcoind, DynBitcoindRpc};
use fedimint_core::config::{
@@ -364,6 +364,9 @@ impl ServerModule for Lightning {

Ok(())
}
LightningConsensusItem::Default { variant, .. } => Err(anyhow!(
"Received lnv2 consensus item with unknown variant {variant}"
)),
}
}

0 comments on commit ad7b24b

Please sign in to comment.