From 0e3e0fb4cb20a810dc864c6b0abba9abfe076add Mon Sep 17 00:00:00 2001 From: Daniel Karzel Date: Wed, 30 Jun 2021 15:13:47 +1000 Subject: [PATCH] fixup! Add the `list-sellers` command to the CLI --- swap/src/bin/swap.rs | 9 ++++++--- swap/src/cli/list_sellers.rs | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/swap/src/bin/swap.rs b/swap/src/bin/swap.rs index 3e9d730b..547a7436 100644 --- a/swap/src/bin/swap.rs +++ b/swap/src/bin/swap.rs @@ -281,7 +281,7 @@ async fn main() -> Result<()> { .context("Failed to read in seed file")?; let identity = seed.derive_libp2p_identity(); - let makers = list_sellers( + let sellers = list_sellers( rendezvous_node_peer_id, rendezvous_node_addr, namespace, @@ -290,8 +290,11 @@ async fn main() -> Result<()> { ) .await?; - for maker in makers { - tracing::info!(peer_id=%maker.peer_id, multiaddr=%maker.multiaddr, price=%maker.quote.price, max_quantity=%maker.quote.max_quantity, min_quantity=%maker.quote.min_quantity); + for seller in sellers { + // TODO: Do not use tracing for printing this information + // TODO: Print on stdout + // TODO: Decide if the json flag should still be honoured + tracing::info!(peer_id=%seller.peer_id, multiaddr=%seller.multiaddr, price=%seller.quote.price, max_quantity=%seller.quote.max_quantity, min_quantity=%seller.quote.min_quantity); } } }; diff --git a/swap/src/cli/list_sellers.rs b/swap/src/cli/list_sellers.rs index 4a215353..9c3fff74 100644 --- a/swap/src/cli/list_sellers.rs +++ b/swap/src/cli/list_sellers.rs @@ -31,9 +31,9 @@ pub async fn list_sellers( rendezvous_node_addr, namespace, ); - let makers = event_loop.run().await; + let sellers = event_loop.run().await; - Ok(makers) + Ok(sellers) } pub struct Seller { @@ -223,7 +223,7 @@ impl EventLoop { .collect::, _>>(); match all_quotes_fetched { - Ok(makers) => break makers, + Ok(sellers) => break sellers, Err(StillPending {}) => continue, } }