Repository navigation
Conversation
9869bbc to
9e4f454
Compare
| BadRequest(RequestError), | ||
| // To be returned as HTTP 500 | ||
| Server(Box<dyn error::Error>), | ||
| Server(Box<dyn error::Error + 'static + Sync + Send>), |
There was a problem hiding this comment.
I dont think I need this anymore, but would be nice to leave it I guess
|
All of these changes are new API surface. I imagine some of these will be required but others might be able to be worked around. May you please enumerate why each change is required or is a better design? I'd especially like to better understand the changes that affect type/method visibility. I think #69 might be better to fix with a dedicated PR designed to fix the problem in general, allowing for substitution of the original payment output with any number of outputs, rather than an additional substitution method that increases the surface area of the API. Glad you're having success finding compatiblity with lightning payjoin integration in any case. |
| #[cfg(feature = "base64")] | ||
| pub use bitcoin::base64; | ||
| pub use uri::{PjParseError, PjUri, PjUriBuilder, Uri}; | ||
| pub use uri::{MaybePayjoinExtras, PjParseError, PjUri, PjUriBuilder, Uri}; |
There was a problem hiding this comment.
this is useful in testing where we want to mutate the pjuri in order to change test direction(ie start with a pj uri and then maybe change it to something different) example: https://github.com/lightningdevkit/ldk-node/pull/257/files#diff-ebba69f49eedcd3dd6a656eff964c6184b6d29c02fbad6a49d3b41c87cc3de79R192
| #[derive(Clone)] | ||
| pub struct PayjoinExtras { | ||
| pub(crate) endpoint: Url, | ||
| pub endpoint: Url, |
There was a problem hiding this comment.
this is useful in testing where we want to mutate the pjuri in order to change test direction(ie start with a pj uri and then maybe change it to something different) example: https://github.com/lightningdevkit/ldk-node/pull/257/files#diff-ebba69f49eedcd3dd6a656eff964c6184b6d29c02fbad6a49d3b41c87cc3de79R192
| self.payjoin_psbt.unsigned_tx.output[self.owned_vouts[0]].script_pubkey = script; | ||
| } | ||
|
|
||
| /// payjoin request value in satoshis |
There was a problem hiding this comment.
This is useful in lightning context in order to get a scheduled channel based on the payjoin amount received
exmple: https://github.com/lightningdevkit/ldk-node/pull/257/files#diff-d07cd679b2d6743b550aec08c91b33e92bdd40a9556385925c987e9d82b222c5R89
| } | ||
|
|
||
| fn proposal_from_test_vector() -> Result<UncheckedProposal, RequestError> { | ||
| fn proposal_from_test_vector() -> Result<UncheckedProposal, Error> { |
There was a problem hiding this comment.
Makes it easier to integrate testing, otherwise we would need to handle RequestError in downstream in addition to Error which we already need to deal with
|
@DanGould added a comment on each commit pub fn substitue_our_output(&mut self, txo: TxOut) {
self.payjoin_psbt.unsigned_tx.output[self.owned_vouts[0]] = txo;
} |
|
You should be able to substitute the output with many outputs at random index, not just one. I'm not exactly sure what that interface looks like yet. I assume this will require adjustment to both the psbt.unsigned_tx output map and the psbt.outputs map. |
241947a to
b3770f6
Compare
|
Took out the |
Here are few commits I have while working on the payjoin integration with
ldk_nodelightningdevkit/ldk-node#257.