add Debug and constructor for CarnotSettings (#71)

This commit is contained in:
Al Liu 2023-02-10 19:04:56 +08:00 committed by GitHub
parent 320755d19d
commit 6b45bf408e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -8,6 +8,7 @@ use crate::fountain::{FountainCode, FountainError};
/// Fountain code that does no protocol at all.
/// Just bypasses the raw bytes into a single chunk and reconstruct from it.
#[derive(Debug)]
pub struct MockFountain;
#[async_trait]

View File

@ -56,6 +56,16 @@ impl<Fountain: FountainCode> Clone for CarnotSettings<Fountain> {
}
}
impl<Fountain: FountainCode> CarnotSettings<Fountain> {
#[inline]
pub const fn new(private_key: [u8; 32], fountain_settings: Fountain::Settings) -> Self {
Self {
private_key,
fountain_settings,
}
}
}
pub struct CarnotConsensus<A, P, M, F>
where
F: FountainCode,

View File

@ -95,7 +95,7 @@ fn test_mockmempool() {
let (mtx, mrx) = tokio::sync::oneshot::channel();
mempool_outbound
.send(MempoolMsg::View {
ancestor_hint: BlockId,
ancestor_hint: BlockId::default(),
reply_channel: mtx,
})
.await