HomePhabricator

[Cashtab] Use context instead of mixed approach for managing contacts in…

Description

[Cashtab] Use context instead of mixed approach for managing contacts in Configure

Summary:
Right now we have a local state variable and local storage. Instead, we should use the available contactList from wallet context -- so there is only one source of truth here.

Ended up requiring a significant refactor. I added several integration tests to support. However some cases are still not tested (see test plan).

This is the kind of diff that really shows the negative fallout from rushing to add a feature. The contact list is a low impact feature. It was poorly implemented and now must be cleaned up to avoid deprecating it.

Test Plan:
npm test

Add a contact from savedWallet
Try to add it again, it won't add bc it exists

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Differential Revision: https://reviews.bitcoinabc.org/D15354

Details

Provenance
bytesofmanAuthored on Feb 1 2024, 00:48
bytesofmanPushed on Feb 10 2024, 12:57
Reviewer
Restricted Project
Differential Revision
D15354: [Cashtab] Use context instead of mixed approach for managing contacts in Configure
Parents
rABC5b3f957504d2: [chronik-client] Support for script endpoints
Branches
Unknown
Tags
Unknown