Page MenuHomePhabricator

[Cashtab] [Simplify wallet structure p4] Remove parent artifact object slpBalancesAndUtxos
ClosedPublic

Authored by bytesofman on Nov 25 2022, 12:32.

Details

Summary

T2663

Depends on D12593

Remove parent object slpBalancesAndUtxos from wallet structure

Note: this means that this wallet structure should not longer be supported by any functions in Cashtab...with the exceptions of isValidStoredWallet (because stored wallets may be in the old format) and loadStoredWallet (for the same reason)

Hence, this diff modifies mocks in existing unit tests.

Test Plan

Review unit test mock changes and npm test
npm start
Wait to see dev console msg that active wallet has been updated. Confirm by reviewing local storage.
Change wallets. Wait to see dev console msg that active wallet has been updated. Confirm by reviewing local storage.
Switch back to original wallet. Confirm both used wallets are stored correctly in local storage.
Send an XEC tx
Create a token
Burn a token
Send an eToken tx

Diff Detail

Event Timeline

This revision is now accepted and ready to land.Nov 26 2022, 08:16

Failed tests logs:

====== CashTab Unit Tests: useBCH hook Throws error attempting to burn an eToken ID that is not within the wallet's utxo ======
Error: expect(received).toStrictEqual(expected) // deep equality

Expected: [Error: No token UTXOs for the specified token could be found.]
Received: [TypeError: Cannot destructure property 'tokenId' of 'undefined' as it is undefined.]
    at Object.<anonymous> (/work/web/cashtab/src/hooks/__tests__/useBCH.test.js:211:29)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)

Each failure log is accessible here:
CashTab Unit Tests: useBCH hook Throws error attempting to burn an eToken ID that is not within the wallet's utxo

Patching merge conflict error