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

refactor: use react-native-quick-crypto #5865

Merged
merged 5 commits into from
Sep 2, 2024

Conversation

jeanregisser
Copy link
Member

@jeanregisser jeanregisser commented Aug 30, 2024

Description

Use https://github.com/margelo/react-native-quick-crypto to provide fast and secure crypto operations.

Note: We'll be able to gradually remove the following libs which are now redundant:

  • react-native-bip39
  • react-native-fast-crypto
  • react-native-securerandom
  • node-libs-react-native and its own native deps (once ContractKit is removed)
  • react-native-crypto
  • react-native-randombytes

Test plan

  • Tests pass
  • Manually
    • confirmed mnemonic generation and key derivation is as fast as before and uses the native implementation from the new library, on both iOS and Android
    • importing some existing mnemonics works as before

Related issues

Backwards compatibility

Yes

Network scalability

If a new NetworkId and/or Network are added in the future, the changes in this PR will:

  • Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)

@jeanregisser jeanregisser force-pushed the jeanregisser/copy-latest-cryptographic-utils branch from eb928e1 to 161cfee Compare August 30, 2024 10:54
@jeanregisser jeanregisser force-pushed the jeanregisser/use-rn-quick-crypto branch from c29b513 to 3ffb507 Compare August 30, 2024 10:59
Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 89.18919% with 4 lines in your changes missing coverage. Please review.

Project coverage is 87.63%. Comparing base (7ec0e15) to head (4290d87).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/utils/account.ts 89.65% 3 Missing ⚠️
src/web3/saga.ts 83.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5865      +/-   ##
==========================================
- Coverage   87.64%   87.63%   -0.01%     
==========================================
  Files         739      739              
  Lines       31837    31846       +9     
  Branches     5397     5702     +305     
==========================================
+ Hits        27902    27907       +5     
+ Misses       3891     3716     -175     
- Partials       44      223     +179     
Files with missing lines Coverage Δ
src/backup/utils.ts 92.75% <100.00%> (-0.11%) ⬇️
src/import/saga.ts 84.03% <100.00%> (-0.14%) ⬇️
src/web3/saga.ts 76.51% <83.33%> (-0.18%) ⬇️
src/utils/account.ts 90.95% <89.65%> (-1.03%) ⬇️

... and 74 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

Copy link
Contributor

@bakoushin bakoushin left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Contributor

@jophish jophish left a comment

Choose a reason for hiding this comment

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

🎉

@jeanregisser jeanregisser force-pushed the jeanregisser/copy-latest-cryptographic-utils branch from 161cfee to 8d7860f Compare September 2, 2024 09:49
Base automatically changed from jeanregisser/copy-latest-cryptographic-utils to main September 2, 2024 10:30
@jeanregisser jeanregisser force-pushed the jeanregisser/use-rn-quick-crypto branch from 3ffb507 to 4290d87 Compare September 2, 2024 10:33
@jeanregisser jeanregisser added this pull request to the merge queue Sep 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 2, 2024
@jeanregisser jeanregisser added this pull request to the merge queue Sep 2, 2024
Merged via the queue into main with commit ce07828 Sep 2, 2024
15 checks passed
@jeanregisser jeanregisser deleted the jeanregisser/use-rn-quick-crypto branch September 2, 2024 12:00
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.

3 participants