pub enum BidAddr {
Unified(AccountHash),
Validator(AccountHash),
DelegatedAccount {
validator: AccountHash,
delegator: AccountHash,
},
DelegatedPurse {
validator: AccountHash,
delegator: URefAddr,
},
Credit {
validator: AccountHash,
era_id: EraId,
},
ReservedDelegationAccount {
validator: AccountHash,
delegator: AccountHash,
},
ReservedDelegationPurse {
validator: AccountHash,
delegator: URefAddr,
},
UnbondAccount {
validator: AccountHash,
unbonder: AccountHash,
},
UnbondPurse {
validator: AccountHash,
unbonder: URefAddr,
},
}Expand description
Bid Address
Variants§
Unified(AccountHash)
Unified BidAddr.
Validator(AccountHash)
Validator BidAddr.
DelegatedAccount
Delegated account BidAddr.
DelegatedPurse
Delegated purse BidAddr.
Credit
Validator credit BidAddr.
ReservedDelegationAccount
Reserved delegation account BidAddr
ReservedDelegationPurse
Reserved delegation purse BidAddr
UnbondAccount
UnbondPurse
Implementations§
Source§impl BidAddr
impl BidAddr
Sourcepub const VALIDATOR_BID_ADDR_LENGTH: usize = 33usize
pub const VALIDATOR_BID_ADDR_LENGTH: usize = 33usize
The length in bytes of a BidAddr for a validator bid.
Sourcepub const DELEGATOR_BID_ADDR_LENGTH: usize = 65usize
pub const DELEGATOR_BID_ADDR_LENGTH: usize = 65usize
The length in bytes of a BidAddr for a delegator bid.
Sourcepub const fn new_validator_addr(validator: [u8; 32]) -> Self
pub const fn new_validator_addr(validator: [u8; 32]) -> Self
Constructs a new BidAddr instance from a validator’s AccountHash.
Sourcepub fn new_validator_addr_from_public_key(
validator_public_key: PublicKey,
) -> Self
pub fn new_validator_addr_from_public_key( validator_public_key: PublicKey, ) -> Self
Sourcepub const fn new_delegator_account_addr(pair: ([u8; 32], [u8; 32])) -> Self
pub const fn new_delegator_account_addr(pair: ([u8; 32], [u8; 32])) -> Self
Constructs a new BidAddr::DelegatedAccount instance from the AccountHash pair of a
validator and a delegator.
Sourcepub const fn new_reservation_account_addr(pair: ([u8; 32], [u8; 32])) -> Self
pub const fn new_reservation_account_addr(pair: ([u8; 32], [u8; 32])) -> Self
Constructs a new BidAddr::ReservedDelegationAccount instance from the AccountHash
pair of a validator and a delegator.
pub const fn legacy(validator: [u8; 32]) -> Self
Sourcepub fn new_delegator_kind(
validator: &PublicKey,
delegator_kind: &DelegatorKind,
) -> Self
pub fn new_delegator_kind( validator: &PublicKey, delegator_kind: &DelegatorKind, ) -> Self
Create a new instance of a BidAddr.
Sourcepub fn new_from_public_keys(
validator: &PublicKey,
maybe_delegator: Option<&PublicKey>,
) -> Self
pub fn new_from_public_keys( validator: &PublicKey, maybe_delegator: Option<&PublicKey>, ) -> Self
Create a new instance of a BidAddr.
Sourcepub fn new_purse_delegation(validator: &PublicKey, delegator: URefAddr) -> Self
pub fn new_purse_delegation(validator: &PublicKey, delegator: URefAddr) -> Self
Create a new instance of a BidAddr.
Sourcepub fn new_credit(validator: &PublicKey, era_id: EraId) -> Self
pub fn new_credit(validator: &PublicKey, era_id: EraId) -> Self
Create a new instance of a BidAddr.
Sourcepub fn new_reservation_account(
validator: &PublicKey,
delegator: &PublicKey,
) -> Self
pub fn new_reservation_account( validator: &PublicKey, delegator: &PublicKey, ) -> Self
Create a new instance of a BidAddr.
Sourcepub fn new_reservation_purse(validator: &PublicKey, delegator: URefAddr) -> Self
pub fn new_reservation_purse(validator: &PublicKey, delegator: URefAddr) -> Self
Create a new instance of a BidAddr.
Sourcepub fn new_unbond_account(validator: PublicKey, unbonder: PublicKey) -> Self
pub fn new_unbond_account(validator: PublicKey, unbonder: PublicKey) -> Self
Create a new instance of a BidAddr.
Sourcepub fn delegated_account_prefix(&self) -> Result<Vec<u8>, Error>
pub fn delegated_account_prefix(&self) -> Result<Vec<u8>, Error>
Returns the common prefix of all delegated accounts to the cited validator.
Sourcepub fn delegated_purse_prefix(&self) -> Result<Vec<u8>, Error>
pub fn delegated_purse_prefix(&self) -> Result<Vec<u8>, Error>
Returns the common prefix of all delegated purses to the cited validator.
Sourcepub fn reserved_account_prefix(&self) -> Result<Vec<u8>, Error>
pub fn reserved_account_prefix(&self) -> Result<Vec<u8>, Error>
Returns the common prefix of all reservations for accounts to the cited validator.
Sourcepub fn reserved_purse_prefix(&self) -> Result<Vec<u8>, Error>
pub fn reserved_purse_prefix(&self) -> Result<Vec<u8>, Error>
Returns the common prefix of all reservations for purses to the cited validator.
Sourcepub fn validator_account_hash(&self) -> AccountHash
pub fn validator_account_hash(&self) -> AccountHash
Validator account hash.
Sourcepub fn maybe_delegator_account_hash(&self) -> Option<AccountHash>
pub fn maybe_delegator_account_hash(&self) -> Option<AccountHash>
Delegator account hash or none.
Sourcepub fn maybe_delegator_purse(&self) -> Option<URefAddr>
pub fn maybe_delegator_purse(&self) -> Option<URefAddr>
Delegator purse addr or none.
Sourcepub fn maybe_era_id(&self) -> Option<EraId>
pub fn maybe_era_id(&self) -> Option<EraId>
Era id or none.
Sourcepub fn is_delegator_bid_addr(&self) -> bool
pub fn is_delegator_bid_addr(&self) -> bool
If true, this instance is the key for a delegator bid record. Else, it is the key for a validator bid record.
Sourcepub fn serialized_length(&self) -> usize
pub fn serialized_length(&self) -> usize
How long will be the serialized value for this instance.
Sourcepub fn tag(&self) -> BidAddrTag
pub fn tag(&self) -> BidAddrTag
Returns the BiddAddrTag of this instance.
Trait Implementations§
Source§impl DataSize for BidAddrwhere
AccountHash: DataSize,
impl DataSize for BidAddrwhere
AccountHash: DataSize,
Source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
true, the type has a heap size that can vary at runtime, depending on the actual value.Source§const STATIC_HEAP_SIZE: usize = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
IS_DYNAMIC is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.Source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Source§impl<'de> Deserialize<'de> for BidAddr
impl<'de> Deserialize<'de> for BidAddr
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>,
Source§impl Distribution<BidAddr> for Standard
Available on crate feature testing only.
impl Distribution<BidAddr> for Standard
testing only.Source§impl From<AccountHash> for BidAddr
impl From<AccountHash> for BidAddr
Source§fn from(account_hash: AccountHash) -> Self
fn from(account_hash: AccountHash) -> Self
Source§impl JsonSchema for BidAddr
impl JsonSchema for BidAddr
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl Ord for BidAddr
impl Ord for BidAddr
Source§impl PartialOrd for BidAddr
impl PartialOrd for BidAddr
Source§impl ToBytes for BidAddr
impl ToBytes for BidAddr
Source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
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 Copy for BidAddr
impl Eq for BidAddr
impl StructuralPartialEq for BidAddr
Auto Trait Implementations§
impl Freeze for BidAddr
impl RefUnwindSafe for BidAddr
impl Send for BidAddr
impl Sync for BidAddr
impl Unpin for BidAddr
impl UnwindSafe for BidAddr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more