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/refactor, fix build, lint issues and tests. #40

Merged
merged 1,691 commits into from
Sep 24, 2024

Conversation

VGabriel45
Copy link
Collaborator

@VGabriel45 VGabriel45 commented Sep 24, 2024

PR-Codex overview

This PR focuses on refactoring the codebase to replace instances of holder with signer, improving type definitions, and enhancing the functionality of modules related to account management and validation. Additionally, it updates tests to reflect these changes.

Detailed summary

  • Updated CHANGELOG.md for version 0.0.0.
  • Added @rhinestone/module-sdk dependency in package.json.
  • Replaced holder with signer in various files, including:
    • src/sdk/account/utils/index.ts
    • src/sdk/clients/createNexusClient.ts
    • src/sdk/modules/base/BaseModule.ts
    • Test files and decorators.
  • Adjusted function signatures to use signer instead of holder.
  • Enhanced module creation and validation logic.
  • Updated tests to ensure compatibility with the new signer implementation.
  • Added new utility functions for better handling of modules.
  • Updated src/sdk/account/toNexusAccount.ts to use signer in parameters.

The following files were skipped due to too many changes: src/sdk/modules/validators/OwnableValidator.ts

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

GabiDev45 and others added 30 commits January 18, 2024 17:58
Paymaster check and setup logic on SDK (SPONSORED | ERC20).
Chore(SMA-547): Chore: Move common code into common package
* Update README.md
* Add paymasterAndData validation in e2e tests

* Use config values instead of hardcoded in tests

---------

Co-authored-by: GabiDev <[email protected]>
* Resolved SMA-549

lint:fix

log

* continued

* continued

* continued

* Remove e2e test from unit test

commit lockfile

* rpc test

* fix tests
* Refactor paymasterServiceData validation logic for ERC20 mode

* Add assertions and test case for ERC20 Paymaster user op

* Changed isNullOrUndefined function param to any type

* Update createSmartWalletClient to createSmartAccountClient

* Added ts-doc for setPaymasterUserOp

* Export FeeQuotesOrDataResponse from @account and update import path in test

* Refactor setPaymasterUserOp --> getPaymasterUserOp

---------

Co-authored-by: GabiDev <[email protected]>
* Fix for etherv6 signer compatibility

* Refactor name

---------

Co-authored-by: GabiDev <[email protected]>
* Resolved SMA-559

* Fix await

* Fix tests

* Update docs

* remove unused import

* Fix broken tests

* Fix rpc url

* buildTokenPaymasterUserOp

* lint:fix

* Fix spender

* Abstract tokenlist away

* fix test

* fix await

* lint:fix

* Make getPaymasterUserOp public

* remove log
GabiDev45 and others added 23 commits August 13, 2024 16:06
…g redundant tests & skiping temporary tests
* chore: testing framework
* chore: add test support for smart sessions
* feat: eip 712 (draft)

* feat: added signTypedData for Nexus (draft)

* feat: signTypedData + tests on baseSepolia testnet

* refactor: fix build errors

* feat: updated to latest nexus contracts

* fix tests

---------

Co-authored-by: VGabriel45 <[email protected]>
Co-authored-by: livingrockrises <[email protected]>
chore: refactor (#574)
…add missing features after viem refactor + fix issues & conflicts +++ (#576)

* fixed ownable validator implementation and tests

* refactor: refactor OwnableValidator instance class

* feat: added signature override to sendTransaction

* refactor: switch to local network (draft)

* fix: sort owners for module install data and change commit hash for deployed accounts

* refactor: remove signature override for now

* fix: fallback installation & get installed modules

* feat: fix ownable validator initialization and add test

* fixed conflicts + added missing functionality + tests

* feat: ownable validator multi signature test + fixes

* feat: add signatureOverride param

* refactor: remove console.logs

* feat: added tests for ownable executor & cleanup

* refactor: cleanup

* refactor: removed useless decorator

* fix: fix build errors

---------

Co-authored-by: VGabriel45 <[email protected]>
Copy link

size-limit report 📦

Path Size
core (esm) 11.33 KB (+1.47% 🔺)
core (cjs) 17.42 KB (+1.09% 🔺)
bundler (tree-shaking) 197 B (0%)
paymaster (tree-shaking) 117 B (0%)

Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 68.99% 6274 / 9094
🔵 Statements 68.99% 6274 / 9094
🔵 Functions 1.21% 2 / 164
🔵 Branches 64.28% 9 / 14
File CoverageNo changed files found.
Generated in workflow #167

@VGabriel45 VGabriel45 changed the title Feat/refactor, fix build, lint issues and tests Feat/refactor, fix build, lint issues and tests. Sep 24, 2024
test.skip("should create a nexusAccount from an ethers signer", async () => {
const ethersProvider = new JsonRpcProvider(chain.rpcUrls.default.http[0])
const ethersSigner = new Wallet(pKey, ethersProvider)
// test.skip("should create a nexusAccount from an ethers signer", async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

comments

factoryAddress = contracts.k1ValidatorFactory.address,
k1ValidatorAddress = contracts.k1Validator.address,
bundlerTransport,
paymaster,
Copy link
Collaborator

Choose a reason for hiding this comment

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

can remove these

@joepegler joepegler merged commit c22f303 into develop Sep 24, 2024
5 checks passed
@joepegler joepegler deleted the feat/refactor_and_missing_pieces branch September 24, 2024 13:02
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.

9 participants