Struct snarkos_node_bft::helpers::proposal::Proposal
source · pub struct Proposal<N: Network> { /* private fields */ }Implementations§
source§impl<N: Network> Proposal<N>
impl<N: Network> Proposal<N>
sourcepub fn new(
committee: Committee<N>,
batch_header: BatchHeader<N>,
transmissions: IndexMap<TransmissionID<N>, Transmission<N>>
) -> Result<Self>
pub fn new( committee: Committee<N>, batch_header: BatchHeader<N>, transmissions: IndexMap<TransmissionID<N>, Transmission<N>> ) -> Result<Self>
Initializes a new instance of the proposal.
sourcepub const fn batch_header(&self) -> &BatchHeader<N>
pub const fn batch_header(&self) -> &BatchHeader<N>
Returns the proposed batch header.
sourcepub const fn transmissions(
&self
) -> &IndexMap<TransmissionID<N>, Transmission<N>>
pub const fn transmissions( &self ) -> &IndexMap<TransmissionID<N>, Transmission<N>>
Returns the transmissions.
sourcepub fn into_transmissions(self) -> IndexMap<TransmissionID<N>, Transmission<N>>
pub fn into_transmissions(self) -> IndexMap<TransmissionID<N>, Transmission<N>>
Returns the transmissions.
sourcepub fn nonsigners(&self, committee: &Committee<N>) -> HashSet<Address<N>>
pub fn nonsigners(&self, committee: &Committee<N>) -> HashSet<Address<N>>
Returns the nonsigners.
sourcepub fn is_quorum_threshold_reached(&self, committee: &Committee<N>) -> bool
pub fn is_quorum_threshold_reached(&self, committee: &Committee<N>) -> bool
Returns true if the quorum threshold has been reached for the proposed batch.
sourcepub fn contains_transmission(
&self,
transmission_id: impl Into<TransmissionID<N>>
) -> bool
pub fn contains_transmission( &self, transmission_id: impl Into<TransmissionID<N>> ) -> bool
Returns true if the proposal contains the given transmission ID.
sourcepub fn get_transmission(
&self,
transmission_id: impl Into<TransmissionID<N>>
) -> Option<&Transmission<N>>
pub fn get_transmission( &self, transmission_id: impl Into<TransmissionID<N>> ) -> Option<&Transmission<N>>
Returns the transmission for the given transmission ID.
sourcepub fn add_signature(
&mut self,
signer: Address<N>,
signature: Signature<N>,
timestamp: i64,
committee: &Committee<N>
) -> Result<()>
pub fn add_signature( &mut self, signer: Address<N>, signature: Signature<N>, timestamp: i64, committee: &Committee<N> ) -> Result<()>
Adds a signature to the proposal, if the signature is valid.
sourcepub fn to_certificate(
&self,
committee: &Committee<N>
) -> Result<(BatchCertificate<N>, IndexMap<TransmissionID<N>, Transmission<N>>)>
pub fn to_certificate( &self, committee: &Committee<N> ) -> Result<(BatchCertificate<N>, IndexMap<TransmissionID<N>, Transmission<N>>)>
Returns the batch certificate and transmissions.
Auto Trait Implementations§
impl<N> RefUnwindSafe for Proposal<N>where N: RefUnwindSafe, <N as Environment>::Field: RefUnwindSafe, <<N as Environment>::PairingCurve as PairingEngine>::G1Affine: RefUnwindSafe, <N as Environment>::Projective: RefUnwindSafe, <N as Environment>::Scalar: RefUnwindSafe, <N as Network>::StateRoot: RefUnwindSafe, <N as Network>::TransactionID: RefUnwindSafe, <N as Network>::TransitionID: RefUnwindSafe,
impl<N> Send for Proposal<N>
impl<N> Sync for Proposal<N>
impl<N> Unpin for Proposal<N>where N: Unpin, <N as Environment>::Field: Unpin, <<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Unpin, <N as Environment>::Projective: Unpin, <N as Environment>::Scalar: Unpin, <N as Network>::StateRoot: Unpin, <N as Network>::TransactionID: Unpin, <N as Network>::TransitionID: Unpin,
impl<N> UnwindSafe for Proposal<N>where N: UnwindSafe, <N as Environment>::Field: UnwindSafe, <<N as Environment>::PairingCurve as PairingEngine>::G1Affine: UnwindSafe + RefUnwindSafe, <N as Environment>::Projective: UnwindSafe, <N as Environment>::Scalar: UnwindSafe, <N as Network>::StateRoot: UnwindSafe, <N as Network>::TransactionID: UnwindSafe, <N as Network>::TransitionID: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more