Struct gauge::EpochGaugeVote
source · [−]pub struct EpochGaugeVote {
pub allocated_power: u64,
}
Expand description
An EpochGaugeVote is a user’s committed votes for a given Gauge at a given epoch.
Seeds:
[
b"EpochGaugeVote",
gauge_vote.key().as_ref(),
voting_epoch.to_le_bytes().as_ref(),
];
Fields
allocated_power: u64
The rewards share used to vote for the derived epoch. This is calculated from:
vote_power_at_expiry * (weight / total_weight)
Implementations
sourceimpl EpochGaugeVote
impl EpochGaugeVote
sourcepub const LEN: usize = 8usize
pub const LEN: usize = 8usize
Length of an EpochGaugeVote in bytes.
sourceimpl EpochGaugeVote
impl EpochGaugeVote
sourcepub fn find_program_address(
gauge_vote: &Pubkey,
voting_epoch: u32
) -> (Pubkey, u8)
pub fn find_program_address(
gauge_vote: &Pubkey,
voting_epoch: u32
) -> (Pubkey, u8)
Finds the address of an EpochGaugeVote for a given GaugeVote and voting epoch.
Trait Implementations
sourceimpl AccountDeserialize for EpochGaugeVote
impl AccountDeserialize for EpochGaugeVote
sourcefn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a Mint
account into a token
Account
. Read more
sourceimpl AccountSerialize for EpochGaugeVote
impl AccountSerialize for EpochGaugeVote
sourceimpl BorshDeserialize for EpochGaugeVote where
u64: BorshDeserialize,
impl BorshDeserialize for EpochGaugeVote where
u64: BorshDeserialize,
sourceimpl BorshSerialize for EpochGaugeVote where
u64: BorshSerialize,
impl BorshSerialize for EpochGaugeVote where
u64: BorshSerialize,
sourceimpl Clone for EpochGaugeVote
impl Clone for EpochGaugeVote
sourcefn clone(&self) -> EpochGaugeVote
fn clone(&self) -> EpochGaugeVote
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for EpochGaugeVote
impl Debug for EpochGaugeVote
sourceimpl Default for EpochGaugeVote
impl Default for EpochGaugeVote
sourcefn default() -> EpochGaugeVote
fn default() -> EpochGaugeVote
Returns the “default value” for a type. Read more
sourceimpl Discriminator for EpochGaugeVote
impl Discriminator for EpochGaugeVote
fn discriminator() -> [u8; 8]
sourceimpl Owner for EpochGaugeVote
impl Owner for EpochGaugeVote
impl Copy for EpochGaugeVote
Auto Trait Implementations
impl RefUnwindSafe for EpochGaugeVote
impl Send for EpochGaugeVote
impl Sync for EpochGaugeVote
impl Unpin for EpochGaugeVote
impl UnwindSafe for EpochGaugeVote
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more