Page MenuHomePhabricator

[Cashtab] Improve isValidStoredWallet validation
ClosedPublic

Authored by emack on Jul 2 2023, 01:53.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC890a4217c28f: [Cashtab] Improve isValidStoredWallet validation
Summary

As per feedback from D14186, updating isValidStoredWallet validation logic to also check for name, mnemonic, Path245, Path145 and Path1899 keys in the wallet object.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emack requested review of this revision.Jul 2 2023, 01:53
bytesofman requested changes to this revision.Jul 2 2023, 03:24
bytesofman added inline comments.
cashtab/src/utils/cashMethods.js
1075 ↗(On Diff #41172)

Add a unit test that shows isValidStoredWallet is false for a wallet missing one of these newly added checked fields, i.e. name or mnemonic or both

This revision now requires changes to proceed.Jul 2 2023, 03:24
emack marked an inline comment as done.

Updated unit tests

Failed tests logs:

====== CashTab Unit Tests:  Verify processChronikWsMsg() processes AddedToMempool events ======
assert.notEqual(received, expected)

Expected value to not be equal to:
  null
Received:
  null

Difference:

Compared values have no visual difference.
    at Object.<anonymous> (/work/cashtab/src/hooks/__tests__/useWallet.test.js:42:12)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Each failure log is accessible here:
CashTab Unit Tests: Verify processChronikWsMsg() processes AddedToMempool events

bytesofman requested changes to this revision.Jul 2 2023, 12:58

Failed tests logs:

====== CashTab Unit Tests:  Verify processChronikWsMsg() processes AddedToMempool events ======
assert.notEqual(received, expected)

Expected value to not be equal to:
  null
Received:
  null

Difference:

Compared values have no visual difference.
    at Object.<anonymous> (/work/cashtab/src/hooks/__tests__/useWallet.test.js:42:12)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Each failure log is accessible here:
CashTab Unit Tests: Verify processChronikWsMsg() processes AddedToMempool events

mb a rebase issue?

This revision now requires changes to proceed.Jul 2 2023, 12:58

mb a rebase issue?

Will re-run once D14192 finishes building

Failed tests logs:

====== CashTab Unit Tests:  Verify processChronikWsMsg() processes AddedToMempool events ======
assert.notEqual(received, expected)

Expected value to not be equal to:
  null
Received:
  null

Difference:

Compared values have no visual difference.
    at Object.<anonymous> (/work/cashtab/src/hooks/__tests__/useWallet.test.js:42:12)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Each failure log is accessible here:
CashTab Unit Tests: Verify processChronikWsMsg() processes AddedToMempool events

This revision is now accepted and ready to land.Jul 2 2023, 13:54