Skip to content

Commit

Permalink
chore: add more logging to the fetch store quotes fn
Browse files Browse the repository at this point in the history
  • Loading branch information
mickvandijke committed Jan 7, 2025
1 parent 8da56e5 commit ef35c1b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions autonomi/src/client/quote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ impl Client {
.into_iter()
.map(|content_addr| fetch_store_quote_with_retries(&self.network, content_addr))
.collect();

let raw_quotes_per_addr = futures::future::try_join_all(futures).await?;

// choose the quotes to pay for each address
Expand All @@ -70,9 +71,15 @@ impl Client {
let mut rate_limiter = RateLimiter::new();

for (content_addr, raw_quotes) in raw_quotes_per_addr {
debug!(
"fetching market price for content_addr: {content_addr}, with {} quotes.",
raw_quotes.len()
);

// FIXME: find better way to deal with paid content addrs and feedback to the user
// assume that content addr is already paid for and uploaded
if raw_quotes.is_empty() {
debug!("content_addr: {content_addr} is already paid for. No need to fetch market price.");
continue;
}

Expand All @@ -90,6 +97,8 @@ impl Client {
)
.await?;

debug!("market prices: {all_prices:?}");

let mut prices: Vec<(PeerId, PaymentQuote, Amount)> = all_prices
.into_iter()
.zip(raw_quotes.into_iter())
Expand Down

0 comments on commit ef35c1b

Please sign in to comment.