pub struct PhaseVote {
pub chain_id: ChainID,
pub view: ViewNumber,
pub block: CryptoHash,
pub phase: Phase,
pub signature: SignatureBytes,
}Expand description
Message sent by a validator to a leader of view + 1 to
indicate that the validator agrees to a specific Proposal or Nudge.
Fields§
§chain_id: ChainIDchain_id field of the Proposal or Nudge associated with this PhaseVote.
view: ViewNumberview field of the Proposal or Nudge associated with this PhaseVote.
block: CryptoHashblock field of the Proposal or Nudge associated with this PhaseVote.
phase: Phasephase field of the Proposal or Nudge associated with this PhaseVote.
signature: SignatureBytesDigital signature formed using
Implementations§
source§impl PhaseVote
impl PhaseVote
sourcepub(crate) fn new(
keypair: &Keypair,
chain_id: ChainID,
view: ViewNumber,
block: CryptoHash,
phase: Phase,
) -> Self
pub(crate) fn new( keypair: &Keypair, chain_id: ChainID, view: ViewNumber, block: CryptoHash, phase: Phase, ) -> Self
Create a PhaseVote for the given chain_id, view, block, and phase by signing over the values
with the provided keypair.
Trait Implementations§
source§impl BorshDeserialize for PhaseVotewhere
ChainID: BorshDeserialize,
ViewNumber: BorshDeserialize,
CryptoHash: BorshDeserialize,
Phase: BorshDeserialize,
SignatureBytes: BorshDeserialize,
impl BorshDeserialize for PhaseVotewhere
ChainID: BorshDeserialize,
ViewNumber: BorshDeserialize,
CryptoHash: BorshDeserialize,
Phase: BorshDeserialize,
SignatureBytes: BorshDeserialize,
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSerialize for PhaseVotewhere
ChainID: BorshSerialize,
ViewNumber: BorshSerialize,
CryptoHash: BorshSerialize,
Phase: BorshSerialize,
SignatureBytes: BorshSerialize,
impl BorshSerialize for PhaseVotewhere
ChainID: BorshSerialize,
ViewNumber: BorshSerialize,
CryptoHash: BorshSerialize,
Phase: BorshSerialize,
SignatureBytes: BorshSerialize,
source§impl From<PhaseVote> for HotStuffMessage
impl From<PhaseVote> for HotStuffMessage
source§impl SignedMessage for PhaseVote
impl SignedMessage for PhaseVote
source§fn message_bytes(&self) -> Vec<u8>
fn message_bytes(&self) -> Vec<u8>
Get the bytes that are passed as input into the signing function to form the signature
of the
SignedMessage.source§fn signature_bytes(&self) -> SignatureBytes
fn signature_bytes(&self) -> SignatureBytes
Get the signature of the
SignedMessage.source§fn is_correct(&self, verifying_key: &VerifyingKey) -> bool
fn is_correct(&self, verifying_key: &VerifyingKey) -> bool
Verify that
signature_bytes is a signature created by verifying_key over message_bytes.Auto Trait Implementations§
impl Freeze for PhaseVote
impl RefUnwindSafe for PhaseVote
impl Send for PhaseVote
impl Sync for PhaseVote
impl Unpin for PhaseVote
impl UnwindSafe for PhaseVote
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)