[][src]Enum parsec::Observation

pub enum Observation<T: NetworkEvent, P: PublicId> {
    Genesis {
        group: BTreeSet<P>,
        related_info: Vec<u8>,
    },
    Add {
        peer_id: P,
        related_info: Vec<u8>,
    },
    Remove {
        peer_id: P,
        related_info: Vec<u8>,
    },
    Accusation {
        offender: P,
        malice: Malice<T, P>,
    },
    OpaquePayload(T),
    StartDkg(BTreeSet<P>),
    DkgResult {
        participants: BTreeSet<P>,
        dkg_result: DkgResultWrapper,
    },
    DkgMessage(DkgMessage),
}

An enum of the various network events for which a peer can vote.

Variants

Genesis

Genesis group

Fields of Genesis

group: BTreeSet<P>

Members of the genesis group.

related_info: Vec<u8>

Extra arbitrary information for use by the client. Note: this can be set through the genesis_related_info argument of Parsec::from_genesis.

Add

Vote to add the indicated peer to the network.

Fields of Add

peer_id: P

Public id of the peer to be added

related_info: Vec<u8>

Extra arbitrary information for use by the client

Remove

Vote to remove the indicated peer from the network.

Fields of Remove

peer_id: P

Public id of the peer to be removed

related_info: Vec<u8>

Extra arbitrary information for use by the client

Accusation

Output only: Do not vote for it. Vote to accuse a peer of malicious behaviour.

Fields of Accusation

offender: P

Public id of the peer committing the malice.

malice: Malice<T, P>

Type of the malice committed.

OpaquePayload(T)

Vote for an event which is opaque to Parsec.

StartDkg(BTreeSet<P>)

Internal only: No blocks with it. Can be voted as an input.

DkgResult

Output only: Do not vote for it. Will have empty proof set.

Fields of DkgResult

participants: BTreeSet<P>

DKG Participants: These peers have a secret key.

dkg_result: DkgResultWrapper

DKG result. public_key_set will be shared state. secret_key_share will be unique to each peers: all participating peers will have one assuming less than 1/3 malicious. (Ignored in comparaison and serialization).

DkgMessage(DkgMessage)

Internal only: Do not vote for it or expect it to come in blocks. Vote for the next message (Part or Ack) to be handled for the Distributed Key Generation algorithm used by our common coin.

Implementations

impl<T: NetworkEvent, P: PublicId> Observation<T, P>[src]

pub fn is_opaque(&self) -> bool[src]

Is this observation's payload opaque to PARSEC?

pub fn is_dkg_message(&self) -> bool[src]

Is this observation an internal DkgMessage

pub fn is_internal(&self) -> bool[src]

Is this observation an internal and should not be published in a Block

pub fn is_dkg_result(&self) -> bool[src]

Is this observation a result only DkgResult

Trait Implementations

impl<T: Clone + NetworkEvent, P: Clone + PublicId> Clone for Observation<T, P>[src]

impl<T: NetworkEvent, P: PublicId> Debug for Observation<T, P>[src]

impl<'de, T: NetworkEvent, P: PublicId> Deserialize<'de> for Observation<T, P>[src]

impl<T: Eq + NetworkEvent, P: Eq + PublicId> Eq for Observation<T, P>[src]

impl<T: Hash + NetworkEvent, P: Hash + PublicId> Hash for Observation<T, P>[src]

impl<T: Ord + NetworkEvent, P: Ord + PublicId> Ord for Observation<T, P>[src]

impl<T: PartialEq + NetworkEvent, P: PartialEq + PublicId> PartialEq<Observation<T, P>> for Observation<T, P>[src]

impl<T: PartialOrd + NetworkEvent, P: PartialOrd + PublicId> PartialOrd<Observation<T, P>> for Observation<T, P>[src]

impl<T: NetworkEvent, P: PublicId> Serialize for Observation<T, P>[src]

impl<T: NetworkEvent, P: PublicId> StructuralEq for Observation<T, P>[src]

impl<T: NetworkEvent, P: PublicId> StructuralPartialEq for Observation<T, P>[src]

Auto Trait Implementations

impl<T, P> RefUnwindSafe for Observation<T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe,
    <P as PublicId>::Signature: RefUnwindSafe

impl<T, P> Send for Observation<T, P> where
    P: Send,
    T: Send,
    <P as PublicId>::Signature: Send

impl<T, P> Sync for Observation<T, P> where
    P: Sync,
    T: Sync,
    <P as PublicId>::Signature: Sync

impl<T, P> Unpin for Observation<T, P> where
    P: Unpin,
    T: Unpin

impl<T, P> UnwindSafe for Observation<T, P> where
    P: RefUnwindSafe + UnwindSafe,
    T: UnwindSafe,
    <P as PublicId>::Signature: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,