Page MenuHomePhabricator

[Cashtab] Deprecate parsing encrypted msgs in tx history
ClosedPublic

Authored by bytesofman on Jan 3 2024, 00:33.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCc7433e8fa25f: [Cashtab] Deprecate parsing encrypted msgs in tx history
Summary

Now that encrypted msg sending has been deprecated and disabled for over a month, stop parsing these txs in history. This allows us to remove 2 unused npm modules.

Test Plan

npm test, npm start and normal cashtab msgs render in tx history

Diff Detail

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

Event Timeline

Failed tests logs:

====== CashTab Unit Tests:  Wallet without BCH balance ======
Error: expect(received).toMatchSnapshot()

Snapshot name: `Wallet without BCH balance 1`

- Snapshot  - 7
+ Received  + 7

@@ -1,14 +1,14 @@
  Array [
    <div
-     className="sc-btzYZH jMTXaH"
+     className="sc-cmTdod gXOxSM"
    >
      <div
-       className="sc-kfGgVZ cdsuhv"
+       className="sc-hwwEjo jPkbkn"
      >
        <h4
-         className="sc-esjQYD ezHxVM"
+         className="sc-kPVwWT kNZAnC"
        >
          MigrationTestAlpha
        </h4>
        <a
          href="/configure"
@@ -46,14 +46,14 @@
            </span>
          </button>
        </div>
      </div>
      <div
-       className="sc-bYSBpT fkOMEu"
+       className="sc-btzYZH emKHAR"
      >
        <span
-         className="sc-iyvyFf dFHNeY"
+         className="sc-dfVpRl imfxmK"
        >
           
          0
           
          XEC
@@ -61,14 +61,14 @@
        </span>
      </div>
    </div>,
    <br />,
    <div
-     className="sc-cmTdod hmdHrJ"
+     className="sc-feJyhm lfjVYN"
    >
      <div
-       className="sc-ibxdXY wkYHn"
+       className="sc-kIPQKe izKukF"
      >
        <div />
        <span
          aria-label="party emoji"
          role="img"
    at Object.<anonymous> (/work/cashtab/src/components/Home/__tests__/Home.test.js:26:18)
    at Promise.then.completed (/work/cashtab/node_modules/jest-circus/build/utils.js:391:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/work/cashtab/node_modules/jest-circus/build/utils.js:316:10)
    at _callCircusTest (/work/cashtab/node_modules/jest-circus/build/run.js:218:40)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at _runTest (/work/cashtab/node_modules/jest-circus/build/run.js:155:3)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:66:9)
    at run (/work/cashtab/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:389:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:475:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)
====== CashTab Unit Tests:  Wallet with BCH balances ======
Error: expect(received).toMatchSnapshot()

Snapshot name: `Wallet with BCH balances 1`

- Snapshot  - 7
+ Received  + 7

@@ -1,14 +1,14 @@
  Array [
    <div
-     className="sc-btzYZH jMTXaH"
+     className="sc-cmTdod gXOxSM"
    >
      <div
-       className="sc-kfGgVZ cdsuhv"
+       className="sc-hwwEjo jPkbkn"
      >
        <h4
-         className="sc-esjQYD ezHxVM"
+         className="sc-kPVwWT kNZAnC"
        >
          MigrationTestAlpha
        </h4>
        <a
          href="/configure"
@@ -46,14 +46,14 @@
            </span>
          </button>
        </div>
      </div>
      <div
-       className="sc-bYSBpT fkOMEu"
+       className="sc-btzYZH emKHAR"
      >
        <span
-         className="sc-iyvyFf dFHNeY"
+         className="sc-dfVpRl imfxmK"
        >
           
          0
           
          XEC
@@ -61,14 +61,14 @@
        </span>
      </div>
    </div>,
    <br />,
    <div
-     className="sc-cmTdod hmdHrJ"
+     className="sc-feJyhm lfjVYN"
    >
      <div
-       className="sc-ibxdXY wkYHn"
+       className="sc-kIPQKe izKukF"
      >
        <div />
        <span
          aria-label="party emoji"
          role="img"
    at Object.<anonymous> (/work/cashtab/src/components/Home/__tests__/Home.test.js:40:18)
    at Promise.then.completed (/work/cashtab/node_modules/jest-circus/build/utils.js:391:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/work/cashtab/node_modules/jest-circus/build/utils.js:316:10)
    at _callCircusTest (/work/cashtab/node_modules/jest-circus/build/run.js:218:40)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at _runTest (/work/cashtab/node_modules/jest-circus/build/run.js:155:3)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:66:9)
    at run (/work/cashtab/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:389:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:475:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)
====== CashTab Unit Tests:  Wallet with BCH balances and tokens ======
Error: expect(received).toMatchSnapshot()

Snapshot name: `Wallet with BCH balances and tokens 1`

- Snapshot  - 7
+ Received  + 7

