Struct casper_types::system::auction::Bid[][src]

pub struct Bid { /* fields omitted */ }

An entry in the validator map.

Implementations

impl Bid[src]

pub fn locked(
    validator_public_key: PublicKey,
    bonding_purse: URef,
    staked_amount: U512,
    delegation_rate: DelegationRate,
    release_timestamp_millis: u64
) -> Self
[src]

Creates new instance of a bid with locked funds.

pub fn unlocked(
    validator_public_key: PublicKey,
    bonding_purse: URef,
    staked_amount: U512,
    delegation_rate: DelegationRate
) -> Self
[src]

Creates new instance of a bid with unlocked funds.

pub fn validator_public_key(&self) -> &PublicKey[src]

Gets the validator public key of the provided bid

pub fn bonding_purse(&self) -> &URef[src]

Gets the bonding purse of the provided bid

pub fn staked_amount(&self) -> &U512[src]

Gets the staked amount of the provided bid

pub fn staked_amount_mut(&mut self) -> &mut U512[src]

Gets the staked amount of the provided bid

pub fn delegation_rate(&self) -> &DelegationRate[src]

Gets the delegation rate of the provided bid

pub fn vesting_schedule(&self) -> Option<&VestingSchedule>[src]

Returns a reference to the vesting schedule of the provided bid. None if a non-genesis validator.

pub fn vesting_schedule_mut(&mut self) -> Option<&mut VestingSchedule>[src]

Returns a mutable reference to the vesting schedule of the provided bid. None if a non-genesis validator.

pub fn delegators(&self) -> &BTreeMap<PublicKey, Delegator>[src]

Returns a reference to the delegators of the provided bid

pub fn delegators_mut(&mut self) -> &mut BTreeMap<PublicKey, Delegator>[src]

Returns a mutable reference to the delegators of the provided bid

pub fn inactive(&self) -> bool[src]

Returns true if validator is inactive

pub fn decrease_stake(
    &mut self,
    amount: U512,
    era_end_timestamp_millis: u64
) -> Result<U512, Error>
[src]

Decreases the stake of the provided bid

pub fn increase_stake(&mut self, amount: U512) -> Result<U512, Error>[src]

Increases the stake of the provided bid

pub fn with_delegation_rate(
    &mut self,
    delegation_rate: DelegationRate
) -> &mut Self
[src]

Updates the delegation rate of the provided bid

pub fn process(&mut self, timestamp_millis: u64) -> bool[src]

Initializes the vesting schedule of provided bid if the provided timestamp is greater than or equal to the bid’s initial release timestamp and the bid is owned by a genesis validator.

Returns true if the provided bid’s vesting schedule was initialized.

pub fn activate(&mut self) -> bool[src]

Sets given bid’s inactive field to false

pub fn deactivate(&mut self) -> bool[src]

Sets given bid’s inactive field to true

pub fn total_staked_amount(&self) -> Result<U512, Error>[src]

Returns the total staked amount of validator + all delegators

Trait Implementations

impl CLTyped for Bid[src]

impl Clone for Bid[src]

impl Debug for Bid[src]

impl<'de> Deserialize<'de> for Bid[src]

impl Eq for Bid[src]

impl From<&'_ Bid> for SeigniorageRecipient[src]

impl FromBytes for Bid[src]

impl PartialEq<Bid> for Bid[src]

impl Serialize for Bid[src]

impl StructuralEq for Bid[src]

impl StructuralPartialEq for Bid[src]

impl ToBytes for Bid[src]

Auto Trait Implementations

impl RefUnwindSafe for Bid

impl Send for Bid

impl Sync for Bid

impl Unpin for Bid

impl UnwindSafe for Bid

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,