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

Add view functions to Proxy pallet for runtime-specific type configuration #7297 #7320

Merged
merged 24 commits into from
Feb 15, 2025

Conversation

Nathy-bajo
Copy link
Contributor

@Nathy-bajo Nathy-bajo commented Jan 23, 2025

Solves #7297

I added a ProxyApi runtime API to the Proxy pallet with two methods:

check_permissions: Checks if a RuntimeCall passes a ProxyType's InstanceFilter.
is_superset: Verifies if one ProxyType includes another.

Polkadot address: 121HJWZtD13GJQPD82oEj3gSeHqsRYm1mFgRALu4L96kfPD1

@Nathy-bajo Nathy-bajo requested a review from a team as a code owner January 23, 2025 21:33
@Nathy-bajo
Copy link
Contributor Author

Please review @bkchr

@Nathy-bajo
Copy link
Contributor Author

Please review @bkchr

@Nathy-bajo
Copy link
Contributor Author

As @kianenigma requested in #7297 (comment)

I updated the implementation by adding #[pallet::view_functions_experimental] attribute to the Proxy pallet and implemented two new view functions:

check_permissions: Checks if a given RuntimeCall is allowed for a specific ProxyType using the InstanceFilter trait.

is_superset: Checks if one ProxyType is a superset of another ProxyType by comparing them using the PartialOrd trait.

@Nathy-bajo Nathy-bajo changed the title Add runtime api to Proxy pallet crate #7297 Add view functions to Proxy pallet for runtime-specific type configuration #7297 Feb 10, 2025
@kianenigma kianenigma requested a review from re-gius February 10, 2025 16:17
Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

LGTM, the lock files need to be updated?

The idea of view functions is to be a stable interface as well. The two functions added here seem pretty reasonable to me, but good for other reviewers to also double check that.

@github-actions github-actions bot requested a review from kianenigma February 10, 2025 16:31
Copy link
Contributor

Review required! Latest push from author must always be reviewed

@Nathy-bajo
Copy link
Contributor Author

Nathy-bajo commented Feb 10, 2025

LGTM, the lock files need to be updated?

I think it was because I updated cargo

The idea of view functions is to be a stable interface as well. The two functions added here seem pretty reasonable to me, but good for other reviewers to also double check that.

@bkchr bkchr added the T2-pallets This PR/Issue is related to a particular pallet. label Feb 10, 2025
@bkchr bkchr enabled auto-merge February 10, 2025 21:41
@bkchr
Copy link
Member

bkchr commented Feb 10, 2025

/cmd prdoc --audience runtime_dev --bump minor

Copy link
Contributor

Command "prdoc --audience runtime_dev --bump minor" has failed ❌! See logs here

@Nathy-bajo
Copy link
Contributor Author

@bkchr Do I need to add a prdoc file?

@Nathy-bajo Nathy-bajo requested a review from bkchr February 13, 2025 08:49
@bkchr
Copy link
Member

bkchr commented Feb 14, 2025

/cmd prdoc --bump minor --audience runtime_user

Copy link
Contributor

Command "prdoc --bump minor --audience runtime_user" has failed ❌! See logs here

@bkchr
Copy link
Member

bkchr commented Feb 14, 2025

/cmd prdoc --bump minor --audience runtime_user

Copy link
Contributor

Command "prdoc --bump minor --audience runtime_user" has failed ❌! See logs here

@bkchr
Copy link
Member

bkchr commented Feb 14, 2025

@bkchr Do I need to add a prdoc file?

Yes.

auto-merge was automatically disabled February 14, 2025 20:27

Head branch was pushed to by a user without write access

@bkchr bkchr enabled auto-merge February 14, 2025 22:44
@bkchr bkchr added this pull request to the merge queue Feb 15, 2025
Merged via the queue into paritytech:master with commit 87ac3f2 Feb 15, 2025
224 of 233 checks passed
@Nathy-bajo
Copy link
Contributor Author

Glad to see this merged🎉

please see my Polkadot address in the description @bkchr

@bkchr
Copy link
Member

bkchr commented Feb 16, 2025

/tip small

Copy link

@bkchr A referendum for a small (20 DOT) tip was successfully submitted for @Nathy-bajo (121HJWZtD13GJQPD82oEj3gSeHqsRYm1mFgRALu4L96kfPD1 on polkadot).

Referendum number: 1446.
tip

Copy link

The referendum has appeared on Polkassembly.

@Nathy-bajo Nathy-bajo deleted the proxy-pallet-runtime branch February 17, 2025 00:42
clangenb pushed a commit to clangenb/polkadot-sdk that referenced this pull request Feb 19, 2025
…ation paritytech#7297 (paritytech#7320)

Solves paritytech#7297

I added a ProxyApi runtime API to the Proxy pallet with two methods:

check_permissions: Checks if a RuntimeCall passes a ProxyType's
InstanceFilter.
is_superset: Verifies if one ProxyType includes another.




Polkadot address: 121HJWZtD13GJQPD82oEj3gSeHqsRYm1mFgRALu4L96kfPD1

---------

Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants