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

✨ Helper functions related to verifyMessage util fn #119

Merged
merged 20 commits into from
May 15, 2022

Conversation

arimgibson
Copy link
Contributor

@arimgibson arimgibson commented May 5, 2022

UPDATE: this PR was originally intended to close #26. However, because of complex issues with the cryptography, #26 will be put into the Icebox section of the Main Issues project to be tackled at a later date. This PR now contains some of the key helper functions created for use in the verifyMessage utility function.

Additional Tasks

  • Revisit and build out tests for mentioned helper functions
  • Revisit and ensure proper documentation for mentioned helper functions
    (I was trying to breeze through those tedious helper functions but cut some corners along the way, want to go back and make sure that my tests are thorough and cover a variety of cases & types before this PR is merged)

arimgibson and others added 2 commits May 5, 2022 00:01
* Added hashMessage to exports

* ✨ Added splitSignature util fn
* Added hashMessage to exports

* ✨ Added splitSignature util fn

* make gas price less flakey

* ✨ Added `computeAddress` util fn (#116)

* Added initial computeAddress fn, relies on ethers at the moment

* Init computePublicKey util fn

* ✨ Added computePublicKey util fn

* 📝 Added documenation to computePublicKey

* ⬆ Pre-commit hook package bump, added @noble/secp256k1

* ✨ Added `computePublicKey` util fn (#118)

* Init computePublicKey util fn

* ✨ Added computePublicKey util fn

* 📝 Added documenation to computePublicKey

* ⬆ Pre-commit hook package bump, added @noble/secp256k1

* 🧪 Pass computeAddress test

* 📝 Add docs for computeAddress

* 📝 Pre-commit script update readme and chains

* 🧪 Pass tests with recoverPublicKey

* 📝 Pre-commit script readme update

Co-authored-by: daws.eth <dawsonbotsford@gmail.com>
@arimgibson arimgibson self-assigned this May 5, 2022
@vercel
Copy link

vercel bot commented May 5, 2022

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

Name Status Preview Updated
essential-eth ✅ Ready (Inspect) Visit Preview May 15, 2022 at 11:02PM (UTC)

@arimgibson arimgibson changed the title ✨ Added verifyMessage util fn ✨ Helper functions related to verifyMessage util fn May 6, 2022
@codecov
Copy link

codecov bot commented May 6, 2022

Codecov Report

Merging #119 (1629d27) into master (a95999c) will decrease coverage by 5.44%.
The diff coverage is 46.29%.

@@            Coverage Diff             @@
##           master     #119      +/-   ##
==========================================
- Coverage   91.02%   85.58%   -5.45%     
==========================================
  Files          34       37       +3     
  Lines         780      888     +108     
  Branches      220      258      +38     
==========================================
+ Hits          710      760      +50     
- Misses         64      113      +49     
- Partials        6       15       +9     
Impacted Files Coverage Δ
src/providers/utils/chains-info.ts 100.00% <ø> (ø)
src/utils/split-signature.ts 31.76% <31.76%> (ø)
src/index.ts 100.00% <100.00%> (ø)
src/utils/compute-address.ts 100.00% <100.00%> (ø)
src/utils/compute-public-key.ts 100.00% <100.00%> (ø)

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 a95999c...1629d27. Read the comment docs.

@arimgibson arimgibson marked this pull request as ready for review May 6, 2022 23:26
@arimgibson arimgibson requested a review from dawsbot May 6, 2022 23:27
@arimgibson
Copy link
Contributor Author

@dawsbot not sure if you saw but I requested you as a reviewer for this PR. I believe it should be ready to merge after you take a peek. The Codecov is bad because of the split-signature function that was copied in directly from ethers, I can add tests for that in a separate PR just so this one isn't held up from being merged

src/utils/compute-address.ts Outdated Show resolved Hide resolved
src/utils/split-signature.ts Show resolved Hide resolved
src/utils/split-signature.ts Show resolved Hide resolved
src/utils/split-signature.ts Show resolved Hide resolved
src/utils/tests/compute-public-key.test.ts Show resolved Hide resolved
@dawsbot dawsbot merged commit 42034bb into master May 15, 2022
@dawsbot dawsbot deleted the feature/verifyMessage branch May 15, 2022 23:05
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 fn verifyMessage
2 participants