-
Notifications
You must be signed in to change notification settings - Fork 355
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
Expose sudo powers on Router we give to Modules #453
Conversation
packages/multi-test/src/app.rs
Outdated
@@ -665,6 +665,33 @@ where | |||
} | |||
} | |||
|
|||
// TODO: extend this later to give privileged access to various modules |
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.
Just leaving a comment to create later issue for this one.
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.
lgtm
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.
lgtm
type BasicRouter<ExecC = Empty, QueryC = Empty> = Router< | ||
BankKeeper, | ||
FailingModule<Empty, Empty>, | ||
WasmKeeper<Empty, Empty>, | ||
FailingModule<ExecC, QueryC, Empty>, | ||
WasmKeeper<ExecC, QueryC>, | ||
FailingStaking, | ||
FailingDistribution, | ||
> { | ||
>; | ||
|
||
fn mock_router() -> BasicRouter { |
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 like this!
I came across this need when trying to implement a custom router that could perform privileged operations on contracts.
It actually seems like it can be generalised for all "governance proposals" and such as done in the sdk, which is a privileged interface to modules.
I implemented this for Wasm::Sudo and Bank::Mint
I also added a test for a CustomModule that makes these permissions calls to mint tokens (also needed by staking module) and came across a lot of usability issues with the UI, which I was able to sort out.
I am getting a much higher confidence we can start plugging in external implementations.