forked from comit-network/xmr-btc-swap
-
Notifications
You must be signed in to change notification settings - Fork 6
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(gui): Swap state stepper to use Tauri events #77
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We should use this opportunity to re-think the state stepper design. Currently there are a few open questions. Types of steppersWe have two different stepper paths (Happy, Unhappy). Each step in a stepper can be either
Open questions
@Einliterflasche What do you think? |
binarybaron
force-pushed
the
gui/rework-swap-state-stepper
branch
from
September 18, 2024 22:41
9c9c8b9
to
0f02cce
Compare
binarybaron
changed the title
refactor(gui): Rework swap state stepper to use Tauri events
refactor(gui): Swap state stepper to use Tauri events
Sep 20, 2024
binarybaron
force-pushed
the
gui/rework-swap-state-stepper
branch
from
September 22, 2024 19:04
a6325b0
to
2d002b5
Compare
I'm merging this. #77 (comment) should be made in another issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously we used the data we fetched via the rpc (
GetSwapInfo
call, saved in redux inrpc.swapInfos
) to decide what to display in the state stepper to the user. The state stepper is displayed at the bottom of theSwapDialog
.However, we are moving away from our depedence on periodic rpc calls and towards relying more and more on the events we receive from the Host (from Tauri). Our goal is to rely solely on the Tauri events for everything displayed about the currently running swap.
This PR includes the following changes:
SwapStateStepper
such that it relies only on the Tauri eventsEncryptedSignatureSent
,CancelTimelockExpired
) in the state machineBtcRefunded
Tauri event after Bitcoin refund transaction is published"Waiting for them to redeem the Bitcoin"
and"Revealing encrypted signature to the other party"
on theSwapStatePage
(content displayed in the center of theSwapDialog
)