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

Implement prepare_refund_failed_swap() #712

Merged
merged 4 commits into from
Nov 14, 2023

Conversation

danielgranhao
Copy link
Collaborator

@danielgranhao danielgranhao commented Oct 24, 2023

No description provided.

@danielgranhao danielgranhao force-pushed the feature/prepare-failed-swap-refund branch from 6ce5633 to 89d313b Compare October 24, 2023 11:46
@danielgranhao danielgranhao changed the title Feature/prepare failed swap refund Implement prepare_refund_failed_swap() Oct 24, 2023
@danielgranhao danielgranhao force-pushed the feature/resolve-failed-swaps branch 2 times, most recently from e266e70 to 8743455 Compare October 25, 2023 15:40
Base automatically changed from feature/resolve-failed-swaps to main-breez October 25, 2023 16:08
@danielgranhao danielgranhao changed the base branch from main-breez to main October 26, 2023 11:12
@danielgranhao danielgranhao force-pushed the feature/prepare-failed-swap-refund branch from 89d313b to 504b4d4 Compare November 10, 2023 16:27
@danielgranhao danielgranhao reopened this Nov 10, 2023
@danielgranhao danielgranhao force-pushed the feature/prepare-failed-swap-refund branch from c547c56 to fe6ca62 Compare November 10, 2023 16:31
@danielgranhao danielgranhao marked this pull request as ready for review November 10, 2023 16:33
src/lib.rs Outdated Show resolved Hide resolved
@@ -85,6 +85,9 @@ interface LightningNode {
[Throws=LnError]
sequence<FailedSwapInfo> get_unresolved_failed_swaps();

[Throws=LnError]
FailedSwapRefundInfo prepare_refund_failed_swap(FailedSwapInfo failed_swap_info, string to_address, u32 onchain_fee_rate);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might make sense to expand the FailedSwapRefundInfo to be used as an argument in the resolve_failed_swap method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we don't need to force the use of the prepare method. Why do we need more info other than the swap address?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was just thinking from the client perspective, but I might have misunderstood the use of the prepare_refund_failed_swap method.

As a client if, and here I'm not sure if that's the case, I always call the prepare_refund_failed_swap method before refunding a swap would prefer to just supply the response from this to the refund_failed_swap method.
But if the client doesn't always call the prepare method before, this doesn't make sense.

Copy link
Collaborator Author

@danielgranhao danielgranhao Nov 14, 2023

Choose a reason for hiding this comment

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

Sure. It definitely wasn't strictly needed that the prepare method is used, but we expect it to always be used, so let's do it like you propose. Implemented in 784bea6

@danielgranhao danielgranhao force-pushed the feature/prepare-failed-swap-refund branch from b7788fc to 42952a4 Compare November 13, 2023 16:15
@danielgranhao danielgranhao merged commit 67abe26 into main Nov 14, 2023
13 checks passed
@danielgranhao danielgranhao deleted the feature/prepare-failed-swap-refund branch November 14, 2023 14:45
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.

2 participants