-
Notifications
You must be signed in to change notification settings - Fork 438
[v10] Subtensor Pallet-Based GenericCall creation logic. #3136
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
| """ | ||
|
|
||
| subtensor: Union["Subtensor", "AsyncSubtensor"] | ||
| dynamic_function: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is great, but how does this actually get used? Like I see it in the tests, but how does a user go about using this, or rather why is it not just enabled by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know, I was thinking of introducing more strictness. But I like your approach too. Although I'll keep the logic of using CallBuilder.dynamic_function . There will always be users who want to control the behavior themselves.
Context
This PR introduces a new pallet-based architecture for creating
GenericCallobjects without immediate submission. This is an intermediate step toward full Proxy pallet support, which requires the ability to compose nested calls where oneGenericCallis passed as a parameter to another.Changes
CallBuilderbase class: Provides a unified interface for creatingGenericCallinstances from any Subtensor pallet.Balances,Crowdloan,Sudo,SubtensorModule,Swap, andCommitments.SubtensorandAsyncSubtensorinstances.transferandstart_callextrinsics to use the new pallet architecture.Benefits
GenericCallobjects can be created once and reused for fee estimation, submission, or nesting in other calls.Union[GenericCall, Awaitable[GenericCall]]based on the subtensor type.CallBuilder.Example Usage
Create a sync call without submitting
Create a async call without submitting
Use for fee estimation
Submit the call
Nest calls (preparation for Proxy support)
Dynamic call creation within defined pallet class
Dynamic call creation without defined pallet class
Testing