Page MenuHomePhabricator

[Cashtab] [BCH Deprecation] [Mnemonic] Pt 6/7 - Optimize bip39 bundle via webpack IgnorePlugin
ClosedPublic

Authored by emack on Nov 18 2022, 05:52.

Details

Summary

T2730

Depends on D12482

Stacked diff to localize existing uses of BCH.Mnemonic throughout the app and deprecate the BCH.Mnemonic object.

This diff uses webpack.IgnorePlugin to create a bip39 bundle that would only contain the english wordlists.

Pt 1/7 - Implement BCH.Mnemonic.toSeed locally
Pt 2/7 - Implement BCH.Mnemonic.generate locally
Pt 3/7 - Implement BCH.Mnemonic.wordLists locally
Pt 4/7 - Implement BCH.Mnemonic.validate locally
Pt 5/7 - Deprecate BCH.Mnemonic
Pt 6/7 - Optimize bip39 bundle via webpack IgnorePlugin
Pt 7/7 - Unwrap validateMnemonicWordList

Test Plan
  • npm test
  • npm start
  • insert a valid mnemonic into the Import Wallet field and ensure the english wordlist is displayed along with a 'bip39 wordlist is excluding japanese, spanish, italian, french, korean, czech, portuguese and chinese' console log message
  • comment out the webpack.IgnorePlugin config in webpack.config.js and observe that the console log message above for excluding non-english wordlists is not displayed

Diff Detail

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

Event Timeline

emack requested review of this revision.Nov 18 2022, 05:52

diff and test plan look good. However, I get cherry pick conflicts when I try to pull it down.

If I run

git checkout master
git pull
arc patch 12526

I get

 INFO  Base commit is not in local repository; trying to fetch.
Branch name arcpatch-D12526 already exists; trying a new name.
Created and checked out branch arcpatch-D12526_1.
Branch name arcpatch-D12450 already exists; trying a new name.
Created and checked out branch arcpatch-D12450_1.
Checking patch web/cashtab/src/hooks/useWallet.js...
Checking patch web/cashtab/package.json...
Checking patch web/cashtab/package-lock.json...
Applied patch web/cashtab/src/hooks/useWallet.js cleanly.
Applied patch web/cashtab/package.json cleanly.
Applied patch web/cashtab/package-lock.json cleanly.
 COMMITTED  Successfully committed patch.

 Cherry Pick Failed!
 Exception 
Command failed with error #1!
COMMAND
git cherry-pick -- arcpatch-D12450_1

STDOUT
Auto-merging web/cashtab/package-lock.json
Auto-merging web/cashtab/package.json
Auto-merging web/cashtab/src/hooks/useWallet.js
CONFLICT (content): Merge conflict in web/cashtab/src/hooks/useWallet.js


STDERR
error: could not apply 19797c594... [Cashtab] [BCH Deprecation] [Mnemonic] Pt 1/7 - Implement BCH.Mnemonic.toSeed locally
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

(Run with `--trace` for a full exception trace.)

This is most likely caused by useWallet.js changing in other diffs in between part 1 and part 7 of this diff being up.

This should correct the issue:

git checkout master
git pull
git checkout mnemonic
git rebase -i master

Then type 'edit' for each part.

At each part,

arc diff HEAD^, comment 'rebase', then git rebase --continue

This revision now requires changes to proceed.Nov 19 2022, 15:35
This revision is now accepted and ready to land.Nov 21 2022, 08:00