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 OwnableExecutor module & fixed tests #580

Closed
wants to merge 2 commits into from

Conversation

VGabriel45
Copy link
Collaborator

@VGabriel45 VGabriel45 commented Sep 18, 2024

PR-Codex overview

This PR updates code related to smart account deployment and testing utilities.

Detailed summary

  • Updated publicClient.getBytecode to publicClient.getCode in multiple files.
  • Added type NexusSmartAccount and type UserOperationStruct.
  • Modified BaseExecutionModule method signature.
  • Replaced createSmartAccountClient with getTestSmartAccount in test files.
  • Updated BaseSmartContractAccount implementation.
  • Added getTestSmartAccount function for testing smart accounts.
  • Changed hardfork value from "Paris" to "Cancun".
  • Replaced testClient.getBytecode with testClient.getCode in test files.
  • Updated byteCodeDeployer function to use publicClient.getCode.
  • Added createOwnableExecutorModule function and related changes in test files.

The following files were skipped due to too many changes: tests/modules.ownableExecutor.read.test.ts, src/modules/executors/OwnableExecutor.ts, src/account/NexusSmartAccount.ts, tests/modules.ownableExecutor.write.test.ts

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

@VGabriel45 VGabriel45 changed the title refactor OwnableExecutor module class & fixed tests refactor OwnableExecutor module & fixed tests Sep 18, 2024
Copy link

size-limit report 📦

Path Size
core (esm) 16.68 KB (-0.6% 🔽)
core (cjs) 22.01 KB (+0.07% 🔺)
bundler (tree-shaking) 4.72 KB (0%)
paymaster (tree-shaking) 2.42 KB (0%)

@VGabriel45 VGabriel45 requested review from joepegler and livingrockrises and removed request for joepegler September 19, 2024 13:02
// buildUseropDto
)
}
// async sendTransactionWithExecutor(
Copy link
Collaborator

Choose a reason for hiding this comment

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

comments

accountAddress?: Address
): Promise<UserOpReceipt> {
senderSmartAccount?: NexusSmartAccount
): Promise<Partial<UserOperationStruct>> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was thinking about this after you mentioned it yesterday. Taking inspiration and being consistent with the other decorators that deal with sending user ops here. see clients/decorators/installModule, clients/decorators/uninstallFallback etc. They allow you to pass in options for sending the userop (gas estimates etc), and return the user op hash.
image

@@ -193,4 +185,15 @@ export class OwnableExecutorModule extends BaseExecutionModule {

return owners as Address[]
}

public async isModuleInitialized(smartAccount?: Address): Promise<any> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like another useful decorator

@@ -198,7 +252,7 @@ export const toConfiguredAnvil = async ({
rpcPort
}: { rpcPort: number }): Promise<AnvilInstance> => {
const instance = anvil({
hardfork: "Paris",
hardfork: "Cancun",
Copy link
Collaborator

Choose a reason for hiding this comment

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

😍

Copy link
Collaborator

@joepegler joepegler left a comment

Choose a reason for hiding this comment

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

sry wrong pr

@VGabriel45 VGabriel45 closed this Sep 23, 2024
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