Skip to content

Remove url from payjoin-ffi in favor of native payjoin::url - #1907

Merged
DanGould merged 1 commit into
payjoin:masterfrom
benalleng:ffi-url-drop
Sep 29, 2026
Merged

DanGould merged 1 commit into
payjoin:masterfrom
benalleng:ffi-url-drop

Conversation

@benalleng

Copy link
Copy Markdown
Collaborator

Closes #1905

This removes the url dep in payjoin-ffi in favor of using the native payjoin url. I feel like there was a reason we told ourselves why we didn't want this at first but I can't find it for the life of me so I thought I should just put it out into the wild to see what we think.

I also notices there were some pretty egregious test errors where we were using url parsing instead of uri parsing.

Pull Request Checklist

Please confirm the following before requesting review:

@coveralls

coveralls commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 36450575032

Warning

No base build found for commit 5bca992 on master.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 86.869%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 17013
Covered Lines: 14779
Line Coverage: 86.87%
Coverage Strength: 334.02 hits per line

💛 - Coveralls

@DanGould

Copy link
Copy Markdown
Member

seems like a simple oversight that got forgotten to be removed to me

I also added some additional url specific tests with the uri unit tests
to demonstrate that the url validation is happening as a precondition to
the uri validation.
@benalleng
benalleng marked this pull request as ready for review September 28, 2026 16:22

@DanGould DanGould left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oof. Those tests were pretty broken before. egregious as your pr body says indeed. I approved that test I think, it started as an honest TODO and then that got lifted accidentally. In hindsight I think it's totally minor but.

I wondered iwhy Kotlin was left out, but it was actually already right.

This is a good reason for BIP{,3}21 test cases to be a single data file under payjoin-ffi/. Did decoded values not get checked? Unfinished tests should be written to fail and then ignored like with the #[ignore] procmacro in rust. Spooky but doesn't seem to have any bad consequences, fortunately. Hygiene fix makes me feel clean .

ACK e92e9d3

Comment on lines 17 to +20
public void UrlEncodedPayjoinParameter()
{
var uri = "bitcoin:12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX?amount=1&pj=https://example.com?ciao";
var result = Url.Parse(uri);
var uri = "bitcoin:12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX?amount=1&pj=https%3A%2F%2Fexample.com%3Fciao";
var result = Uri.Parse(uri);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was this test just incorrectly written before?

@DanGould
DanGould merged commit 0d38cb1 into payjoin:master Sep 29, 2026
57 checks passed
@DanGould DanGould mentioned this pull request Sep 29, 2026
13 tasks
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.

Should our Url implementation replace url as a dep in payjoin-ffi?

3 participants