#[repr(C, align(16))]pub struct EpochRewards {
pub distribution_starting_block_height: u64,
pub num_partitions: u64,
pub parent_blockhash: Hash,
pub total_points: u128,
pub total_rewards: u64,
pub distributed_rewards: u64,
pub active: bool,
}Fields§
§distribution_starting_block_height: u64The starting block height of the rewards distribution in the current epoch
num_partitions: u64Number of partitions in the rewards distribution in the current epoch, used to generate an EpochRewardsHasher
parent_blockhash: HashThe blockhash of the parent block of the first block in the epoch, used to seed an EpochRewardsHasher
total_points: u128The total rewards points calculated for the current epoch, where points equals the sum of (delegated stake * credits observed) for all delegations
total_rewards: u64The total rewards calculated for the current epoch. This may be greater
than the total distributed_rewards at the end of the rewards period,
due to rounding and inability to deliver rewards smaller than 1 lamport.
distributed_rewards: u64The rewards currently distributed for the current epoch, in lamports
active: boolWhether the rewards period (including calculation and distribution) is active
Implementations§
Source§impl EpochRewards
impl EpochRewards
pub fn distribute(&mut self, amount: u64)
Trait Implementations§
Source§impl Clone for EpochRewards
impl Clone for EpochRewards
Source§impl Debug for EpochRewards
impl Debug for EpochRewards
Source§impl Default for EpochRewards
impl Default for EpochRewards
Source§fn default() -> EpochRewards
fn default() -> EpochRewards
Source§impl<'de> Deserialize<'de> for EpochRewards
impl<'de> Deserialize<'de> for EpochRewards
Source§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>,
Source§impl PartialEq for EpochRewards
impl PartialEq for EpochRewards
Source§impl Serialize for EpochRewards
impl Serialize for EpochRewards
Source§impl Sysvar for EpochRewards
impl Sysvar for EpochRewards
Source§fn from_account_info(
account_info: &AccountInfo<'_>,
) -> Result<Self, ProgramError>
fn from_account_info( account_info: &AccountInfo<'_>, ) -> Result<Self, ProgramError>
AccountInfo. Read moreSource§fn to_account_info(&self, account_info: &mut AccountInfo<'_>) -> Option<()>
fn to_account_info(&self, account_info: &mut AccountInfo<'_>) -> Option<()>
AccountInfo. Read moreSource§impl SysvarId for EpochRewards
impl SysvarId for EpochRewards
impl Eq for EpochRewards
impl StructuralPartialEq for EpochRewards
Auto Trait Implementations§
impl Freeze for EpochRewards
impl RefUnwindSafe for EpochRewards
impl Send for EpochRewards
impl Sync for EpochRewards
impl Unpin for EpochRewards
impl UnwindSafe for EpochRewards
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
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)
clone_to_uninit)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more