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 Contract Layout #319

Merged
merged 1 commit into from
Mar 18, 2024
Merged

Refactor Contract Layout #319

merged 1 commit into from
Mar 18, 2024

Conversation

nlordell
Copy link
Collaborator

This PR changes the contract layout in the passkey package, as well as some small renames. It also changes constants to be used as library-ies instead of contracts that are inherited (to be more consistent, as both were used previously).

There are almost no logic changes, some notable examples that came with the refactor:

  1. Since SignatureData needed to be shared by the WebAuthnSigner and WebAuthnSignerFactory, I created a WebAuthnSignature library that declares the stuck and includes the casting logic. This lead to some small changes in the WebAuthnSignerFactory notably to work around some "stack too deep" error that didn't happen before.
  2. The WebAuthnConstants is now WebAuthnFlags and I removed the AUTH_DATA_FLAGS_BE and AUTH_DATA_FLAGS_BS because they aren't actual flags 🤷. Don't know how they got there, but the bits in those flags are officially reserved for future use. I also didn't bother adding the AT and ET flags, since those can't really be verified on-chain anyway and not really relevant from a signature verification perspective (they indicate what additional data is available in the authenticator data blob, but we don't make use of it anyway).

@nlordell nlordell requested a review from a team as a code owner March 11, 2024 16:04
@nlordell nlordell requested review from akshay-ap, mmv08 and remedcu and removed request for a team March 11, 2024 16:04
Copy link
Member

@akshay-ap akshay-ap left a comment

Choose a reason for hiding this comment

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

lgtm

Base automatically changed from chore/refactor-monorepo-3 to main March 18, 2024 14:28
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8328356680

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+62.4%) to 76.923%

Totals Coverage Status
Change from base Build 8328333224: 62.4%
Covered Lines: 131
Relevant Lines: 155

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8328356687

Details

  • 1 of 24 (4.17%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 14.474%

Changes Missing Coverage Covered Lines Changed/Added Lines %
modules/passkey/contracts/WebAuthnSigner.sol 0 1 0.0%
modules/passkey/contracts/libraries/WebAuthnSignature.sol 0 1 0.0%
modules/passkey/contracts/4337/Safe256BitECSignerLaunchpad.sol 0 2 0.0%
modules/passkey/contracts/base/SignatureValidator.sol 0 2 0.0%
modules/passkey/contracts/verifiers/WebAuthnVerifier.sol 0 2 0.0%
modules/passkey/contracts/WebAuthnSignerFactory.sol 0 15 0.0%
Totals Coverage Status
Change from base Build 8328333224: 0.0%
Covered Lines: 17
Relevant Lines: 108

💛 - Coveralls

@nlordell nlordell merged commit 4ad1f0c into main Mar 18, 2024
14 checks passed
@nlordell nlordell deleted the chore/refactor-monorepo-4 branch March 18, 2024 14:34
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants