Struct casper_types::system::auction::UnbondingPurse
source · pub struct UnbondingPurse { /* private fields */ }
Expand description
Unbonding purse.
Implementations§
source§impl UnbondingPurse
impl UnbondingPurse
sourcepub const fn new(
bonding_purse: URef,
validator_public_key: PublicKey,
unbonder_public_key: PublicKey,
era_of_creation: EraId,
amount: U512,
new_validator: Option<PublicKey>
) -> Self
pub const fn new( bonding_purse: URef, validator_public_key: PublicKey, unbonder_public_key: PublicKey, era_of_creation: EraId, amount: U512, new_validator: Option<PublicKey> ) -> Self
Creates UnbondingPurse
instance for an unbonding request.
sourcepub fn is_validator(&self) -> bool
pub fn is_validator(&self) -> bool
Checks if given request is made by a validator by checking if public key of unbonder is same as a key owned by validator.
sourcepub fn bonding_purse(&self) -> &URef
pub fn bonding_purse(&self) -> &URef
Returns bonding purse used to make this unbonding request.
sourcepub fn validator_public_key(&self) -> &PublicKey
pub fn validator_public_key(&self) -> &PublicKey
Returns public key of validator.
sourcepub fn unbonder_public_key(&self) -> &PublicKey
pub fn unbonder_public_key(&self) -> &PublicKey
Returns public key of unbonder.
For withdrawal requests that originated from validator’s public key through withdraw_bid
entrypoint this is equal to UnbondingPurse::validator_public_key
and
UnbondingPurse::is_validator
is true
.
sourcepub fn era_of_creation(&self) -> EraId
pub fn era_of_creation(&self) -> EraId
Returns era which was used to create this unbonding request.
sourcepub fn new_validator(&self) -> &Option<PublicKey>
pub fn new_validator(&self) -> &Option<PublicKey>
Returns the public key for the new validator.
Trait Implementations§
source§impl Clone for UnbondingPurse
impl Clone for UnbondingPurse
source§fn clone(&self) -> UnbondingPurse
fn clone(&self) -> UnbondingPurse
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 UnbondingPurse
impl Debug for UnbondingPurse
source§impl<'de> Deserialize<'de> for UnbondingPurse
impl<'de> Deserialize<'de> for UnbondingPurse
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 From<WithdrawPurse> for UnbondingPurse
impl From<WithdrawPurse> for UnbondingPurse
source§fn from(withdraw_purse: WithdrawPurse) -> Self
fn from(withdraw_purse: WithdrawPurse) -> Self
Converts to this type from the input type.
source§impl FromBytes for UnbondingPurse
impl FromBytes for UnbondingPurse
source§impl PartialEq for UnbondingPurse
impl PartialEq for UnbondingPurse
source§fn eq(&self, other: &UnbondingPurse) -> bool
fn eq(&self, other: &UnbondingPurse) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for UnbondingPurse
impl Serialize for UnbondingPurse
source§impl ToBytes for UnbondingPurse
impl ToBytes for UnbondingPurse
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 UnbondingPurse
impl StructuralEq for UnbondingPurse
impl StructuralPartialEq for UnbondingPurse
Auto Trait Implementations§
impl RefUnwindSafe for UnbondingPurse
impl Send for UnbondingPurse
impl Sync for UnbondingPurse
impl Unpin for UnbondingPurse
impl UnwindSafe for UnbondingPurse
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