pub struct CompletionReceipt {
pub lease_id: String,
pub provider_npub: String,
pub consumer_npub: String,
pub duration_paid: u64,
pub duration_delivered: u64,
pub success_flag: f32,
pub payment_proof: PaymentProof,
pub version: u8,
pub consumer_signature: Option<String>,
pub provider_co_signature: Option<String>,
pub completed_at: u64,
}Expand description
Co-signed completion receipt. The consumer signs the
canonicalized JSON of (lease_id, provider_npub, consumer_npub, duration_paid, duration_delivered, success_flag, payment_proof, version); the provider returns a provider_co_signature over
the same bytes; the receipt event carries both.
Receipts missing either signature do not contribute to score
(see score_provider).
Fields§
§lease_id: String§provider_npub: String§consumer_npub: String§duration_paid: u64Seconds the consumer paid for.
duration_delivered: u64Seconds the workload was actually live (provider-reported, cross-checkable against heartbeat history from Unit 4).
success_flag: f321.0 = success, 0.0 = failure. Floats so future units can surface partial-credit cases (e.g. lease delivered but with SLA violations).
payment_proof: PaymentProof§version: u8§consumer_signature: Option<String>Schnorr signature over the canonical content by the consumer’s Nostr key. None means “consumer hasn’t signed”, which is invalid for scoring.
provider_co_signature: Option<String>Schnorr signature over the same content by the provider’s Nostr key. None means “provider hasn’t co-signed”.
completed_at: u64Unix timestamp (provider-stamped) at which this receipt was minted. Aggregators can window by this.
Trait Implementations§
Source§impl Clone for CompletionReceipt
impl Clone for CompletionReceipt
Source§fn clone(&self) -> CompletionReceipt
fn clone(&self) -> CompletionReceipt
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompletionReceipt
impl Debug for CompletionReceipt
Source§impl<'de> Deserialize<'de> for CompletionReceipt
impl<'de> Deserialize<'de> for CompletionReceipt
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 PartialEq for CompletionReceipt
impl PartialEq for CompletionReceipt
Source§fn eq(&self, other: &CompletionReceipt) -> bool
fn eq(&self, other: &CompletionReceipt) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CompletionReceipt
impl Serialize for CompletionReceipt
impl StructuralPartialEq for CompletionReceipt
Auto Trait Implementations§
impl Freeze for CompletionReceipt
impl RefUnwindSafe for CompletionReceipt
impl Send for CompletionReceipt
impl Sync for CompletionReceipt
impl Unpin for CompletionReceipt
impl UnsafeUnpin for CompletionReceipt
impl UnwindSafe for CompletionReceipt
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<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