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

Extend GetCallMetadata with indices #208

Open
ggwpez opened this issue Mar 2, 2023 · 7 comments
Open

Extend GetCallMetadata with indices #208

ggwpez opened this issue Mar 2, 2023 · 7 comments
Assignees
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. D1-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@ggwpez
Copy link
Member

ggwpez commented Mar 2, 2023

GetCallMetadata can currently be used to get the call- and module-name of a RuntimeCall.
In cases where we want to select specific calls/modules, it is better to use their index than strings.

GetCallMetadata could therefore be extended to also return these indices. Looking internally, we use a GetCallName trait which is re-used in the GetCallMetadata trait. So probably analogous to that add a GetCallIndex and then re-use that as well.

@kziemianek
Copy link

Hi, I would love to do it :)

@ggwpez
Copy link
Member Author

ggwpez commented Mar 2, 2023

Okay great! yes please go ahead

@kziemianek
Copy link

@ggwpez, I think I have most of stuff done, but I'm struggling to figure out how to get function index from decl_module! macro (frame/support/src/dispatch.rs). I need this to fill GetCallIndex trait implementation. Could you guide me a little bit ?

@ggwpez
Copy link
Member Author

ggwpez commented Mar 7, 2023

Yes best to open a Draft MR @kziemianek, then it is easier to collaborate and comment.

@kziemianek
Copy link

@ggwpez I've opened, please take a look.

@liamaharon
Copy link
Contributor

Closed in paritytech/substrate#13558

@ggwpez
Copy link
Member Author

ggwpez commented Apr 28, 2023

Closed in paritytech/substrate#13558

That was just the first part. The second part is blocked on removing the old decl_* pallet macros.

@ggwpez ggwpez reopened this Apr 28, 2023
@juangirini juangirini transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added I5-enhancement An additional feature request. C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. T1-FRAME This PR/Issue is related to core FRAME, the framework. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. and removed J0-enhancement labels Aug 25, 2023
@ggwpez ggwpez added D1-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. and removed D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. labels Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. D1-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
Status: Backlog
Development

No branches or pull requests

5 participants