New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: payment quotes #981
feat: payment quotes #981
Conversation
9eb73d7
to
fb17dc7
Compare
fb17dc7
to
942fe23
Compare
const QUOTE_EXPIRATION_SECS: u64 = 3600; | ||
|
||
impl Node { | ||
pub(crate) fn create_quote_for_storecost( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets get some more docs/info around these. How the quotes are envisaged to be used etc. (here and below)
use crate::node::Node; | ||
|
||
/// The time in seconds that a quote is valid for | ||
const QUOTE_EXPIRATION_SECS: u64 = 3600; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets add a comment as to how/why this was chosen too 🙇
Description
Summary generated by Reviewpad on 20 Nov 23 06:58 UTC
This pull request includes changes in multiple files:
The
response.rs
file:store_cost
field toquote
and changed its type fromResult<NanoTokens>
toResult<PaymentQuote>
.QueryResponse
enum.The
offline_transfer.rs
file:CashNoteRedemption
,UniquePubkey
, andContentPaymentsMap
.PaymentDetails
andContentPaymentsMap
.OfflineTransfer
struct by replacing theall_extended_data_payments
field withall_spend_requests
.The
data_payments.rs
file:Payment
,PaymentDetails
, andPaymentQuote
.ContentPaymentsMap
andQuoteSignature
.PaymentDetails
andPaymentQuote
structs.The
sn_client/src/wallet.rs
file:get_payment_transfers
function toget_payment_for_addr
.get_payment_for_addr
fromVec<Transfer>
toPayment
.get_store_cost_at_address
from(MainPubkey, NanoTokens)
to(MainPubkey, PaymentQuote)
.pay_for_records
function to useBTreeMap<XorName, (MainPubkey, PaymentQuote)>
.The
sn_client/src/api.rs
file:Payment
struct from thesn_transfers
module.payment
parameter type in thestore_chunk
method toPayment
.The
wallet.rs
file in thewallet
module:Payment
,PaymentQuote
,CashNoteRedemption
, andContentPaymentsMap
.The
quote.rs
file:The
lib.rs
file:quote
.Other miscellaneous changes in various files related to imports, function names, and code logic.
Please review these changes for correctness, compatibility, and adherence to requirements.