Skip to content

Avoid stringly typed arguments in payjoin-cli App trait#479

Merged
DanGould merged 2 commits intopayjoin:masterfrom
nothingmuch:typed-cli-args
Jan 14, 2025
Merged

Avoid stringly typed arguments in payjoin-cli App trait#479
DanGould merged 2 commits intopayjoin:masterfrom
nothingmuch:typed-cli-args

Conversation

@nothingmuch
Copy link
Collaborator

Minor standalone changes from ongoing refactoring work. A more comprehensive approach might be to allow explicit units to be parsed from the string form of these arguments (see also rust-bitcoin/rust-bitcoin#1786) but personally I think that's undesirable since it complicates payjoin-cli, and as a reference implementation it should prioritize readability and simplicity over convenience/flexibility of the CLI.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 12767588652

Details

  • 0 of 23 (0.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 60.758%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin-cli/src/app/mod.rs 0 1 0.0%
payjoin-cli/src/app/v2.rs 0 2 0.0%
payjoin-cli/src/app/v1.rs 0 4 0.0%
payjoin-cli/src/main.rs 0 16 0.0%
Totals Coverage Status
Change from base Build 12759909420: 0.0%
Covered Lines: 2917
Relevant Lines: 4801

💛 - Coveralls

Copy link
Contributor

@DanGould DanGould left a comment

Choose a reason for hiding this comment

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

tACK 7c53399. I smoke tested and checked that FeeRate and Amount sent were appropriate, because I don't think these are tested in e2e.rs.

I agree with implicit units with explicit documentation.

This marks progress toward #452 but does not yet complete it because receiver's max_fee_rate is still an Option<u64> but not a proper Option<FeeRate>

@DanGould DanGould merged commit 34ee78d into payjoin:master Jan 14, 2025
6 checks passed
@nothingmuch
Copy link
Collaborator Author

This marks progress toward #452 but does not yet complete it because receiver's max_fee_rate is still an Option<u64> but not a proper Option<FeeRate>

Indeed, I did these more than a week ago, and wanted to PR before I forgot, in hindsight I should have reviewed the issue before opening this PR. I will follow up since that's probably also a very simple change.

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.

3 participants