loom_node_actor_config/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#[derive(Debug, Clone)]
pub struct NodeBlockActorConfig {
    pub block_header: bool,
    pub block_with_tx: bool,
    pub block_logs: bool,
    pub block_state_update: bool,
}

impl NodeBlockActorConfig {
    pub fn all_disabled() -> Self {
        Self { block_header: false, block_with_tx: false, block_logs: false, block_state_update: false }
    }

    pub fn all_enabled() -> Self {
        Self { block_header: true, block_with_tx: true, block_logs: true, block_state_update: true }
    }

    pub fn with_block_header(mut self) -> Self {
        self.block_header = true;
        self
    }

    pub fn with_block_with_tx(mut self) -> Self {
        self.block_with_tx = true;
        self
    }

    pub fn with_block_logs(mut self) -> Self {
        self.block_logs = true;
        self
    }

    pub fn with_block_state_update(mut self) -> Self {
        self.block_state_update = true;
        self
    }
}