Skip to content

Added api to query wether an address is a module #329

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

Conversation

Kayanski
Copy link
Contributor

@Kayanski Kayanski commented Apr 23, 2024

This PR aims at adding an API to query wether an address is registered Abstract SDK Module.

Major Changes

We added a single query in the ModuleRegistry API

Here are the steps of the query :

  1. We query the address raw storage for the ModuleInfo config
  2. We query the Version control to get the information associated with this config
  3. We verify the stored version control information match the inputted address

TODO

Clippy doesn't pass because AbstractSDkError has large differences between variants. We need to find a solution (not take Module but String instead in the WrongModule variant ?)

Checklist

  • CI is green.
  • Changelog updated.

Copy link

cloudflare-workers-and-pages bot commented Apr 23, 2024

Deploying abstract-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0aabd36
Status: ✅  Deploy successful!
Preview URL: https://731d6ea9.abstract-docs.pages.dev
Branch Preview URL: https://nicolas-abs-383-add-module-v.abstract-docs.pages.dev

View logs

@CyberHoward CyberHoward added this to the v0.22 milestone Apr 25, 2024
@Kayanski Kayanski requested a review from Buckram123 April 29, 2024 17:19
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 30, 2024
Copy link
Collaborator

@Buckram123 Buckram123 left a comment

Choose a reason for hiding this comment

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

Looks good, but I'm not sure if Native and AccountBase module types should be included as well

@codecov-commenter
Copy link

codecov-commenter commented Apr 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 40 lines in your changes are missing coverage. Please review.

Project coverage is 86.7%. Comparing base (21e55ad) to head (0aabd36).
Report is 108 commits behind head on main.

Additional details and impacted files
Files Coverage Δ
framework/packages/abstract-sdk/src/error.rs 12.5% <ø> (ø)
...packages/abstract-sdk/src/apis/version_registry.rs 7.8% <0.0%> (-5.1%) ⬇️

... and 113 files with indirect coverage changes

@Kayanski Kayanski merged commit 63d68a4 into main Apr 30, 2024
@Kayanski Kayanski deleted the nicolas/abs-383-add-module-verification-functions-in-verifyrs-api branch April 30, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation sdk
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants