Struct chain_impl_mockchain::accounting::account::last_rewards::LastRewards
source · pub struct LastRewards {
pub epoch: Epoch,
pub reward: Value,
}
Expand description
Last rewards associated with a state
It tracks the epoch where the rewards has been received, and the total amount of reward for such an epoch
Fields§
§epoch: Epoch
§reward: Value
Implementations§
source§impl LastRewards
impl LastRewards
sourcepub fn add_for(&mut self, epoch: Epoch, value: Value)
pub fn add_for(&mut self, epoch: Epoch, value: Value)
Add some value to the last reward, if the epoch is the same, then the result is just added, however.account
This should never be used with an epoch less than the last set epoch, as it would means the rewards system is rewarding something from a past state.
Trait Implementations§
source§impl Arbitrary for LastRewards
impl Arbitrary for LastRewards
§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = BoxedStrategy<LastRewards>
type Strategy = BoxedStrategy<LastRewards>
The type of
Strategy
used to generate values of type Self
.source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
source§impl Clone for LastRewards
impl Clone for LastRewards
source§fn clone(&self) -> LastRewards
fn clone(&self) -> LastRewards
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LastRewards
impl Debug for LastRewards
source§impl Default for LastRewards
impl Default for LastRewards
source§impl PartialEq<LastRewards> for LastRewards
impl PartialEq<LastRewards> for LastRewards
source§fn eq(&self, other: &LastRewards) -> bool
fn eq(&self, other: &LastRewards) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for LastRewards
impl StructuralEq for LastRewards
impl StructuralPartialEq for LastRewards
Auto Trait Implementations§
impl RefUnwindSafe for LastRewards
impl Send for LastRewards
impl Sync for LastRewards
impl Unpin for LastRewards
impl UnwindSafe for LastRewards
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