Struct solana_vote_program::vote_state::VoteState [−][src]
pub struct VoteState { pub node_pubkey: Pubkey, pub authorized_withdrawer: Pubkey, pub commission: u8, pub votes: VecDeque<Lockout>, pub root_slot: Option<Slot>, pub last_timestamp: BlockTimestamp, // some fields omitted }
Fields
node_pubkey: Pubkey
the node that votes in this account
the signer for withdrawals
commission: u8
percentage (0-100) that represents what part of a rewards payout should be given to this VoteAccount
votes: VecDeque<Lockout>
root_slot: Option<Slot>
last_timestamp: BlockTimestamp
most recent timestamp submitted with a vote
Implementations
returns commission split as (voter_portion, staker_portion, was_split) tuple
if commission calculation is 100% one way or other, indicate with false for was_split
pub fn process_vote(
&mut self,
vote: &Vote,
slot_hashes: &[SlotHash],
epoch: Epoch
) -> Result<(), VoteError>
increment credits, record credits for last epoch if new epoch
“unchecked” functions used by tests and Tower
Number of “credits” owed to this account from the mining pool. Submit this VoteState to the Rewards program to trade credits for lamports.
Number of “credits” owed to this account from the mining pool on a per-epoch basis, starting from credits observed. Each tuple of (Epoch, u64, u64) is read as (epoch, credits, prev_credits), where credits for each epoch is credits - prev_credits; while redundant this makes calculating rewards over partial epochs nice and simple
pub fn process_timestamp(
&mut self,
slot: Slot,
timestamp: UnixTimestamp
) -> Result<(), VoteError>
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for VoteState
impl UnwindSafe for VoteState
Blanket Implementations
pub default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
pub default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self