Skip to main content

RewardDistributorCommitment

Struct RewardDistributorCommitment 

Source
pub struct RewardDistributorCommitment {
    pub epoch_start: u64,
    pub clawback_puzzle_hash: HexId,
    pub rewards_base_units: u64,
    pub recoverable_base_units: u64,
}
Expand description

One clawback commitment slot for a distributor epoch — SPEC §7.4 clause 5.

§recoverable_base_units is NOT rewards_base_units

Committed is not recoverable: SPEC §7.4 clause 4 / §7.5 return only withdrawal_share_bps / 10000 of the committed value on clawback (the remainder is forfeited to the reserve — see GetRewardDistributorResult::withdrawal_share_bps). Reporting only rewards_base_units and letting a caller label it “recoverable” would overstate every clawback by the forfeit fraction — exactly the one-balance-figure money-honesty failure SPEC §7.4 clause 5 forbids, relocated from a single total into a single per-slot figure. So the responder must compute recoverable_base_units itself, with integer arithmetic in the order rewards_base_units * withdrawal_share_bps / 10_000 — multiply then divide, no floats, truncated (never rounded up: rounding up would promise money the chain will not return). This type does not enforce that computation — see below.

Only the holder of the key for clawback_puzzle_hash may claw this slot back — not an operator role, not the manager singleton, and not the launcher (SPEC §7.4 clause 3). This field is the proof of entitlement; a reader must not mistake it for a display label.

This type does not enforce any of the above: recoverable_base_units is a bare pub u64 with no constructor or validation. The responder must compute it in the order described; nothing here checks that it did.

Fields§

§epoch_start: u64

The epoch this commitment slot funds.

§clawback_puzzle_hash: HexId

The chain’s clawback_ph (SPEC / chia-sdk-types RewardDistributorCommitmentSlotValue): the puzzle hash whose key holder alone may claw this slot back.

§rewards_base_units: u64

The committed amount, in base units.

§recoverable_base_units: u64

The amount actually recoverable on clawback, in base units — rewards_base_units * withdrawal_share_bps / 10_000, integer arithmetic, truncated down. See the type doc for why this must never be derived by a caller from rewards_base_units alone.

This is share arithmetic only. It is NOT an eligibility claim: it says what fraction of the slot would return, not that the caller may claw it back. Entitlement is key-holding against clawback_puzzle_hash and nothing else (SPEC §7.4 cl. 3).

Trait Implementations§

Source§

impl Clone for RewardDistributorCommitment

Source§

fn clone(&self) -> RewardDistributorCommitment

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for RewardDistributorCommitment

Source§

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

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

impl<'de> Deserialize<'de> for RewardDistributorCommitment

Source§

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 Eq for RewardDistributorCommitment

Source§

impl PartialEq for RewardDistributorCommitment

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for RewardDistributorCommitment

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RewardDistributorCommitment

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
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
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

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.

Source§

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

Source§

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.