umbra-protocol
umbra-protocol copied to clipboard
feat: save user announcements to local storage and last fetched block
Description
Updates to fetch and scan only the latest blocks. The latest blocks are those after the initial scan, where each subsequent scan saves the latest fetched block to local storage, allowing for appropriate updating of the scan range:
- Initial scan --> fetch/scan blocks 1 to x
- Next scan --> fetch/scan blocks x + 1 to latest block (y)
- Subsequent scan --> fetch/scan blocks y + 1 to latest block etc.
Methodology:
- User announcements are updated in local storage on each fetch/scan
- The latest fetched block is updated in local storage on each fetch/scan
- The most recent announcement block data is updated in local storage on each fetch/scan to accurately show if there are no announcements fetched in the current scan
- The
startBlockfor the scan is appropriately updated to the latest fetched block
Other Updates:
- Show fetching/scanning latest verbiage above the top right of the
AccountReceiveTable, intentionally omitting the large scan indicator at the bottom of the table - Implemented a clear local storage button with auto app refresh
Comments:
- There were instances where querying the subgraph potentially hung (using goldsky, so outdated); while this may not be directly affected by this PR, it's worth noting for testing purposes
To Test:
- Perform the initial scan using account A
- Navigate to a different route/page using account A
- Validate: Navigate back to the receive page to confirm: a) The initial user announcements are present b) The fetching/scanning sequence is reflected appropriately (it's fetching/scanning only the latest blocks)
- Perform a send transaction from a different account to account A, then navigate to the receive view connected with account A; validate as in step 3
- Test the clear local storage functionality and ensure the app refreshes correctly