pub struct ValidatorSubstate {
Show 14 fields pub sorted_key: Option<SortedKey>, pub key: Secp256k1PublicKey, pub is_registered: bool, pub accepts_delegated_stake: bool, pub validator_fee_factor: Decimal, pub validator_fee_change_request: Option<ValidatorFeeChangeRequest>, pub stake_unit_resource: ResourceAddress, pub stake_xrd_vault_id: Own, pub claim_nft: ResourceAddress, pub pending_xrd_withdraw_vault_id: Own, pub locked_owner_stake_unit_vault_id: Own, pub pending_owner_stake_unit_unlock_vault_id: Own, pub pending_owner_stake_unit_withdrawals: BTreeMap<Epoch, Decimal>, pub already_unlocked_owner_stake_unit_amount: Decimal,
}

Fields§

§sorted_key: Option<SortedKey>

A key used internally for storage of registered validators sorted by their stake descending. It is only useful when the validator is registered and has non-zero stake - hence, the field is None otherwise. Note: in theory, this value could be always computed from the [is_registered] status and the amount stored in [stake_xrd_vault_id]; we simply keep it cached to simplify certain updates.

§key: Secp256k1PublicKey

This validator’s public key.

§is_registered: bool

Whether this validator is currently interested in participating in the consensus.

§accepts_delegated_stake: bool

Whether this validator is currently accepting delegated stake or not

§validator_fee_factor: Decimal

A fraction of the effective emission amount which gets transferred to the validator’s owner (by staking it and depositing the stake units to the [locked_owner_stake_unit_vault_id]). Note: it is a decimal factor, not a percentage (i.e. 0.015 means “1.5%” here). Note: it may be overridden by [validator_fee_change_request], if it contains a change which already became effective.

§validator_fee_change_request: Option<ValidatorFeeChangeRequest>

The most recent request to change the [validator_fee_factor] (which requires a delay). Note: the value from this request will be used instead of [validator_fee_factor] if the request has already reached its effective epoch. Note: when another change is requested, the value from this (previous) one is moved to the [validator_fee_factor] - provided that it became already effective. Otherwise, this request is overwritten by the new one.

§stake_unit_resource: ResourceAddress

A type of fungible resource representing stake units specific to this validator. Conceptually, “staking to validator A” means “contributing to the validator’s staking pool, and receiving the validator’s stake units which act as the pool units for the staking pool”.

§stake_xrd_vault_id: Own

A vault holding the XRDs currently staked to this validator.

§claim_nft: ResourceAddress

A type of non-fungible token used as a receipt for unstaked stake units. Unstaking burns the SUs and inactivates the staked XRDs (i.e. moves it from the regular [stake_xrd_vault_id] to the [pending_xrd_withdraw_vault_id]), and then requires to claim the XRDs using this NFT after a delay (see [UnstakeData.claim_epoch]).

§pending_xrd_withdraw_vault_id: Own

A vault holding the XRDs that were unstaked (see the [unstake_nft]) but not yet claimed.

§locked_owner_stake_unit_vault_id: Own

A vault holding the SUs that this validator’s owner voluntarily decided to temporarily lock here, as a public display of their confidence in this validator’s future reliability. Withdrawing SUs from this vault is subject to a delay (which is configured separately from the regular unstaking delay, see [ConsensusManagerConfigSubstate.num_owner_stake_units_unlock_epochs]). This vault is private to the owner (i.e. the owner’s badge is required for any interaction with this vault).

§pending_owner_stake_unit_unlock_vault_id: Own

A vault holding the SUs which the owner has decided to withdraw from their “public display” vault (see [locked_owner_stake_unit_vault_id]) but which have not yet been unlocked after the mandatory delay (see [pending_owner_stake_unit_withdrawals]).

§pending_owner_stake_unit_withdrawals: BTreeMap<Epoch, Decimal>

All currently pending “delayed withdrawal” operations of the owner’s stake units vault (see [locked_owner_stake_unit_vault_id]). This maps an epoch number to an amount of stake units that become unlocked at that epoch. Note: because of performance considerations, a maximum size of this map is limited to OWNER_STAKE_UNITS_PENDING_WITHDRAWALS_LIMIT: starting another withdrawal will first attempt to move any already-available amount to [already_unlocked_owner_stake_unit_amount] and only then will fail if the limit is exceeded.

§already_unlocked_owner_stake_unit_amount: Decimal

An amount of owner’s stake units that has already waited for a sufficient number of epochs in the [pending_owner_stake_unit_withdrawals] and was automatically moved from there. The very next [finish_unlock_owner_stake_units()] operation will release this amount.

Trait Implementations§

source§

impl Categorize<ScryptoCustomValueKind> for ValidatorSubstate

source§

impl Clone for ValidatorSubstate

source§

fn clone(&self) -> ValidatorSubstate

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ValidatorSubstate

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<D: Decoder<ScryptoCustomValueKind>> Decode<ScryptoCustomValueKind, D> for ValidatorSubstate

source§

fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<ScryptoCustomValueKind> ) -> Result<Self, DecodeError>

Decodes the type from the decoder, which should match a preloaded value kind. Read more
source§

impl Describe<ScryptoCustomTypeKind> for ValidatorSubstate

source§

const TYPE_ID: RustTypeId = _

The TYPE_ID should give a unique identifier for its SBOR schema type. An SBOR schema type capture details about the SBOR payload, how it should be interpreted, validated and displayed. Read more
source§

fn type_data() -> TypeData<ScryptoCustomTypeKind, RustTypeId>

Returns the local schema for the given type. Read more
source§

fn add_all_dependencies(aggregator: &mut TypeAggregator<ScryptoCustomTypeKind>)

For each type referenced in get_local_type_data, we need to ensure that the type and all of its own references get added to the aggregator. Read more
source§

impl<E: Encoder<ScryptoCustomValueKind>> Encode<ScryptoCustomValueKind, E> for ValidatorSubstate

source§

fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>

Encodes the SBOR value’s kind to the encoder
source§

fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>

Encodes the SBOR body of the type to the encoder. Read more
source§

impl From<ValidatorSubstate> for VersionedValidatorState

source§

fn from(value: ValidatorStateV1) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ValidatorSubstate

source§

fn eq(&self, other: &ValidatorSubstate) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl SborTuple<ScryptoCustomValueKind> for ValidatorSubstate

source§

impl Eq for ValidatorSubstate

source§

impl StructuralPartialEq for ValidatorSubstate

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<U> As for U

§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

source§

impl<T> ScryptoCategorize for T

source§

impl<T> ScryptoDecode for T

source§

impl<T> ScryptoDescribe for T

source§

impl<T> ScryptoEncode for T

source§

impl<T> ScryptoSbor for T

source§

impl<T> ScryptoSborTuple for T