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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Definitions central to BPCon values.
//!
//! This module defines traits and structures related to the values used within the BPCon consensus protocol.
//! It includes a general `Value` trait for handling values in the protocol, as well as a `ValueSelector` trait
//! for implementing value selection and verification logic.
use ;
use HashMap;
use ;
/// A general trait representing a value in the BPCon consensus protocol.
///
/// Implementing this trait ensures that values can be safely transmitted and logged during the
/// consensus process.
/// A trait for selecting and verifying values in the BPCon consensus protocol.
///
/// The `ValueSelector` trait provides the functionality for verifying that a value has been
/// selected according to the rules of the protocol and for selecting a value based on
/// specific conditions.
///
/// ## Important Rules:
/// - **Safety**: Value selection must adhere to the BPCon protocol rules, meaning only "safe" values
/// can be selected. This implies that a party should not vote for different values, even across
/// different ballots.
/// - **Consensus Compliance**: The selection process should consider the state of messages (typically
/// from 1b messages) sent by other parties, ensuring the selected value is compliant with the
/// collective state of the consensus.
///
/// # Type Parameters
/// - `V`: The type of value being selected and verified. This must implement the `Value` trait.