feat(freshness): enhance diagnostics and update snapshot structure

- Introduced a new Diagnostics struct to capture transaction visibility state and activity state.
- Updated BuildSnapshot function to return diagnostics alongside snapshot, completeness, and sampling.
- Enhanced test cases to validate the new diagnostics data.
- Updated frontend components to utilize the new diagnostics information for improved user feedback on freshness context.

This change improves the observability of transaction activity and enhances the user experience by providing clearer insights into the freshness of data.
This commit is contained in:
defiQUG
2026-04-12 18:22:08 -07:00
parent 50c5435c0c
commit b5a2e0c0a4
34 changed files with 1328 additions and 165 deletions

View File

@@ -4,6 +4,7 @@ import {
normalizeWatchlistAddress,
parseStoredWatchlist,
sanitizeWatchlistEntries,
toggleWatchlistEntry,
} from './watchlist'
describe('watchlist utils', () => {
@@ -39,4 +40,10 @@ describe('watchlist utils', () => {
isWatchlistEntry(entries, '0x1234567890123456789012345678901234567890'.toUpperCase()),
).toBe(true)
})
it('toggles watchlist entries on and off case-insensitively', () => {
const address = '0x1234567890123456789012345678901234567890'
expect(toggleWatchlistEntry([], address)).toEqual([address])
expect(toggleWatchlistEntry([address], address.toUpperCase())).toEqual([])
})
})