Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/FAT-13 Sync Onboarding logic #346

Merged
merged 4 commits into from
Jun 30, 2022

Conversation

alexandremgo
Copy link
Contributor

📝 Description

3 features in live-common:

  • Function to extract the device onboarding state from byte flags
  • Polling mechanism to retrieve the device onboarding state
  • Make the polling mechanism available as a react hook for LLM and LLD

❓ Context

  • Impacted projects: live-common
  • Linked resource(s): FAT-13

✅ Checklist

  • Test coverage : unit tested + QA tested the logic through this POC
  • Atomic delivery
  • No breaking changes : only new features, not updating former features

📸 Demo

Videos have been posted on Slack from this POC

🚀 Expectations to reach

Please make sure you follow these Important Steps.

Pull Requests must pass the CI and be internally validated in order to be merged.

@vercel
Copy link

vercel bot commented Jun 14, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
live-common-tools ✅ Ready (Inspect) Visit Preview Jun 30, 2022 at 8:05AM (UTC)
3 Ignored Deployments
Name Status Preview Updated
ledger-live-github-bot ⬜️ Ignored (Inspect) Jun 30, 2022 at 8:05AM (UTC)
native-ui-storybook ⬜️ Ignored (Inspect) Jun 30, 2022 at 8:05AM (UTC)
react-ui-storybook ⬜️ Ignored (Inspect) Jun 30, 2022 at 8:05AM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Jun 14, 2022

🦋 Changeset detected

Latest commit: 60fb9ef

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@ledgerhq/live-common Minor
@ledgerhq/live-cli Patch
ledger-live-desktop Patch
live-mobile Patch
live-common-tools Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added common Has changes in live-common ledgerjs Has changes in the ledgerjs open source libs labels Jun 14, 2022
@codecov
Copy link

codecov bot commented Jun 14, 2022

Codecov Report

Merging #346 (1e51dda) into develop (cb1a6fb) will decrease coverage by 16.63%.
The diff coverage is 92.56%.

❗ Current head 1e51dda differs from pull request most recent head 60fb9ef. Consider uploading reports for the commit 60fb9ef to get more accurate results

@@             Coverage Diff              @@
##           develop     #346       +/-   ##
============================================
- Coverage    64.18%   47.54%   -16.64%     
============================================
  Files          638      592       -46     
  Lines        28915    26346     -2569     
  Branches      7262     6751      -511     
============================================
- Hits         18558    12527     -6031     
- Misses       10287    13767     +3480     
+ Partials        70       52       -18     
Flag Coverage Δ
bot ?
test 47.54% <92.56%> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
.../src/onboarding/hooks/useOnboardingStatePolling.ts 89.28% <89.28%> (ø)
...er-live-common/src/hw/getOnboardingStatePolling.ts 92.72% <92.72%> (ø)
...edger-live-common/src/hw/extractOnboardingState.ts 94.11% <94.11%> (ø)
libs/ledger-live-common/src/types/manager.ts 100.00% <100.00%> (ø)
...e-common/src/families/cosmos/js-synchronisation.ts 9.00% <0.00%> (-84.69%) ⬇️
...dger-live-common/src/families/solana/api/queued.ts 16.66% <0.00%> (-83.34%) ⬇️
...bitcoin/wallet-btc/pickingstrategies/CoinSelect.ts 8.79% <0.00%> (-82.42%) ⬇️
...-common/src/families/bitcoin/js-synchronisation.ts 13.14% <0.00%> (-81.72%) ⬇️
...-common/src/families/solana/validator-app/index.ts 18.51% <0.00%> (-81.49%) ⬇️
.../bitcoin/wallet-btc/pickingstrategies/DeepFirst.ts 17.94% <0.00%> (-79.49%) ⬇️
... and 264 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb1a6fb...60fb9ef. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Jun 14, 2022

@alexandremgo

Screenshots: ✅

There are no changes in the screenshots for this PR. If this is expected, you are good to go.

Copy link
Contributor

@juan-cortes juan-cortes left a comment

Choose a reason for hiding this comment

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

lgtm, the only thing I would change is starting from hex strings instead of byte arrays for the tests, like the actual apdu returned from a device in that case. But I guess it's the same thing

@alexandremgo
Copy link
Contributor Author

lgtm, the only thing I would change is starting from hex strings instead of byte arrays for the tests, like the actual apdu returned from a device in that case. But I guess it's the same thing

I think to do this, we should unit test getVersion <- it's this function that handles the raw hex string
Otherwise, it would become an integration or end-to-end test 🤓 (which could be interesting to implement, i still haven't look on our we set up the e2e tests with the bots)

@alexandremgo alexandremgo force-pushed the feat/FAT-13-sync-onboarding-logic branch from 76b0358 to 60fb9ef Compare June 30, 2022 08:03
@alexandremgo alexandremgo merged commit f26fa16 into develop Jun 30, 2022
@alexandremgo alexandremgo deleted the feat/FAT-13-sync-onboarding-logic branch June 30, 2022 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli common Has changes in live-common feature ready ledgerjs Has changes in the ledgerjs open source libs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants