Skip to main content

WireCapability

Struct WireCapability 

Source
pub struct WireCapability {
    pub spending_cap: u64,
    pub expiry: u64,
    pub owner_signature: Vec<u8>,
}
Expand description

A pool owner’s spending capability, carried inside StreamRequestExt (ADR 003 §Capability delegation). signer and pool_id are not on the wire — they are derived from stream context, exactly like a Voucher’s implicit fields: signer is the request’s bound Ethereum address (ClientBinding::ethereum_address, or the registered on-chain signer when binding is absent) and pool_id is StreamRequest::pool_id.

Fields§

§spending_cap: u64

Maximum cumulative amount the signer may spend against the pool under this grant. A u64, matching the PaymentPool.spendingCap on-chain storage/calldata width exactly — the node zero-extends it to a uint256 word when it reconstructs the EIP-712 capability digest (just as it does Voucher::amount).

§expiry: u64

Unix-seconds expiry. After it, vouchers under this capability are no longer redeemable.

§owner_signature: Vec<u8>

EIP-712 owner signature over the capability (r‖s‖v, 65 bytes for an EOA owner; may be longer for an ERC-1271 contract owner, so unlike VOUCHER_SIG_LEN-pinned signatures this is only checked non-empty at the wire boundary — WireCapability::validate). The cryptographic recovery/verification happens in decdn_incentive.

Implementations§

Source§

impl WireCapability

Source

pub const fn validate(&self) -> Result<(), MessageValidationError>

Validate the wire-level owner_signature non-emptiness. Unlike ClientBinding::validate / Voucher::validate this cannot pin an exact length — an ERC-1271 contract signature may be longer than the 65-byte EOA form — so this is a floor, not a full shape check.

§Errors

MessageValidationError::EmptyCapabilitySignature if owner_signature is empty.

Trait Implementations§

Source§

impl Clone for WireCapability

Source§

fn clone(&self) -> Self

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 WireCapability

Source§

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

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

impl<'de> Deserialize<'de> for WireCapability

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 WireCapability

Source§

impl PartialEq for WireCapability

Source§

fn eq(&self, other: &Self) -> 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 WireCapability

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 WireCapability

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.