Page MenuHomePhabricator

[Cashtab] Improve isValidContactList function and tests
ClosedPublic

Authored by bytesofman on Jan 31 2024, 19:10.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC3c75da4a6bd0: [Cashtab] Improve isValidContactList function and tests
Summary

Wallets with aliases in contact list currently throw the list out and do not set to context. Patch this.

Migrate legacy tests to vectors to improve readability. Add new vector for alias case.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
patch-nocontactlist-bug
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26802
Build 53172: Build Diffcashtab-tests
Build 53171: arc lint + arc unit

Event Timeline

bytesofman retitled this revision from [Cashtab] Treat aliases in contact list as valid to [Cashtab] Improve isValidContactList function and tests.
bytesofman edited the summary of this revision. (Show Details)
emack requested changes to this revision.Jan 31 2024, 23:19
emack added a subscriber: emack.

Wallets with aliases in contact list currently throw the list out and do not set to context.

I'm not seeing the part where it's throwing out the list nor how it's patched to be set to context in this diff. Is there a part 2 to this stack?

This revision now requires changes to proceed.Jan 31 2024, 23:19

Wallets with aliases in contact list currently throw the list out and do not set to context.

I'm not seeing the part where it's throwing out the list nor how it's patched to be set to context in this diff. Is there a part 2 to this stack?

see inline comments

there's a separate issue here in that the Configure page is getting contact list from local forage, and not wallet context -- so it renders everything just fine. this should be patched after we get this fix in (which allows useWallet.js to set the localforage contactList to wallet context).

but a wallet with aliases in contact list will not show contacts rendered in tx history.

cashtab/src/validation/fixtures/vectors.js
633 ↗(On Diff #44803)

here is the new test

cashtab/src/validation/index.js
306 ↗(On Diff #44803)

chicken.xec will fail this test but pas after the change at right

This revision is now accepted and ready to land.Feb 1 2024, 00:33