Page MenuHomePhabricator

[Cashtab] [p6 and final of normalizeBalance improvements] Remove double definition of this function in useWallet
ClosedPublic

Authored by bytesofman on Aug 11 2022, 23:59.

Details

Summary

T2601

Depends on D11847

Remove the normalizeBalance function from useWallet.js, as it is already defined and unit tested in CashMethods.js. Adjust the input to be the needed nonSlpUtxos array and not its parent slpBalancesAndUtxos object

Test Plan

npm start and make sure your wallet has the same balance as before, works normally.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
fix-normalizeBalance
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19806
Build 39326: Build Diffcashtab-tests
Build 39325: arc lint + arc unit

Event Timeline

Tail of the build log:

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.4.3',
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.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 source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated text-encoding@0.6.4: no longer maintained
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
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 1810 packages, and audited 1811 packages in 27s

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

22 vulnerabilities (10 moderate, 11 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

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

Some issues need review, and may require choosing
a different dependency.

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

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

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

src/hooks/useWallet.js
  Line 7:5:  'fromSmallestDenomination' 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

Remove now-unused import function from cashMethods

emack added a subscriber: emack.

pre and post patch balances match all ok

This revision is now accepted and ready to land.Aug 12 2022, 06:39