Struct casper_types::system::auction::WithdrawPurse
source · pub struct WithdrawPurse { /* private fields */ }
Expand description
A withdraw purse, a legacy structure.
Implementations§
source§impl WithdrawPurse
impl WithdrawPurse
sourcepub const fn new(
bonding_purse: URef,
validator_public_key: PublicKey,
unbonder_public_key: PublicKey,
era_of_creation: EraId,
amount: U512,
) -> Self
pub const fn new( bonding_purse: URef, validator_public_key: PublicKey, unbonder_public_key: PublicKey, era_of_creation: EraId, amount: U512, ) -> Self
Creates WithdrawPurse
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 WithdrawPurse::validator_public_key
and
WithdrawPurse::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.
Trait Implementations§
source§impl Clone for WithdrawPurse
impl Clone for WithdrawPurse
source§fn clone(&self) -> WithdrawPurse
fn clone(&self) -> WithdrawPurse
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 WithdrawPurse
impl Debug for WithdrawPurse
source§impl<'de> Deserialize<'de> for WithdrawPurse
impl<'de> Deserialize<'de> for WithdrawPurse
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 WithdrawPurse
impl FromBytes for WithdrawPurse
source§impl PartialEq for WithdrawPurse
impl PartialEq for WithdrawPurse
source§impl Serialize for WithdrawPurse
impl Serialize for WithdrawPurse
source§impl ToBytes for WithdrawPurse
impl ToBytes for WithdrawPurse
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 WithdrawPurse
impl StructuralPartialEq for WithdrawPurse
Auto Trait Implementations§
impl Freeze for WithdrawPurse
impl RefUnwindSafe for WithdrawPurse
impl Send for WithdrawPurse
impl Sync for WithdrawPurse
impl Unpin for WithdrawPurse
impl UnwindSafe for WithdrawPurse
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)