-
Notifications
You must be signed in to change notification settings - Fork 97
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
Rework governance/ update admin-module NTRN-70 #303
Conversation
f400a7f
to
b86ff05
Compare
app/app.go
Outdated
// TODO: enabled proposals? | ||
//if len(enabledProposals) != 0 { | ||
// app.AdminmoduleKeeper.Router().AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, enabledProposals)) | ||
//} |
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.
TODO?
wasmOpts..., | ||
) | ||
wasmHooks.ContractKeeper = &app.WasmKeeper | ||
|
||
app.CronKeeper.WasmMsgServer = wasmkeeper.NewMsgServerImpl(&app.WasmKeeper) | ||
cronModule := cron.NewAppModule(appCodec, &app.CronKeeper) | ||
|
||
if len(enabledProposals) != 0 { |
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.
enabledProposals
variable is not used anymore, remove it please
@@ -41,6 +36,20 @@ func isConsumerParamChangeWhitelisted(paramChanges []proposal.ParamChange) bool | |||
return true | |||
} | |||
|
|||
func isSdkMessageWhitelisted(msg sdk.Msg) bool { |
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.
please add a comment what is the purpose of this method.
@@ -41,6 +36,20 @@ func isConsumerParamChangeWhitelisted(paramChanges []proposal.ParamChange) bool | |||
return true | |||
} | |||
|
|||
func isSdkMessageWhitelisted(msg sdk.Msg) bool { | |||
switch msg.(type) { |
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.
We definitely need to whitelist more messages here, but it's out of scope of this PR, will do it later
wasmbinding/message_plugin.go
Outdated
@@ -295,6 +294,34 @@ func (m *CustomMessenger) submitTx(ctx sdk.Context, contractAddr sdk.AccAddress, | |||
} | |||
|
|||
func (m *CustomMessenger) submitAdminProposal(ctx sdk.Context, contractAddr sdk.AccAddress, submitAdminProposal *bindings.SubmitAdminProposal) ([]sdk.Event, [][]byte, error) { | |||
var data []byte | |||
if submitAdminProposal.AdminProposal.ParamChangeProposal != nil || submitAdminProposal.AdminProposal.UpgradeProposal != nil || submitAdminProposal.AdminProposal.ClientUpdateProposal != nil { |
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.
Please add a comment there why exactly we need that condition.
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.
Also i think it's cleaner to create a method isLegacyProposal()
which does this check inside of it
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.
These two conditions differ only in the method that should called (m.performSubmitAdminProposalLegacy()
or m.performSubmitAdminProposal()
).
Logging and unmarshalling logic is the same for both conditions. Let's refactor to make it easier to read?
Co-authored-by: Mike Mozhaev <programmer10110@gmail.com>
Co-authored-by: Mike Mozhaev <programmer10110@gmail.com>
Co-authored-by: Mike Mozhaev <programmer10110@gmail.com>
845b949
to
552a67f
Compare
@@ -170,23 +169,6 @@ var ( | |||
EnableSpecificProposals = "" | |||
) | |||
|
|||
// GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to | |||
// produce a list of enabled proposals to pass into wasmd app. | |||
func GetEnabledProposals() []wasm.ProposalType { |
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.
do you think its safe to remove EnableSpecificProposals
and ProposalsEnabled
variables. and also remove all mentions in Makefile
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.
why it might be unsafe? wasm.ProposalType is basically deprecated
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.
There are lots of app.GetEnabledProposals(),
in testing code that needs to be fixed
TASK
Admin module PR
Neutron PR
Neutron SDK PR
Integration tests