pub struct SingleNodeQuotePayment {
pub quotes: Vec<QuotePaymentInfo>,
}Expand description
Variable-size single-node payment plan for a chunk.
The shared ant-protocol::payment::SingleNodePayment helper still models
the legacy fixed CLOSE_GROUP_SIZE quote set. Node-side verification now
accepts any non-empty quote bundle up to CLOSE_GROUP_SIZE, so the client
keeps the same 3x-median payment rule while allowing the single-node path to
proceed with as few as one valid quote.
Fields§
§quotes: Vec<QuotePaymentInfo>Quotes sorted by price; the median-priced quote receives 3x payment and the rest receive zero.
Implementations§
Source§impl SingleNodeQuotePayment
impl SingleNodeQuotePayment
Sourcepub fn from_quotes(quotes: Vec<PaymentQuote>) -> Result<Self>
pub fn from_quotes(quotes: Vec<PaymentQuote>) -> Result<Self>
Build a single-node payment from one or more quotes.
The quotes are sorted by price, the median quote receives 3x its quoted price, and every other quote is included with a zero amount so proof and payment intent construction stay aligned.
Sourcepub fn total_amount(&self) -> Amount
pub fn total_amount(&self) -> Amount
Total on-chain amount paid by this single-node payment.
Trait Implementations§
Source§impl Clone for SingleNodeQuotePayment
impl Clone for SingleNodeQuotePayment
Source§fn clone(&self) -> SingleNodeQuotePayment
fn clone(&self) -> SingleNodeQuotePayment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SingleNodeQuotePayment
impl RefUnwindSafe for SingleNodeQuotePayment
impl Send for SingleNodeQuotePayment
impl Sync for SingleNodeQuotePayment
impl Unpin for SingleNodeQuotePayment
impl UnsafeUnpin for SingleNodeQuotePayment
impl UnwindSafe for SingleNodeQuotePayment
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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