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: copy account module from @celo/cryptographic-utils@3.2.0 #5861

Merged
merged 7 commits into from
Sep 2, 2024

Conversation

jeanregisser
Copy link
Member

Description

This is the first step to remove @celo/cryptographic-utils.

It copies the accounts module from it.

I've copied the exact same version used from the celo SDK: 3.2.0.
And listed the exact same NPM packages it was using internally.
This is to ensure it behaves the same.
We'll upgrade/remove these in a follow up PR.

I've slightly modified it to directly include some sub modules, which we didn't need to share.

  • @celo/base/lib/account (some type definitions)
  • @celo/base/lib/string (only 1 function used)

Test plan

  • Tests pass

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 changed the title chore: copy account features from @celo/cryptographic-utils@3.2.0 chore: copy account module from @celo/cryptographic-utils@3.2.0 Aug 29, 2024
Copy link

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 90.86758% with 20 lines in your changes missing coverage. Please review.

Project coverage is 87.63%. Comparing base (d5a8a8d) to head (04611dd).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/utils/account.ts 90.52% 20 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5861      +/-   ##
==========================================
+ Coverage   87.61%   87.63%   +0.01%     
==========================================
  Files         738      739       +1     
  Lines       31650    31861     +211     
  Branches     5637     5710      +73     
==========================================
+ Hits        27730    27921     +191     
- Misses       3697     3896     +199     
+ Partials      223       44     -179     
Files with missing lines Coverage Δ
src/backup/utils.ts 92.85% <100.00%> (ø)
src/import/ImportWallet.tsx 83.89% <100.00%> (ø)
src/import/saga.ts 84.16% <100.00%> (ø)
src/web3/saga.ts 76.69% <100.00%> (ø)
src/utils/account.ts 90.52% <90.52%> (ø)

... and 72 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 d5a8a8d...04611dd. Read the comment docs.

@jeanregisser jeanregisser force-pushed the jeanregisser/copy-cryptographic-utils branch from 97273d0 to d34bdb8 Compare August 29, 2024 14:44
@jeanregisser jeanregisser changed the title chore: copy account module from @celo/cryptographic-utils@3.2.0 refactor: copy account module from @celo/cryptographic-utils@3.2.0 Aug 29, 2024
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.

LGTM, assuming that the contents of account.ts and account.test.ts are basically copied verbatim (which, from a brief comparison to the originals, it looks like they are).

@@ -0,0 +1,495 @@
// Initially copied from https://github.com/celo-org/celo-monorepo/blob/sdks-3.2.0/packages/sdk/cryptographic-utils/src/account.ts
Copy link
Contributor

Choose a reason for hiding this comment

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

Is any part of this file meaningfully modified from the original? What of this ought to be reviewed, if any?

Copy link
Member Author

@jeanregisser jeanregisser Sep 2, 2024

Choose a reason for hiding this comment

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

Nothing was changed except some imports.
I did that in several steps: first step was 1:1 copy
Then small edits were made in d845d3b

@jeanregisser jeanregisser added this pull request to the merge queue Sep 2, 2024
Merged via the queue into main with commit 4a7bef8 Sep 2, 2024
15 checks passed
@jeanregisser jeanregisser deleted the jeanregisser/copy-cryptographic-utils branch September 2, 2024 08:38
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.

2 participants