Commit Graph

8 Commits

Author SHA1 Message Date
Ivan Belyakov 24bf9aada5 feat(wallet): move balance cache to a common place and make it a
parameter to share between transfers and balance history in an upcoming
commit.
Had to refactor its interface for that reason.
2023-09-05 12:20:49 +02:00
Dario Gabriel Lipicar da8e8716b2 fix(wallet): Fix block hash for detected blocks with ETH transfers
Part of #10251
2023-06-05 12:08:18 -03:00
IvanBelyakoff 7adfbb5467
feat(wallet): SequentialFetchStrategy improvements: (#3551)
- reverted a change that stopped looking for ERC20 transfers if no nonce
  and balance change found within a block range for ETH
- implemented sending EventRecentHistoryReady event at a proper time
- moved EventFetchingRecentHistory event to Strategy type as it does not make
sense to send this event in loop
- moved iterating through blocks logic to inside of `loadTransfers` command, which
now accepts a block range.
- reuse `uniqueHeaders` function in commands.go
- clean up

Updates #10246
2023-06-01 16:09:50 +03:00
IvanBelyakoff dc84afb751
Add new transfers fetching for sequential strategy (#3520)
* chore(wallet): refactor sequential transfers commands

* feat(desktop/wallet): add fetching new blocks and transfers for
transfers SequentialFetchStrategy

Updates #10246
2023-05-26 11:27:48 +03:00
IvanBelyakoff 17aaaf1dca
fix(desktop/wallet): fix bug in balance_cache - balances and nonces (#3509)
were stored in cache by pointers, which caused falsy cache hits in loop
because pointers with same address were created for different block
numbers. Now cache uses block numbers of uint64 as key, which can
overflow but it is not a problem since we use this cache for values
comparison, not as user data.
Fix crash on nil pointer in log.
Remove some unused code.
Protect nonceRanges with mutex while reading.

Updates #10246
2023-05-19 14:46:54 +03:00
IvanBelyakoff 94c7cd32af
feat(wallet): Implemented SequentialFetchStrategy for transfers. (#3480)
By default OnDemandFetchStategy is still used.

Updates #10246
2023-05-19 11:19:48 +03:00
IvanBelyakoff cb9f2dd7d2
feat(wallet): refactor transfers to allow multiple transfer fetching (#3432)
strategies.

On mobile devices we might not want to load all transfers history
to avoid high internet traffic consumption or to save some space.
On desktop we will load all transfers in background.

- Moved current fetching transfers implementation to
OnDemandFetchStrategy
- Implemented QueuedAtomicGroup to cache outgoing commands above a
threshold
- Refactored some type names, methods for better clarity:
  - LastKnownBlock name was misused
  - Block renamed to BlockDAO to clarify what it does and avoid
confusion with geth Block type
- Cleanup - removed unused parameters and types' members
- Changed tests to use in memory DB for speedup
- Added more logging and comments

Updates #10246
2023-05-08 08:02:00 +02:00
Anthony Laibe 07651d4d06
feat: enable wallet without network binding (#2349)
* feat: enable wallet without network binding

* feat: make transfer network aware

* feat: allow to pass initial networks via config

* fix: nil check and feed

* feat: Add documentation with better function name

* fix: do not init the manager more than once

* fix: PR feedbacks

* Bump version

* Update Jenkinsfile.tests

* Convert int to string

Co-authored-by: RichΛrd <info@richardramos.me>
2021-09-09 16:28:54 +02:00