pub struct SignedVote { /* private fields */ }
Expand description
SignedVote is the union of a canonicalized vote, the signature on the sign bytes of that vote and the id of the validator who signed it.
Implementations§
Source§impl SignedVote
impl SignedVote
Sourcepub fn new(
vote: Vote,
chain_id: ChainId,
validator_address: Id,
signature: Signature,
) -> SignedVote
pub fn new( vote: Vote, chain_id: ChainId, validator_address: Id, signature: Signature, ) -> SignedVote
Create new SignedVote
from provided canonicalized vote, validator id, and
the signature of that validator.
Sourcepub fn from_vote(vote: Vote, chain_id: ChainId) -> Option<Self>
pub fn from_vote(vote: Vote, chain_id: ChainId) -> Option<Self>
Create a new SignedVote
from the provided Vote
, which may or may not be signed.
If the vote is not signed, this function will return None
.
Sourcepub fn validator_id(&self) -> Id
pub fn validator_id(&self) -> Id
Return the id of the validator that signed this vote.
Sourcepub fn sign_bytes(&self) -> Vec<u8> ⓘ
pub fn sign_bytes(&self) -> Vec<u8> ⓘ
Return the bytes (of the canonicalized vote) that were signed.
pub fn sign_bytes_into( &self, buf: &mut impl BufMut, ) -> Result<(), ProtobufError>
Auto Trait Implementations§
impl Freeze for SignedVote
impl RefUnwindSafe for SignedVote
impl Send for SignedVote
impl Sync for SignedVote
impl Unpin for SignedVote
impl UnwindSafe for SignedVote
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