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/devx 337 abstract module #333

Merged
merged 12 commits into from
Dec 14, 2023
Merged

Conversation

VGabriel45
Copy link
Collaborator

Summary

Related Issue: # DEVX 337

Change Type

  • Bug Fix
  • Refactor
  • New Feature
  • Breaking Change
  • Documentation Update
  • Performance Improvement
  • Other

Checklist

  • My code follows this project's style guidelines
  • I've reviewed my own code
  • I've added comments for any hard-to-understand areas
  • [] I've updated the documentation if necessary
  • [] My changes generate no new warnings
  • I've added tests that prove my fix is effective or my feature works
  • All unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Information

The context of this PR is to optimize developer experience of the SDK.
This PR will removes the need for the user/developer to create the Module instance in his application, reducing the amount of boilerplate code that needs to be written.
User/developer can now choose to provide only "module" field in the config of the "create()" method, specifying between ECDSA_OWNERSHIP or MULTICHAIN modules.
The "signer" field is now required in config.
Added a new enum type "ValidationModule" which will map a module key to module address.
This will not work for Session and Batched Session modules as they require smart account address in order to be created which are available only after the creation of the smart account instance.

The creation of module instance by the user/developer is still available for compatibility reasons.

@VGabriel45 VGabriel45 changed the base branch from main to develop December 4, 2023 22:40
nodeClientUrl?: string; // very specific to Biconomy
defaultValidationModule: BaseValidationModule;
module?: ValidationModule;
Copy link
Collaborator

Choose a reason for hiding this comment

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

consider renaming var name and type name as discussed above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@livingrockrises livingrockrises left a comment

Choose a reason for hiding this comment

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

reviewed i

* @param {AuthorizationModuleType} authorizationModuleType - The type of authorization module to create.
* @returns {Promise<BaseValidationModule>} A promise that resolves to the created authorization module.
*/
async checkAndCreateModule(signer: Signer, authorizationModuleType: AuthorizationModuleType): Promise<BaseValidationModule> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

bunch of mistakes in this entire code block. can discuss in a call

return MultiChainValidationModule.create({
signer,
});
case AuthorizationModuleType.SESSION:
Copy link
Collaborator

Choose a reason for hiding this comment

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

session key manager module or batched session router module can not be default authorization modules.

@livingrockrises livingrockrises merged commit 57ecd91 into develop Dec 14, 2023
2 checks passed
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.

5 participants