Struct SettlementAttestation
pub struct SettlementAttestation {
pub issuer_did: String,
pub settlement_id: String,
pub unit: UnitRef,
pub destination_did: String,
pub amount_minor: u128,
pub grant_cid: Option<Vec<u8>>,
pub settled_at: u64,
pub signature: Vec<u8>,
}Expand description
A settlement attestation: the signed, self-contained claim that a specific settlement committed, and therefore that a specific issuance is owed.
Fields§
§issuer_did: StringDID of the party that signed this attestation (the settlement authority). Verification resolves key material from this, so it is part of the signed body rather than supplied alongside it.
settlement_id: StringThe settlement row this attests to. Bound into the signed body so an attestation cannot be presented under a different id.
unit: UnitRefThe credit unit to be issued.
destination_did: StringThe pseudonymous destination identity for the issued credits.
amount_minor: u128Amount in minor units.
grant_cid: Option<Vec<u8>>The allocation grant this settlement backs, if any.
settled_at: u64When the settlement committed (unix seconds).
signature: Vec<u8>COSE composite signature (EdDSA + ML-DSA-65) over Self::signing_input.
Implementations§
§impl SettlementAttestation
impl SettlementAttestation
pub fn signing_input(&self) -> Result<Vec<u8>, PayError>
pub fn signing_input(&self) -> Result<Vec<u8>, PayError>
The exact bytes a signature must cover: the canonical body without the signature element.
pub fn encode(&self) -> Result<Vec<u8>, PayError>
pub fn encode(&self) -> Result<Vec<u8>, PayError>
The canonical wire bytes, signature included. This is what travels in
the capnp attestation :Data field and what a future exchange record
embeds verbatim.
pub fn decode(bytes: &[u8]) -> Result<SettlementAttestation, PayError>
pub fn decode(bytes: &[u8]) -> Result<SettlementAttestation, PayError>
Parse canonical wire bytes.
Rejects any input that is not already canonical. Accepting a non-canonical encoding and normalizing it would give the same logical attestation two different CIDs, which defeats content-addressing it.
Trait Implementations§
§impl Clone for SettlementAttestation
impl Clone for SettlementAttestation
§fn clone(&self) -> SettlementAttestation
fn clone(&self) -> SettlementAttestation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for SettlementAttestation
impl Debug for SettlementAttestation
§impl<'de> Deserialize<'de> for SettlementAttestation
impl<'de> Deserialize<'de> for SettlementAttestation
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SettlementAttestation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SettlementAttestation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for SettlementAttestation
impl PartialEq for SettlementAttestation
§fn eq(&self, other: &SettlementAttestation) -> bool
fn eq(&self, other: &SettlementAttestation) -> bool
self and other values to be equal, and is used by ==.§impl Serialize for SettlementAttestation
impl Serialize for SettlementAttestation
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for SettlementAttestation
impl StructuralPartialEq for SettlementAttestation
Auto Trait Implementations§
impl Freeze for SettlementAttestation
impl RefUnwindSafe for SettlementAttestation
impl Send for SettlementAttestation
impl Sync for SettlementAttestation
impl Unpin for SettlementAttestation
impl UnsafeUnpin for SettlementAttestation
impl UnwindSafe for SettlementAttestation
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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