Skip to content
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

cli: add command to list PublicOffer #303

Merged
merged 7 commits into from
Dec 8, 2021

Conversation

Lederstrumpf
Copy link
Member

Lists public offer ids. First step towards addressing #287.
Requires merge of farcaster-project/farcaster-core#195.

@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2021

Codecov Report

Merging #303 (e36d527) into main (ef19c74) will increase coverage by 0.0%.
The diff coverage is 22.2%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #303   +/-   ##
=====================================
  Coverage   15.2%   15.2%           
=====================================
  Files         27      27           
  Lines       6587    6604   +17     
=====================================
+ Hits        1004    1007    +3     
- Misses      5583    5597   +14     
Impacted Files Coverage Δ
src/cli/command.rs 32.7% <0.0%> (-0.9%) ⬇️
src/farcasterd/runtime.rs 0.0% <0.0%> (ø)
src/rpc/request.rs 16.2% <50.0%> (+0.4%) ⬆️
src/cli/opts.rs 52.6% <66.7%> (-0.1%) ⬇️
src/lib.rs 13.1% <0.0%> (-<0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef19c74...e36d527. Read the comment docs.

@h4sh3d
Copy link
Member

h4sh3d commented Dec 5, 2021

Do you need something else in core for this? Otherwise you can release 0.4.3 with the CI

@zkao
Copy link
Member

zkao commented Dec 5, 2021

the public offers are in info, you can check how its done there

@zkao
Copy link
Member

zkao commented Dec 5, 2021

offers: self.public_offers.iter().cloned().collect(),

@Lederstrumpf Lederstrumpf force-pushed the cli_list_public_offers branch 2 times, most recently from 0dbb1c0 to 42fe818 Compare December 6, 2021 17:23
@Lederstrumpf
Copy link
Member Author

I've comment the list-offer-ids command for now since we're just pushing the full list of public offers for the PoC and not doing any diffing. Long-term, we should switch to pushing just the IDs since they're more compact and then have the receiver request the base58 encoded offers for anything they're missing.

So now the CLI has only list-swaps and list-offers, where list-offers dumps the public offers as in

offers: self.public_offers.iter().cloned().collect(),

Copy link
Member

@h4sh3d h4sh3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 42fe818

@zkao
Copy link
Member

zkao commented Dec 7, 2021

@Lederstrumpf, @h4sh3d can we call swap-cli ls still?

if not can u add that?

@h4sh3d
Copy link
Member

h4sh3d commented Dec 7, 2021

@Lederstrumpf maybe there is some sort of "alias" in clap you can use to make list-swaps also respond on ls

@zkao zkao changed the title cli: add command to list PublicOfferIds cli: add command to list PublicOffer Dec 7, 2021
@zkao
Copy link
Member

zkao commented Dec 7, 2021

yes, its called short

@zkao
Copy link
Member

zkao commented Dec 7, 2021

can u please fix that and rebase?

@zkao
Copy link
Member

zkao commented Dec 7, 2021

@h4sh3d

@h4sh3d h4sh3d force-pushed the cli_list_public_offers branch from 42fe818 to e36d527 Compare December 7, 2021 14:41
@h4sh3d
Copy link
Member

h4sh3d commented Dec 7, 2021

Now we can use ls, ls-swaps and list-swaps or ls-offers and list-offers.

@zkao
Copy link
Member

zkao commented Dec 8, 2021

ls, ls-swaps and list-swaps or ls-offers and list-offers

there is mixed semantics here: either ls means list or list-swaps, but not both in different contexts

@zkao
Copy link
Member

zkao commented Dec 8, 2021

ls --swaps
ls --offers

or

ls-swaps
ls-offers

or

ls
lo

I prefer the latter, because the gain in characters are minimal in the others

@Lederstrumpf Lederstrumpf force-pushed the cli_list_public_offers branch from 73f92b0 to e36d527 Compare December 8, 2021 03:13
@h4sh3d h4sh3d merged commit 1464082 into farcaster-project:main Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants