Struct casper_types::system::auction::Delegator
source · pub struct Delegator { /* private fields */ }
Expand description
Represents a party delegating their stake to a validator (or “delegatee”)
Implementations§
source§impl Delegator
impl Delegator
sourcepub fn unlocked(
delegator_public_key: PublicKey,
staked_amount: U512,
bonding_purse: URef,
validator_public_key: PublicKey
) -> Self
pub fn unlocked( delegator_public_key: PublicKey, staked_amount: U512, bonding_purse: URef, validator_public_key: PublicKey ) -> Self
Creates a new Delegator
sourcepub fn locked(
delegator_public_key: PublicKey,
staked_amount: U512,
bonding_purse: URef,
validator_public_key: PublicKey,
release_timestamp_millis: u64
) -> Self
pub fn locked( delegator_public_key: PublicKey, staked_amount: U512, bonding_purse: URef, validator_public_key: PublicKey, release_timestamp_millis: u64 ) -> Self
Creates new instance of a Delegator
with locked funds.
sourcepub fn delegator_public_key(&self) -> &PublicKey
pub fn delegator_public_key(&self) -> &PublicKey
Returns public key of the delegator.
sourcepub fn staked_amount(&self) -> &U512
pub fn staked_amount(&self) -> &U512
Returns the staked amount
sourcepub fn staked_amount_mut(&mut self) -> &mut U512
pub fn staked_amount_mut(&mut self) -> &mut U512
Returns the mutable staked amount
sourcepub fn bonding_purse(&self) -> &URef
pub fn bonding_purse(&self) -> &URef
Returns the bonding purse
sourcepub fn validator_public_key(&self) -> &PublicKey
pub fn validator_public_key(&self) -> &PublicKey
Returns delegatee
sourcepub fn decrease_stake(
&mut self,
amount: U512,
era_end_timestamp_millis: u64
) -> Result<U512, Error>
pub fn decrease_stake( &mut self, amount: U512, era_end_timestamp_millis: u64 ) -> Result<U512, Error>
Decreases the stake of the provided bid
sourcepub fn increase_stake(&mut self, amount: U512) -> Result<U512, Error>
pub fn increase_stake(&mut self, amount: U512) -> Result<U512, Error>
Increases the stake of the provided bid
sourcepub fn vesting_schedule(&self) -> Option<&VestingSchedule>
pub fn vesting_schedule(&self) -> Option<&VestingSchedule>
Returns a reference to the vesting schedule of the provided
delegator bid. None
if a non-genesis validator.
sourcepub fn vesting_schedule_mut(&mut self) -> Option<&mut VestingSchedule>
pub fn vesting_schedule_mut(&mut self) -> Option<&mut VestingSchedule>
Returns a mutable reference to the vesting schedule of the provided
delegator bid. None
if a non-genesis validator.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Delegator
impl<'de> Deserialize<'de> for Delegator
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Delegator
impl PartialEq for Delegator
source§impl ToBytes for Delegator
impl ToBytes for Delegator
source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Returns the length of the
Vec<u8>
which would be returned from a successful call to
to_bytes()
or into_bytes()
. The data is not actually serialized, so this call is
relatively cheap.impl Eq for Delegator
impl StructuralEq for Delegator
impl StructuralPartialEq for Delegator
Auto Trait Implementations§
impl RefUnwindSafe for Delegator
impl Send for Delegator
impl Sync for Delegator
impl Unpin for Delegator
impl UnwindSafe for Delegator
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