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

use click.Path for make_offer command filename #17538

Merged
merged 1 commit into from Feb 10, 2024
Merged

Conversation

emlowe
Copy link
Contributor

@emlowe emlowe commented Feb 9, 2024

Fixes #10920

Addresses several issues with the seldom used make_offer CLI option. Uses click.Path type to avoid problems with using a directory or a non-writable file and added a couple of tests for those. This allows click to handle most error cases upfront.

Also, make sure to only make the offer after opening the file for writing, which would help to prevent other problems with creating the offer while being unable to write out to the file. Doesn't address all situations like running out of disk space, but this likely works for the large majority of failure cases.

@emlowe emlowe added the Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog label Feb 9, 2024
Copy link
Contributor

github-actions bot commented Feb 9, 2024

File Coverage Missing Lines
chia/cmds/wallet_funcs.py 85.7% lines 570
Total Missing Coverage
23 lines Unknown 95%

@emlowe emlowe marked this pull request as ready for review February 9, 2024 22:47
@emlowe emlowe requested a review from a team as a code owner February 9, 2024 22:47
@Starttoaster Starttoaster merged commit 59cbb96 into main Feb 10, 2024
268 of 270 checks passed
@Starttoaster Starttoaster deleted the EL.make-offer-path branch February 10, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] missing output filename causes exception, but still creates offer and does not show to user
3 participants