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

411 Allow calling extrinsics of clients-info crate from authorized accounts #418

Conversation

b-yap
Copy link
Contributor

@b-yap b-yap commented Oct 12, 2023

closes #411

General overview of the changes:

  • Authorize other accounts to perform the extrinsics of clients-info
  • Introduce the AuthorizedAccounts storage
  • generate new weights

How to begin the review:

  • pallets/clients-info/src/
    • lib.rs
      • new storage: AuthorizedAccounts
      • new extrinsics: fn authorize_account() and fn deauthorize_account()
      • old extrinsics: if the origin is not _root_, check from the AuthorizedAccounts`
      • new errors:
        • ThisAccountIdIsNotAuthorized
        • UserUnableToDeauthorizeThemself
        • UserUnableToDeauthorizeRootAccount
      • new events: AccountIdAuthorized(T::AccountId), AccountIdDeauthorized(T::AccountId)
    • tests.rs: new tests;
      • fn authorize_account_should_work()
      • fn deauthorize_account_should_work()
      • fn test_errors()
    • benchmarking.rs: addedfn deauthorize_account() and fn authorize_account()

@b-yap b-yap force-pushed the 411-allow-calling-extrinsics-of-clients-info-crate-from-authorized-accounts branch from 2155806 to c388cd8 Compare October 13, 2023 09:01
@b-yap b-yap requested a review from a team October 13, 2023 09:11
@b-yap b-yap marked this pull request as ready for review October 13, 2023 09:11
Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

I left some comments, tests and benchmarks look good 👍

pallets/clients-info/src/lib.rs Outdated Show resolved Hide resolved
pallets/clients-info/src/lib.rs Outdated Show resolved Hide resolved
pallets/clients-info/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

LGTM now

@b-yap b-yap force-pushed the 411-allow-calling-extrinsics-of-clients-info-crate-from-authorized-accounts branch from c9ae160 to 5c513d3 Compare October 17, 2023 13:17
@ebma
Copy link
Member

ebma commented Oct 17, 2023

Seems like we need to update the metadata of the standalone chain again @b-yap.

@b-yap b-yap force-pushed the 411-allow-calling-extrinsics-of-clients-info-crate-from-authorized-accounts branch from 2ed1980 to 7e71389 Compare October 18, 2023 08:04
@b-yap b-yap merged commit c2e5245 into main Oct 19, 2023
2 checks passed
@b-yap b-yap deleted the 411-allow-calling-extrinsics-of-clients-info-crate-from-authorized-accounts branch October 19, 2023 05:07
b-yap added a commit that referenced this pull request Oct 25, 2023
…accounts (#418)

* initial iteration

* add test cases and benchmark, to update the weights.
also

* rebase

* initial iteration

* add test cases and benchmark, to update the weights.
also

* remove unused 'e'

* put back deny warnings

* update metadata-standalone.scale

* https://github.com/pendulum-chain/spacewalk/actions/runs/6557977544/job/17810623957?pr=418#step:12:618
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.

Allow calling extrinsics of clients-info crate from authorized accounts
2 participants