-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
x/gov: allow arbitrary messages in proposal #9726
Conversation
Visit https://dashboard.github.orijtech.com?pr=9726&repo=cosmos%2Fcosmos-sdk to see benchmark details. |
message MsgSignal { | ||
option (gogoproto.equal) = true; | ||
option (gogoproto.goproto_stringer) = false; | ||
option (gogoproto.stringer) = false; | ||
option (gogoproto.goproto_getters) = false; | ||
|
||
string title = 1; | ||
string description = 2; | ||
} |
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.
Maybe we just add title
& description
fields to MsgSubmitProposal
?
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.
That's the alternative to adding a signal message in the proposal. I wasn't sure if all proposals necessary needed a title and a description. In some cases a link/address that points to the forum / proposal write up might suffice
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 a link is more common and maybe a better idea. We should discuss. I don't think the title and description metadata should extend to group proposals for a number of reasons. Some groups may be want to be more anonymous and including title and description could confuse users into sharing private info on a public blockchain.
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.
@@ -24,6 +24,10 @@ service Msg { | |||
// FundCommunityPool defines a method to allow an account to directly | |||
// fund the community pool. | |||
rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); | |||
|
|||
// SpendCommunityPool defined a method to transfer tokens from the community |
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.
// SpendCommunityPool defined a method to transfer tokens from the community | |
// SpendCommunityPool defines a method to transfer tokens from the community |
@@ -272,7 +272,7 @@ func NewSimApp( | |||
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)) | |||
govKeeper := govkeeper.NewKeeper( | |||
appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, | |||
&stakingKeeper, govRouter, |
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.
should we just get rid of the govRouter
declaration above and delete x/gov/types/router.go
?
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.
Yeah that is my intention.
NOTE: I just published the PR so aaron and I could discuss a few points. It isn't quite ready
@@ -181,3 +184,26 @@ func (k Keeper) FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk. | |||
|
|||
return nil | |||
} | |||
|
|||
// SpendCommunityPool allows an authority to send coins to a recipient account. | |||
// An error is returned if not sufficient funds exist all the caller of the msg |
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.
// An error is returned if not sufficient funds exist all the caller of the msg | |
// An error is returned if not sufficient funds exist or the caller of the msg |
ctx.EventManager().EmitEvent( | ||
sdk.NewEvent( | ||
sdk.EventTypeMessage, | ||
sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), |
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.
not sure if we should emit this event here
|
||
Example: | ||
$ %s tx gov submit-proposal --proposal="path/to/proposal.json" --from mykey | ||
$ %s tx gov submit-proposal path/to/msgs.json 10stake --from mykey |
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.
$ %s tx gov submit-proposal path/to/msgs.json 10stake --from mykey | |
$ %s tx gov submit-proposal path/to/msgs.json --from mykey --deposit 10stake |
|
||
return msgs, nil | ||
} | ||
|
||
// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces | ||
func (p Proposal) UnpackInterfaces(unpacker types.AnyUnpacker) error { | ||
var content Content |
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.
this should be updated to unpack messages, ditto for MsgSubmitProposal
Okay yeah I will try split it up 👍 |
Closing in favour of #9809 |
Description
Closes: #9438
NOTE: I will most likely break this up into a few smaller PR's given the amount of files it touches
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change