#[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: u64
The starting block height of the rewards distribution in the current epoch
num_partitions: u64
Number of partitions in the rewards distribution in the current epoch, used to generate an EpochRewardsHasher
parent_blockhash: Hash
The blockhash of the parent block of the first block in the epoch, used to seed an EpochRewardsHasher
total_points: u128
The total rewards points calculated for the current epoch, where points equals the sum of (delegated stake * credits observed) for all delegations
total_rewards: u64
The 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: u64
The rewards currently distributed for the current epoch, in lamports
active: bool
Whether 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§fn clone(&self) -> EpochRewards
fn clone(&self) -> EpochRewards
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§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<EpochRewards, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EpochRewards, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for EpochRewards
impl PartialEq for EpochRewards
Source§impl Serialize for EpochRewards
impl Serialize for EpochRewards
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl Sysvar for EpochRewards
impl Sysvar for EpochRewards
Source§fn get() -> Result<EpochRewards, ProgramError>
fn get() -> Result<EpochRewards, ProgramError>
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§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