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

Refactor watcher types #760

Merged
merged 2 commits into from
Feb 12, 2025
Merged

Refactor watcher types #760

merged 2 commits into from
Feb 12, 2025

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Feb 12, 2025

Watch types (and mostly the BitcoinEvent sealed class) were confusing because we imported code from eclair and never adapted it to mobile wallets where we have less complex watch scenarios.

We refactor this and rename the different kind of events to match what we're using. We can thus use exhaustive pattern matching when a watch triggers, which is particularly important in the Closing state where we want to make sure we're not missing any scenario.

Watch types (and mostly the `BitcoinEvent` sealed class) were confusing
because we imported code from `eclair` and never adapted it to mobile
wallets where we have less complex watch scenarios.

We refactor this and rename the different kind of events to match what
we're using. This is a first step towards doing exhaustive pattern
matching when a watch triggers, which we'll do in the next commit.

We also add a few helper variables and move funding helpers.
We can now use exhaustive pattern matching when a watch triggers, which
is particularly important in the `Closing` state where we want to make
sure we're not missing any scenario.
@t-bast t-bast requested review from pm47 and sstone February 12, 2025 10:03
@t-bast t-bast merged commit 219a9b8 into master Feb 12, 2025
2 checks passed
@t-bast t-bast deleted the refactor-watcher-types branch February 12, 2025 13:29
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