2022-01-04 01:33:00 -08:00
<!--
order: 3
-->
# Msg Service
## Msg/CreateGroup
A new group can be created with the `MsgCreateGroup` , which has an admin address, a list of members and some optional metadata bytes.
2022-02-03 04:40:45 -08:00
The metadata has a maximum length that is chosen by the app developer, and
passed into the group keeper as a config.
2022-02-14 14:39:35 -08:00
+++ https://github.com/cosmos/cosmos-sdk/blob/6f58963e7f6ce820e9b33f02f06f7b96f6d2e347/proto/cosmos/group/v1beta1/tx.proto#L54-L65
2022-01-04 01:33:00 -08:00
2022-02-03 04:40:45 -08:00
It's expecting to fail if metadata length is greater than `MaxMetadataLen` config.
2022-01-04 01:33:00 -08:00
## Msg/UpdateGroupMembers
Group members can be updated with the `UpdateGroupMembers` .
2022-02-18 05:47:04 -08:00
+++https://github.com/cosmos/cosmos-sdk/blob/9aef070625e9676d7c0acb212c17ae9dba3c32dc/proto/cosmos/group/v1beta1/tx.proto#L74-L86
2022-01-04 01:33:00 -08:00
In the list of `MemberUpdates` , an existing member can be removed by setting its weight to 0.
It's expecting to fail if the signer is not the admin of the group.
## Msg/UpdateGroupAdmin
The `UpdateGroupAdmin` can be used to update a group admin.
2022-02-18 05:47:04 -08:00
+++ https://github.com/cosmos/cosmos-sdk/blob/9aef070625e9676d7c0acb212c17ae9dba3c32dc/proto/cosmos/group/v1beta1/tx.proto#L91-L102
2022-01-04 01:33:00 -08:00
It's expecting to fail if the signer is not the admin of the group.
## Msg/UpdateGroupMetadata
The `UpdateGroupMetadata` can be used to update a group metadata.
2022-02-18 05:47:04 -08:00
+++ https://github.com/cosmos/cosmos-sdk/blob/9aef070625e9676d7c0acb212c17ae9dba3c32dc/proto/cosmos/group/v1beta1/tx.proto#L107-L118
2022-01-04 01:33:00 -08:00
It's expecting to fail if:
2022-02-10 04:07:01 -08:00
* new metadata length is greater than `MaxMetadataLen` config.
* the signer is not the admin of the group.
2022-01-04 01:33:00 -08:00
2022-01-05 00:54:52 -08:00
## Msg/CreateGroupPolicy
2022-01-04 01:33:00 -08:00
2022-01-05 00:54:52 -08:00
A new group policy can be created with the `MsgCreateGroupPolicy` , which has an admin address, a group id, a decision policy and some optional metadata bytes.
2022-01-04 01:33:00 -08:00
2022-02-18 05:47:04 -08:00
+++ https://github.com/cosmos/cosmos-sdk/blob/9aef070625e9676d7c0acb212c17ae9dba3c32dc/proto/cosmos/group/v1beta1/tx.proto#L127-L142
2022-01-04 01:33:00 -08:00
2022-02-03 04:40:45 -08:00
It's expecting to fail if metadata length is greater than `MaxMetadataLen` config.
2022-01-04 01:33:00 -08:00
2022-02-18 05:47:04 -08:00
## Msg/CreateGroupWithPolicy
A new group with policy can be created with the `MsgCreateGroupWithPolicy` , which has an admin address, a list of members, a decision policy, a group policy as admin field to optionally set group and group policy admin with group policy address and some optional metadata bytes for group and group policy.
+++ https://github.com/cosmos/cosmos-sdk/blob/likhita/MsgCreateGroupWithPolicy/proto/cosmos/group/v1beta1/tx.proto#L167-L188
It's expecting to fail if group metadata or group policy metadata length is greater than some `MaxMetadataLength` .
2022-01-05 00:54:52 -08:00
## Msg/UpdateGroupPolicyAdmin
2022-01-04 01:33:00 -08:00
2022-01-05 00:54:52 -08:00
The `UpdateGroupPolicyAdmin` can be used to update a group policy admin.
2022-01-04 01:33:00 -08:00
2022-02-18 05:47:04 -08:00
+++ https://github.com/cosmos/cosmos-sdk/blob/9aef070625e9676d7c0acb212c17ae9dba3c32dc/proto/cosmos/group/v1beta1/tx.proto#L151-L162
2022-01-04 01:33:00 -08:00
2022-01-05 00:54:52 -08:00
It's expecting to fail if the signer is not the admin of the group policy.
2022-01-04 01:33:00 -08:00
2022-01-05 00:54:52 -08:00
## Msg/UpdateGroupPolicyDecisionPolicy
2022-01-04 01:33:00 -08:00
2022-01-05 00:54:52 -08:00
The `UpdateGroupPolicyDecisionPolicy` can be used to update a decision policy.
2022-01-04 01:33:00 -08:00
2022-02-18 05:47:04 -08:00
+++ https://github.com/cosmos/cosmos-sdk/blob/9aef070625e9676d7c0acb212c17ae9dba3c32dc/proto/cosmos/group/v1beta1/tx.proto#L167-L179
2022-01-04 01:33:00 -08:00
2022-01-05 00:54:52 -08:00
It's expecting to fail if the signer is not the admin of the group policy.
2022-01-04 01:33:00 -08:00
2022-01-05 00:54:52 -08:00
## Msg/UpdateGroupPolicyMetadata
2022-01-04 01:33:00 -08:00
2022-01-05 00:54:52 -08:00
The `UpdateGroupPolicyMetadata` can be used to update a group policy metadata.
2022-01-04 01:33:00 -08:00
2022-02-18 05:47:04 -08:00
+++ https://github.com/cosmos/cosmos-sdk/blob/9aef070625e9676d7c0acb212c17ae9dba3c32dc/proto/cosmos/group/v1beta1/tx.proto#L184-L195
2022-01-04 01:33:00 -08:00
It's expecting to fail if:
2022-02-10 04:07:01 -08:00
* new metadata length is greater than `MaxMetadataLen` config.
* the signer is not the admin of the group.
2022-01-04 01:33:00 -08:00
## Msg/CreateProposal
2022-01-05 00:54:52 -08:00
A new proposal can be created with the `MsgCreateProposal` , which has a group policy account address, a list of proposers addresses, a list of messages to execute if the proposal is accepted and some optional metadata bytes.
2022-01-04 01:33:00 -08:00
An optional `Exec` value can be provided to try to execute the proposal immediately after proposal creation. Proposers signatures are considered as yes votes in this case.
2022-02-18 05:47:04 -08:00
+++ https://github.com/cosmos/cosmos-sdk/blob/9aef070625e9676d7c0acb212c17ae9dba3c32dc/proto/cosmos/group/v1beta1/tx.proto#L218-L239
2022-01-04 01:33:00 -08:00
2022-02-03 04:40:45 -08:00
It's expecting to fail if metadata length is greater than `MaxMetadataLen` config.
2022-01-04 01:33:00 -08:00
2022-02-04 00:37:45 -08:00
## Msg/WithdrawProposal
A proposal can be withdrawn using `MsgWithdrawProposal` which has a `address` (can be either proposer or policy admin) and a `proposal_id` (which has to be withdrawn).
2022-02-14 14:39:35 -08:00
+++ https://github.com/cosmos/cosmos-sdk/blob/f2d6f0e4bb1a9bd7f7ae3cdc4702c9d3d1fc0329/proto/cosmos/group/v1beta1/tx.proto#L251-L258
2022-02-04 00:37:45 -08:00
It's expecting to fail if:
2022-02-10 04:07:01 -08:00
* the signer is neither policy address nor proposer of the proposal.
* the proposal is already closed or aborted.
2022-02-04 00:37:45 -08:00
2022-01-04 01:33:00 -08:00
## Msg/Vote
A new vote can be created with the `MsgVote` , given a proposal id, a voter address, a choice (yes, no, veto or abstain) and some optional metadata bytes.
An optional `Exec` value can be provided to try to execute the proposal immediately after voting.
2022-02-18 05:47:04 -08:00
+++ https://github.com/cosmos/cosmos-sdk/blob/9aef070625e9676d7c0acb212c17ae9dba3c32dc/proto/cosmos/group/v1beta1/tx.proto#L248-L265
2022-01-04 01:33:00 -08:00
2022-02-03 04:40:45 -08:00
It's expecting to fail if metadata length is greater than `MaxMetadataLen` config.
2022-01-04 01:33:00 -08:00
## Msg/Exec
A proposal can be executed with the `MsgExec` .
2022-02-18 05:47:04 -08:00
+++ https://github.com/cosmos/cosmos-sdk/blob/9aef070625e9676d7c0acb212c17ae9dba3c32dc/proto/cosmos/group/v1beta1/tx.proto#L270-L278
2022-01-04 01:33:00 -08:00
The messages that are part of this proposal won't be executed if:
2022-02-10 04:07:01 -08:00
* the group has been modified before tally.
* the group policy has been modified before tally.
* the proposal has not been accepted.
* the proposal status is not closed.
* the proposal has already been successfully executed.