Skip to content

Derive multiple accounts from mnemonic#983

Merged
buberdds merged 1 commit intomasterfrom
buberdds/multi
Sep 9, 2022
Merged

Derive multiple accounts from mnemonic#983
buberdds merged 1 commit intomasterfrom
buberdds/multi

Conversation

@buberdds
Copy link
Copy Markdown
Contributor

@buberdds buberdds commented Sep 6, 2022

Closes #82

Most of this stuff was extracted or moved from "ledger". FromLedgerModal is now called MultiAccountsSelectionModal, redux part was renamed as well as it's not longer bound to ledger.

Screenshot 2022-09-06 at 14 55 46

Screenshot 2022-09-06 at 14 56 35

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 6, 2022

MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 29 0 0.06s
✅ GIT git_diff yes no 0.01s
✅ JSON eslint-plugin-jsonc 1 0 0 1.21s
✅ JSON jsonlint 1 0 0.32s
✅ JSON prettier 1 0 0 0.71s
✅ JSON v8r 1 0 1.57s
✅ TSX eslint 9 0 0 8.85s
✅ TYPESCRIPT eslint 17 0 0 6.71s

See errors details in artifact MegaLinter reports on CI Job page
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

@buberdds buberdds force-pushed the buberdds/multi branch 2 times, most recently from 23d7238 to caa05cf Compare September 6, 2022 13:30
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 6, 2022

Codecov Report

Merging #983 (ef162b9) into master (73f13ff) will increase coverage by 0.49%.
The diff coverage is 83.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #983      +/-   ##
==========================================
+ Coverage   88.20%   88.69%   +0.49%     
==========================================
  Files          99      100       +1     
  Lines        1713     1752      +39     
  Branches      396      405       +9     
==========================================
+ Hits         1511     1554      +43     
+ Misses        202      198       -4     
Flag Coverage Δ
cypress 60.21% <70.53%> (+2.61%) ⬆️
jest 79.64% <80.35%> (+0.52%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ponents/Toolbar/Features/AccountSelector/index.tsx 100.00% <ø> (ø)
src/app/state/transaction/saga.ts 74.74% <ø> (ø)
src/store/reducers.ts 100.00% <ø> (ø)
src/app/state/wallet/index.ts 72.72% <50.00%> (ø)
...pages/OpenWalletPage/Features/FromLedger/index.tsx 54.54% <57.14%> (-13.88%) ⬇️
src/app/pages/CreateWalletPage/index.tsx 86.84% <66.66%> (-4.07%) ⬇️
src/app/state/importaccounts/index.ts 73.07% <66.66%> (ø)
...ges/OpenWalletPage/Features/FromMnemonic/index.tsx 80.00% <75.00%> (-20.00%) ⬇️
src/app/state/importaccounts/saga.ts 91.80% <83.33%> (ø)
...ge/Features/ImportAccountsSelectionModal/index.tsx 96.42% <96.42%> (ø)
... and 7 more

@buberdds buberdds requested a review from lukaw3d September 6, 2022 13:39
@buberdds buberdds force-pushed the buberdds/multi branch 2 times, most recently from 794851b to 2372443 Compare September 6, 2022 14:14
Comment thread src/app/pages/OpenWalletPage/Features/MultiAccountsSelectionModal/index.tsx Outdated
Comment thread src/app/lib/ledger.ts Outdated
Comment thread src/app/pages/OpenWalletPage/Features/MultiAccountsSelectionModal/index.tsx Outdated
Comment thread src/app/pages/CreateWalletPage/index.tsx Outdated
Comment thread src/types/RootState.ts Outdated
Comment thread src/app/state/multiaccounts/index.ts Outdated
@buberdds buberdds changed the title MultiAccounts feature Derive multiple accounts from mnemonic Sep 7, 2022
@buberdds buberdds requested a review from lukaw3d September 8, 2022 07:24
Copy link
Copy Markdown
Contributor

@lukaw3d lukaw3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Just split the first commit and combine some others

@buberdds buberdds merged commit 0f5b5e0 into master Sep 9, 2022
@buberdds buberdds deleted the buberdds/multi branch September 9, 2022 08:39

import { transactionActions } from '.'
import { sign } from '../ledger/saga'
import { sign } from '../importaccounts/saga'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice before, this ledger-specific sign function is now oddly named / oddly placed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, should sign and getUSBTransport generator functions be moved to app/lib/ledger.ts ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

maybe also have fewer ledger sign functions?

  • sign from ../importaccounts/saga calls
  • OasisTransaction.signUsingLedger calls
  • LedgerSigner.sign calls
  • OasisApp.sign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ability to open additional accounts for the same wallet / mnemonic

2 participants