@@ -1,14 +1,14 @@
  Array [
    <div
-     className="sc-btzYZH jMTXaH"
+     className="sc-cmTdod gXOxSM"
    >
      <div
-       className="sc-kfGgVZ cdsuhv"
+       className="sc-hwwEjo jPkbkn"
      >
        <h4
-         className="sc-esjQYD ezHxVM"
+         className="sc-kPVwWT kNZAnC"
        >
          MigrationTestAlpha
        </h4>
        <a
          href="/configure"
@@ -46,14 +46,14 @@
            </span>
          </button>
        </div>
      </div>
      <div
-       className="sc-bYSBpT fkOMEu"
+       className="sc-btzYZH emKHAR"
      >
        <span
-         className="sc-iyvyFf dFHNeY"
+         className="sc-dfVpRl imfxmK"
        >
           
          0
           
          XEC
@@ -61,14 +61,14 @@
        </span>
      </div>
    </div>,
    <br />,
    <div
-     className="sc-cmTdod hmdHrJ"
+     className="sc-feJyhm lfjVYN"
    >
      <div
-       className="sc-ibxdXY wkYHn"
+       className="sc-kIPQKe izKukF"
      >
        <div />
        <span
          aria-label="party emoji"
          role="img"
    at Object.<anonymous> (/work/cashtab/src/components/Home/__tests__/Home.test.js:54:18)
    at Promise.then.completed (/work/cashtab/node_modules/jest-circus/build/utils.js:391:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/work/cashtab/node_modules/jest-circus/build/utils.js:316:10)
    at _callCircusTest (/work/cashtab/node_modules/jest-circus/build/run.js:218:40)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at _runTest (/work/cashtab/node_modules/jest-circus/build/run.js:155:3)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:66:9)
    at run (/work/cashtab/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:389:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:475:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)
====== CashTab Unit Tests:  Wallet with BCH balances and tokens and state field ======
Error: expect(received).toMatchSnapshot()

Snapshot name: `Wallet with BCH balances and tokens and state field 1`

- Snapshot  - 7
+ Received  + 7

@@ -1,14 +1,14 @@
  Array [
    <div
-     className="sc-btzYZH jMTXaH"
+     className="sc-cmTdod gXOxSM"
    >
      <div
-       className="sc-kfGgVZ cdsuhv"
+       className="sc-hwwEjo jPkbkn"
      >
        <h4
-         className="sc-esjQYD ezHxVM"
+         className="sc-kPVwWT kNZAnC"
        >
          MigrationTestAlpha
        </h4>
        <a
          href="/configure"
@@ -46,14 +46,14 @@
            </span>
          </button>
        </div>
      </div>
      <div
-       className="sc-bYSBpT fkOMEu"
+       className="sc-btzYZH emKHAR"
      >
        <span
-         className="sc-iyvyFf dFHNeY"
+         className="sc-dfVpRl imfxmK"
        >
           
          0.06
           
          XEC
@@ -61,14 +61,14 @@
        </span>
      </div>
    </div>,
    <br />,
    <div
-     className="sc-cmTdod hmdHrJ"
+     className="sc-feJyhm lfjVYN"
    >
      <div
-       className="sc-ibxdXY wkYHn"
+       className="sc-kIPQKe izKukF"
      >
        <div />
        <span
          aria-label="party emoji"
          role="img"
    at Object.<anonymous> (/work/cashtab/src/components/Home/__tests__/Home.test.js:70:18)
    at Promise.then.completed (/work/cashtab/node_modules/jest-circus/build/utils.js:391:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/work/cashtab/node_modules/jest-circus/build/utils.js:316:10)
    at _callCircusTest (/work/cashtab/node_modules/jest-circus/build/run.js:218:40)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at _runTest (/work/cashtab/node_modules/jest-circus/build/run.js:155:3)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:66:9)
    at run (/work/cashtab/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:389:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:475:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)

Each failure log is accessible here:
CashTab Unit Tests: Wallet without BCH balance
CashTab Unit Tests: Wallet with BCH balances
CashTab Unit Tests: Wallet with BCH balances and tokens
CashTab Unit Tests: Wallet with BCH balances and tokens and state field

remove deprecated tx history key

bytesofman published this revision for review.Jan 3 2024, 04:32
Fabien requested changes to this revision.Jan 3 2024, 08:53
Fabien added a subscriber: Fabien.

Not sure if it's intentional or not but this diff does more than what the title and summary tell

cashtab/src/utils/__tests__/transactions.test.js
25 ↗(On Diff #43835)

Why is this case removed ?

81 ↗(On Diff #43835)

Same question

193 ↗(On Diff #43835)

Same

250 ↗(On Diff #43835)

Same

cashtab/src/utils/transactions.js
434 ↗(On Diff #43835)

I think that's the issue, this diff does more than what is stated (not only the encryption part of the code is removed)

This revision now requires changes to proceed.Jan 3 2024, 08:53
bytesofman marked 4 inline comments as done.
bytesofman added inline comments.
cashtab/src/utils/__tests__/transactions.test.js
25 ↗(On Diff #43835)

This is testing the legacy sendXec function which is no longer used -- the new sendXec function is tested in transactions/

81 ↗(On Diff #43835)

same

193 ↗(On Diff #43835)

ditto

250 ↗(On Diff #43835)

ditto

bytesofman marked 5 inline comments as done.
bytesofman added inline comments.
cashtab/src/utils/transactions.js
434 ↗(On Diff #43835)

could be split up -- was not my plan to take this out when I started the diff, but realized it was the last holdout of ecies-lite

...I'll back out this removal and do it separately.

bytesofman marked an inline comment as done.

rebase

This revision is now accepted and ready to land.Jan 4 2024, 09:34

rebase error patch (remove deprecated dependency)