Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Minor wallet improvements #2172

Merged
merged 5 commits into from
Jun 7, 2022
Merged

Minor wallet improvements #2172

merged 5 commits into from
Jun 7, 2022

Conversation

bonomat
Copy link
Collaborator

@bonomat bonomat commented Jun 6, 2022

Fixes #2158

Minor UI change:

Maker UI:
image

Taker UI:

image

While syncing:

image

@bonomat bonomat requested review from da-kami and klochowicz and removed request for da-kami June 6, 2022 04:09
@bonomat bonomat force-pushed the wallet-manual-sync branch from b0307a8 to d0ccadb Compare June 6, 2022 05:41
@@ -350,6 +351,11 @@ where
})
.await?
}

pub async fn sync_wallet(&self) -> Result<()> {
self.wallet_actor.send(wallet::Sync).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding is, that this is a blocking send that we await so the UI gets feedback if the sync is done.
Not sure how the routes will behave if a user triggers some other actions while waiting for the wallet to sync, but I don't think it matters much.
I was thinking if it would make sense to make this send_async, but I don't think we can easily achieve this in a good way, and while the wallet is syncing we should not really trigger actions anyway. So I think this is fine :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just tried it: it's not blocking, you can go out of the wallet. I was able to open a position but I think the sync was already done by that time :)

@bonomat
Copy link
Collaborator Author

bonomat commented Jun 7, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 7, 2022

Merge conflict.

bonomat added 5 commits June 7, 2022 13:39
Allows us to see when sync is being started
We don't have it in the frontend so no need to have the endpoint exported.
Now that we can trigger the wallet sync manually through the UI we can sync less often. This
- reduces load from ourselves because syncing is a long running process
- reduces load from the infrastructure we are using

For now we sync every 3 minutes. This has been chosen because 2 is an impossible number: https://wiki.c2.com/?TwoIsAnImpossibleNumber
@bonomat bonomat force-pushed the wallet-manual-sync branch from d0ccadb to 867915a Compare June 7, 2022 03:40
@bonomat
Copy link
Collaborator Author

bonomat commented Jun 7, 2022

bors r+

bors bot added a commit that referenced this pull request Jun 7, 2022
2172: Minor wallet improvements r=bonomat a=bonomat

Fixes #2158 

Minor UI change: 

Maker UI: 
<img width="486" alt="image" src="https://user-images.githubusercontent.com/224613/172093037-b1dfc492-9789-4524-a781-afc77c9de069.png">

Taker UI: 

<img width="750" alt="image" src="https://user-images.githubusercontent.com/224613/172093106-79a31577-4d09-4e33-9dbb-e2f3a51d3a08.png">


While syncing: 

<img width="803" alt="image" src="https://user-images.githubusercontent.com/224613/172093127-a58e6f27-44f9-499d-866b-55dcfa2243f6.png">



Co-authored-by: Philipp Hoenisch <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jun 7, 2022

Build failed:

@bonomat
Copy link
Collaborator Author

bonomat commented Jun 7, 2022

bors retry

bors bot added a commit that referenced this pull request Jun 7, 2022
2172: Minor wallet improvements r=bonomat a=bonomat

Fixes #2158 

Minor UI change: 

Maker UI: 
<img width="486" alt="image" src="https://user-images.githubusercontent.com/224613/172093037-b1dfc492-9789-4524-a781-afc77c9de069.png">

Taker UI: 

<img width="750" alt="image" src="https://user-images.githubusercontent.com/224613/172093106-79a31577-4d09-4e33-9dbb-e2f3a51d3a08.png">


While syncing: 

<img width="803" alt="image" src="https://user-images.githubusercontent.com/224613/172093127-a58e6f27-44f9-499d-866b-55dcfa2243f6.png">



Co-authored-by: Philipp Hoenisch <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jun 7, 2022

Build failed:

@bonomat
Copy link
Collaborator Author

bonomat commented Jun 7, 2022

bors r+

@bors bors bot merged commit 51eb120 into master Jun 7, 2022
@bors bors bot deleted the wallet-manual-sync branch June 7, 2022 04:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize wallet and/or monitoring
2 participants