Add clone and copy to CoverTrafficSettings (#911)

* Add clone and copy to CoverTrafficSettings

* Make settings fields public.
This commit is contained in:
Álex 2024-11-07 06:40:22 +01:00 committed by GitHub
parent 727b838042
commit 1c62ced9ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

1
.gitignore vendored
View File

@ -15,6 +15,7 @@ store.*
sim_config.json sim_config.json
*.txt *.txt
.env .env
.idea/
# Integration test temp dirs # Integration test temp dirs
tests/.tmp* tests/.tmp*

View File

@ -8,12 +8,14 @@ use std::ops::{DerefMut, Div};
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
#[derive(Copy, Clone)]
pub struct CoverTrafficSettings { pub struct CoverTrafficSettings {
node_id: [u8; 32], pub node_id: [u8; 32],
number_of_hops: usize, pub number_of_hops: usize,
slots_per_epoch: usize, pub slots_per_epoch: usize,
network_size: usize, pub network_size: usize,
} }
pub struct CoverTraffic<EpochStream, SlotStream, Message> { pub struct CoverTraffic<EpochStream, SlotStream, Message> {
winning_probability: f64, winning_probability: f64,
settings: CoverTrafficSettings, settings: CoverTrafficSettings,