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

feat: add wallet state #6763

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

SWvheerden
Copy link
Collaborator

Description

Adds a wallet state grpc call which returns the balance, scanned height and wallet state

Copy link

github-actions bot commented Jan 24, 2025

Test Results (CI)

    3 files    129 suites   35m 9s ⏱️
1 350 tests 1 350 ✅ 0 💤 0 ❌
4 048 runs  4 048 ✅ 0 💤 0 ❌

Results for commit ad7de14.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 24, 2025

Test Results (Integration tests)

 2 files  + 2  11 suites  +11   29m 19s ⏱️ + 29m 19s
36 tests +36  35 ✅ +35  0 💤 ±0  1 ❌ +1 
37 runs  +37  36 ✅ +36  0 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit ad7de14. ± Comparison against base commit 2535e87.

♻️ This comment has been updated with latest results.

hansieodendaal
hansieodendaal previously approved these changes Jan 27, 2025
Copy link
Contributor

@hansieodendaal hansieodendaal left a comment

Choose a reason for hiding this comment

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

utACK

Comment on lines 300 to 301
let mut debouncer = self.debouncer.lock().await;
let balance = match debouncer.get_balance().await {
Copy link
Contributor

Choose a reason for hiding this comment

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

fmt ok?

Comment on lines 330 to 331
trace!(target: LOG_TARGET, "'get_state' completed in {:.2?}", start.elapsed());
Ok(Response::new(GetStateResponse {
Copy link
Contributor

Choose a reason for hiding this comment

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

fmt ok?

@SWvheerden SWvheerden merged commit d88f7d6 into tari-project:development Jan 27, 2025
16 of 17 checks passed
@SWvheerden SWvheerden deleted the sw_add_wallet_state branch January 27, 2025 11:47
brianp pushed a commit to tari-project/universe that referenced this pull request Feb 5, 2025
Adjustment possible thanks to
tari-project/tari#6763

Description
---
Create a backend -> frontend middleware which controls data flow and
events triggering. Example: It'll ensure wallet scanning is finished to
detect win/lose when new block mined and emit update events in a
controlled order and frequency.

Changes
---
At the end of `setup_inner`, we call `initialize_frontend_updates` which
updates frontend with initial data(wallet address, hardware details
etc.) and waits for changes in tokio channels. We call `EventsManger` to
handle updates for specific update using `EventService` and call
`EventEmitter`

Improvements
---
* Reduce unwanted rerender
* Solve problem when importing wallet with extensive tx history - update
balance when wallet finished scanning
* Robust win/lose block determination
* Unify new block height ui updates timing

Losing new block height:

[lose.webm](https://github.com/user-attachments/assets/10de3c75-9f4a-4b7f-bf96-4fe91c42e345)
Winning new block height:

[win.webm](https://github.com/user-attachments/assets/b840dedb-de8c-4197-bdd0-76ed9a107da1)
Initial wallet scanning:

![scanning](https://github.com/user-attachments/assets/765ee887-8b0d-4130-9b65-b3499494380b)
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