1
0
mirror of synced 2025-01-09 15:26:11 +00:00

Add missing bounds for cover traffic (#914)

This commit is contained in:
Daniel Sanchez 2024-11-08 04:09:52 +01:00 committed by GitHub
parent a3c2fe5d55
commit 360a9aa558
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,13 +1,13 @@
use blake2::Digest; use blake2::Digest;
use futures::{Stream, StreamExt}; use futures::{Stream, StreamExt};
use nomos_mix_message::MixMessage; use nomos_mix_message::MixMessage;
use serde::Deserialize;
use std::collections::HashSet; use std::collections::HashSet;
use std::hash::Hash; use std::hash::Hash;
use std::marker::PhantomData; use std::marker::PhantomData;
use std::ops::{DerefMut, Div}; use std::ops::{DerefMut, Div};
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use serde::Deserialize;
#[derive(Copy, Clone, Deserialize)] #[derive(Copy, Clone, Deserialize)]
pub struct CoverTrafficSettings { pub struct CoverTrafficSettings {
@ -28,8 +28,8 @@ pub struct CoverTraffic<EpochStream, SlotStream, Message> {
impl<EpochStream, SlotStream, Message> CoverTraffic<EpochStream, SlotStream, Message> impl<EpochStream, SlotStream, Message> CoverTraffic<EpochStream, SlotStream, Message>
where where
EpochStream: Stream<Item = usize>, EpochStream: Stream<Item = usize> + Send + Sync + Unpin,
SlotStream: Stream<Item = usize>, SlotStream: Stream<Item = usize> + Send + Sync + Unpin,
{ {
pub fn new( pub fn new(
settings: CoverTrafficSettings, settings: CoverTrafficSettings,
@ -50,9 +50,9 @@ where
impl<EpochStream, SlotStream, Message> Stream for CoverTraffic<EpochStream, SlotStream, Message> impl<EpochStream, SlotStream, Message> Stream for CoverTraffic<EpochStream, SlotStream, Message>
where where
EpochStream: Stream<Item = usize> + Unpin, EpochStream: Stream<Item = usize> + Send + Sync + Unpin,
SlotStream: Stream<Item = usize> + Unpin, SlotStream: Stream<Item = usize> + Send + Sync + Unpin,
Message: MixMessage + Unpin, Message: MixMessage + Send + Sync + Unpin,
{ {
type Item = Vec<u8>; type Item = Vec<u8>;