pub struct PaymentQuote {
pub content: XorName,
pub timestamp: SystemTime,
pub price: Uint<256, 4>,
pub rewards_address: Address,
pub pub_key: Vec<u8>,
pub signature: Vec<u8>,
}Expand description
A payment quote to store data given by a node to a client.
The PaymentQuote is a contract between the node and itself to make sure the clients aren’t mispaying. It is NOT a contract between the client and the node.
Fields§
§content: XorNameThe content paid for
timestamp: SystemTimeThe local node time when the quote was created
price: Uint<256, 4>The node-calculated price for storing this content
rewards_address: AddressThe node’s wallet address
pub_key: Vec<u8>The node’s public key in bytes (ML-DSA-65)
signature: Vec<u8>The node’s signature for the quote (ML-DSA-65)
Implementations§
Source§impl PaymentQuote
impl PaymentQuote
Sourcepub fn hash(&self) -> FixedBytes<32>
pub fn hash(&self) -> FixedBytes<32>
Compute the hash of this quote.
Sourcepub fn bytes_for_signing(
xorname: XorName,
timestamp: SystemTime,
price: &Uint<256, 4>,
rewards_address: &Address,
) -> Vec<u8> ⓘ
pub fn bytes_for_signing( xorname: XorName, timestamp: SystemTime, price: &Uint<256, 4>, rewards_address: &Address, ) -> Vec<u8> ⓘ
Returns the bytes to be signed from the given parameters.
Sourcepub fn bytes_for_sig(&self) -> Vec<u8> ⓘ
pub fn bytes_for_sig(&self) -> Vec<u8> ⓘ
Returns the bytes to be signed from self.
Trait Implementations§
Source§impl Clone for PaymentQuote
impl Clone for PaymentQuote
Source§fn clone(&self) -> PaymentQuote
fn clone(&self) -> PaymentQuote
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PaymentQuote
impl Debug for PaymentQuote
Source§impl<'de> Deserialize<'de> for PaymentQuote
impl<'de> Deserialize<'de> for PaymentQuote
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PaymentQuote, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PaymentQuote, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for PaymentQuote
impl Ord for PaymentQuote
Source§fn cmp(&self, other: &PaymentQuote) -> Ordering
fn cmp(&self, other: &PaymentQuote) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PaymentQuote
impl PartialEq for PaymentQuote
Source§impl PartialOrd for PaymentQuote
impl PartialOrd for PaymentQuote
Source§impl Serialize for PaymentQuote
impl Serialize for PaymentQuote
Source§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,
Serialize this value into the given Serde serializer. Read more
impl Eq for PaymentQuote
impl StructuralPartialEq for PaymentQuote
Auto Trait Implementations§
impl Freeze for PaymentQuote
impl RefUnwindSafe for PaymentQuote
impl Send for PaymentQuote
impl Sync for PaymentQuote
impl Unpin for PaymentQuote
impl UnsafeUnpin for PaymentQuote
impl UnwindSafe for PaymentQuote
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Converts
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>
Converts
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