-
Notifications
You must be signed in to change notification settings - Fork 23
Send Payjoin (with test) #121
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
Conversation
Change interface to accept a bip21 PjUri as defined in bip78. Only use address from the bip21 Uri, still pass amount in as a separate argument to send_sats.
Update payjoin to v0.4.0-alpha
…itcoin used in payjoin.
|
@DanGould Made some changes to get things running in our new regtest environment, and to get us updated to using rust-bitcoin 0.29. I Found your new version of payjoin, that was helpful, thank you. To test locally, I had to set up a regtest environment using the instructions in this link: And then some commands... This is the test output, I expanded the BDK Wallet struct for debugging... I'm not sure if the fact that BDK seems to have some internal confusion over regtest vs testnet is the issue. |
|
what is |
Co-authored-by: Dan Gould <d@ngould.dev>
No, it's to the Blockstream fork of electrs used for Esplora, which can be found here: It must be run in conjunction with bitcoind, like in the example I provided here: Perhaps we should document this, but it was always meant to be temporary, since we also want to build this: |
|
@DanGould Just tested your latest change, got this as a response: |
|
Sounds like it's working to me! Of course btcpayserver won't find your regtest input, they're running testnet. I'm not clear about the direction of the test environment. How do you switch between testnet / regtest? Will there be a docker container or nix flake to manage the env in the future? |
|
Oh nice, that makes sense! We switch by calling a method to change it in an in-memory singleton, but I just realized, we don't have a way to do so through env vars yet. I can get that added, it's a handy feature to have, and then we can use different wallets in CI. |
|
@DanGould It's kind of silly, but I've cheesed it on this for now. Once it makes it into the next version of BitMask, I'll have to invite you to test it out. Also, one thing that might be helpful is if your process_response method returned an error that had more error information than just "couldn't decode PSBT"; something including the error message might be more helpful to disambiguate between the different kinds of errors. Anyway, I'll ask my teammates to review this now. |
|
can't decode PSBT means the PSBT as serialized is not valid and it's a single error from consensus decoding. Maybe it should be more explicit that the de/encoding de/serialization is wrong Edit: I need to know what "cheesed it on this" means. You smilin? |
Yeah, the error message is wrong, it returns the same message when there's multiple things that could go wrong. And yes, smilin, it's just a silly test case, but it could be improved if there were richer errors returned. |
|
@josediegorobles Please review at your earliest convenience. |
|
Thanks for the review, @josediegorobles! |
Send integration was tested by @cryptoquick in bitmask-stack/bitmask-core#121
Send integration was tested by @cryptoquick in bitmask-stack/bitmask-core#121
(supersedes #119)
WIP, getting an error when running
cargo test --test payjoin -- --nocapture --exact:@DanGould please feel free to PR into this branch, so we can collaborate.