Skip to content

Commit

Permalink
chore: add encodable default for lnv2 ci
Browse files Browse the repository at this point in the history
  • Loading branch information
joschisan committed Aug 6, 2024
1 parent dbbe3b3 commit 902463e
Show file tree
Hide file tree
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
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion modules/fedimint-lnv2-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -364,6 +364,9 @@ impl ServerModule for Lightning {

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

Expand Down

0 comments on commit 902463e

Please sign in to comment.