Page MenuHomePhabricator

[Cashtab] [chronik tx history p11] Update incoming tx notifications parsing to use new function
ClosedPublic

Authored by bytesofman on Oct 3 2022, 23:46.

Details

Summary

T2447

Depends on D12130

The parseChronikTx function was originally used only to parse incoming websocket txs for incoming tx notifications. This used a legacy way of getting token info.

Modify this implementation to use the now existing cashtabCache object.

Test Plan

Review changes to unit tests and npm test
npm start
Receive an etoken tx of an etoken already in your cache, observe notification is correct
Receive an etoken tx of an etoken not in your cache, observe notification is correct and cashtabCache is updated in local storage

Diff Detail

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

Event Timeline

The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.

Tail of the build log:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-place@7.0.5',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-preset-env@7.8.2',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-pseudo-class-any-link@7.1.6',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-selector-not@6.0.1',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated text-encoding@0.6.4: no longer maintained
npm WARN deprecated ts-custom-error@2.2.2: npm package tarball contains useless codeclimate-reporter binary, please update to version 3.1.1. See https://github.com/adriengibrat/ts-custom-error/issues/32

> cashtab@1.0.0 prepare
> cd ../.. && husky install web/cashtab/.husky

husky - Git hooks installed

added 1807 packages, and audited 1808 packages in 29s

232 packages are looking for funding
  run `npm fund` for details

5 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm notice 
npm notice New major version of npm available! 7.7.6 -> 8.19.2
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.19.2>
npm notice Run `npm install -g npm@8.19.2` to update!
npm notice 

> cashtab@1.0.0 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

[eslint] 
src/hooks/useWallet.js
  Line 11:5:  'checkWalletForTokenInfo' is defined but never used  no-unused-vars

Search for the keywords to learn more about each error.


Build cashtab-tests failed with exit code 1
emack requested changes to this revision.Oct 5 2022, 09:20
emack added a subscriber: emack.

everything else looks good

web/cashtab/src/hooks/useWallet.js
882 ↗(On Diff #35408)

just noticed this call is not wrapped in a try...catch() block. Needs to catch exceptions from chronik.tx in case txid is not found or there's an api response error, and prevent it from progressing further down into parseChronikTx().

This revision now requires changes to proceed.Oct 5 2022, 09:20

responding to review feedback

This revision is now accepted and ready to land.Oct 5 2022, 23:11