refactor: Align on gov/group Proposals and Vote syntax (#11097)
## Description Closes: #11070 - Proto-breaking changes: - group Choice -> VoteOption - group MsgCreateProposal -> MsgSubmitProposal - group enums -> prepend `PROPOSAL_` (e.g. `PROPOSAL_STATUS_`, `PROPOSAL_RESULT_`) - group Tally -> TallyResult - CLI-breaking changes: - group submit proposal: takes a single arg which is a proposal.json file --- ### 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... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### 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... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
This commit is contained in:
parent
9ff6d5441d
commit
875378b231
@ -7226,95 +7226,96 @@ var file_cosmos_base_abci_v1beta1_abci_proto_rawDesc = []byte{
|
||||
0x12, 0x34, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x16, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62,
|
||||
0x63, 0x69, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06,
|
||||
0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x9a, 0x01, 0x0a,
|
||||
0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xa9, 0x01, 0x0a,
|
||||
0x0e, 0x41, 0x42, 0x43, 0x49, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x67, 0x12,
|
||||
0x1b, 0x0a, 0x09, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0d, 0x52, 0x08, 0x6d, 0x73, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03,
|
||||
0x6c, 0x6f, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x53,
|
||||
0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25,
|
||||
0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63,
|
||||
0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67,
|
||||
0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x14, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x0c, 0x53,
|
||||
0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x06, 0x65, 0x76, 0x65,
|
||||
0x6e, 0x74, 0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x72, 0x0a, 0x0b, 0x53, 0x74, 0x72,
|
||||
0x69, 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x49, 0x0a, 0x0a,
|
||||
0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61,
|
||||
0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72,
|
||||
0x69, 0x62, 0x75, 0x74, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x61, 0x74, 0x74,
|
||||
0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x33, 0x0a,
|
||||
0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
|
||||
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x22, 0x43, 0x0a, 0x07, 0x47, 0x61, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a,
|
||||
0x0a, 0x67, 0x61, 0x73, 0x5f, 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x04, 0x52, 0x09, 0x67, 0x61, 0x73, 0x57, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08,
|
||||
0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07,
|
||||
0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75,
|
||||
0x6c, 0x74, 0x12, 0x16, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c,
|
||||
0x42, 0x02, 0x18, 0x01, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f,
|
||||
0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x34, 0x0a, 0x06,
|
||||
0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74,
|
||||
0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45,
|
||||
0x76, 0x65, 0x6e, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e,
|
||||
0x74, 0x73, 0x12, 0x39, 0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52,
|
||||
0x0c, 0x6d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x3a, 0x04, 0x88,
|
||||
0xa0, 0x1f, 0x00, 0x22, 0x96, 0x01, 0x0a, 0x12, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x08, 0x67, 0x61,
|
||||
0x73, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63,
|
||||
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e,
|
||||
0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x61, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x42,
|
||||
0x08, 0xc8, 0xde, 0x1f, 0x00, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x07, 0x67, 0x61, 0x73, 0x49, 0x6e,
|
||||
0x66, 0x6f, 0x12, 0x38, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65,
|
||||
0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65,
|
||||
0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x40, 0x0a, 0x07,
|
||||
0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74,
|
||||
0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79,
|
||||
0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c,
|
||||
0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x06, 0x18, 0x01, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x87,
|
||||
0x01, 0x0a, 0x09, 0x54, 0x78, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x04,
|
||||
0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73,
|
||||
0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31,
|
||||
0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x42, 0x02, 0x18,
|
||||
0x01, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x5f, 0x72,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0c, 0x6d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x22, 0xdc, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61,
|
||||
0x72, 0x63, 0x68, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x0a, 0x0b,
|
||||
0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x04, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a,
|
||||
0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f,
|
||||
0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62,
|
||||
0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75,
|
||||
0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x74,
|
||||
0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f,
|
||||
0x74, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x36, 0x0a, 0x03, 0x74, 0x78, 0x73,
|
||||
0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e,
|
||||
0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
|
||||
0x31, 0x2e, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x03, 0x74, 0x78,
|
||||
0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x42, 0xf7, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e,
|
||||
0x2a, 0x0a, 0x09, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0d, 0x42, 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65,
|
||||
0x78, 0x52, 0x08, 0x6d, 0x73, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x6c,
|
||||
0x6f, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x53, 0x0a,
|
||||
0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e,
|
||||
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69,
|
||||
0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x09, 0x41, 0x62, 0x63, 0x69, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d,
|
||||
0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62,
|
||||
0x61, 0x73, 0x65, 0x2f, 0x61, 0x62, 0x63, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
|
||||
0x3b, 0x61, 0x62, 0x63, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43,
|
||||
0x42, 0x41, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65,
|
||||
0x2e, 0x41, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x18,
|
||||
0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x41, 0x62, 0x63, 0x69,
|
||||
0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f,
|
||||
0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x41, 0x62, 0x63, 0x69, 0x5c, 0x56, 0x31, 0x62, 0x65,
|
||||
0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea,
|
||||
0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a,
|
||||
0x41, 0x62, 0x63, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xd8, 0xe1, 0x1e,
|
||||
0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45,
|
||||
0x76, 0x65, 0x6e, 0x74, 0x42, 0x14, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x0c, 0x53, 0x74,
|
||||
0x72, 0x69, 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e,
|
||||
0x74, 0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x72, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69,
|
||||
0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x61,
|
||||
0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||
0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62,
|
||||
0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69,
|
||||
0x62, 0x75, 0x74, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72,
|
||||
0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x33, 0x0a, 0x09,
|
||||
0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x22, 0x43, 0x0a, 0x07, 0x47, 0x61, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a,
|
||||
0x67, 0x61, 0x73, 0x5f, 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04,
|
||||
0x52, 0x09, 0x67, 0x61, 0x73, 0x57, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67,
|
||||
0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67,
|
||||
0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c,
|
||||
0x74, 0x12, 0x16, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42,
|
||||
0x02, 0x18, 0x01, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x34, 0x0a, 0x06, 0x65,
|
||||
0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x65,
|
||||
0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, 0x76,
|
||||
0x65, 0x6e, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74,
|
||||
0x73, 0x12, 0x39, 0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0c,
|
||||
0x6d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x3a, 0x04, 0x88, 0xa0,
|
||||
0x1f, 0x00, 0x22, 0x96, 0x01, 0x0a, 0x12, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x08, 0x67, 0x61, 0x73,
|
||||
0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f,
|
||||
0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76,
|
||||
0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x61, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x08,
|
||||
0xc8, 0xde, 0x1f, 0x00, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x07, 0x67, 0x61, 0x73, 0x49, 0x6e, 0x66,
|
||||
0x6f, 0x12, 0x38, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e,
|
||||
0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73,
|
||||
0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x40, 0x0a, 0x07, 0x4d,
|
||||
0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79,
|
||||
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70,
|
||||
0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52,
|
||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x06, 0x18, 0x01, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x87, 0x01,
|
||||
0x0a, 0x09, 0x54, 0x78, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x04, 0x64,
|
||||
0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d,
|
||||
0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62,
|
||||
0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x42, 0x02, 0x18, 0x01,
|
||||
0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x5f, 0x72, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||
0x41, 0x6e, 0x79, 0x52, 0x0c, 0x6d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x22, 0xdc, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72,
|
||||
0x63, 0x68, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74,
|
||||
0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04,
|
||||
0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75,
|
||||
0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65,
|
||||
0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d,
|
||||
0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x74, 0x61,
|
||||
0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x74,
|
||||
0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||
0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x36, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18,
|
||||
0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62,
|
||||
0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
|
||||
0x2e, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x03, 0x74, 0x78, 0x73,
|
||||
0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x42, 0xf7, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63,
|
||||
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e,
|
||||
0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x09, 0x41, 0x62, 0x63, 0x69, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73,
|
||||
0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61,
|
||||
0x73, 0x65, 0x2f, 0x61, 0x62, 0x63, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b,
|
||||
0x61, 0x62, 0x63, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42,
|
||||
0x41, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e,
|
||||
0x41, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x18, 0x43,
|
||||
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x41, 0x62, 0x63, 0x69, 0x5c,
|
||||
0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
|
||||
0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x41, 0x62, 0x63, 0x69, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74,
|
||||
0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
|
||||
0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x41,
|
||||
0x62, 0x63, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xd8, 0xe1, 0x1e, 0x00,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
@ -5762,9 +5762,12 @@ type Proposal struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
|
||||
Content *anypb.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
|
||||
Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty"`
|
||||
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
|
||||
Content *anypb.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
|
||||
Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty"`
|
||||
// final_tally_result is the final tally result of the proposal. When
|
||||
// querying a proposal via gRPC, this field is not populated until the
|
||||
// proposal's voting period has ended.
|
||||
FinalTallyResult *TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result,omitempty"`
|
||||
SubmitTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3" json:"submit_time,omitempty"`
|
||||
DepositEndTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3" json:"deposit_end_time,omitempty"`
|
||||
|
||||
@ -1196,7 +1196,7 @@ func (x *_Proposal_7_list) IsValid() bool {
|
||||
|
||||
var (
|
||||
md_Proposal protoreflect.MessageDescriptor
|
||||
fd_Proposal_proposal_id protoreflect.FieldDescriptor
|
||||
fd_Proposal_id protoreflect.FieldDescriptor
|
||||
fd_Proposal_messages protoreflect.FieldDescriptor
|
||||
fd_Proposal_status protoreflect.FieldDescriptor
|
||||
fd_Proposal_final_tally_result protoreflect.FieldDescriptor
|
||||
@ -1211,7 +1211,7 @@ var (
|
||||
func init() {
|
||||
file_cosmos_gov_v1beta2_gov_proto_init()
|
||||
md_Proposal = File_cosmos_gov_v1beta2_gov_proto.Messages().ByName("Proposal")
|
||||
fd_Proposal_proposal_id = md_Proposal.Fields().ByName("proposal_id")
|
||||
fd_Proposal_id = md_Proposal.Fields().ByName("id")
|
||||
fd_Proposal_messages = md_Proposal.Fields().ByName("messages")
|
||||
fd_Proposal_status = md_Proposal.Fields().ByName("status")
|
||||
fd_Proposal_final_tally_result = md_Proposal.Fields().ByName("final_tally_result")
|
||||
@ -1288,9 +1288,9 @@ func (x *fastReflection_Proposal) Interface() protoreflect.ProtoMessage {
|
||||
// While iterating, mutating operations may only be performed
|
||||
// on the current field descriptor.
|
||||
func (x *fastReflection_Proposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
if x.ProposalId != uint64(0) {
|
||||
value := protoreflect.ValueOfUint64(x.ProposalId)
|
||||
if !f(fd_Proposal_proposal_id, value) {
|
||||
if x.Id != uint64(0) {
|
||||
value := protoreflect.ValueOfUint64(x.Id)
|
||||
if !f(fd_Proposal_id, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -1363,8 +1363,8 @@ func (x *fastReflection_Proposal) Range(f func(protoreflect.FieldDescriptor, pro
|
||||
// a repeated field is populated if it is non-empty.
|
||||
func (x *fastReflection_Proposal) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.gov.v1beta2.Proposal.proposal_id":
|
||||
return x.ProposalId != uint64(0)
|
||||
case "cosmos.gov.v1beta2.Proposal.id":
|
||||
return x.Id != uint64(0)
|
||||
case "cosmos.gov.v1beta2.Proposal.messages":
|
||||
return len(x.Messages) != 0
|
||||
case "cosmos.gov.v1beta2.Proposal.status":
|
||||
@ -1399,8 +1399,8 @@ func (x *fastReflection_Proposal) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
// Clear is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Proposal) Clear(fd protoreflect.FieldDescriptor) {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.gov.v1beta2.Proposal.proposal_id":
|
||||
x.ProposalId = uint64(0)
|
||||
case "cosmos.gov.v1beta2.Proposal.id":
|
||||
x.Id = uint64(0)
|
||||
case "cosmos.gov.v1beta2.Proposal.messages":
|
||||
x.Messages = nil
|
||||
case "cosmos.gov.v1beta2.Proposal.status":
|
||||
@ -1435,8 +1435,8 @@ func (x *fastReflection_Proposal) Clear(fd protoreflect.FieldDescriptor) {
|
||||
// of the value; to obtain a mutable reference, use Mutable.
|
||||
func (x *fastReflection_Proposal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch descriptor.FullName() {
|
||||
case "cosmos.gov.v1beta2.Proposal.proposal_id":
|
||||
value := x.ProposalId
|
||||
case "cosmos.gov.v1beta2.Proposal.id":
|
||||
value := x.Id
|
||||
return protoreflect.ValueOfUint64(value)
|
||||
case "cosmos.gov.v1beta2.Proposal.messages":
|
||||
if len(x.Messages) == 0 {
|
||||
@ -1491,8 +1491,8 @@ func (x *fastReflection_Proposal) Get(descriptor protoreflect.FieldDescriptor) p
|
||||
// Set is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_Proposal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.gov.v1beta2.Proposal.proposal_id":
|
||||
x.ProposalId = value.Uint()
|
||||
case "cosmos.gov.v1beta2.Proposal.id":
|
||||
x.Id = value.Uint()
|
||||
case "cosmos.gov.v1beta2.Proposal.messages":
|
||||
lv := value.List()
|
||||
clv := lv.(*_Proposal_2_list)
|
||||
@ -1572,8 +1572,8 @@ func (x *fastReflection_Proposal) Mutable(fd protoreflect.FieldDescriptor) proto
|
||||
x.VotingEndTime = new(timestamppb.Timestamp)
|
||||
}
|
||||
return protoreflect.ValueOfMessage(x.VotingEndTime.ProtoReflect())
|
||||
case "cosmos.gov.v1beta2.Proposal.proposal_id":
|
||||
panic(fmt.Errorf("field proposal_id of message cosmos.gov.v1beta2.Proposal is not mutable"))
|
||||
case "cosmos.gov.v1beta2.Proposal.id":
|
||||
panic(fmt.Errorf("field id of message cosmos.gov.v1beta2.Proposal is not mutable"))
|
||||
case "cosmos.gov.v1beta2.Proposal.status":
|
||||
panic(fmt.Errorf("field status of message cosmos.gov.v1beta2.Proposal is not mutable"))
|
||||
case "cosmos.gov.v1beta2.Proposal.metadata":
|
||||
@ -1591,7 +1591,7 @@ func (x *fastReflection_Proposal) Mutable(fd protoreflect.FieldDescriptor) proto
|
||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||
func (x *fastReflection_Proposal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.gov.v1beta2.Proposal.proposal_id":
|
||||
case "cosmos.gov.v1beta2.Proposal.id":
|
||||
return protoreflect.ValueOfUint64(uint64(0))
|
||||
case "cosmos.gov.v1beta2.Proposal.messages":
|
||||
list := []*anypb.Any{}
|
||||
@ -1687,8 +1687,8 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods {
|
||||
var n int
|
||||
var l int
|
||||
_ = l
|
||||
if x.ProposalId != 0 {
|
||||
n += 1 + runtime.Sov(uint64(x.ProposalId))
|
||||
if x.Id != 0 {
|
||||
n += 1 + runtime.Sov(uint64(x.Id))
|
||||
}
|
||||
if len(x.Messages) > 0 {
|
||||
for _, e := range x.Messages {
|
||||
@ -1872,8 +1872,8 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods {
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
}
|
||||
if x.ProposalId != 0 {
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(x.ProposalId))
|
||||
if x.Id != 0 {
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(x.Id))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
@ -1928,9 +1928,9 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods {
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType)
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
||||
}
|
||||
x.ProposalId = 0
|
||||
x.Id = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
@ -1940,7 +1940,7 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods {
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
x.ProposalId |= uint64(b&0x7F) << shift
|
||||
x.Id |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
@ -2282,20 +2282,20 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods {
|
||||
}
|
||||
|
||||
var (
|
||||
md_TallyResult protoreflect.MessageDescriptor
|
||||
fd_TallyResult_yes protoreflect.FieldDescriptor
|
||||
fd_TallyResult_abstain protoreflect.FieldDescriptor
|
||||
fd_TallyResult_no protoreflect.FieldDescriptor
|
||||
fd_TallyResult_no_with_veto protoreflect.FieldDescriptor
|
||||
md_TallyResult protoreflect.MessageDescriptor
|
||||
fd_TallyResult_yes_count protoreflect.FieldDescriptor
|
||||
fd_TallyResult_abstain_count protoreflect.FieldDescriptor
|
||||
fd_TallyResult_no_count protoreflect.FieldDescriptor
|
||||
fd_TallyResult_no_with_veto_count protoreflect.FieldDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
file_cosmos_gov_v1beta2_gov_proto_init()
|
||||
md_TallyResult = File_cosmos_gov_v1beta2_gov_proto.Messages().ByName("TallyResult")
|
||||
fd_TallyResult_yes = md_TallyResult.Fields().ByName("yes")
|
||||
fd_TallyResult_abstain = md_TallyResult.Fields().ByName("abstain")
|
||||
fd_TallyResult_no = md_TallyResult.Fields().ByName("no")
|
||||
fd_TallyResult_no_with_veto = md_TallyResult.Fields().ByName("no_with_veto")
|
||||
fd_TallyResult_yes_count = md_TallyResult.Fields().ByName("yes_count")
|
||||
fd_TallyResult_abstain_count = md_TallyResult.Fields().ByName("abstain_count")
|
||||
fd_TallyResult_no_count = md_TallyResult.Fields().ByName("no_count")
|
||||
fd_TallyResult_no_with_veto_count = md_TallyResult.Fields().ByName("no_with_veto_count")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_TallyResult)(nil)
|
||||
@ -2363,27 +2363,27 @@ func (x *fastReflection_TallyResult) Interface() protoreflect.ProtoMessage {
|
||||
// While iterating, mutating operations may only be performed
|
||||
// on the current field descriptor.
|
||||
func (x *fastReflection_TallyResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
if x.Yes != "" {
|
||||
value := protoreflect.ValueOfString(x.Yes)
|
||||
if !f(fd_TallyResult_yes, value) {
|
||||
if x.YesCount != "" {
|
||||
value := protoreflect.ValueOfString(x.YesCount)
|
||||
if !f(fd_TallyResult_yes_count, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if x.Abstain != "" {
|
||||
value := protoreflect.ValueOfString(x.Abstain)
|
||||
if !f(fd_TallyResult_abstain, value) {
|
||||
if x.AbstainCount != "" {
|
||||
value := protoreflect.ValueOfString(x.AbstainCount)
|
||||
if !f(fd_TallyResult_abstain_count, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if x.No != "" {
|
||||
value := protoreflect.ValueOfString(x.No)
|
||||
if !f(fd_TallyResult_no, value) {
|
||||
if x.NoCount != "" {
|
||||
value := protoreflect.ValueOfString(x.NoCount)
|
||||
if !f(fd_TallyResult_no_count, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if x.NoWithVeto != "" {
|
||||
value := protoreflect.ValueOfString(x.NoWithVeto)
|
||||
if !f(fd_TallyResult_no_with_veto, value) {
|
||||
if x.NoWithVetoCount != "" {
|
||||
value := protoreflect.ValueOfString(x.NoWithVetoCount)
|
||||
if !f(fd_TallyResult_no_with_veto_count, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -2402,14 +2402,14 @@ func (x *fastReflection_TallyResult) Range(f func(protoreflect.FieldDescriptor,
|
||||
// a repeated field is populated if it is non-empty.
|
||||
func (x *fastReflection_TallyResult) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.gov.v1beta2.TallyResult.yes":
|
||||
return x.Yes != ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.abstain":
|
||||
return x.Abstain != ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.no":
|
||||
return x.No != ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_with_veto":
|
||||
return x.NoWithVeto != ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.yes_count":
|
||||
return x.YesCount != ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.abstain_count":
|
||||
return x.AbstainCount != ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_count":
|
||||
return x.NoCount != ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_with_veto_count":
|
||||
return x.NoWithVetoCount != ""
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.TallyResult"))
|
||||
@ -2426,14 +2426,14 @@ func (x *fastReflection_TallyResult) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
// Clear is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_TallyResult) Clear(fd protoreflect.FieldDescriptor) {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.gov.v1beta2.TallyResult.yes":
|
||||
x.Yes = ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.abstain":
|
||||
x.Abstain = ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.no":
|
||||
x.No = ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_with_veto":
|
||||
x.NoWithVeto = ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.yes_count":
|
||||
x.YesCount = ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.abstain_count":
|
||||
x.AbstainCount = ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_count":
|
||||
x.NoCount = ""
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_with_veto_count":
|
||||
x.NoWithVetoCount = ""
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.TallyResult"))
|
||||
@ -2450,17 +2450,17 @@ func (x *fastReflection_TallyResult) Clear(fd protoreflect.FieldDescriptor) {
|
||||
// of the value; to obtain a mutable reference, use Mutable.
|
||||
func (x *fastReflection_TallyResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch descriptor.FullName() {
|
||||
case "cosmos.gov.v1beta2.TallyResult.yes":
|
||||
value := x.Yes
|
||||
case "cosmos.gov.v1beta2.TallyResult.yes_count":
|
||||
value := x.YesCount
|
||||
return protoreflect.ValueOfString(value)
|
||||
case "cosmos.gov.v1beta2.TallyResult.abstain":
|
||||
value := x.Abstain
|
||||
case "cosmos.gov.v1beta2.TallyResult.abstain_count":
|
||||
value := x.AbstainCount
|
||||
return protoreflect.ValueOfString(value)
|
||||
case "cosmos.gov.v1beta2.TallyResult.no":
|
||||
value := x.No
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_count":
|
||||
value := x.NoCount
|
||||
return protoreflect.ValueOfString(value)
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_with_veto":
|
||||
value := x.NoWithVeto
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_with_veto_count":
|
||||
value := x.NoWithVetoCount
|
||||
return protoreflect.ValueOfString(value)
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
@ -2482,14 +2482,14 @@ func (x *fastReflection_TallyResult) Get(descriptor protoreflect.FieldDescriptor
|
||||
// Set is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_TallyResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.gov.v1beta2.TallyResult.yes":
|
||||
x.Yes = value.Interface().(string)
|
||||
case "cosmos.gov.v1beta2.TallyResult.abstain":
|
||||
x.Abstain = value.Interface().(string)
|
||||
case "cosmos.gov.v1beta2.TallyResult.no":
|
||||
x.No = value.Interface().(string)
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_with_veto":
|
||||
x.NoWithVeto = value.Interface().(string)
|
||||
case "cosmos.gov.v1beta2.TallyResult.yes_count":
|
||||
x.YesCount = value.Interface().(string)
|
||||
case "cosmos.gov.v1beta2.TallyResult.abstain_count":
|
||||
x.AbstainCount = value.Interface().(string)
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_count":
|
||||
x.NoCount = value.Interface().(string)
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_with_veto_count":
|
||||
x.NoWithVetoCount = value.Interface().(string)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.TallyResult"))
|
||||
@ -2510,14 +2510,14 @@ func (x *fastReflection_TallyResult) Set(fd protoreflect.FieldDescriptor, value
|
||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_TallyResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.gov.v1beta2.TallyResult.yes":
|
||||
panic(fmt.Errorf("field yes of message cosmos.gov.v1beta2.TallyResult is not mutable"))
|
||||
case "cosmos.gov.v1beta2.TallyResult.abstain":
|
||||
panic(fmt.Errorf("field abstain of message cosmos.gov.v1beta2.TallyResult is not mutable"))
|
||||
case "cosmos.gov.v1beta2.TallyResult.no":
|
||||
panic(fmt.Errorf("field no of message cosmos.gov.v1beta2.TallyResult is not mutable"))
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_with_veto":
|
||||
panic(fmt.Errorf("field no_with_veto of message cosmos.gov.v1beta2.TallyResult is not mutable"))
|
||||
case "cosmos.gov.v1beta2.TallyResult.yes_count":
|
||||
panic(fmt.Errorf("field yes_count of message cosmos.gov.v1beta2.TallyResult is not mutable"))
|
||||
case "cosmos.gov.v1beta2.TallyResult.abstain_count":
|
||||
panic(fmt.Errorf("field abstain_count of message cosmos.gov.v1beta2.TallyResult is not mutable"))
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_count":
|
||||
panic(fmt.Errorf("field no_count of message cosmos.gov.v1beta2.TallyResult is not mutable"))
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_with_veto_count":
|
||||
panic(fmt.Errorf("field no_with_veto_count of message cosmos.gov.v1beta2.TallyResult is not mutable"))
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.TallyResult"))
|
||||
@ -2531,13 +2531,13 @@ func (x *fastReflection_TallyResult) Mutable(fd protoreflect.FieldDescriptor) pr
|
||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||
func (x *fastReflection_TallyResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.gov.v1beta2.TallyResult.yes":
|
||||
case "cosmos.gov.v1beta2.TallyResult.yes_count":
|
||||
return protoreflect.ValueOfString("")
|
||||
case "cosmos.gov.v1beta2.TallyResult.abstain":
|
||||
case "cosmos.gov.v1beta2.TallyResult.abstain_count":
|
||||
return protoreflect.ValueOfString("")
|
||||
case "cosmos.gov.v1beta2.TallyResult.no":
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_count":
|
||||
return protoreflect.ValueOfString("")
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_with_veto":
|
||||
case "cosmos.gov.v1beta2.TallyResult.no_with_veto_count":
|
||||
return protoreflect.ValueOfString("")
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
@ -2608,19 +2608,19 @@ func (x *fastReflection_TallyResult) ProtoMethods() *protoiface.Methods {
|
||||
var n int
|
||||
var l int
|
||||
_ = l
|
||||
l = len(x.Yes)
|
||||
l = len(x.YesCount)
|
||||
if l > 0 {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
l = len(x.Abstain)
|
||||
l = len(x.AbstainCount)
|
||||
if l > 0 {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
l = len(x.No)
|
||||
l = len(x.NoCount)
|
||||
if l > 0 {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
l = len(x.NoWithVeto)
|
||||
l = len(x.NoWithVetoCount)
|
||||
if l > 0 {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
@ -2653,31 +2653,31 @@ func (x *fastReflection_TallyResult) ProtoMethods() *protoiface.Methods {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if len(x.NoWithVeto) > 0 {
|
||||
i -= len(x.NoWithVeto)
|
||||
copy(dAtA[i:], x.NoWithVeto)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NoWithVeto)))
|
||||
if len(x.NoWithVetoCount) > 0 {
|
||||
i -= len(x.NoWithVetoCount)
|
||||
copy(dAtA[i:], x.NoWithVetoCount)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NoWithVetoCount)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(x.No) > 0 {
|
||||
i -= len(x.No)
|
||||
copy(dAtA[i:], x.No)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.No)))
|
||||
if len(x.NoCount) > 0 {
|
||||
i -= len(x.NoCount)
|
||||
copy(dAtA[i:], x.NoCount)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NoCount)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(x.Abstain) > 0 {
|
||||
i -= len(x.Abstain)
|
||||
copy(dAtA[i:], x.Abstain)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Abstain)))
|
||||
if len(x.AbstainCount) > 0 {
|
||||
i -= len(x.AbstainCount)
|
||||
copy(dAtA[i:], x.AbstainCount)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AbstainCount)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if len(x.Yes) > 0 {
|
||||
i -= len(x.Yes)
|
||||
copy(dAtA[i:], x.Yes)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Yes)))
|
||||
if len(x.YesCount) > 0 {
|
||||
i -= len(x.YesCount)
|
||||
copy(dAtA[i:], x.YesCount)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.YesCount)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
@ -2732,7 +2732,7 @@ func (x *fastReflection_TallyResult) ProtoMethods() *protoiface.Methods {
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Yes", wireType)
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field YesCount", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@ -2760,11 +2760,11 @@ func (x *fastReflection_TallyResult) ProtoMethods() *protoiface.Methods {
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
x.Yes = string(dAtA[iNdEx:postIndex])
|
||||
x.YesCount = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Abstain", wireType)
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AbstainCount", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@ -2792,11 +2792,11 @@ func (x *fastReflection_TallyResult) ProtoMethods() *protoiface.Methods {
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
x.Abstain = string(dAtA[iNdEx:postIndex])
|
||||
x.AbstainCount = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field No", wireType)
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NoCount", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@ -2824,11 +2824,11 @@ func (x *fastReflection_TallyResult) ProtoMethods() *protoiface.Methods {
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
x.No = string(dAtA[iNdEx:postIndex])
|
||||
x.NoCount = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NoWithVeto", wireType)
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NoWithVetoCount", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@ -2856,7 +2856,7 @@ func (x *fastReflection_TallyResult) ProtoMethods() *protoiface.Methods {
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
x.NoWithVeto = string(dAtA[iNdEx:postIndex])
|
||||
x.NoWithVetoCount = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
@ -5304,9 +5304,12 @@ type Proposal struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
|
||||
Messages []*anypb.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"`
|
||||
Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta2.ProposalStatus" json:"status,omitempty"`
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Messages []*anypb.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"`
|
||||
Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta2.ProposalStatus" json:"status,omitempty"`
|
||||
// final_tally_result is the final tally result of the proposal. When
|
||||
// querying a proposal via gRPC, this field is not populated until the
|
||||
// proposal's voting period has ended.
|
||||
FinalTallyResult *TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result,omitempty"`
|
||||
SubmitTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3" json:"submit_time,omitempty"`
|
||||
DepositEndTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3" json:"deposit_end_time,omitempty"`
|
||||
@ -5337,9 +5340,9 @@ func (*Proposal) Descriptor() ([]byte, []int) {
|
||||
return file_cosmos_gov_v1beta2_gov_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Proposal) GetProposalId() uint64 {
|
||||
func (x *Proposal) GetId() uint64 {
|
||||
if x != nil {
|
||||
return x.ProposalId
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@ -5413,10 +5416,10 @@ type TallyResult struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Yes string `protobuf:"bytes,1,opt,name=yes,proto3" json:"yes,omitempty"`
|
||||
Abstain string `protobuf:"bytes,2,opt,name=abstain,proto3" json:"abstain,omitempty"`
|
||||
No string `protobuf:"bytes,3,opt,name=no,proto3" json:"no,omitempty"`
|
||||
NoWithVeto string `protobuf:"bytes,4,opt,name=no_with_veto,json=noWithVeto,proto3" json:"no_with_veto,omitempty"`
|
||||
YesCount string `protobuf:"bytes,1,opt,name=yes_count,json=yesCount,proto3" json:"yes_count,omitempty"`
|
||||
AbstainCount string `protobuf:"bytes,2,opt,name=abstain_count,json=abstainCount,proto3" json:"abstain_count,omitempty"`
|
||||
NoCount string `protobuf:"bytes,3,opt,name=no_count,json=noCount,proto3" json:"no_count,omitempty"`
|
||||
NoWithVetoCount string `protobuf:"bytes,4,opt,name=no_with_veto_count,json=noWithVetoCount,proto3" json:"no_with_veto_count,omitempty"`
|
||||
}
|
||||
|
||||
func (x *TallyResult) Reset() {
|
||||
@ -5439,30 +5442,30 @@ func (*TallyResult) Descriptor() ([]byte, []int) {
|
||||
return file_cosmos_gov_v1beta2_gov_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *TallyResult) GetYes() string {
|
||||
func (x *TallyResult) GetYesCount() string {
|
||||
if x != nil {
|
||||
return x.Yes
|
||||
return x.YesCount
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TallyResult) GetAbstain() string {
|
||||
func (x *TallyResult) GetAbstainCount() string {
|
||||
if x != nil {
|
||||
return x.Abstain
|
||||
return x.AbstainCount
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TallyResult) GetNo() string {
|
||||
func (x *TallyResult) GetNoCount() string {
|
||||
if x != nil {
|
||||
return x.No
|
||||
return x.NoCount
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TallyResult) GetNoWithVeto() string {
|
||||
func (x *TallyResult) GetNoWithVetoCount() string {
|
||||
if x != nil {
|
||||
return x.NoWithVeto
|
||||
return x.NoWithVetoCount
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@ -5695,136 +5698,137 @@ var file_cosmos_gov_v1beta2_gov_proto_rawDesc = []byte{
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73,
|
||||
0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
|
||||
0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f,
|
||||
0x75, 0x6e, 0x74, 0x22, 0xf1, 0x04, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c,
|
||||
0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49,
|
||||
0x64, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76,
|
||||
0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61,
|
||||
0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
|
||||
0x4d, 0x0a, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x72,
|
||||
0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f,
|
||||
0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32,
|
||||
0x2e, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x10, 0x66, 0x69,
|
||||
0x6e, 0x61, 0x6c, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x41,
|
||||
0x0a, 0x0b, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42,
|
||||
0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x69, 0x6d,
|
||||
0x65, 0x12, 0x4a, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x65, 0x6e, 0x64,
|
||||
0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
|
||||
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
|
||||
0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x64,
|
||||
0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x44, 0x0a,
|
||||
0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x07,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61,
|
||||
0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42,
|
||||
0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f,
|
||||
0x73, 0x69, 0x74, 0x12, 0x4c, 0x0a, 0x11, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74,
|
||||
0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01,
|
||||
0x52, 0x0f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d,
|
||||
0x65, 0x12, 0x48, 0x0a, 0x0f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x64, 0x5f,
|
||||
0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
|
||||
0x75, 0x6e, 0x74, 0x22, 0xe0, 0x04, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c,
|
||||
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64,
|
||||
0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||
0x65, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x0e, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e,
|
||||
0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c,
|
||||
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4d,
|
||||
0x0a, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x72, 0x65,
|
||||
0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x73,
|
||||
0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e,
|
||||
0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x10, 0x66, 0x69, 0x6e,
|
||||
0x61, 0x6c, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x41, 0x0a,
|
||||
0x0b, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04,
|
||||
0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x12, 0x4a, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x65, 0x6e, 0x64, 0x5f,
|
||||
0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
|
||||
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,
|
||||
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0d, 0x76, 0x6f,
|
||||
0x74, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d,
|
||||
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d,
|
||||
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xab, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c,
|
||||
0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x03, 0x79, 0x65, 0x73, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
|
||||
0x2e, 0x49, 0x6e, 0x74, 0x52, 0x03, 0x79, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x07, 0x61, 0x62, 0x73,
|
||||
0x74, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a,
|
||||
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x62, 0x73, 0x74,
|
||||
0x61, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x02, 0x6e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42,
|
||||
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x64, 0x65,
|
||||
0x70, 0x6f, 0x73, 0x69, 0x74, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x0d,
|
||||
0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x07, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73,
|
||||
0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04,
|
||||
0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73,
|
||||
0x69, 0x74, 0x12, 0x4c, 0x0a, 0x11, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x61,
|
||||
0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||
0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52,
|
||||
0x0f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x12, 0x48, 0x0a, 0x0f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74,
|
||||
0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0d, 0x76, 0x6f, 0x74,
|
||||
0x69, 0x6e, 0x67, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65,
|
||||
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65,
|
||||
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xd7, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79,
|
||||
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x09, 0x79, 0x65, 0x73, 0x5f, 0x63, 0x6f,
|
||||
0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63,
|
||||
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x08, 0x79, 0x65, 0x73, 0x43, 0x6f,
|
||||
0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x0d, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x63,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a,
|
||||
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0c, 0x61, 0x62, 0x73, 0x74,
|
||||
0x61, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x63,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a,
|
||||
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x6e, 0x6f, 0x43, 0x6f,
|
||||
0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x12, 0x6e, 0x6f, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x76,
|
||||
0x65, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42,
|
||||
0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52,
|
||||
0x02, 0x6e, 0x6f, 0x12, 0x30, 0x0a, 0x0c, 0x6e, 0x6f, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x76,
|
||||
0x65, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63,
|
||||
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0a, 0x6e, 0x6f, 0x57, 0x69, 0x74,
|
||||
0x68, 0x56, 0x65, 0x74, 0x6f, 0x22, 0x9f, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1f,
|
||||
0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12,
|
||||
0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18,
|
||||
0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65,
|
||||
0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12,
|
||||
0x40, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31,
|
||||
0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f,
|
||||
0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xd9, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6f,
|
||||
0x73, 0x69, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, 0x0b, 0x6d, 0x69, 0x6e,
|
||||
0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19,
|
||||
0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62,
|
||||
0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, 0xea,
|
||||
0xde, 0x1f, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2c, 0x6f,
|
||||
0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70,
|
||||
0x6f, 0x73, 0x69, 0x74, 0x12, 0x6d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f,
|
||||
0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x24, 0xea, 0xde, 0x1f,
|
||||
0x1c, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72,
|
||||
0x69, 0x6f, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f,
|
||||
0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72,
|
||||
0x69, 0x6f, 0x64, 0x22, 0x54, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72,
|
||||
0x61, 0x6d, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65,
|
||||
0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f,
|
||||
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74,
|
||||
0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0xe1, 0x01, 0x0a, 0x0b, 0x54, 0x61,
|
||||
0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x71, 0x75, 0x6f,
|
||||
0x72, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xea, 0xde, 0x1f, 0x10, 0x71,
|
||||
0x75, 0x6f, 0x72, 0x75, 0x6d, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xd2,
|
||||
0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71,
|
||||
0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x43, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f,
|
||||
0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xea, 0xde, 0x1f, 0x13, 0x74, 0x68,
|
||||
0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74,
|
||||
0x79, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52,
|
||||
0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x51, 0x0a, 0x0e, 0x76, 0x65,
|
||||
0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x09, 0x42, 0x2a, 0xea, 0xde, 0x1f, 0x18, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72,
|
||||
0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79,
|
||||
0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d,
|
||||
0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2a, 0x89, 0x01,
|
||||
0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17,
|
||||
0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50,
|
||||
0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54,
|
||||
0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x59, 0x45, 0x53, 0x10, 0x01, 0x12, 0x17,
|
||||
0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42,
|
||||
0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f,
|
||||
0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x56,
|
||||
0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49,
|
||||
0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, 0x2a, 0xce, 0x01, 0x0a, 0x0e, 0x50, 0x72,
|
||||
0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x1b,
|
||||
0x0f, 0x6e, 0x6f, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x74, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74,
|
||||
0x22, 0x9f, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f,
|
||||
0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a,
|
||||
0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f,
|
||||
0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63,
|
||||
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72,
|
||||
0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x07, 0x6f, 0x70,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f,
|
||||
0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32,
|
||||
0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4a, 0x04, 0x08, 0x03,
|
||||
0x10, 0x04, 0x22, 0xd9, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f,
|
||||
0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d,
|
||||
0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e,
|
||||
0x43, 0x6f, 0x69, 0x6e, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x15, 0x6d, 0x69,
|
||||
0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d,
|
||||
0x70, 0x74, 0x79, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12,
|
||||
0x6d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70,
|
||||
0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f,
|
||||
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75,
|
||||
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x24, 0xea, 0xde, 0x1f, 0x1c, 0x6d, 0x61, 0x78, 0x5f,
|
||||
0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2c, 0x6f,
|
||||
0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x10, 0x6d, 0x61,
|
||||
0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0x54,
|
||||
0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x44,
|
||||
0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65,
|
||||
0x72, 0x69, 0x6f, 0x64, 0x22, 0xe1, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xea, 0xde, 0x1f, 0x10, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d,
|
||||
0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f,
|
||||
0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d,
|
||||
0x12, 0x43, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x42, 0x25, 0xea, 0xde, 0x1f, 0x13, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f,
|
||||
0x6c, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xd2, 0xb4, 0x2d, 0x0a,
|
||||
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65,
|
||||
0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x51, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68,
|
||||
0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0xea,
|
||||
0xde, 0x1f, 0x18, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c,
|
||||
0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xd2, 0xb4, 0x2d, 0x0a, 0x63,
|
||||
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54,
|
||||
0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2a, 0x89, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74,
|
||||
0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f,
|
||||
0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
|
||||
0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54,
|
||||
0x49, 0x4f, 0x4e, 0x5f, 0x59, 0x45, 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x4f, 0x54,
|
||||
0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e,
|
||||
0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f,
|
||||
0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f,
|
||||
0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45,
|
||||
0x54, 0x4f, 0x10, 0x04, 0x2a, 0xce, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61,
|
||||
0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f,
|
||||
0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
|
||||
0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50,
|
||||
0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f,
|
||||
0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d,
|
||||
0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f,
|
||||
0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a,
|
||||
0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53,
|
||||
0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10,
|
||||
0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54,
|
||||
0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x45, 0x52, 0x49,
|
||||
0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c,
|
||||
0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, 0x44, 0x10, 0x03,
|
||||
0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41,
|
||||
0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x1a,
|
||||
0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55,
|
||||
0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, 0xcc, 0x01, 0x0a, 0x16, 0x63,
|
||||
0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31,
|
||||
0x62, 0x65, 0x74, 0x61, 0x32, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
|
||||
0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f,
|
||||
0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f,
|
||||
0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76,
|
||||
0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
|
||||
0x32, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
|
||||
0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xca, 0x02, 0x12, 0x43,
|
||||
0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12,
|
||||
0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54,
|
||||
0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50,
|
||||
0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52,
|
||||
0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f,
|
||||
0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49,
|
||||
0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, 0xcc, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f,
|
||||
0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32,
|
||||
0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f,
|
||||
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63,
|
||||
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
|
||||
0x32, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xa2, 0x02, 0x03, 0x43,
|
||||
0x47, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e,
|
||||
0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
|
||||
0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xe2, 0x02, 0x1e, 0x43,
|
||||
0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61,
|
||||
0x32, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56,
|
||||
0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
|
||||
0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76,
|
||||
0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14,
|
||||
0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62,
|
||||
0x65, 0x74, 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
@ -1662,25 +1662,25 @@ func (x *fastReflection_EventUpdateGroupPolicy) ProtoMethods() *protoiface.Metho
|
||||
}
|
||||
|
||||
var (
|
||||
md_EventCreateProposal protoreflect.MessageDescriptor
|
||||
fd_EventCreateProposal_proposal_id protoreflect.FieldDescriptor
|
||||
md_EventSubmitProposal protoreflect.MessageDescriptor
|
||||
fd_EventSubmitProposal_proposal_id protoreflect.FieldDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
file_cosmos_group_v1beta1_events_proto_init()
|
||||
md_EventCreateProposal = File_cosmos_group_v1beta1_events_proto.Messages().ByName("EventCreateProposal")
|
||||
fd_EventCreateProposal_proposal_id = md_EventCreateProposal.Fields().ByName("proposal_id")
|
||||
md_EventSubmitProposal = File_cosmos_group_v1beta1_events_proto.Messages().ByName("EventSubmitProposal")
|
||||
fd_EventSubmitProposal_proposal_id = md_EventSubmitProposal.Fields().ByName("proposal_id")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_EventCreateProposal)(nil)
|
||||
var _ protoreflect.Message = (*fastReflection_EventSubmitProposal)(nil)
|
||||
|
||||
type fastReflection_EventCreateProposal EventCreateProposal
|
||||
type fastReflection_EventSubmitProposal EventSubmitProposal
|
||||
|
||||
func (x *EventCreateProposal) ProtoReflect() protoreflect.Message {
|
||||
return (*fastReflection_EventCreateProposal)(x)
|
||||
func (x *EventSubmitProposal) ProtoReflect() protoreflect.Message {
|
||||
return (*fastReflection_EventSubmitProposal)(x)
|
||||
}
|
||||
|
||||
func (x *EventCreateProposal) slowProtoReflect() protoreflect.Message {
|
||||
func (x *EventSubmitProposal) slowProtoReflect() protoreflect.Message {
|
||||
mi := &file_cosmos_group_v1beta1_events_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -1692,43 +1692,43 @@ func (x *EventCreateProposal) slowProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
var _fastReflection_EventCreateProposal_messageType fastReflection_EventCreateProposal_messageType
|
||||
var _ protoreflect.MessageType = fastReflection_EventCreateProposal_messageType{}
|
||||
var _fastReflection_EventSubmitProposal_messageType fastReflection_EventSubmitProposal_messageType
|
||||
var _ protoreflect.MessageType = fastReflection_EventSubmitProposal_messageType{}
|
||||
|
||||
type fastReflection_EventCreateProposal_messageType struct{}
|
||||
type fastReflection_EventSubmitProposal_messageType struct{}
|
||||
|
||||
func (x fastReflection_EventCreateProposal_messageType) Zero() protoreflect.Message {
|
||||
return (*fastReflection_EventCreateProposal)(nil)
|
||||
func (x fastReflection_EventSubmitProposal_messageType) Zero() protoreflect.Message {
|
||||
return (*fastReflection_EventSubmitProposal)(nil)
|
||||
}
|
||||
func (x fastReflection_EventCreateProposal_messageType) New() protoreflect.Message {
|
||||
return new(fastReflection_EventCreateProposal)
|
||||
func (x fastReflection_EventSubmitProposal_messageType) New() protoreflect.Message {
|
||||
return new(fastReflection_EventSubmitProposal)
|
||||
}
|
||||
func (x fastReflection_EventCreateProposal_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_EventCreateProposal
|
||||
func (x fastReflection_EventSubmitProposal_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_EventSubmitProposal
|
||||
}
|
||||
|
||||
// Descriptor returns message descriptor, which contains only the protobuf
|
||||
// type information for the message.
|
||||
func (x *fastReflection_EventCreateProposal) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_EventCreateProposal
|
||||
func (x *fastReflection_EventSubmitProposal) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_EventSubmitProposal
|
||||
}
|
||||
|
||||
// Type returns the message type, which encapsulates both Go and protobuf
|
||||
// type information. If the Go type information is not needed,
|
||||
// it is recommended that the message descriptor be used instead.
|
||||
func (x *fastReflection_EventCreateProposal) Type() protoreflect.MessageType {
|
||||
return _fastReflection_EventCreateProposal_messageType
|
||||
func (x *fastReflection_EventSubmitProposal) Type() protoreflect.MessageType {
|
||||
return _fastReflection_EventSubmitProposal_messageType
|
||||
}
|
||||
|
||||
// New returns a newly allocated and mutable empty message.
|
||||
func (x *fastReflection_EventCreateProposal) New() protoreflect.Message {
|
||||
return new(fastReflection_EventCreateProposal)
|
||||
func (x *fastReflection_EventSubmitProposal) New() protoreflect.Message {
|
||||
return new(fastReflection_EventSubmitProposal)
|
||||
}
|
||||
|
||||
// Interface unwraps the message reflection interface and
|
||||
// returns the underlying ProtoMessage interface.
|
||||
func (x *fastReflection_EventCreateProposal) Interface() protoreflect.ProtoMessage {
|
||||
return (*EventCreateProposal)(x)
|
||||
func (x *fastReflection_EventSubmitProposal) Interface() protoreflect.ProtoMessage {
|
||||
return (*EventSubmitProposal)(x)
|
||||
}
|
||||
|
||||
// Range iterates over every populated field in an undefined order,
|
||||
@ -1736,10 +1736,10 @@ func (x *fastReflection_EventCreateProposal) Interface() protoreflect.ProtoMessa
|
||||
// Range returns immediately if f returns false.
|
||||
// While iterating, mutating operations may only be performed
|
||||
// on the current field descriptor.
|
||||
func (x *fastReflection_EventCreateProposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
func (x *fastReflection_EventSubmitProposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
if x.ProposalId != uint64(0) {
|
||||
value := protoreflect.ValueOfUint64(x.ProposalId)
|
||||
if !f(fd_EventCreateProposal_proposal_id, value) {
|
||||
if !f(fd_EventSubmitProposal_proposal_id, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -1756,15 +1756,15 @@ func (x *fastReflection_EventCreateProposal) Range(f func(protoreflect.FieldDesc
|
||||
// In other cases (aside from the nullable cases above),
|
||||
// a proto3 scalar field is populated if it contains a non-zero value, and
|
||||
// a repeated field is populated if it is non-empty.
|
||||
func (x *fastReflection_EventCreateProposal) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
func (x *fastReflection_EventSubmitProposal) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.group.v1beta1.EventCreateProposal.proposal_id":
|
||||
case "cosmos.group.v1beta1.EventSubmitProposal.proposal_id":
|
||||
return x.ProposalId != uint64(0)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.EventCreateProposal"))
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.EventSubmitProposal"))
|
||||
}
|
||||
panic(fmt.Errorf("message cosmos.group.v1beta1.EventCreateProposal does not contain field %s", fd.FullName()))
|
||||
panic(fmt.Errorf("message cosmos.group.v1beta1.EventSubmitProposal does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1774,15 +1774,15 @@ func (x *fastReflection_EventCreateProposal) Has(fd protoreflect.FieldDescriptor
|
||||
// associated with the given field number.
|
||||
//
|
||||
// Clear is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_EventCreateProposal) Clear(fd protoreflect.FieldDescriptor) {
|
||||
func (x *fastReflection_EventSubmitProposal) Clear(fd protoreflect.FieldDescriptor) {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.group.v1beta1.EventCreateProposal.proposal_id":
|
||||
case "cosmos.group.v1beta1.EventSubmitProposal.proposal_id":
|
||||
x.ProposalId = uint64(0)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.EventCreateProposal"))
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.EventSubmitProposal"))
|
||||
}
|
||||
panic(fmt.Errorf("message cosmos.group.v1beta1.EventCreateProposal does not contain field %s", fd.FullName()))
|
||||
panic(fmt.Errorf("message cosmos.group.v1beta1.EventSubmitProposal does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1792,16 +1792,16 @@ func (x *fastReflection_EventCreateProposal) Clear(fd protoreflect.FieldDescript
|
||||
// the default value of a bytes scalar is guaranteed to be a copy.
|
||||
// For unpopulated composite types, it returns an empty, read-only view
|
||||
// of the value; to obtain a mutable reference, use Mutable.
|
||||
func (x *fastReflection_EventCreateProposal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
func (x *fastReflection_EventSubmitProposal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch descriptor.FullName() {
|
||||
case "cosmos.group.v1beta1.EventCreateProposal.proposal_id":
|
||||
case "cosmos.group.v1beta1.EventSubmitProposal.proposal_id":
|
||||
value := x.ProposalId
|
||||
return protoreflect.ValueOfUint64(value)
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.EventCreateProposal"))
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.EventSubmitProposal"))
|
||||
}
|
||||
panic(fmt.Errorf("message cosmos.group.v1beta1.EventCreateProposal does not contain field %s", descriptor.FullName()))
|
||||
panic(fmt.Errorf("message cosmos.group.v1beta1.EventSubmitProposal does not contain field %s", descriptor.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1815,15 +1815,15 @@ func (x *fastReflection_EventCreateProposal) Get(descriptor protoreflect.FieldDe
|
||||
// empty, read-only value, then it panics.
|
||||
//
|
||||
// Set is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_EventCreateProposal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||
func (x *fastReflection_EventSubmitProposal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.group.v1beta1.EventCreateProposal.proposal_id":
|
||||
case "cosmos.group.v1beta1.EventSubmitProposal.proposal_id":
|
||||
x.ProposalId = value.Uint()
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.EventCreateProposal"))
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.EventSubmitProposal"))
|
||||
}
|
||||
panic(fmt.Errorf("message cosmos.group.v1beta1.EventCreateProposal does not contain field %s", fd.FullName()))
|
||||
panic(fmt.Errorf("message cosmos.group.v1beta1.EventSubmitProposal does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
@ -1837,40 +1837,40 @@ func (x *fastReflection_EventCreateProposal) Set(fd protoreflect.FieldDescriptor
|
||||
// It panics if the field does not contain a composite type.
|
||||
//
|
||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_EventCreateProposal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
func (x *fastReflection_EventSubmitProposal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.group.v1beta1.EventCreateProposal.proposal_id":
|
||||
panic(fmt.Errorf("field proposal_id of message cosmos.group.v1beta1.EventCreateProposal is not mutable"))
|
||||
case "cosmos.group.v1beta1.EventSubmitProposal.proposal_id":
|
||||
panic(fmt.Errorf("field proposal_id of message cosmos.group.v1beta1.EventSubmitProposal is not mutable"))
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.EventCreateProposal"))
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.EventSubmitProposal"))
|
||||
}
|
||||
panic(fmt.Errorf("message cosmos.group.v1beta1.EventCreateProposal does not contain field %s", fd.FullName()))
|
||||
panic(fmt.Errorf("message cosmos.group.v1beta1.EventSubmitProposal does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// NewField returns a new value that is assignable to the field
|
||||
// for the given descriptor. For scalars, this returns the default value.
|
||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
||||
func (x *fastReflection_EventCreateProposal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
func (x *fastReflection_EventSubmitProposal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "cosmos.group.v1beta1.EventCreateProposal.proposal_id":
|
||||
case "cosmos.group.v1beta1.EventSubmitProposal.proposal_id":
|
||||
return protoreflect.ValueOfUint64(uint64(0))
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.EventCreateProposal"))
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1beta1.EventSubmitProposal"))
|
||||
}
|
||||
panic(fmt.Errorf("message cosmos.group.v1beta1.EventCreateProposal does not contain field %s", fd.FullName()))
|
||||
panic(fmt.Errorf("message cosmos.group.v1beta1.EventSubmitProposal does not contain field %s", fd.FullName()))
|
||||
}
|
||||
}
|
||||
|
||||
// WhichOneof reports which field within the oneof is populated,
|
||||
// returning nil if none are populated.
|
||||
// It panics if the oneof descriptor does not belong to this message.
|
||||
func (x *fastReflection_EventCreateProposal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
func (x *fastReflection_EventSubmitProposal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
switch d.FullName() {
|
||||
default:
|
||||
panic(fmt.Errorf("%s is not a oneof field in cosmos.group.v1beta1.EventCreateProposal", d.FullName()))
|
||||
panic(fmt.Errorf("%s is not a oneof field in cosmos.group.v1beta1.EventSubmitProposal", d.FullName()))
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
@ -1878,7 +1878,7 @@ func (x *fastReflection_EventCreateProposal) WhichOneof(d protoreflect.OneofDesc
|
||||
// GetUnknown retrieves the entire list of unknown fields.
|
||||
// The caller may only mutate the contents of the RawFields
|
||||
// if the mutated bytes are stored back into the message with SetUnknown.
|
||||
func (x *fastReflection_EventCreateProposal) GetUnknown() protoreflect.RawFields {
|
||||
func (x *fastReflection_EventSubmitProposal) GetUnknown() protoreflect.RawFields {
|
||||
return x.unknownFields
|
||||
}
|
||||
|
||||
@ -1889,7 +1889,7 @@ func (x *fastReflection_EventCreateProposal) GetUnknown() protoreflect.RawFields
|
||||
// An empty RawFields may be passed to clear the fields.
|
||||
//
|
||||
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_EventCreateProposal) SetUnknown(fields protoreflect.RawFields) {
|
||||
func (x *fastReflection_EventSubmitProposal) SetUnknown(fields protoreflect.RawFields) {
|
||||
x.unknownFields = fields
|
||||
}
|
||||
|
||||
@ -1901,7 +1901,7 @@ func (x *fastReflection_EventCreateProposal) SetUnknown(fields protoreflect.RawF
|
||||
// message type, but the details are implementation dependent.
|
||||
// Validity is not part of the protobuf data model, and may not
|
||||
// be preserved in marshaling or other operations.
|
||||
func (x *fastReflection_EventCreateProposal) IsValid() bool {
|
||||
func (x *fastReflection_EventSubmitProposal) IsValid() bool {
|
||||
return x != nil
|
||||
}
|
||||
|
||||
@ -1911,9 +1911,9 @@ func (x *fastReflection_EventCreateProposal) IsValid() bool {
|
||||
// The returned methods type is identical to
|
||||
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
||||
// Consult the protoiface package documentation for details.
|
||||
func (x *fastReflection_EventCreateProposal) ProtoMethods() *protoiface.Methods {
|
||||
func (x *fastReflection_EventSubmitProposal) ProtoMethods() *protoiface.Methods {
|
||||
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||
x := input.Message.Interface().(*EventCreateProposal)
|
||||
x := input.Message.Interface().(*EventSubmitProposal)
|
||||
if x == nil {
|
||||
return protoiface.SizeOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
@ -1938,7 +1938,7 @@ func (x *fastReflection_EventCreateProposal) ProtoMethods() *protoiface.Methods
|
||||
}
|
||||
|
||||
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
||||
x := input.Message.Interface().(*EventCreateProposal)
|
||||
x := input.Message.Interface().(*EventSubmitProposal)
|
||||
if x == nil {
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
@ -1973,7 +1973,7 @@ func (x *fastReflection_EventCreateProposal) ProtoMethods() *protoiface.Methods
|
||||
}, nil
|
||||
}
|
||||
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
||||
x := input.Message.Interface().(*EventCreateProposal)
|
||||
x := input.Message.Interface().(*EventSubmitProposal)
|
||||
if x == nil {
|
||||
return protoiface.UnmarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
@ -2005,10 +2005,10 @@ func (x *fastReflection_EventCreateProposal) ProtoMethods() *protoiface.Methods
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventCreateProposal: wiretype end group for non-group")
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventSubmitProposal: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventCreateProposal: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
@ -3438,8 +3438,8 @@ func (x *EventUpdateGroupPolicy) GetAddress() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// EventCreateProposal is an event emitted when a proposal is created.
|
||||
type EventCreateProposal struct {
|
||||
// EventSubmitProposal is an event emitted when a proposal is created.
|
||||
type EventSubmitProposal struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@ -3448,8 +3448,8 @@ type EventCreateProposal struct {
|
||||
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *EventCreateProposal) Reset() {
|
||||
*x = EventCreateProposal{}
|
||||
func (x *EventSubmitProposal) Reset() {
|
||||
*x = EventSubmitProposal{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_cosmos_group_v1beta1_events_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -3457,18 +3457,18 @@ func (x *EventCreateProposal) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (x *EventCreateProposal) String() string {
|
||||
func (x *EventSubmitProposal) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EventCreateProposal) ProtoMessage() {}
|
||||
func (*EventSubmitProposal) ProtoMessage() {}
|
||||
|
||||
// Deprecated: Use EventCreateProposal.ProtoReflect.Descriptor instead.
|
||||
func (*EventCreateProposal) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use EventSubmitProposal.ProtoReflect.Descriptor instead.
|
||||
func (*EventSubmitProposal) Descriptor() ([]byte, []int) {
|
||||
return file_cosmos_group_v1beta1_events_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *EventCreateProposal) GetProposalId() uint64 {
|
||||
func (x *EventSubmitProposal) GetProposalId() uint64 {
|
||||
if x != nil {
|
||||
return x.ProposalId
|
||||
}
|
||||
@ -3610,7 +3610,7 @@ var file_cosmos_group_v1beta1_events_proto_rawDesc = []byte{
|
||||
0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d,
|
||||
0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53,
|
||||
0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x36,
|
||||
0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f,
|
||||
0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f,
|
||||
0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61,
|
||||
0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70,
|
||||
0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x15, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x57,
|
||||
@ -3658,7 +3658,7 @@ var file_cosmos_group_v1beta1_events_proto_goTypes = []interface{}{
|
||||
(*EventUpdateGroup)(nil), // 1: cosmos.group.v1beta1.EventUpdateGroup
|
||||
(*EventCreateGroupPolicy)(nil), // 2: cosmos.group.v1beta1.EventCreateGroupPolicy
|
||||
(*EventUpdateGroupPolicy)(nil), // 3: cosmos.group.v1beta1.EventUpdateGroupPolicy
|
||||
(*EventCreateProposal)(nil), // 4: cosmos.group.v1beta1.EventCreateProposal
|
||||
(*EventSubmitProposal)(nil), // 4: cosmos.group.v1beta1.EventSubmitProposal
|
||||
(*EventWithdrawProposal)(nil), // 5: cosmos.group.v1beta1.EventWithdrawProposal
|
||||
(*EventVote)(nil), // 6: cosmos.group.v1beta1.EventVote
|
||||
(*EventExec)(nil), // 7: cosmos.group.v1beta1.EventExec
|
||||
@ -3726,7 +3726,7 @@ func file_cosmos_group_v1beta1_events_proto_init() {
|
||||
}
|
||||
}
|
||||
file_cosmos_group_v1beta1_events_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*EventCreateProposal); i {
|
||||
switch v := v.(*EventSubmitProposal); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -38,8 +38,8 @@ type MsgClient interface {
|
||||
UpdateGroupPolicyDecisionPolicy(ctx context.Context, in *MsgUpdateGroupPolicyDecisionPolicy, opts ...grpc.CallOption) (*MsgUpdateGroupPolicyDecisionPolicyResponse, error)
|
||||
// UpdateGroupPolicyMetadata updates a group policy metadata.
|
||||
UpdateGroupPolicyMetadata(ctx context.Context, in *MsgUpdateGroupPolicyMetadata, opts ...grpc.CallOption) (*MsgUpdateGroupPolicyMetadataResponse, error)
|
||||
// CreateProposal submits a new proposal.
|
||||
CreateProposal(ctx context.Context, in *MsgCreateProposal, opts ...grpc.CallOption) (*MsgCreateProposalResponse, error)
|
||||
// SubmitProposal submits a new proposal.
|
||||
SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error)
|
||||
// WithdrawProposal aborts a proposal.
|
||||
WithdrawProposal(ctx context.Context, in *MsgWithdrawProposal, opts ...grpc.CallOption) (*MsgWithdrawProposalResponse, error)
|
||||
// Vote allows a voter to vote on a proposal.
|
||||
@ -128,9 +128,9 @@ func (c *msgClient) UpdateGroupPolicyMetadata(ctx context.Context, in *MsgUpdate
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) CreateProposal(ctx context.Context, in *MsgCreateProposal, opts ...grpc.CallOption) (*MsgCreateProposalResponse, error) {
|
||||
out := new(MsgCreateProposalResponse)
|
||||
err := c.cc.Invoke(ctx, "/cosmos.group.v1beta1.Msg/CreateProposal", in, out, opts...)
|
||||
func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) {
|
||||
out := new(MsgSubmitProposalResponse)
|
||||
err := c.cc.Invoke(ctx, "/cosmos.group.v1beta1.Msg/SubmitProposal", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -184,8 +184,8 @@ type MsgServer interface {
|
||||
UpdateGroupPolicyDecisionPolicy(context.Context, *MsgUpdateGroupPolicyDecisionPolicy) (*MsgUpdateGroupPolicyDecisionPolicyResponse, error)
|
||||
// UpdateGroupPolicyMetadata updates a group policy metadata.
|
||||
UpdateGroupPolicyMetadata(context.Context, *MsgUpdateGroupPolicyMetadata) (*MsgUpdateGroupPolicyMetadataResponse, error)
|
||||
// CreateProposal submits a new proposal.
|
||||
CreateProposal(context.Context, *MsgCreateProposal) (*MsgCreateProposalResponse, error)
|
||||
// SubmitProposal submits a new proposal.
|
||||
SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error)
|
||||
// WithdrawProposal aborts a proposal.
|
||||
WithdrawProposal(context.Context, *MsgWithdrawProposal) (*MsgWithdrawProposalResponse, error)
|
||||
// Vote allows a voter to vote on a proposal.
|
||||
@ -223,8 +223,8 @@ func (UnimplementedMsgServer) UpdateGroupPolicyDecisionPolicy(context.Context, *
|
||||
func (UnimplementedMsgServer) UpdateGroupPolicyMetadata(context.Context, *MsgUpdateGroupPolicyMetadata) (*MsgUpdateGroupPolicyMetadataResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateGroupPolicyMetadata not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) CreateProposal(context.Context, *MsgCreateProposal) (*MsgCreateProposalResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateProposal not implemented")
|
||||
func (UnimplementedMsgServer) SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) WithdrawProposal(context.Context, *MsgWithdrawProposal) (*MsgWithdrawProposalResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method WithdrawProposal not implemented")
|
||||
@ -392,20 +392,20 @@ func _Msg_UpdateGroupPolicyMetadata_Handler(srv interface{}, ctx context.Context
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_CreateProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgCreateProposal)
|
||||
func _Msg_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgSubmitProposal)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).CreateProposal(ctx, in)
|
||||
return srv.(MsgServer).SubmitProposal(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cosmos.group.v1beta1.Msg/CreateProposal",
|
||||
FullMethod: "/cosmos.group.v1beta1.Msg/SubmitProposal",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).CreateProposal(ctx, req.(*MsgCreateProposal))
|
||||
return srv.(MsgServer).SubmitProposal(ctx, req.(*MsgSubmitProposal))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@ -504,8 +504,8 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
|
||||
Handler: _Msg_UpdateGroupPolicyMetadata_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateProposal",
|
||||
Handler: _Msg_CreateProposal_Handler,
|
||||
MethodName: "SubmitProposal",
|
||||
Handler: _Msg_SubmitProposal_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "WithdrawProposal",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -72,6 +72,9 @@ message Proposal {
|
||||
uint64 proposal_id = 1;
|
||||
google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"];
|
||||
ProposalStatus status = 3;
|
||||
// final_tally_result is the final tally result of the proposal. When
|
||||
// querying a proposal via gRPC, this field is not populated until the
|
||||
// proposal's voting period has ended.
|
||||
TallyResult final_tally_result = 4 [(gogoproto.nullable) = false];
|
||||
google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
|
||||
google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
|
||||
|
||||
@ -41,9 +41,12 @@ message Deposit {
|
||||
|
||||
// Proposal defines the core field members of a governance proposal.
|
||||
message Proposal {
|
||||
uint64 proposal_id = 1;
|
||||
uint64 id = 1;
|
||||
repeated google.protobuf.Any messages = 2;
|
||||
ProposalStatus status = 3;
|
||||
// final_tally_result is the final tally result of the proposal. When
|
||||
// querying a proposal via gRPC, this field is not populated until the
|
||||
// proposal's voting period has ended.
|
||||
TallyResult final_tally_result = 4;
|
||||
google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true];
|
||||
google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true];
|
||||
@ -78,10 +81,10 @@ enum ProposalStatus {
|
||||
|
||||
// TallyResult defines a standard tally for a governance proposal.
|
||||
message TallyResult {
|
||||
string yes = 1 [(cosmos_proto.scalar) = "cosmos.Int"];
|
||||
string abstain = 2 [(cosmos_proto.scalar) = "cosmos.Int"];
|
||||
string no = 3 [(cosmos_proto.scalar) = "cosmos.Int"];
|
||||
string no_with_veto = 4 [(cosmos_proto.scalar) = "cosmos.Int"];
|
||||
string yes_count = 1 [(cosmos_proto.scalar) = "cosmos.Int"];
|
||||
string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"];
|
||||
string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"];
|
||||
string no_with_veto_count = 4 [(cosmos_proto.scalar) = "cosmos.Int"];
|
||||
}
|
||||
|
||||
// Vote defines a vote on a governance proposal.
|
||||
|
||||
@ -34,8 +34,8 @@ message EventUpdateGroupPolicy {
|
||||
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
}
|
||||
|
||||
// EventCreateProposal is an event emitted when a proposal is created.
|
||||
message EventCreateProposal {
|
||||
// EventSubmitProposal is an event emitted when a proposal is created.
|
||||
message EventSubmitProposal {
|
||||
|
||||
// proposal_id is the unique ID of the proposal.
|
||||
uint64 proposal_id = 1;
|
||||
|
||||
@ -39,8 +39,8 @@ service Msg {
|
||||
// UpdateGroupPolicyMetadata updates a group policy metadata.
|
||||
rpc UpdateGroupPolicyMetadata(MsgUpdateGroupPolicyMetadata) returns (MsgUpdateGroupPolicyMetadataResponse);
|
||||
|
||||
// CreateProposal submits a new proposal.
|
||||
rpc CreateProposal(MsgCreateProposal) returns (MsgCreateProposalResponse);
|
||||
// SubmitProposal submits a new proposal.
|
||||
rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse);
|
||||
|
||||
// WithdrawProposal aborts a proposal.
|
||||
rpc WithdrawProposal(MsgWithdrawProposal) returns (MsgWithdrawProposalResponse);
|
||||
@ -229,8 +229,8 @@ enum Exec {
|
||||
EXEC_TRY = 1;
|
||||
}
|
||||
|
||||
// MsgCreateProposal is the Msg/CreateProposal request type.
|
||||
message MsgCreateProposal {
|
||||
// MsgSubmitProposal is the Msg/SubmitProposal request type.
|
||||
message MsgSubmitProposal {
|
||||
option (cosmos.msg.v1.signer) = "proposers";
|
||||
|
||||
option (gogoproto.goproto_getters) = false;
|
||||
@ -245,8 +245,8 @@ message MsgCreateProposal {
|
||||
// metadata is any arbitrary metadata to attached to the proposal.
|
||||
bytes metadata = 3;
|
||||
|
||||
// msgs is a list of Msgs that will be executed if the proposal passes.
|
||||
repeated google.protobuf.Any msgs = 4;
|
||||
// messages is a list of `sdk.Msg`s that will be executed if the proposal passes.
|
||||
repeated google.protobuf.Any messages = 4;
|
||||
|
||||
// exec defines the mode of execution of the proposal,
|
||||
// whether it should be executed immediately on creation or not.
|
||||
@ -254,8 +254,8 @@ message MsgCreateProposal {
|
||||
Exec exec = 5;
|
||||
}
|
||||
|
||||
// MsgCreateProposalResponse is the Msg/CreateProposal response type.
|
||||
message MsgCreateProposalResponse {
|
||||
// MsgSubmitProposalResponse is the Msg/SubmitProposal response type.
|
||||
message MsgSubmitProposalResponse {
|
||||
|
||||
// proposal is the unique ID of the proposal.
|
||||
uint64 proposal_id = 1;
|
||||
@ -282,8 +282,8 @@ message MsgVote {
|
||||
// voter is the voter account address.
|
||||
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
|
||||
// choice is the voter's choice on the proposal.
|
||||
Choice choice = 3;
|
||||
// option is the voter's choice on the proposal.
|
||||
VoteOption option = 3;
|
||||
|
||||
// metadata is any arbitrary metadata to attached to the vote.
|
||||
bytes metadata = 4;
|
||||
|
||||
@ -58,23 +58,20 @@ message PercentageDecisionPolicy {
|
||||
google.protobuf.Duration timeout = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// Choice defines available types of choices for voting.
|
||||
enum Choice {
|
||||
// VoteOption enumerates the valid vote options for a given proposal.
|
||||
enum VoteOption {
|
||||
option (gogoproto.goproto_enum_prefix) = false;
|
||||
|
||||
// CHOICE_UNSPECIFIED defines a no-op voting choice.
|
||||
CHOICE_UNSPECIFIED = 0;
|
||||
|
||||
// CHOICE_NO defines a no voting choice.
|
||||
CHOICE_NO = 1;
|
||||
|
||||
// CHOICE_YES defines a yes voting choice.
|
||||
CHOICE_YES = 2;
|
||||
|
||||
// CHOICE_ABSTAIN defines an abstaining voting choice.
|
||||
CHOICE_ABSTAIN = 3;
|
||||
|
||||
// CHOICE_VETO defines a voting choice with veto.
|
||||
CHOICE_VETO = 4;
|
||||
// VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
|
||||
VOTE_OPTION_UNSPECIFIED = 0;
|
||||
// VOTE_OPTION_YES defines a yes vote option.
|
||||
VOTE_OPTION_YES = 1;
|
||||
// VOTE_OPTION_ABSTAIN defines an abstain vote option.
|
||||
VOTE_OPTION_ABSTAIN = 2;
|
||||
// VOTE_OPTION_NO defines a no vote option.
|
||||
VOTE_OPTION_NO = 3;
|
||||
// VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option.
|
||||
VOTE_OPTION_NO_WITH_VETO = 4;
|
||||
}
|
||||
|
||||
//
|
||||
@ -84,8 +81,8 @@ enum Choice {
|
||||
// GroupInfo represents the high-level on-chain information for a group.
|
||||
message GroupInfo {
|
||||
|
||||
// group_id is the unique ID of the group.
|
||||
uint64 group_id = 1;
|
||||
// id is the unique ID of the group.
|
||||
uint64 id = 1;
|
||||
|
||||
// admin is the account address of the group's admin.
|
||||
string admin = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
@ -151,8 +148,8 @@ message GroupPolicyInfo {
|
||||
message Proposal {
|
||||
option (gogoproto.goproto_getters) = false;
|
||||
|
||||
// proposal_id is the unique id of the proposal.
|
||||
uint64 proposal_id = 1;
|
||||
// id is the unique id of the proposal.
|
||||
uint64 id = 1;
|
||||
|
||||
// address is the account address of group policy.
|
||||
string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
@ -163,8 +160,8 @@ message Proposal {
|
||||
// proposers are the account addresses of the proposers.
|
||||
repeated string proposers = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
|
||||
// submitted_at is a timestamp specifying when a proposal was submitted.
|
||||
google.protobuf.Timestamp submitted_at = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
// submit_time is a timestamp specifying when a proposal was submitted.
|
||||
google.protobuf.Timestamp submit_time = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
|
||||
// group_version tracks the version of the group that this proposal corresponds to.
|
||||
// When group membership is changed, existing proposals from previous group versions will become invalid.
|
||||
@ -174,98 +171,102 @@ message Proposal {
|
||||
// When a decision policy is changed, existing proposals from previous policy versions will become invalid.
|
||||
uint64 group_policy_version = 7;
|
||||
|
||||
// Status defines proposal statuses.
|
||||
enum Status {
|
||||
option (gogoproto.goproto_enum_prefix) = false;
|
||||
|
||||
// An empty value is invalid and not allowed.
|
||||
STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "ProposalStatusInvalid"];
|
||||
|
||||
// Initial status of a proposal when persisted.
|
||||
STATUS_SUBMITTED = 1 [(gogoproto.enumvalue_customname) = "ProposalStatusSubmitted"];
|
||||
|
||||
// Final status of a proposal when the final tally was executed.
|
||||
STATUS_CLOSED = 2 [(gogoproto.enumvalue_customname) = "ProposalStatusClosed"];
|
||||
|
||||
// Final status of a proposal when the group was modified before the final tally.
|
||||
STATUS_ABORTED = 3 [(gogoproto.enumvalue_customname) = "ProposalStatusAborted"];
|
||||
|
||||
// A proposal can be deleted before the voting start time by the owner. When this happens the final status
|
||||
// is Withdrawn.
|
||||
STATUS_WITHDRAWN = 4 [(gogoproto.enumvalue_customname) = "ProposalStatusWithdrawn"];
|
||||
}
|
||||
|
||||
// Status represents the high level position in the life cycle of the proposal. Initial value is Submitted.
|
||||
Status status = 8;
|
||||
|
||||
// Result defines types of proposal results.
|
||||
enum Result {
|
||||
option (gogoproto.goproto_enum_prefix) = false;
|
||||
|
||||
// An empty value is invalid and not allowed
|
||||
RESULT_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "ProposalResultInvalid"];
|
||||
|
||||
// Until a final tally has happened the status is unfinalized
|
||||
RESULT_UNFINALIZED = 1 [(gogoproto.enumvalue_customname) = "ProposalResultUnfinalized"];
|
||||
|
||||
// Final result of the tally
|
||||
RESULT_ACCEPTED = 2 [(gogoproto.enumvalue_customname) = "ProposalResultAccepted"];
|
||||
|
||||
// Final result of the tally
|
||||
RESULT_REJECTED = 3 [(gogoproto.enumvalue_customname) = "ProposalResultRejected"];
|
||||
}
|
||||
// status represents the high level position in the life cycle of the proposal. Initial value is Submitted.
|
||||
ProposalStatus status = 8;
|
||||
|
||||
// result is the final result based on the votes and election rule. Initial value is unfinalized.
|
||||
// The result is persisted so that clients can always rely on this state and not have to replicate the logic.
|
||||
Result result = 9;
|
||||
ProposalResult result = 9;
|
||||
|
||||
// vote_state contains the sums of all weighted votes for this proposal.
|
||||
Tally vote_state = 10 [(gogoproto.nullable) = false];
|
||||
// final_tally_result contains the sums of all weighted votes for this
|
||||
// proposal for each vote option, after tallying. When querying a proposal
|
||||
// via gRPC, this field is not populated until the proposal's voting period
|
||||
// has ended.
|
||||
TallyResult final_tally_result = 10 [(gogoproto.nullable) = false];
|
||||
|
||||
// timeout is the timestamp of the block where the proposal execution times out. Header times of the votes and
|
||||
// execution messages must be before this end time to be included in the election. After the timeout timestamp the
|
||||
// proposal can not be executed anymore and should be considered pending delete.
|
||||
// timeout is the timestamp before which both voting and execution must be
|
||||
// done. If this timestamp is passed, then the proposal cannot be executed
|
||||
// anymore and should be considered pending delete. This timestamp is checked
|
||||
// against the block header's timestamp.
|
||||
google.protobuf.Timestamp timeout = 11 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
|
||||
// ExecutorResult defines types of proposal executor results.
|
||||
enum ExecutorResult {
|
||||
option (gogoproto.goproto_enum_prefix) = false;
|
||||
|
||||
// An empty value is not allowed.
|
||||
EXECUTOR_RESULT_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "ProposalExecutorResultInvalid"];
|
||||
|
||||
// We have not yet run the executor.
|
||||
EXECUTOR_RESULT_NOT_RUN = 1 [(gogoproto.enumvalue_customname) = "ProposalExecutorResultNotRun"];
|
||||
|
||||
// The executor was successful and proposed action updated state.
|
||||
EXECUTOR_RESULT_SUCCESS = 2 [(gogoproto.enumvalue_customname) = "ProposalExecutorResultSuccess"];
|
||||
|
||||
// The executor returned an error and proposed action didn't update state.
|
||||
EXECUTOR_RESULT_FAILURE = 3 [(gogoproto.enumvalue_customname) = "ProposalExecutorResultFailure"];
|
||||
}
|
||||
|
||||
// executor_result is the final result based on the votes and election rule. Initial value is NotRun.
|
||||
ExecutorResult executor_result = 12;
|
||||
ProposalExecutorResult executor_result = 12;
|
||||
|
||||
// msgs is a list of Msgs that will be executed if the proposal passes.
|
||||
repeated google.protobuf.Any msgs = 13;
|
||||
// messages is a list of Msgs that will be executed if the proposal passes.
|
||||
repeated google.protobuf.Any messages = 13;
|
||||
}
|
||||
|
||||
// Tally represents the sum of weighted votes.
|
||||
message Tally {
|
||||
// ProposalStatus defines proposal statuses.
|
||||
enum ProposalStatus {
|
||||
option (gogoproto.goproto_enum_prefix) = false;
|
||||
|
||||
// An empty value is invalid and not allowed.
|
||||
PROPOSAL_STATUS_UNSPECIFIED = 0;
|
||||
|
||||
// Initial status of a proposal when persisted.
|
||||
PROPOSAL_STATUS_SUBMITTED = 1;
|
||||
|
||||
// Final status of a proposal when the final tally was executed.
|
||||
PROPOSAL_STATUS_CLOSED = 2;
|
||||
|
||||
// Final status of a proposal when the group was modified before the final tally.
|
||||
PROPOSAL_STATUS_ABORTED = 3;
|
||||
|
||||
// A proposal can be deleted before the voting start time by the owner. When this happens the final status
|
||||
// is Withdrawn.
|
||||
PROPOSAL_STATUS_WITHDRAWN = 4;
|
||||
}
|
||||
|
||||
// ProposalResult defines types of proposal results.
|
||||
enum ProposalResult {
|
||||
option (gogoproto.goproto_enum_prefix) = false;
|
||||
|
||||
// An empty value is invalid and not allowed
|
||||
PROPOSAL_RESULT_UNSPECIFIED = 0;
|
||||
|
||||
// Until a final tally has happened the status is unfinalized
|
||||
PROPOSAL_RESULT_UNFINALIZED = 1;
|
||||
|
||||
// Final result of the tally
|
||||
PROPOSAL_RESULT_ACCEPTED = 2;
|
||||
|
||||
// Final result of the tally
|
||||
PROPOSAL_RESULT_REJECTED = 3;
|
||||
}
|
||||
|
||||
// ProposalExecutorResult defines types of proposal executor results.
|
||||
enum ProposalExecutorResult {
|
||||
option (gogoproto.goproto_enum_prefix) = false;
|
||||
|
||||
// An empty value is not allowed.
|
||||
PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED = 0;
|
||||
|
||||
// We have not yet run the executor.
|
||||
PROPOSAL_EXECUTOR_RESULT_NOT_RUN = 1;
|
||||
|
||||
// The executor was successful and proposed action updated state.
|
||||
PROPOSAL_EXECUTOR_RESULT_SUCCESS = 2;
|
||||
|
||||
// The executor returned an error and proposed action didn't update state.
|
||||
PROPOSAL_EXECUTOR_RESULT_FAILURE = 3;
|
||||
}
|
||||
|
||||
// TallyResult represents the sum of weighted votes for each vote option.
|
||||
message TallyResult {
|
||||
option (gogoproto.goproto_getters) = false;
|
||||
|
||||
// yes_count is the weighted sum of yes votes.
|
||||
string yes_count = 1;
|
||||
|
||||
// no_count is the weighted sum of no votes.
|
||||
string no_count = 2;
|
||||
// abstain_count is the weighted sum of abstainers.
|
||||
string abstain_count = 2;
|
||||
|
||||
// abstain_count is the weighted sum of abstainers
|
||||
string abstain_count = 3;
|
||||
// no is the weighted sum of no votes.
|
||||
string no_count = 3;
|
||||
|
||||
// veto_count is the weighted sum of vetoes.
|
||||
string veto_count = 4;
|
||||
// no_with_veto_count is the weighted sum of veto.
|
||||
string no_with_veto_count = 4;
|
||||
}
|
||||
|
||||
// Vote represents a vote for a proposal.
|
||||
@ -277,12 +278,12 @@ message Vote {
|
||||
// voter is the account address of the voter.
|
||||
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
|
||||
// choice is the voter's choice on the proposal.
|
||||
Choice choice = 3;
|
||||
// option is the voter's choice on the proposal.
|
||||
VoteOption option = 3;
|
||||
|
||||
// metadata is any arbitrary metadata to attached to the vote.
|
||||
bytes metadata = 4;
|
||||
|
||||
// submitted_at is the timestamp when the vote was submitted.
|
||||
google.protobuf.Timestamp submitted_at = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
// submit_time is the timestamp when the vote was submitted.
|
||||
google.protobuf.Timestamp submit_time = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
}
|
||||
|
||||
@ -19,23 +19,23 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) {
|
||||
|
||||
// delete dead proposals from store and returns theirs deposits. A proposal is dead when it's inactive and didn't get enough deposit on time to get into voting phase.
|
||||
keeper.IterateInactiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal v1beta2.Proposal) bool {
|
||||
keeper.DeleteProposal(ctx, proposal.ProposalId)
|
||||
keeper.RefundAndDeleteDeposits(ctx, proposal.ProposalId) // refund deposit if proposal got removed without getting 100% of the proposal
|
||||
keeper.DeleteProposal(ctx, proposal.Id)
|
||||
keeper.RefundAndDeleteDeposits(ctx, proposal.Id) // refund deposit if proposal got removed without getting 100% of the proposal
|
||||
|
||||
// called when proposal become inactive
|
||||
keeper.AfterProposalFailedMinDeposit(ctx, proposal.ProposalId)
|
||||
keeper.AfterProposalFailedMinDeposit(ctx, proposal.Id)
|
||||
|
||||
ctx.EventManager().EmitEvent(
|
||||
sdk.NewEvent(
|
||||
types.EventTypeInactiveProposal,
|
||||
sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposal.ProposalId)),
|
||||
sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposal.Id)),
|
||||
sdk.NewAttribute(types.AttributeKeyProposalResult, types.AttributeValueProposalDropped),
|
||||
),
|
||||
)
|
||||
|
||||
logger.Info(
|
||||
"proposal did not meet minimum deposit; deleted",
|
||||
"proposal", proposal.ProposalId,
|
||||
"proposal", proposal.Id,
|
||||
"min_deposit", sdk.NewCoins(keeper.GetDepositParams(ctx).MinDeposit...).String(),
|
||||
"total_deposit", sdk.NewCoins(proposal.TotalDeposit...).String(),
|
||||
)
|
||||
@ -50,9 +50,9 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) {
|
||||
passes, burnDeposits, tallyResults := keeper.Tally(ctx, proposal)
|
||||
|
||||
if burnDeposits {
|
||||
keeper.DeleteAndBurnDeposits(ctx, proposal.ProposalId)
|
||||
keeper.DeleteAndBurnDeposits(ctx, proposal.Id)
|
||||
} else {
|
||||
keeper.RefundAndDeleteDeposits(ctx, proposal.ProposalId)
|
||||
keeper.RefundAndDeleteDeposits(ctx, proposal.Id)
|
||||
}
|
||||
|
||||
if passes {
|
||||
@ -106,21 +106,21 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) {
|
||||
proposal.FinalTallyResult = &tallyResults
|
||||
|
||||
keeper.SetProposal(ctx, proposal)
|
||||
keeper.RemoveFromActiveProposalQueue(ctx, proposal.ProposalId, *proposal.VotingEndTime)
|
||||
keeper.RemoveFromActiveProposalQueue(ctx, proposal.Id, *proposal.VotingEndTime)
|
||||
|
||||
// when proposal become active
|
||||
keeper.AfterProposalVotingPeriodEnded(ctx, proposal.ProposalId)
|
||||
keeper.AfterProposalVotingPeriodEnded(ctx, proposal.Id)
|
||||
|
||||
logger.Info(
|
||||
"proposal tallied",
|
||||
"proposal", proposal.ProposalId,
|
||||
"proposal", proposal.Id,
|
||||
"results", logMsg,
|
||||
)
|
||||
|
||||
ctx.EventManager().EmitEvent(
|
||||
sdk.NewEvent(
|
||||
types.EventTypeActiveProposal,
|
||||
sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposal.ProposalId)),
|
||||
sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposal.Id)),
|
||||
sdk.NewAttribute(types.AttributeKeyProposalResult, tagValue),
|
||||
),
|
||||
)
|
||||
|
||||
@ -297,7 +297,7 @@ func TestProposalPassedEndblocker(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))}
|
||||
newDepositMsg := v1beta2.NewMsgDeposit(addrs[0], proposal.ProposalId, proposalCoins)
|
||||
newDepositMsg := v1beta2.NewMsgDeposit(addrs[0], proposal.Id, proposalCoins)
|
||||
|
||||
res, err := govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg)
|
||||
require.NoError(t, err)
|
||||
@ -310,7 +310,7 @@ func TestProposalPassedEndblocker(t *testing.T) {
|
||||
deposits := initialModuleAccCoins.Add(proposal.TotalDeposit...).Add(proposalCoins...)
|
||||
require.True(t, moduleAccCoins.IsEqual(deposits))
|
||||
|
||||
err = app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
|
||||
err = app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
|
||||
require.NoError(t, err)
|
||||
|
||||
newHeader := ctx.BlockHeader()
|
||||
@ -347,14 +347,14 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10)))
|
||||
newDepositMsg := v1beta2.NewMsgDeposit(addrs[0], proposal.ProposalId, proposalCoins)
|
||||
newDepositMsg := v1beta2.NewMsgDeposit(addrs[0], proposal.Id, proposalCoins)
|
||||
|
||||
govMsgSvr := keeper.NewMsgServerImpl(app.GovKeeper)
|
||||
res, err := govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, res)
|
||||
|
||||
err = app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
|
||||
err = app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
|
||||
require.NoError(t, err)
|
||||
|
||||
newHeader := ctx.BlockHeader()
|
||||
|
||||
@ -51,7 +51,7 @@ func (s *DepositTestSuite) SetupSuite() {
|
||||
id := i + 1
|
||||
deposit := deposits[i]
|
||||
|
||||
s.createProposal(val, deposit, id)
|
||||
s.submitProposal(val, deposit, id)
|
||||
s.proposalIDs = append(s.proposalIDs, fmt.Sprintf("%d", id))
|
||||
}
|
||||
}
|
||||
@ -67,7 +67,7 @@ func (s *DepositTestSuite) SetupNewSuite() {
|
||||
s.Require().NoError(err)
|
||||
}
|
||||
|
||||
func (s *DepositTestSuite) createProposal(val *network.Validator, initialDeposit sdk.Coin, id int) {
|
||||
func (s *DepositTestSuite) submitProposal(val *network.Validator, initialDeposit sdk.Coin, id int) {
|
||||
var exactArgs []string
|
||||
|
||||
if !initialDeposit.IsZero() {
|
||||
@ -151,7 +151,7 @@ func (s *DepositTestSuite) TestRejectedProposalDeposits() {
|
||||
id := 1
|
||||
proposalID := fmt.Sprintf("%d", id)
|
||||
|
||||
s.createProposal(val, initialDeposit, id)
|
||||
s.submitProposal(val, initialDeposit, id)
|
||||
|
||||
// query deposits
|
||||
var deposits v1beta2.QueryDepositsResponse
|
||||
|
||||
@ -35,9 +35,9 @@ func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k
|
||||
for _, proposal := range data.Proposals {
|
||||
switch proposal.Status {
|
||||
case v1beta2.StatusDepositPeriod:
|
||||
k.InsertInactiveProposalQueue(ctx, proposal.ProposalId, *proposal.DepositEndTime)
|
||||
k.InsertInactiveProposalQueue(ctx, proposal.Id, *proposal.DepositEndTime)
|
||||
case v1beta2.StatusVotingPeriod:
|
||||
k.InsertActiveProposalQueue(ctx, proposal.ProposalId, *proposal.VotingEndTime)
|
||||
k.InsertActiveProposalQueue(ctx, proposal.Id, *proposal.VotingEndTime)
|
||||
}
|
||||
k.SetProposal(ctx, *proposal)
|
||||
}
|
||||
@ -65,10 +65,10 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *v1beta2.GenesisState {
|
||||
var proposalsDeposits v1beta2.Deposits
|
||||
var proposalsVotes v1beta2.Votes
|
||||
for _, proposal := range proposals {
|
||||
deposits := k.GetDeposits(ctx, proposal.ProposalId)
|
||||
deposits := k.GetDeposits(ctx, proposal.Id)
|
||||
proposalsDeposits = append(proposalsDeposits, deposits...)
|
||||
|
||||
votes := k.GetVotes(ctx, proposal.ProposalId)
|
||||
votes := k.GetVotes(ctx, proposal.Id)
|
||||
proposalsVotes = append(proposalsVotes, votes...)
|
||||
}
|
||||
|
||||
|
||||
@ -37,11 +37,11 @@ func TestImportExportQueues(t *testing.T) {
|
||||
// Create two proposals, put the second into the voting period
|
||||
proposal1, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID1 := proposal1.ProposalId
|
||||
proposalID1 := proposal1.Id
|
||||
|
||||
proposal2, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID2 := proposal2.ProposalId
|
||||
proposalID2 := proposal2.Id
|
||||
|
||||
votingStarted, err := app.GovKeeper.AddDeposit(ctx, proposalID2, addrs[0], app.GovKeeper.GetDepositParams(ctx).MinDeposit)
|
||||
require.NoError(t, err)
|
||||
|
||||
@ -19,7 +19,7 @@ func TestDeposits(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
|
||||
fourStake := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 4)))
|
||||
fiveStake := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 5)))
|
||||
@ -103,7 +103,7 @@ func TestDeposits(t *testing.T) {
|
||||
// Test delete and burn deposits
|
||||
proposal, err = app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID = proposal.ProposalId
|
||||
proposalID = proposal.Id
|
||||
_, err = app.GovKeeper.AddDeposit(ctx, proposalID, TestAddrs[0], fourStake)
|
||||
require.NoError(t, err)
|
||||
app.GovKeeper.DeleteAndBurnDeposits(ctx, proposalID)
|
||||
|
||||
@ -9,7 +9,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/store/prefix"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/query"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov/migrations/v046"
|
||||
v046 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v046"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"
|
||||
@ -65,7 +65,7 @@ func (q Keeper) Proposals(c context.Context, req *v1beta2.QueryProposalsRequest)
|
||||
return false, err
|
||||
}
|
||||
|
||||
_, matchVoter = q.GetVote(ctx, p.ProposalId, voter)
|
||||
_, matchVoter = q.GetVote(ctx, p.Id, voter)
|
||||
}
|
||||
|
||||
// match depositor (if supplied)
|
||||
@ -74,7 +74,7 @@ func (q Keeper) Proposals(c context.Context, req *v1beta2.QueryProposalsRequest)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
_, matchDepositor = q.GetDeposit(ctx, p.ProposalId, depositor)
|
||||
_, matchDepositor = q.GetDeposit(ctx, p.Id, depositor)
|
||||
}
|
||||
|
||||
if matchVoter && matchDepositor && matchStatus {
|
||||
|
||||
@ -7,7 +7,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/query"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov/migrations/v046"
|
||||
v046 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v046"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"
|
||||
)
|
||||
@ -251,7 +251,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() {
|
||||
"request with filter of deposit address",
|
||||
func() {
|
||||
depositCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 20)))
|
||||
deposit := v1beta2.NewDeposit(testProposals[0].ProposalId, addrs[0], depositCoins)
|
||||
deposit := v1beta2.NewDeposit(testProposals[0].Id, addrs[0], depositCoins)
|
||||
app.GovKeeper.SetDeposit(ctx, deposit)
|
||||
|
||||
req = &v1beta2.QueryProposalsRequest{
|
||||
@ -269,7 +269,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() {
|
||||
func() {
|
||||
testProposals[1].Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, *testProposals[1])
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, testProposals[1].ProposalId, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain)))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, testProposals[1].Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain)))
|
||||
|
||||
req = &v1beta2.QueryProposalsRequest{
|
||||
Voter: addrs[0].String(),
|
||||
@ -371,7 +371,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() {
|
||||
suite.Require().NoError(err)
|
||||
|
||||
req = &v1beta2.QueryVoteRequest{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
Voter: addrs[0].String(),
|
||||
}
|
||||
|
||||
@ -384,14 +384,14 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() {
|
||||
func() {
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain)))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain)))
|
||||
|
||||
req = &v1beta2.QueryVoteRequest{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
Voter: addrs[0].String(),
|
||||
}
|
||||
|
||||
expRes = &v1beta2.QueryVoteResponse{Vote: &v1beta2.Vote{ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Options: []*v1beta2.WeightedVoteOption{{Option: v1beta2.OptionAbstain, Weight: sdk.MustNewDecFromStr("1.0").String()}}}}
|
||||
expRes = &v1beta2.QueryVoteResponse{Vote: &v1beta2.Vote{ProposalId: proposal.Id, Voter: addrs[0].String(), Options: []*v1beta2.WeightedVoteOption{{Option: v1beta2.OptionAbstain, Weight: sdk.MustNewDecFromStr("1.0").String()}}}}
|
||||
},
|
||||
true,
|
||||
},
|
||||
@ -399,7 +399,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() {
|
||||
"wrong voter id request",
|
||||
func() {
|
||||
req = &v1beta2.QueryVoteRequest{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
Voter: addrs[1].String(),
|
||||
}
|
||||
|
||||
@ -476,7 +476,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() {
|
||||
suite.Require().NoError(err)
|
||||
|
||||
req = &v1beta2.QueryVotesRequest{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
}
|
||||
},
|
||||
true,
|
||||
@ -488,18 +488,18 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() {
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
votes = []*v1beta2.Vote{
|
||||
{ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Options: v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain)},
|
||||
{ProposalId: proposal.ProposalId, Voter: addrs[1].String(), Options: v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)},
|
||||
{ProposalId: proposal.Id, Voter: addrs[0].String(), Options: v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain)},
|
||||
{ProposalId: proposal.Id, Voter: addrs[1].String(), Options: v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)},
|
||||
}
|
||||
accAddr1, err1 := sdk.AccAddressFromBech32(votes[0].Voter)
|
||||
accAddr2, err2 := sdk.AccAddressFromBech32(votes[1].Voter)
|
||||
suite.Require().NoError(err1)
|
||||
suite.Require().NoError(err2)
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, accAddr1, votes[0].Options))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, accAddr2, votes[1].Options))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, accAddr1, votes[0].Options))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, accAddr2, votes[1].Options))
|
||||
|
||||
req = &v1beta2.QueryVotesRequest{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
}
|
||||
|
||||
expRes = &v1beta2.QueryVotesResponse{
|
||||
@ -577,7 +577,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() {
|
||||
suite.Require().NoError(err)
|
||||
|
||||
req = &v1beta1.QueryVotesRequest{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
}
|
||||
},
|
||||
true,
|
||||
@ -589,18 +589,18 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() {
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
votes = []v1beta1.Vote{
|
||||
{ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Options: v1beta1.NewNonSplitVoteOption(v1beta1.OptionAbstain)},
|
||||
{ProposalId: proposal.ProposalId, Voter: addrs[1].String(), Options: v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)},
|
||||
{ProposalId: proposal.Id, Voter: addrs[0].String(), Options: v1beta1.NewNonSplitVoteOption(v1beta1.OptionAbstain)},
|
||||
{ProposalId: proposal.Id, Voter: addrs[1].String(), Options: v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)},
|
||||
}
|
||||
accAddr1, err1 := sdk.AccAddressFromBech32(votes[0].Voter)
|
||||
accAddr2, err2 := sdk.AccAddressFromBech32(votes[1].Voter)
|
||||
suite.Require().NoError(err1)
|
||||
suite.Require().NoError(err2)
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, accAddr1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain)))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, accAddr2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, accAddr1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain)))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, accAddr2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)))
|
||||
|
||||
req = &v1beta1.QueryVotesRequest{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
}
|
||||
|
||||
expRes = &v1beta1.QueryVotesResponse{
|
||||
@ -860,7 +860,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() {
|
||||
suite.Require().NotNil(proposal)
|
||||
|
||||
req = &v1beta2.QueryDepositRequest{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
Depositor: addrs[0].String(),
|
||||
}
|
||||
},
|
||||
@ -870,11 +870,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() {
|
||||
"valid request",
|
||||
func() {
|
||||
depositCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 20)))
|
||||
deposit := v1beta2.NewDeposit(proposal.ProposalId, addrs[0], depositCoins)
|
||||
deposit := v1beta2.NewDeposit(proposal.Id, addrs[0], depositCoins)
|
||||
app.GovKeeper.SetDeposit(ctx, deposit)
|
||||
|
||||
req = &v1beta2.QueryDepositRequest{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
Depositor: addrs[0].String(),
|
||||
}
|
||||
|
||||
@ -948,7 +948,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() {
|
||||
suite.Require().NoError(err)
|
||||
|
||||
req = &v1beta2.QueryDepositsRequest{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
}
|
||||
},
|
||||
true,
|
||||
@ -957,17 +957,17 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() {
|
||||
"get deposits with default limit",
|
||||
func() {
|
||||
depositAmount1 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 20)))
|
||||
deposit1 := v1beta2.NewDeposit(proposal.ProposalId, addrs[0], depositAmount1)
|
||||
deposit1 := v1beta2.NewDeposit(proposal.Id, addrs[0], depositAmount1)
|
||||
app.GovKeeper.SetDeposit(ctx, deposit1)
|
||||
|
||||
depositAmount2 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 30)))
|
||||
deposit2 := v1beta2.NewDeposit(proposal.ProposalId, addrs[1], depositAmount2)
|
||||
deposit2 := v1beta2.NewDeposit(proposal.Id, addrs[1], depositAmount2)
|
||||
app.GovKeeper.SetDeposit(ctx, deposit2)
|
||||
|
||||
deposits := v1beta2.Deposits{&deposit1, &deposit2}
|
||||
|
||||
req = &v1beta2.QueryDepositsRequest{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
}
|
||||
|
||||
expRes = &v1beta2.QueryDepositsResponse{
|
||||
@ -1040,7 +1040,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() {
|
||||
suite.Require().NoError(err)
|
||||
suite.Require().NotNil(proposal)
|
||||
|
||||
req = &v1beta2.QueryTallyResultRequest{ProposalId: proposal.ProposalId}
|
||||
req = &v1beta2.QueryTallyResultRequest{ProposalId: proposal.Id}
|
||||
|
||||
tallyResult := v1beta2.EmptyTallyResult()
|
||||
expRes = &v1beta2.QueryTallyResultResponse{
|
||||
@ -1055,18 +1055,18 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() {
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, addrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)))
|
||||
suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.Id, addrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)))
|
||||
|
||||
req = &v1beta2.QueryTallyResultRequest{ProposalId: proposal.ProposalId}
|
||||
req = &v1beta2.QueryTallyResultRequest{ProposalId: proposal.Id}
|
||||
|
||||
expRes = &v1beta2.QueryTallyResultResponse{
|
||||
Tally: &v1beta2.TallyResult{
|
||||
Yes: sdk.NewInt(3 * 5 * 1000000).String(),
|
||||
No: "0",
|
||||
Abstain: "0",
|
||||
NoWithVeto: "0",
|
||||
YesCount: sdk.NewInt(3 * 5 * 1000000).String(),
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
}
|
||||
},
|
||||
@ -1077,9 +1077,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() {
|
||||
func() {
|
||||
proposal.Status = v1beta2.StatusPassed
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
proposal, _ = app.GovKeeper.GetProposal(ctx, proposal.ProposalId)
|
||||
proposal, _ = app.GovKeeper.GetProposal(ctx, proposal.Id)
|
||||
|
||||
req = &v1beta2.QueryTallyResultRequest{ProposalId: proposal.ProposalId}
|
||||
req = &v1beta2.QueryTallyResultRequest{ProposalId: proposal.Id}
|
||||
|
||||
expRes = &v1beta2.QueryTallyResultResponse{
|
||||
Tally: proposal.FinalTallyResult,
|
||||
|
||||
@ -78,12 +78,12 @@ func TestHooks(t *testing.T) {
|
||||
p2, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
activated, err := app.GovKeeper.AddDeposit(ctx, p2.ProposalId, addrs[0], minDeposit)
|
||||
activated, err := app.GovKeeper.AddDeposit(ctx, p2.Id, addrs[0], minDeposit)
|
||||
require.True(t, activated)
|
||||
require.NoError(t, err)
|
||||
require.True(t, govHooksReceiver.AfterProposalDepositValid)
|
||||
|
||||
err = app.GovKeeper.AddVote(ctx, p2.ProposalId, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
|
||||
err = app.GovKeeper.AddVote(ctx, p2.Id, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
|
||||
require.NoError(t, err)
|
||||
require.True(t, govHooksReceiver.AfterProposalVoteValid)
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ func TestIncrementProposalNumber(t *testing.T) {
|
||||
proposal6, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, uint64(6), proposal6.ProposalId)
|
||||
require.Equal(t, uint64(6), proposal6.Id)
|
||||
}
|
||||
|
||||
func TestProposalQueues(t *testing.T) {
|
||||
@ -87,19 +87,19 @@ func TestProposalQueues(t *testing.T) {
|
||||
require.True(t, inactiveIterator.Valid())
|
||||
|
||||
proposalID := types.GetProposalIDFromBytes(inactiveIterator.Value())
|
||||
require.Equal(t, proposalID, proposal.ProposalId)
|
||||
require.Equal(t, proposalID, proposal.Id)
|
||||
inactiveIterator.Close()
|
||||
|
||||
app.GovKeeper.ActivateVotingPeriod(ctx, proposal)
|
||||
|
||||
proposal, ok := app.GovKeeper.GetProposal(ctx, proposal.ProposalId)
|
||||
proposal, ok := app.GovKeeper.GetProposal(ctx, proposal.Id)
|
||||
require.True(t, ok)
|
||||
|
||||
activeIterator := app.GovKeeper.ActiveProposalQueueIterator(ctx, *proposal.VotingEndTime)
|
||||
require.True(t, activeIterator.Valid())
|
||||
|
||||
proposalID, _ = types.SplitActiveProposalQueueKey(activeIterator.Key())
|
||||
require.Equal(t, proposalID, proposal.ProposalId)
|
||||
require.Equal(t, proposalID, proposal.Id)
|
||||
|
||||
activeIterator.Close()
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta2.MsgSubmitP
|
||||
defer telemetry.IncrCounter(1, types.ModuleName, "proposal")
|
||||
|
||||
proposer, _ := sdk.AccAddressFromBech32(msg.GetProposer())
|
||||
votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.ProposalId, proposer, msg.GetInitialDeposit())
|
||||
votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.Id, proposer, msg.GetInitialDeposit())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -70,14 +70,14 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta2.MsgSubmitP
|
||||
|
||||
if votingStarted {
|
||||
submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal,
|
||||
sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", proposal.ProposalId)),
|
||||
sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", proposal.Id)),
|
||||
)
|
||||
|
||||
ctx.EventManager().EmitEvent(submitEvent)
|
||||
}
|
||||
|
||||
return &v1beta2.MsgSubmitProposalResponse{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ func (keeper Keeper) SetProposal(ctx sdk.Context, proposal v1beta2.Proposal) {
|
||||
}
|
||||
|
||||
store := ctx.KVStore(keeper.storeKey)
|
||||
store.Set(types.ProposalKey(proposal.ProposalId), bz)
|
||||
store.Set(types.ProposalKey(proposal.Id), bz)
|
||||
}
|
||||
|
||||
// DeleteProposal deletes a proposal from store.
|
||||
@ -192,12 +192,12 @@ func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, params v1beta2.QueryP
|
||||
|
||||
// match voter address (if supplied)
|
||||
if len(params.Voter) > 0 {
|
||||
_, matchVoter = keeper.GetVote(ctx, p.ProposalId, params.Voter)
|
||||
_, matchVoter = keeper.GetVote(ctx, p.Id, params.Voter)
|
||||
}
|
||||
|
||||
// match depositor (if supplied)
|
||||
if len(params.Depositor) > 0 {
|
||||
_, matchDepositor = keeper.GetDeposit(ctx, p.ProposalId, params.Depositor)
|
||||
_, matchDepositor = keeper.GetDeposit(ctx, p.Id, params.Depositor)
|
||||
}
|
||||
|
||||
if matchVoter && matchDepositor && matchStatus {
|
||||
@ -242,8 +242,8 @@ func (keeper Keeper) ActivateVotingPeriod(ctx sdk.Context, proposal v1beta2.Prop
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
keeper.SetProposal(ctx, proposal)
|
||||
|
||||
keeper.RemoveFromInactiveProposalQueue(ctx, proposal.ProposalId, *proposal.DepositEndTime)
|
||||
keeper.InsertActiveProposalQueue(ctx, proposal.ProposalId, *proposal.VotingEndTime)
|
||||
keeper.RemoveFromInactiveProposalQueue(ctx, proposal.Id, *proposal.DepositEndTime)
|
||||
keeper.InsertActiveProposalQueue(ctx, proposal.Id, *proposal.VotingEndTime)
|
||||
}
|
||||
|
||||
func (keeper Keeper) MarshalProposal(proposal v1beta2.Proposal) ([]byte, error) {
|
||||
|
||||
@ -21,7 +21,7 @@ func (suite *KeeperTestSuite) TestGetSetProposal() {
|
||||
tp := TestProposal
|
||||
proposal, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tp, nil)
|
||||
suite.Require().NoError(err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
suite.app.GovKeeper.SetProposal(suite.ctx, proposal)
|
||||
|
||||
gotProposal, ok := suite.app.GovKeeper.GetProposal(suite.ctx, proposalID)
|
||||
@ -38,7 +38,7 @@ func (suite *KeeperTestSuite) TestActivateVotingPeriod() {
|
||||
|
||||
suite.app.GovKeeper.ActivateVotingPeriod(suite.ctx, proposal)
|
||||
|
||||
proposal, ok := suite.app.GovKeeper.GetProposal(suite.ctx, proposal.ProposalId)
|
||||
proposal, ok := suite.app.GovKeeper.GetProposal(suite.ctx, proposal.Id)
|
||||
suite.Require().True(ok)
|
||||
suite.Require().True(proposal.VotingStartTime.Equal(suite.ctx.BlockHeader().Time))
|
||||
|
||||
@ -46,7 +46,7 @@ func (suite *KeeperTestSuite) TestActivateVotingPeriod() {
|
||||
suite.Require().True(activeIterator.Valid())
|
||||
|
||||
proposalID := types.GetProposalIDFromBytes(activeIterator.Value())
|
||||
suite.Require().Equal(proposalID, proposal.ProposalId)
|
||||
suite.Require().Equal(proposalID, proposal.Id)
|
||||
activeIterator.Close()
|
||||
}
|
||||
|
||||
|
||||
@ -163,7 +163,7 @@ func TestQueries(t *testing.T) {
|
||||
// TestAddrs[0] proposes (and deposits) proposals #1 and #2
|
||||
proposal1, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
deposit1 := v1beta2.NewDeposit(proposal1.ProposalId, TestAddrs[0], oneCoins)
|
||||
deposit1 := v1beta2.NewDeposit(proposal1.Id, TestAddrs[0], oneCoins)
|
||||
depositer1, err := sdk.AccAddressFromBech32(deposit1.Depositor)
|
||||
require.NoError(t, err)
|
||||
_, err = app.GovKeeper.AddDeposit(ctx, deposit1.ProposalId, depositer1, deposit1.Amount)
|
||||
@ -173,7 +173,7 @@ func TestQueries(t *testing.T) {
|
||||
|
||||
proposal2, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
deposit2 := v1beta2.NewDeposit(proposal2.ProposalId, TestAddrs[0], consCoins)
|
||||
deposit2 := v1beta2.NewDeposit(proposal2.Id, TestAddrs[0], consCoins)
|
||||
depositer2, err := sdk.AccAddressFromBech32(deposit2.Depositor)
|
||||
require.NoError(t, err)
|
||||
_, err = app.GovKeeper.AddDeposit(ctx, deposit2.ProposalId, depositer2, deposit2.Amount)
|
||||
@ -184,7 +184,7 @@ func TestQueries(t *testing.T) {
|
||||
// TestAddrs[1] proposes (and deposits) on proposal #3
|
||||
proposal3, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
deposit3 := v1beta2.NewDeposit(proposal3.ProposalId, TestAddrs[1], oneCoins)
|
||||
deposit3 := v1beta2.NewDeposit(proposal3.Id, TestAddrs[1], oneCoins)
|
||||
depositer3, err := sdk.AccAddressFromBech32(deposit3.Depositor)
|
||||
require.NoError(t, err)
|
||||
|
||||
@ -194,7 +194,7 @@ func TestQueries(t *testing.T) {
|
||||
proposal3.TotalDeposit = sdk.NewCoins(proposal3.TotalDeposit...).Add(deposit3.Amount...)
|
||||
|
||||
// TestAddrs[1] deposits on proposals #2 & #3
|
||||
deposit4 := v1beta2.NewDeposit(proposal2.ProposalId, TestAddrs[1], depositParams.MinDeposit)
|
||||
deposit4 := v1beta2.NewDeposit(proposal2.Id, TestAddrs[1], depositParams.MinDeposit)
|
||||
depositer4, err := sdk.AccAddressFromBech32(deposit4.Depositor)
|
||||
require.NoError(t, err)
|
||||
_, err = app.GovKeeper.AddDeposit(ctx, deposit4.ProposalId, depositer4, deposit4.Amount)
|
||||
@ -205,7 +205,7 @@ func TestQueries(t *testing.T) {
|
||||
votingEndTime := ctx.BlockTime().Add(v1beta2.DefaultPeriod)
|
||||
proposal2.VotingEndTime = &votingEndTime
|
||||
|
||||
deposit5 := v1beta2.NewDeposit(proposal3.ProposalId, TestAddrs[1], depositParams.MinDeposit)
|
||||
deposit5 := v1beta2.NewDeposit(proposal3.Id, TestAddrs[1], depositParams.MinDeposit)
|
||||
depositer5, err := sdk.AccAddressFromBech32(deposit5.Depositor)
|
||||
require.NoError(t, err)
|
||||
_, err = app.GovKeeper.AddDeposit(ctx, deposit5.ProposalId, depositer5, deposit5.Amount)
|
||||
@ -220,26 +220,26 @@ func TestQueries(t *testing.T) {
|
||||
|
||||
// check deposits on proposal1 match individual deposits
|
||||
|
||||
deposits := getQueriedDeposits(t, ctx, legacyQuerierCdc, querier, proposal1.ProposalId)
|
||||
deposits := getQueriedDeposits(t, ctx, legacyQuerierCdc, querier, proposal1.Id)
|
||||
require.Len(t, deposits, 1)
|
||||
require.Equal(t, deposit1, deposits[0])
|
||||
|
||||
deposit := getQueriedDeposit(t, ctx, legacyQuerierCdc, querier, proposal1.ProposalId, TestAddrs[0])
|
||||
deposit := getQueriedDeposit(t, ctx, legacyQuerierCdc, querier, proposal1.Id, TestAddrs[0])
|
||||
require.Equal(t, deposit1, deposit)
|
||||
|
||||
// check deposits on proposal2 match individual deposits
|
||||
deposits = getQueriedDeposits(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId)
|
||||
deposits = getQueriedDeposits(t, ctx, legacyQuerierCdc, querier, proposal2.Id)
|
||||
require.Len(t, deposits, 2)
|
||||
// NOTE order of deposits is determined by the addresses
|
||||
require.Equal(t, deposit2, deposits[0])
|
||||
require.Equal(t, deposit4, deposits[1])
|
||||
|
||||
// check deposits on proposal3 match individual deposits
|
||||
deposits = getQueriedDeposits(t, ctx, legacyQuerierCdc, querier, proposal3.ProposalId)
|
||||
deposits = getQueriedDeposits(t, ctx, legacyQuerierCdc, querier, proposal3.Id)
|
||||
require.Len(t, deposits, 1)
|
||||
require.Equal(t, deposit5, deposits[0])
|
||||
|
||||
deposit = getQueriedDeposit(t, ctx, legacyQuerierCdc, querier, proposal3.ProposalId, TestAddrs[1])
|
||||
deposit = getQueriedDeposit(t, ctx, legacyQuerierCdc, querier, proposal3.Id, TestAddrs[1])
|
||||
require.Equal(t, deposit5, deposit)
|
||||
|
||||
// Only proposal #1 should be in v1beta2.Deposit Period
|
||||
@ -254,13 +254,13 @@ func TestQueries(t *testing.T) {
|
||||
checkEqualProposal(t, proposal3, *proposals[1])
|
||||
|
||||
// Addrs[0] votes on proposals #2 & #3
|
||||
vote1 := v1beta2.NewVote(proposal2.ProposalId, TestAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
|
||||
vote2 := v1beta2.NewVote(proposal3.ProposalId, TestAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
|
||||
vote1 := v1beta2.NewVote(proposal2.Id, TestAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
|
||||
vote2 := v1beta2.NewVote(proposal3.Id, TestAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
|
||||
app.GovKeeper.SetVote(ctx, vote1)
|
||||
app.GovKeeper.SetVote(ctx, vote2)
|
||||
|
||||
// Addrs[1] votes on proposal #3
|
||||
vote3 := v1beta2.NewVote(proposal3.ProposalId, TestAddrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
|
||||
vote3 := v1beta2.NewVote(proposal3.Id, TestAddrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))
|
||||
app.GovKeeper.SetVote(ctx, vote3)
|
||||
|
||||
// Test query voted by TestAddrs[0]
|
||||
@ -269,15 +269,15 @@ func TestQueries(t *testing.T) {
|
||||
checkEqualProposal(t, proposal3, *proposals[1])
|
||||
|
||||
// Test query votes on v1beta2.Proposal 2
|
||||
votes := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId, 1, 0)
|
||||
votes := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal2.Id, 1, 0)
|
||||
require.Len(t, votes, 1)
|
||||
checkEqualVotes(t, vote1, votes[0])
|
||||
|
||||
vote := getQueriedVote(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId, TestAddrs[0])
|
||||
vote := getQueriedVote(t, ctx, legacyQuerierCdc, querier, proposal2.Id, TestAddrs[0])
|
||||
checkEqualVotes(t, vote1, vote)
|
||||
|
||||
// Test query votes on v1beta2.Proposal 3
|
||||
votes = getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal3.ProposalId, 1, 0)
|
||||
votes = getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal3.Id, 1, 0)
|
||||
require.Len(t, votes, 2)
|
||||
checkEqualVotes(t, vote2, votes[0])
|
||||
checkEqualVotes(t, vote3, votes[1])
|
||||
@ -290,20 +290,20 @@ func TestQueries(t *testing.T) {
|
||||
|
||||
// Test query voted by TestAddrs[1]
|
||||
proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, TestAddrs[1], v1beta2.StatusNil, 1, 0)
|
||||
require.Equal(t, proposal3.ProposalId, proposals[0].ProposalId)
|
||||
require.Equal(t, proposal3.Id, proposals[0].Id)
|
||||
|
||||
// Test query deposited by TestAddrs[0]
|
||||
proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, TestAddrs[0], nil, v1beta2.StatusNil, 1, 0)
|
||||
require.Equal(t, proposal1.ProposalId, proposals[0].ProposalId)
|
||||
require.Equal(t, proposal1.Id, proposals[0].Id)
|
||||
|
||||
// Test query deposited by addr2
|
||||
proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, TestAddrs[1], nil, v1beta2.StatusNil, 1, 0)
|
||||
require.Equal(t, proposal2.ProposalId, proposals[0].ProposalId)
|
||||
require.Equal(t, proposal3.ProposalId, proposals[1].ProposalId)
|
||||
require.Equal(t, proposal2.Id, proposals[0].Id)
|
||||
require.Equal(t, proposal3.Id, proposals[1].Id)
|
||||
|
||||
// Test query voted AND deposited by addr1
|
||||
proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, TestAddrs[0], TestAddrs[0], v1beta2.StatusNil, 1, 0)
|
||||
require.Equal(t, proposal2.ProposalId, proposals[0].ProposalId)
|
||||
require.Equal(t, proposal2.Id, proposals[0].Id)
|
||||
}
|
||||
|
||||
func TestPaginatedVotesQuery(t *testing.T) {
|
||||
@ -312,8 +312,8 @@ func TestPaginatedVotesQuery(t *testing.T) {
|
||||
legacyQuerierCdc := app.LegacyAmino()
|
||||
|
||||
proposal := v1beta2.Proposal{
|
||||
ProposalId: 100,
|
||||
Status: v1beta2.StatusVotingPeriod,
|
||||
Id: 100,
|
||||
Status: v1beta2.StatusVotingPeriod,
|
||||
}
|
||||
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
@ -334,7 +334,7 @@ func TestPaginatedVotesQuery(t *testing.T) {
|
||||
}
|
||||
for i := range votes {
|
||||
vote := v1beta2.Vote{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
Voter: genAddr(),
|
||||
Options: v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes),
|
||||
}
|
||||
@ -345,7 +345,7 @@ func TestPaginatedVotesQuery(t *testing.T) {
|
||||
querier := keeper.NewQuerier(app.GovKeeper, legacyQuerierCdc)
|
||||
|
||||
// keeper preserves consistent order for each query, but this is not the insertion order
|
||||
all := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal.ProposalId, 1, 0)
|
||||
all := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal.Id, 1, 0)
|
||||
require.Equal(t, len(all), len(votes))
|
||||
|
||||
type testCase struct {
|
||||
@ -379,7 +379,7 @@ func TestPaginatedVotesQuery(t *testing.T) {
|
||||
} {
|
||||
tc := tc
|
||||
t.Run(tc.description, func(t *testing.T) {
|
||||
votes := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal.ProposalId, tc.page, tc.limit)
|
||||
votes := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal.Id, tc.page, tc.limit)
|
||||
require.Equal(t, len(tc.votes), len(votes))
|
||||
for i := range votes {
|
||||
require.Equal(t, tc.votes[i], votes[i])
|
||||
@ -415,7 +415,7 @@ func checkEqualVotes(t *testing.T, vote1, vote2 v1beta2.Vote) {
|
||||
// + loc: (*time.Location)(<nil>)
|
||||
// + }),
|
||||
func checkEqualProposal(t *testing.T, p1, p2 v1beta2.Proposal) {
|
||||
require.Equal(t, p1.ProposalId, p2.ProposalId)
|
||||
require.Equal(t, p1.Id, p2.Id)
|
||||
require.Equal(t, p1.Messages, p2.Messages)
|
||||
require.Equal(t, p1.Status, p2.Status)
|
||||
require.Equal(t, p1.FinalTallyResult, p2.FinalTallyResult)
|
||||
|
||||
@ -33,7 +33,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1beta2.Proposal) (passes b
|
||||
return false
|
||||
})
|
||||
|
||||
keeper.IterateVotes(ctx, proposal.ProposalId, func(vote v1beta2.Vote) bool {
|
||||
keeper.IterateVotes(ctx, proposal.Id, func(vote v1beta2.Vote) bool {
|
||||
// if validator, just record it in the map
|
||||
voter, err := sdk.AccAddressFromBech32(vote.Voter)
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ func TestTallyNoOneVotes(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -46,7 +46,7 @@ func TestTallyNoQuorum(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -69,7 +69,7 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) {
|
||||
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -95,7 +95,7 @@ func TestTallyOnlyValidators51No(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -119,7 +119,7 @@ func TestTallyOnlyValidators51Yes(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -144,7 +144,7 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -170,7 +170,7 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -196,7 +196,7 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -223,7 +223,7 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -257,7 +257,7 @@ func TestTallyDelgatorOverride(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -293,7 +293,7 @@ func TestTallyDelgatorInherit(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -332,7 +332,7 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -374,7 +374,7 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -417,7 +417,7 @@ func TestTallyJailedValidator(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
@ -450,7 +450,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
proposal.Status = v1beta2.StatusVotingPeriod
|
||||
app.GovKeeper.SetProposal(ctx, proposal)
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ func TestVotes(t *testing.T) {
|
||||
tp := TestProposal
|
||||
proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil)
|
||||
require.NoError(t, err)
|
||||
proposalID := proposal.ProposalId
|
||||
proposalID := proposal.Id
|
||||
|
||||
var invalidOption v1beta2.VoteOption = 0x10
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ import (
|
||||
func ConvertToLegacyProposal(proposal v1beta2.Proposal) (v1beta1.Proposal, error) {
|
||||
var err error
|
||||
legacyProposal := v1beta1.Proposal{
|
||||
ProposalId: proposal.ProposalId,
|
||||
ProposalId: proposal.Id,
|
||||
Status: v1beta1.ProposalStatus(proposal.Status),
|
||||
TotalDeposit: types.NewCoins(proposal.TotalDeposit...),
|
||||
}
|
||||
@ -60,21 +60,21 @@ func ConvertToLegacyProposal(proposal v1beta2.Proposal) (v1beta1.Proposal, error
|
||||
}
|
||||
|
||||
func ConvertToLegacyTallyResult(tally *v1beta2.TallyResult) (v1beta1.TallyResult, error) {
|
||||
yes, ok := types.NewIntFromString(tally.Yes)
|
||||
yes, ok := types.NewIntFromString(tally.YesCount)
|
||||
if !ok {
|
||||
return v1beta1.TallyResult{}, fmt.Errorf("unable to convert yes tally string (%s) to int", tally.Yes)
|
||||
return v1beta1.TallyResult{}, fmt.Errorf("unable to convert yes tally string (%s) to int", tally.YesCount)
|
||||
}
|
||||
no, ok := types.NewIntFromString(tally.No)
|
||||
no, ok := types.NewIntFromString(tally.NoCount)
|
||||
if !ok {
|
||||
return v1beta1.TallyResult{}, fmt.Errorf("unable to convert no tally string (%s) to int", tally.No)
|
||||
return v1beta1.TallyResult{}, fmt.Errorf("unable to convert no tally string (%s) to int", tally.NoCount)
|
||||
}
|
||||
veto, ok := types.NewIntFromString(tally.NoWithVeto)
|
||||
veto, ok := types.NewIntFromString(tally.NoWithVetoCount)
|
||||
if !ok {
|
||||
return v1beta1.TallyResult{}, fmt.Errorf("unable to convert no with veto tally string (%s) to int", tally.NoWithVeto)
|
||||
return v1beta1.TallyResult{}, fmt.Errorf("unable to convert no with veto tally string (%s) to int", tally.NoWithVetoCount)
|
||||
}
|
||||
abstain, ok := types.NewIntFromString(tally.Abstain)
|
||||
abstain, ok := types.NewIntFromString(tally.AbstainCount)
|
||||
if !ok {
|
||||
return v1beta1.TallyResult{}, fmt.Errorf("unable to convert abstain tally string (%s) to int", tally.Abstain)
|
||||
return v1beta1.TallyResult{}, fmt.Errorf("unable to convert abstain tally string (%s) to int", tally.AbstainCount)
|
||||
}
|
||||
|
||||
return v1beta1.TallyResult{
|
||||
@ -195,14 +195,14 @@ func convertToNewProposal(oldProp v1beta1.Proposal) (v1beta2.Proposal, error) {
|
||||
}
|
||||
|
||||
return v1beta2.Proposal{
|
||||
ProposalId: oldProp.ProposalId,
|
||||
Messages: []*codectypes.Any{msgAny},
|
||||
Status: v1beta2.ProposalStatus(oldProp.Status),
|
||||
Id: oldProp.ProposalId,
|
||||
Messages: []*codectypes.Any{msgAny},
|
||||
Status: v1beta2.ProposalStatus(oldProp.Status),
|
||||
FinalTallyResult: &v1beta2.TallyResult{
|
||||
Yes: oldProp.FinalTallyResult.Yes.String(),
|
||||
No: oldProp.FinalTallyResult.No.String(),
|
||||
Abstain: oldProp.FinalTallyResult.Abstain.String(),
|
||||
NoWithVeto: oldProp.FinalTallyResult.NoWithVeto.String(),
|
||||
YesCount: oldProp.FinalTallyResult.Yes.String(),
|
||||
NoCount: oldProp.FinalTallyResult.No.String(),
|
||||
AbstainCount: oldProp.FinalTallyResult.Abstain.String(),
|
||||
NoWithVetoCount: oldProp.FinalTallyResult.NoWithVeto.String(),
|
||||
},
|
||||
SubmitTime: &oldProp.SubmitTime,
|
||||
DepositEndTime: &oldProp.DepositEndTime,
|
||||
|
||||
@ -87,11 +87,12 @@ func TestMigrateJSON(t *testing.T) {
|
||||
{
|
||||
"deposit_end_time": "2001-09-09T01:46:40Z",
|
||||
"final_tally_result": {
|
||||
"abstain": "0",
|
||||
"no": "0",
|
||||
"no_with_veto": "0",
|
||||
"yes": "0"
|
||||
"abstain_count": "0",
|
||||
"no_count": "0",
|
||||
"no_with_veto_count": "0",
|
||||
"yes_count": "0"
|
||||
},
|
||||
"id": "1",
|
||||
"messages": [
|
||||
{
|
||||
"@type": "/cosmos.gov.v1beta2.MsgExecLegacyContent",
|
||||
@ -104,7 +105,6 @@ func TestMigrateJSON(t *testing.T) {
|
||||
}
|
||||
],
|
||||
"metadata": null,
|
||||
"proposal_id": "1",
|
||||
"status": "PROPOSAL_STATUS_DEPOSIT_PERIOD",
|
||||
"submit_time": "2001-09-09T01:46:40Z",
|
||||
"total_deposit": [
|
||||
|
||||
@ -55,13 +55,13 @@ func TestMigrateStore(t *testing.T) {
|
||||
}
|
||||
|
||||
func compareProps(t *testing.T, oldProp v1beta1.Proposal, newProp v1beta2.Proposal) {
|
||||
require.Equal(t, oldProp.ProposalId, newProp.ProposalId)
|
||||
require.Equal(t, oldProp.ProposalId, newProp.Id)
|
||||
require.Equal(t, oldProp.TotalDeposit.String(), sdk.Coins(newProp.TotalDeposit).String())
|
||||
require.Equal(t, oldProp.Status.String(), newProp.Status.String())
|
||||
require.Equal(t, oldProp.FinalTallyResult.Yes.String(), newProp.FinalTallyResult.Yes)
|
||||
require.Equal(t, oldProp.FinalTallyResult.No.String(), newProp.FinalTallyResult.No)
|
||||
require.Equal(t, oldProp.FinalTallyResult.NoWithVeto.String(), newProp.FinalTallyResult.NoWithVeto)
|
||||
require.Equal(t, oldProp.FinalTallyResult.Abstain.String(), newProp.FinalTallyResult.Abstain)
|
||||
require.Equal(t, oldProp.FinalTallyResult.Yes.String(), newProp.FinalTallyResult.YesCount)
|
||||
require.Equal(t, oldProp.FinalTallyResult.No.String(), newProp.FinalTallyResult.NoCount)
|
||||
require.Equal(t, oldProp.FinalTallyResult.NoWithVeto.String(), newProp.FinalTallyResult.NoWithVetoCount)
|
||||
require.Equal(t, oldProp.FinalTallyResult.Abstain.String(), newProp.FinalTallyResult.AbstainCount)
|
||||
|
||||
newContent := newProp.Messages[0].GetCachedValue().(*v1beta2.MsgExecLegacyContent).Content.GetCachedValue().(v1beta1.Content)
|
||||
require.Equal(t, oldProp.Content.GetCachedValue().(v1beta1.Content), newContent)
|
||||
|
||||
@ -242,9 +242,12 @@ var xxx_messageInfo_Deposit proto.InternalMessageInfo
|
||||
|
||||
// Proposal defines the core field members of a governance proposal.
|
||||
type Proposal struct {
|
||||
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
|
||||
Content *types1.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
|
||||
Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty"`
|
||||
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
|
||||
Content *types1.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
|
||||
Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty"`
|
||||
// final_tally_result is the final tally result of the proposal. When
|
||||
// querying a proposal via gRPC, this field is not populated until the
|
||||
// proposal's voting period has ended.
|
||||
FinalTallyResult TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result"`
|
||||
SubmitTime time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time"`
|
||||
DepositEndTime time.Time `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time"`
|
||||
|
||||
@ -237,15 +237,18 @@ func (m *Deposit) GetAmount() []types.Coin {
|
||||
|
||||
// Proposal defines the core field members of a governance proposal.
|
||||
type Proposal struct {
|
||||
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
|
||||
Messages []*types1.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"`
|
||||
Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta2.ProposalStatus" json:"status,omitempty"`
|
||||
FinalTallyResult *TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result,omitempty"`
|
||||
SubmitTime *time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time,omitempty"`
|
||||
DepositEndTime *time.Time `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time,omitempty"`
|
||||
TotalDeposit []types.Coin `protobuf:"bytes,7,rep,name=total_deposit,json=totalDeposit,proto3" json:"total_deposit"`
|
||||
VotingStartTime *time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time,omitempty"`
|
||||
VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"`
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Messages []*types1.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"`
|
||||
Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta2.ProposalStatus" json:"status,omitempty"`
|
||||
// final_tally_result is the final tally result of the proposal. When
|
||||
// querying a proposal via gRPC, this field is not populated until the
|
||||
// proposal's voting period has ended.
|
||||
FinalTallyResult *TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result,omitempty"`
|
||||
SubmitTime *time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time,omitempty"`
|
||||
DepositEndTime *time.Time `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time,omitempty"`
|
||||
TotalDeposit []types.Coin `protobuf:"bytes,7,rep,name=total_deposit,json=totalDeposit,proto3" json:"total_deposit"`
|
||||
VotingStartTime *time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time,omitempty"`
|
||||
VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"`
|
||||
// metadata is any arbitrary metadata attached to the proposal.
|
||||
Metadata []byte `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
||||
}
|
||||
@ -283,9 +286,9 @@ func (m *Proposal) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_Proposal proto.InternalMessageInfo
|
||||
|
||||
func (m *Proposal) GetProposalId() uint64 {
|
||||
func (m *Proposal) GetId() uint64 {
|
||||
if m != nil {
|
||||
return m.ProposalId
|
||||
return m.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@ -355,10 +358,10 @@ func (m *Proposal) GetMetadata() []byte {
|
||||
|
||||
// TallyResult defines a standard tally for a governance proposal.
|
||||
type TallyResult struct {
|
||||
Yes string `protobuf:"bytes,1,opt,name=yes,proto3" json:"yes,omitempty"`
|
||||
Abstain string `protobuf:"bytes,2,opt,name=abstain,proto3" json:"abstain,omitempty"`
|
||||
No string `protobuf:"bytes,3,opt,name=no,proto3" json:"no,omitempty"`
|
||||
NoWithVeto string `protobuf:"bytes,4,opt,name=no_with_veto,json=noWithVeto,proto3" json:"no_with_veto,omitempty"`
|
||||
YesCount string `protobuf:"bytes,1,opt,name=yes_count,json=yesCount,proto3" json:"yes_count,omitempty"`
|
||||
AbstainCount string `protobuf:"bytes,2,opt,name=abstain_count,json=abstainCount,proto3" json:"abstain_count,omitempty"`
|
||||
NoCount string `protobuf:"bytes,3,opt,name=no_count,json=noCount,proto3" json:"no_count,omitempty"`
|
||||
NoWithVetoCount string `protobuf:"bytes,4,opt,name=no_with_veto_count,json=noWithVetoCount,proto3" json:"no_with_veto_count,omitempty"`
|
||||
}
|
||||
|
||||
func (m *TallyResult) Reset() { *m = TallyResult{} }
|
||||
@ -394,30 +397,30 @@ func (m *TallyResult) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_TallyResult proto.InternalMessageInfo
|
||||
|
||||
func (m *TallyResult) GetYes() string {
|
||||
func (m *TallyResult) GetYesCount() string {
|
||||
if m != nil {
|
||||
return m.Yes
|
||||
return m.YesCount
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *TallyResult) GetAbstain() string {
|
||||
func (m *TallyResult) GetAbstainCount() string {
|
||||
if m != nil {
|
||||
return m.Abstain
|
||||
return m.AbstainCount
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *TallyResult) GetNo() string {
|
||||
func (m *TallyResult) GetNoCount() string {
|
||||
if m != nil {
|
||||
return m.No
|
||||
return m.NoCount
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *TallyResult) GetNoWithVeto() string {
|
||||
func (m *TallyResult) GetNoWithVetoCount() string {
|
||||
if m != nil {
|
||||
return m.NoWithVeto
|
||||
return m.NoWithVetoCount
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@ -668,75 +671,76 @@ func init() {
|
||||
func init() { proto.RegisterFile("cosmos/gov/v1beta2/gov.proto", fileDescriptor_5abf7b8852811c49) }
|
||||
|
||||
var fileDescriptor_5abf7b8852811c49 = []byte{
|
||||
// 1087 bytes of a gzipped FileDescriptorProto
|
||||
// 1103 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x41, 0x53, 0xdb, 0x46,
|
||||
0x14, 0x46, 0xb6, 0x30, 0xf0, 0x0c, 0x8e, 0xba, 0xd0, 0x46, 0x10, 0x62, 0xbb, 0x9e, 0x36, 0xe3,
|
||||
0x61, 0x8a, 0x0d, 0x74, 0x26, 0x9d, 0xc9, 0xa9, 0x36, 0x56, 0x1a, 0x33, 0x14, 0xbb, 0x92, 0x62,
|
||||
0x14, 0x46, 0xb6, 0x30, 0xe6, 0x19, 0x8c, 0xba, 0xd0, 0x46, 0x10, 0x62, 0x53, 0x4f, 0x9b, 0xa1,
|
||||
0xb4, 0xd8, 0x81, 0xcc, 0xa4, 0x33, 0xe9, 0xa5, 0x36, 0x56, 0x1a, 0x33, 0x14, 0xbb, 0x92, 0x62,
|
||||
0x26, 0xbd, 0x68, 0x64, 0xb4, 0xb1, 0x35, 0xb5, 0xb4, 0xae, 0x76, 0x4d, 0xf0, 0x4f, 0xe8, 0x2d,
|
||||
0xc7, 0xce, 0xf4, 0xd0, 0x1f, 0xd0, 0x6b, 0x7e, 0x44, 0x4e, 0x9d, 0x4c, 0x4e, 0xed, 0xc5, 0x6d,
|
||||
0xe1, 0xc6, 0xad, 0xff, 0x20, 0xa3, 0xd5, 0x0a, 0x1b, 0x9b, 0x0c, 0x9c, 0xbc, 0x7a, 0xef, 0xfb,
|
||||
0xbe, 0xf7, 0x9e, 0xf6, 0xdb, 0xb5, 0x60, 0xf3, 0x84, 0x50, 0x8f, 0xd0, 0x72, 0x87, 0x9c, 0x96,
|
||||
0x4f, 0x77, 0xdb, 0x98, 0xd9, 0x7b, 0xe1, 0xba, 0xd4, 0x0f, 0x08, 0x23, 0x08, 0x45, 0xd9, 0x52,
|
||||
0x18, 0x11, 0xd9, 0x8d, 0xac, 0x60, 0xb4, 0x6d, 0x8a, 0x05, 0x65, 0xb7, 0x7c, 0x42, 0x5c, 0x3f,
|
||||
0xe2, 0x6c, 0xac, 0x75, 0x48, 0x87, 0xf0, 0x65, 0x39, 0x5c, 0x89, 0x68, 0xae, 0x43, 0x48, 0xa7,
|
||||
0x87, 0xcb, 0xfc, 0xa9, 0x3d, 0x78, 0x59, 0x66, 0xae, 0x87, 0x29, 0xb3, 0xbd, 0xbe, 0x00, 0xac,
|
||||
0x4f, 0x03, 0x6c, 0x7f, 0x28, 0x52, 0xd9, 0xe9, 0x94, 0x33, 0x08, 0x6c, 0xe6, 0x92, 0xb8, 0xe2,
|
||||
0x7a, 0xd4, 0x91, 0x15, 0x15, 0x15, 0x2d, 0xf3, 0x87, 0x02, 0x03, 0x74, 0x8c, 0xdd, 0x4e, 0x97,
|
||||
0x61, 0xa7, 0x45, 0x18, 0x6e, 0xf4, 0x43, 0x1a, 0x7a, 0x0c, 0x29, 0xc2, 0x57, 0xaa, 0x94, 0x97,
|
||||
0x8a, 0x99, 0xbd, 0x6c, 0x69, 0x76, 0xce, 0xd2, 0x18, 0xaf, 0x0b, 0x34, 0x7a, 0x04, 0xa9, 0x57,
|
||||
0x5c, 0x4d, 0x4d, 0xe4, 0xa5, 0xe2, 0x52, 0x35, 0xf3, 0xfe, 0xcd, 0x36, 0x08, 0x6a, 0x0d, 0x9f,
|
||||
0xe8, 0x22, 0x5b, 0xf8, 0x4d, 0x82, 0x85, 0x1a, 0xee, 0x13, 0xea, 0x32, 0x94, 0x83, 0x74, 0x3f,
|
||||
0x20, 0x7d, 0x42, 0xed, 0x9e, 0xe5, 0x3a, 0xbc, 0xa0, 0xac, 0x43, 0x1c, 0xaa, 0x3b, 0xe8, 0x31,
|
||||
0x2c, 0x39, 0x11, 0x96, 0x04, 0x42, 0x57, 0x7d, 0xff, 0x66, 0x7b, 0x4d, 0xe8, 0x56, 0x1c, 0x27,
|
||||
0xc0, 0x94, 0x1a, 0x2c, 0x70, 0xfd, 0x8e, 0x3e, 0x86, 0xa2, 0x6f, 0x20, 0x65, 0x7b, 0x64, 0xe0,
|
||||
0x33, 0x35, 0x99, 0x4f, 0x16, 0xd3, 0x7b, 0xeb, 0xf1, 0x10, 0xe1, 0xc6, 0x88, 0x29, 0x76, 0x4b,
|
||||
0xfb, 0xc4, 0xf5, 0xab, 0xf2, 0xdb, 0x51, 0x6e, 0x4e, 0x17, 0xf0, 0xc2, 0xff, 0x32, 0x2c, 0x36,
|
||||
0x45, 0xfd, 0xdb, 0xdb, 0xdb, 0x81, 0x45, 0x0f, 0x53, 0x6a, 0x77, 0x30, 0x55, 0x13, 0xbc, 0xd0,
|
||||
0x5a, 0x29, 0xda, 0x8f, 0x52, 0xbc, 0x1f, 0xa5, 0x8a, 0x3f, 0xd4, 0xaf, 0x50, 0xe8, 0x09, 0xa4,
|
||||
0x28, 0xb3, 0xd9, 0x80, 0xaa, 0x49, 0xfe, 0x76, 0x0b, 0x37, 0xbd, 0xdd, 0xb8, 0x01, 0x83, 0x23,
|
||||
0x75, 0xc1, 0x40, 0xdf, 0x03, 0x7a, 0xe9, 0xfa, 0x76, 0xcf, 0x62, 0x76, 0xaf, 0x37, 0xb4, 0x02,
|
||||
0x4c, 0x07, 0x3d, 0xa6, 0xca, 0x79, 0xa9, 0x98, 0xde, 0xcb, 0xdd, 0xa4, 0x63, 0x86, 0x38, 0x9d,
|
||||
0xc3, 0x74, 0x85, 0x53, 0x27, 0x22, 0xa8, 0x02, 0x69, 0x3a, 0x68, 0x7b, 0x2e, 0xb3, 0x42, 0xbb,
|
||||
0xa9, 0xf3, 0x5c, 0x67, 0x63, 0xa6, 0x7f, 0x33, 0xf6, 0x62, 0x55, 0x7e, 0xfd, 0x4f, 0x4e, 0xd2,
|
||||
0x21, 0x22, 0x85, 0x61, 0x74, 0x00, 0x8a, 0x78, 0xe7, 0x16, 0xf6, 0x9d, 0x48, 0x27, 0x75, 0x47,
|
||||
0x9d, 0x8c, 0x60, 0x6a, 0xbe, 0xc3, 0xb5, 0x6a, 0xb0, 0xc2, 0x08, 0xb3, 0x7b, 0x96, 0x88, 0xab,
|
||||
0x0b, 0x77, 0xdb, 0xb9, 0x65, 0xce, 0x8a, 0x1d, 0x75, 0x08, 0x9f, 0x9c, 0x12, 0xe6, 0xfa, 0x1d,
|
||||
0x8b, 0x32, 0x3b, 0x10, 0xa3, 0x2d, 0xde, 0xb1, 0xa5, 0x7b, 0x11, 0xd5, 0x08, 0x99, 0xbc, 0xa7,
|
||||
0x67, 0x20, 0x42, 0xe3, 0xf1, 0x96, 0xee, 0xa8, 0xb5, 0x12, 0x11, 0xe3, 0xe9, 0x36, 0x42, 0xa7,
|
||||
0x30, 0xdb, 0xb1, 0x99, 0xad, 0x42, 0x5e, 0x2a, 0x2e, 0xeb, 0x57, 0xcf, 0x85, 0x3f, 0x24, 0x48,
|
||||
0x4f, 0x6e, 0x4c, 0x1e, 0x92, 0x43, 0x4c, 0xb9, 0xdd, 0xae, 0x1f, 0xa3, 0xba, 0xcf, 0xf4, 0x30,
|
||||
0x85, 0x8a, 0xb0, 0x60, 0xb7, 0x29, 0xb3, 0x5d, 0xff, 0x86, 0xc3, 0x16, 0xa2, 0xe2, 0x34, 0xca,
|
||||
0x42, 0xc2, 0x27, 0xdc, 0x6b, 0xb3, 0xa0, 0x84, 0x4f, 0xd0, 0x0e, 0x2c, 0xfb, 0xc4, 0x7a, 0xe5,
|
||||
0xb2, 0xae, 0x75, 0x8a, 0x19, 0xe1, 0x6e, 0x9a, 0x45, 0x82, 0x4f, 0x8e, 0x5d, 0xd6, 0x6d, 0x61,
|
||||
0x46, 0x0a, 0xbf, 0x4b, 0x20, 0x87, 0xc7, 0xff, 0xf6, 0xd3, 0x51, 0x82, 0xf9, 0x53, 0xc2, 0xf0,
|
||||
0xed, 0x07, 0x37, 0x82, 0xa1, 0x6f, 0x61, 0x21, 0xba, 0x4b, 0xa8, 0x2a, 0xf3, 0xbd, 0x7f, 0x74,
|
||||
0x93, 0xa9, 0x67, 0xaf, 0x2c, 0x3d, 0xa6, 0x1d, 0xc8, 0x8b, 0x49, 0x45, 0x2e, 0xfc, 0x2d, 0xc1,
|
||||
0x8a, 0xf0, 0x43, 0xd3, 0x0e, 0x6c, 0x8f, 0xa2, 0x17, 0x90, 0xf6, 0x5c, 0xff, 0xca, 0x59, 0xd2,
|
||||
0x6d, 0xce, 0x7a, 0x18, 0x3a, 0xeb, 0x72, 0x94, 0xfb, 0x74, 0x82, 0xf5, 0x15, 0xf1, 0x5c, 0x86,
|
||||
0xbd, 0x3e, 0x1b, 0xea, 0xe0, 0xb9, 0x7e, 0x6c, 0x38, 0x0f, 0x90, 0x67, 0x9f, 0xc5, 0x20, 0xab,
|
||||
0x8f, 0x03, 0x97, 0x38, 0x7c, 0xe2, 0xb0, 0xc2, 0xb4, 0x4b, 0x6a, 0xe2, 0x72, 0xae, 0x7e, 0x71,
|
||||
0x39, 0xca, 0x6d, 0xce, 0x12, 0xc7, 0x45, 0x7e, 0x0d, 0x4d, 0xa4, 0x78, 0xf6, 0x59, 0x3c, 0x09,
|
||||
0xcf, 0x17, 0x4c, 0x58, 0x6e, 0x71, 0x63, 0x89, 0xc9, 0x6a, 0x20, 0x8c, 0x16, 0x57, 0x96, 0x6e,
|
||||
0xab, 0x2c, 0x73, 0xe5, 0xe5, 0x88, 0x25, 0x54, 0xff, 0x8b, 0x1d, 0x28, 0x54, 0x9f, 0x40, 0xea,
|
||||
0xe7, 0x01, 0x09, 0x06, 0x9e, 0x30, 0x61, 0xe1, 0x72, 0x94, 0x53, 0xa2, 0xc8, 0xb8, 0xc3, 0xe9,
|
||||
0xfb, 0x3d, 0xca, 0xa3, 0x7d, 0x58, 0x62, 0xdd, 0x00, 0xd3, 0x2e, 0xe9, 0x39, 0x62, 0xe7, 0xbf,
|
||||
0xbc, 0x1c, 0xe5, 0x56, 0xaf, 0x82, 0x1f, 0x55, 0x18, 0xf3, 0xd0, 0x0f, 0x90, 0x09, 0xed, 0x68,
|
||||
0x8d, 0x95, 0x22, 0x0b, 0x6f, 0x5d, 0x8e, 0x72, 0xea, 0xf5, 0xcc, 0x47, 0xe5, 0x56, 0x42, 0x9c,
|
||||
0x19, 0xc3, 0xb6, 0x7e, 0x91, 0x00, 0x26, 0xfe, 0xe6, 0x1e, 0xc0, 0xfd, 0x56, 0xc3, 0xd4, 0xac,
|
||||
0x46, 0xd3, 0xac, 0x37, 0x8e, 0xac, 0xe7, 0x47, 0x46, 0x53, 0xdb, 0xaf, 0x3f, 0xad, 0x6b, 0x35,
|
||||
0x65, 0x0e, 0xad, 0xc2, 0xbd, 0xc9, 0xe4, 0x0b, 0xcd, 0x50, 0x24, 0x74, 0x1f, 0x56, 0x27, 0x83,
|
||||
0x95, 0xaa, 0x61, 0x56, 0xea, 0x47, 0x4a, 0x02, 0x21, 0xc8, 0x4c, 0x26, 0x8e, 0x1a, 0x4a, 0x12,
|
||||
0x6d, 0x82, 0x7a, 0x3d, 0x66, 0x1d, 0xd7, 0xcd, 0x67, 0x56, 0x4b, 0x33, 0x1b, 0x8a, 0xbc, 0xf5,
|
||||
0xa7, 0x04, 0x99, 0xeb, 0x97, 0x3c, 0xca, 0xc1, 0x83, 0xa6, 0xde, 0x68, 0x36, 0x8c, 0xca, 0xa1,
|
||||
0x65, 0x98, 0x15, 0xf3, 0xb9, 0x31, 0xd5, 0x53, 0x01, 0xb2, 0xd3, 0x80, 0x9a, 0xd6, 0x6c, 0x18,
|
||||
0x75, 0xd3, 0x6a, 0x6a, 0x7a, 0xbd, 0x51, 0x53, 0x24, 0xf4, 0x39, 0x3c, 0x9c, 0xc6, 0xb4, 0x1a,
|
||||
0x66, 0xfd, 0xe8, 0xbb, 0x18, 0x92, 0x40, 0x1b, 0xf0, 0xd9, 0x34, 0xa4, 0x59, 0x31, 0x0c, 0xad,
|
||||
0x16, 0x35, 0x3d, 0x9d, 0xd3, 0xb5, 0x03, 0x6d, 0xdf, 0xd4, 0x6a, 0x8a, 0x7c, 0x13, 0xf3, 0x69,
|
||||
0xa5, 0x7e, 0xa8, 0xd5, 0x94, 0xf9, 0xea, 0xc1, 0xdb, 0xf3, 0xac, 0xf4, 0xee, 0x3c, 0x2b, 0xfd,
|
||||
0x7b, 0x9e, 0x95, 0x5e, 0x5f, 0x64, 0xe7, 0xde, 0x5d, 0x64, 0xe7, 0xfe, 0xba, 0xc8, 0xce, 0xfd,
|
||||
0xb8, 0xd3, 0x71, 0x59, 0x77, 0xd0, 0x2e, 0x9d, 0x10, 0x4f, 0x7c, 0x7d, 0x88, 0x9f, 0x6d, 0xea,
|
||||
0xfc, 0x54, 0x3e, 0xe3, 0xdf, 0x56, 0x6c, 0xd8, 0xc7, 0x34, 0xfe, 0xc2, 0x6a, 0xa7, 0xb8, 0x67,
|
||||
0xbf, 0xfe, 0x10, 0x00, 0x00, 0xff, 0xff, 0x71, 0x11, 0x94, 0x66, 0x7e, 0x09, 0x00, 0x00,
|
||||
0xc7, 0xce, 0xf4, 0xd0, 0x3f, 0x91, 0x1f, 0x91, 0x53, 0x27, 0x93, 0x4b, 0xdb, 0x8b, 0x9b, 0xc2,
|
||||
0x8d, 0x5f, 0x91, 0xd1, 0x6a, 0x85, 0x8d, 0x71, 0x06, 0x4e, 0x96, 0xde, 0xfb, 0xbe, 0xef, 0xbd,
|
||||
0xb7, 0xfb, 0xed, 0x5a, 0xb0, 0x7e, 0x4c, 0xa8, 0x47, 0x68, 0xa9, 0x4d, 0x4e, 0x4a, 0x27, 0x3b,
|
||||
0x2d, 0xcc, 0xec, 0xdd, 0xf0, 0xb9, 0xd8, 0x0b, 0x08, 0x23, 0x08, 0x45, 0xd9, 0x62, 0x18, 0x11,
|
||||
0xd9, 0xb5, 0x9c, 0x60, 0xb4, 0x6c, 0x8a, 0x05, 0x65, 0xa7, 0x74, 0x4c, 0x5c, 0x3f, 0xe2, 0xac,
|
||||
0xad, 0xb4, 0x49, 0x9b, 0xf0, 0xc7, 0x52, 0xf8, 0x24, 0xa2, 0xf9, 0x36, 0x21, 0xed, 0x2e, 0x2e,
|
||||
0xf1, 0xb7, 0x56, 0xff, 0x45, 0x89, 0xb9, 0x1e, 0xa6, 0xcc, 0xf6, 0x7a, 0x02, 0xb0, 0x3a, 0x09,
|
||||
0xb0, 0xfd, 0x81, 0x48, 0xe5, 0x26, 0x53, 0x4e, 0x3f, 0xb0, 0x99, 0x4b, 0xe2, 0x8a, 0xab, 0x51,
|
||||
0x47, 0x56, 0x54, 0x54, 0xb4, 0xcc, 0x5f, 0x0a, 0x0c, 0xd0, 0x11, 0x76, 0xdb, 0x1d, 0x86, 0x9d,
|
||||
0x26, 0x61, 0xb8, 0xde, 0x0b, 0x69, 0xe8, 0x11, 0xa4, 0x08, 0x7f, 0x52, 0xa5, 0x0d, 0x69, 0x33,
|
||||
0xbb, 0x9b, 0x2b, 0x5e, 0x9f, 0xb3, 0x38, 0xc2, 0xeb, 0x02, 0x8d, 0xee, 0x43, 0xea, 0x25, 0x57,
|
||||
0x53, 0x13, 0x1b, 0xd2, 0xe6, 0x7c, 0x25, 0xfb, 0xee, 0xf5, 0x36, 0x08, 0x6a, 0x15, 0x1f, 0xeb,
|
||||
0x22, 0x5b, 0xf8, 0x43, 0x82, 0xb9, 0x2a, 0xee, 0x11, 0xea, 0x32, 0x94, 0x87, 0x4c, 0x2f, 0x20,
|
||||
0x3d, 0x42, 0xed, 0xae, 0xe5, 0x3a, 0xbc, 0xa0, 0xac, 0x43, 0x1c, 0xaa, 0x39, 0xe8, 0x11, 0xcc,
|
||||
0x3b, 0x11, 0x96, 0x04, 0x42, 0x57, 0x7d, 0xf7, 0x7a, 0x7b, 0x45, 0xe8, 0x96, 0x1d, 0x27, 0xc0,
|
||||
0x94, 0x1a, 0x2c, 0x70, 0xfd, 0xb6, 0x3e, 0x82, 0xa2, 0x6f, 0x21, 0x65, 0x7b, 0xa4, 0xef, 0x33,
|
||||
0x35, 0xb9, 0x91, 0xdc, 0xcc, 0xec, 0xae, 0xc6, 0x43, 0x84, 0x1b, 0x23, 0xa6, 0xd8, 0x29, 0xee,
|
||||
0x11, 0xd7, 0xaf, 0xc8, 0x6f, 0x86, 0xf9, 0x19, 0x5d, 0xc0, 0x0b, 0xef, 0x65, 0x48, 0x37, 0x44,
|
||||
0x7d, 0x94, 0x85, 0xc4, 0x65, 0x57, 0x09, 0xd7, 0x41, 0x0f, 0x20, 0xed, 0x61, 0x4a, 0xed, 0x36,
|
||||
0xa6, 0x6a, 0x82, 0xeb, 0xae, 0x14, 0xa3, 0xe5, 0x2f, 0xc6, 0xcb, 0x5f, 0x2c, 0xfb, 0x03, 0xfd,
|
||||
0x12, 0x85, 0x1e, 0x43, 0x8a, 0x32, 0x9b, 0xf5, 0xa9, 0x9a, 0xe4, 0x8b, 0x59, 0x98, 0xb6, 0x98,
|
||||
0x71, 0x3d, 0x83, 0x23, 0x75, 0xc1, 0x40, 0x3f, 0x02, 0x7a, 0xe1, 0xfa, 0x76, 0xd7, 0x62, 0x76,
|
||||
0xb7, 0x3b, 0xb0, 0x02, 0x4c, 0xfb, 0x5d, 0xa6, 0xca, 0x1b, 0xd2, 0x66, 0x66, 0x37, 0x3f, 0x4d,
|
||||
0xc7, 0x0c, 0x71, 0x3a, 0x87, 0xe9, 0x0a, 0xa7, 0x8e, 0x45, 0x50, 0x19, 0x32, 0xb4, 0xdf, 0xf2,
|
||||
0x5c, 0x66, 0x85, 0xee, 0x52, 0x67, 0xb9, 0xce, 0xda, 0xb5, 0xfe, 0xcd, 0xd8, 0x7a, 0x15, 0xf9,
|
||||
0xd5, 0x7f, 0x79, 0x49, 0x87, 0x88, 0x14, 0x86, 0xd1, 0x3e, 0x28, 0x62, 0x89, 0x2d, 0xec, 0x3b,
|
||||
0x91, 0x4e, 0xea, 0x96, 0x3a, 0x59, 0xc1, 0xd4, 0x7c, 0x87, 0x6b, 0x55, 0x61, 0x91, 0x11, 0x66,
|
||||
0x77, 0x2d, 0x11, 0x57, 0xe7, 0x6e, 0xb7, 0x51, 0x0b, 0x9c, 0x15, 0x1b, 0xe8, 0x00, 0x3e, 0x39,
|
||||
0x21, 0xcc, 0xf5, 0xdb, 0x16, 0x65, 0x76, 0x20, 0x46, 0x4b, 0xdf, 0xb2, 0xa5, 0xa5, 0x88, 0x6a,
|
||||
0x84, 0x4c, 0xde, 0xd3, 0x53, 0x10, 0xa1, 0xd1, 0x78, 0xf3, 0xb7, 0xd4, 0x5a, 0x8c, 0x88, 0xf1,
|
||||
0x74, 0x6b, 0xa1, 0x53, 0x98, 0xed, 0xd8, 0xcc, 0x56, 0x61, 0x43, 0xda, 0x5c, 0xd0, 0x2f, 0xdf,
|
||||
0x0b, 0x7f, 0x4b, 0x90, 0x19, 0xdf, 0x98, 0xaf, 0x61, 0x7e, 0x80, 0xa9, 0x75, 0xcc, 0xed, 0x2a,
|
||||
0x5d, 0x3b, 0x3b, 0x35, 0x9f, 0xe9, 0xe9, 0x01, 0xa6, 0x7b, 0x61, 0x1e, 0x3d, 0x84, 0x45, 0xbb,
|
||||
0x45, 0x99, 0xed, 0xfa, 0x82, 0x90, 0x98, 0x4a, 0x58, 0x10, 0xa0, 0x88, 0xf4, 0x15, 0xa4, 0x7d,
|
||||
0x22, 0xf0, 0xc9, 0xa9, 0xf8, 0x39, 0x9f, 0x44, 0xd0, 0xef, 0x00, 0xf9, 0xc4, 0x7a, 0xe9, 0xb2,
|
||||
0x8e, 0x75, 0x82, 0x59, 0x4c, 0x92, 0xa7, 0x92, 0x96, 0x7c, 0x72, 0xe4, 0xb2, 0x4e, 0x13, 0xb3,
|
||||
0x88, 0x5c, 0xf8, 0x53, 0x02, 0x39, 0xbc, 0x19, 0x6e, 0x3e, 0xd7, 0x45, 0x98, 0x3d, 0x21, 0x0c,
|
||||
0xdf, 0x7c, 0xa6, 0x23, 0x18, 0xfa, 0x1e, 0xe6, 0xa2, 0x6b, 0x86, 0xaa, 0x32, 0xf7, 0xc9, 0xfd,
|
||||
0x69, 0x07, 0xe0, 0xfa, 0x6d, 0xa6, 0xc7, 0xb4, 0x7d, 0x39, 0x9d, 0x54, 0xe4, 0xc2, 0xbf, 0x12,
|
||||
0x2c, 0x0a, 0xef, 0x34, 0xec, 0xc0, 0xf6, 0x28, 0x7a, 0x0e, 0x19, 0xcf, 0xf5, 0x2f, 0x5d, 0x28,
|
||||
0xdd, 0xe4, 0xc2, 0x7b, 0xa1, 0x0b, 0x2f, 0x86, 0xf9, 0x4f, 0xc7, 0x58, 0xdf, 0x10, 0xcf, 0x65,
|
||||
0xd8, 0xeb, 0xb1, 0x81, 0x0e, 0x9e, 0xeb, 0xc7, 0xe6, 0xf4, 0x00, 0x79, 0xf6, 0x69, 0x0c, 0xb2,
|
||||
0x7a, 0x38, 0x70, 0x89, 0xc3, 0x27, 0x0e, 0x2b, 0x4c, 0x3a, 0xaa, 0x2a, 0xee, 0xed, 0xca, 0x17,
|
||||
0x17, 0xc3, 0xfc, 0xfa, 0x75, 0xe2, 0xa8, 0xc8, 0xef, 0xa1, 0xe1, 0x14, 0xcf, 0x3e, 0x8d, 0x27,
|
||||
0xe1, 0xf9, 0x82, 0x09, 0x0b, 0x4d, 0x6e, 0x42, 0x31, 0x59, 0x15, 0x84, 0x29, 0xe3, 0xca, 0xd2,
|
||||
0x4d, 0x95, 0x65, 0xae, 0xbc, 0x10, 0xb1, 0x84, 0xea, 0xff, 0xb1, 0x5b, 0x85, 0xea, 0x63, 0x48,
|
||||
0xfd, 0xda, 0x27, 0x41, 0xdf, 0x13, 0x56, 0x2d, 0x5c, 0x0c, 0xf3, 0x4a, 0x14, 0x19, 0x75, 0x38,
|
||||
0x79, 0xf5, 0x47, 0x79, 0xb4, 0x07, 0xf3, 0xac, 0x13, 0x60, 0xda, 0x21, 0x5d, 0x47, 0xec, 0xfc,
|
||||
0x97, 0x17, 0xc3, 0xfc, 0xf2, 0x65, 0xf0, 0xa3, 0x0a, 0x23, 0x1e, 0xfa, 0x09, 0xb2, 0xdc, 0x99,
|
||||
0x23, 0xa5, 0xc8, 0xd2, 0x5b, 0x17, 0xc3, 0xbc, 0x7a, 0x35, 0xf3, 0x51, 0xb9, 0xc5, 0x10, 0x67,
|
||||
0xc6, 0xb0, 0xad, 0xdf, 0x24, 0x80, 0xb1, 0x7f, 0xc0, 0xbb, 0x70, 0xa7, 0x59, 0x37, 0x35, 0xab,
|
||||
0xde, 0x30, 0x6b, 0xf5, 0x43, 0xeb, 0xd9, 0xa1, 0xd1, 0xd0, 0xf6, 0x6a, 0x4f, 0x6a, 0x5a, 0x55,
|
||||
0x99, 0x41, 0xcb, 0xb0, 0x34, 0x9e, 0x7c, 0xae, 0x19, 0x8a, 0x84, 0xee, 0xc0, 0xf2, 0x78, 0xb0,
|
||||
0x5c, 0x31, 0xcc, 0x72, 0xed, 0x50, 0x49, 0x20, 0x04, 0xd9, 0xf1, 0xc4, 0x61, 0x5d, 0x49, 0xa2,
|
||||
0x75, 0x50, 0xaf, 0xc6, 0xac, 0xa3, 0x9a, 0xf9, 0xd4, 0x6a, 0x6a, 0x66, 0x5d, 0x91, 0xb7, 0xfe,
|
||||
0x92, 0x20, 0x7b, 0xf5, 0x0f, 0x01, 0xe5, 0xe1, 0x6e, 0x43, 0xaf, 0x37, 0xea, 0x46, 0xf9, 0xc0,
|
||||
0x32, 0xcc, 0xb2, 0xf9, 0xcc, 0x98, 0xe8, 0xa9, 0x00, 0xb9, 0x49, 0x40, 0x55, 0x6b, 0xd4, 0x8d,
|
||||
0x9a, 0x69, 0x35, 0x34, 0xbd, 0x56, 0xaf, 0x2a, 0x12, 0xfa, 0x1c, 0xee, 0x4d, 0x62, 0x9a, 0x75,
|
||||
0xb3, 0x76, 0xf8, 0x43, 0x0c, 0x49, 0xa0, 0x35, 0xf8, 0x6c, 0x12, 0xd2, 0x28, 0x1b, 0x86, 0x56,
|
||||
0x8d, 0x9a, 0x9e, 0xcc, 0xe9, 0xda, 0xbe, 0xb6, 0x67, 0x6a, 0x55, 0x45, 0x9e, 0xc6, 0x7c, 0x52,
|
||||
0xae, 0x1d, 0x68, 0x55, 0x65, 0xb6, 0xb2, 0xff, 0xe6, 0x2c, 0x27, 0xbd, 0x3d, 0xcb, 0x49, 0xef,
|
||||
0xcf, 0x72, 0xd2, 0xab, 0xf3, 0xdc, 0xcc, 0xdb, 0xf3, 0xdc, 0xcc, 0x3f, 0xe7, 0xb9, 0x99, 0x9f,
|
||||
0x1f, 0xb4, 0x5d, 0xd6, 0xe9, 0xb7, 0x8a, 0xc7, 0xc4, 0x13, 0x1f, 0x26, 0xe2, 0x67, 0x9b, 0x3a,
|
||||
0xbf, 0x94, 0x4e, 0xf9, 0x67, 0x17, 0x1b, 0xf4, 0x30, 0x8d, 0x3f, 0xbe, 0x5a, 0x29, 0xee, 0xd9,
|
||||
0x87, 0x1f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x40, 0x26, 0x09, 0x99, 0x09, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) {
|
||||
@ -935,8 +939,8 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
}
|
||||
if m.ProposalId != 0 {
|
||||
i = encodeVarintGov(dAtA, i, uint64(m.ProposalId))
|
||||
if m.Id != 0 {
|
||||
i = encodeVarintGov(dAtA, i, uint64(m.Id))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
@ -963,31 +967,31 @@ func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.NoWithVeto) > 0 {
|
||||
i -= len(m.NoWithVeto)
|
||||
copy(dAtA[i:], m.NoWithVeto)
|
||||
i = encodeVarintGov(dAtA, i, uint64(len(m.NoWithVeto)))
|
||||
if len(m.NoWithVetoCount) > 0 {
|
||||
i -= len(m.NoWithVetoCount)
|
||||
copy(dAtA[i:], m.NoWithVetoCount)
|
||||
i = encodeVarintGov(dAtA, i, uint64(len(m.NoWithVetoCount)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.No) > 0 {
|
||||
i -= len(m.No)
|
||||
copy(dAtA[i:], m.No)
|
||||
i = encodeVarintGov(dAtA, i, uint64(len(m.No)))
|
||||
if len(m.NoCount) > 0 {
|
||||
i -= len(m.NoCount)
|
||||
copy(dAtA[i:], m.NoCount)
|
||||
i = encodeVarintGov(dAtA, i, uint64(len(m.NoCount)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.Abstain) > 0 {
|
||||
i -= len(m.Abstain)
|
||||
copy(dAtA[i:], m.Abstain)
|
||||
i = encodeVarintGov(dAtA, i, uint64(len(m.Abstain)))
|
||||
if len(m.AbstainCount) > 0 {
|
||||
i -= len(m.AbstainCount)
|
||||
copy(dAtA[i:], m.AbstainCount)
|
||||
i = encodeVarintGov(dAtA, i, uint64(len(m.AbstainCount)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if len(m.Yes) > 0 {
|
||||
i -= len(m.Yes)
|
||||
copy(dAtA[i:], m.Yes)
|
||||
i = encodeVarintGov(dAtA, i, uint64(len(m.Yes)))
|
||||
if len(m.YesCount) > 0 {
|
||||
i -= len(m.YesCount)
|
||||
copy(dAtA[i:], m.YesCount)
|
||||
i = encodeVarintGov(dAtA, i, uint64(len(m.YesCount)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
@ -1222,8 +1226,8 @@ func (m *Proposal) Size() (n int) {
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.ProposalId != 0 {
|
||||
n += 1 + sovGov(uint64(m.ProposalId))
|
||||
if m.Id != 0 {
|
||||
n += 1 + sovGov(uint64(m.Id))
|
||||
}
|
||||
if len(m.Messages) > 0 {
|
||||
for _, e := range m.Messages {
|
||||
@ -1273,19 +1277,19 @@ func (m *TallyResult) Size() (n int) {
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Yes)
|
||||
l = len(m.YesCount)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovGov(uint64(l))
|
||||
}
|
||||
l = len(m.Abstain)
|
||||
l = len(m.AbstainCount)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovGov(uint64(l))
|
||||
}
|
||||
l = len(m.No)
|
||||
l = len(m.NoCount)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovGov(uint64(l))
|
||||
}
|
||||
l = len(m.NoWithVeto)
|
||||
l = len(m.NoWithVetoCount)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovGov(uint64(l))
|
||||
}
|
||||
@ -1640,9 +1644,9 @@ func (m *Proposal) Unmarshal(dAtA []byte) error {
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
||||
}
|
||||
m.ProposalId = 0
|
||||
m.Id = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGov
|
||||
@ -1652,7 +1656,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.ProposalId |= uint64(b&0x7F) << shift
|
||||
m.Id |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
@ -2010,7 +2014,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error {
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Yes", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field YesCount", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@ -2038,11 +2042,11 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Yes = string(dAtA[iNdEx:postIndex])
|
||||
m.YesCount = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Abstain", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field AbstainCount", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@ -2070,11 +2074,11 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Abstain = string(dAtA[iNdEx:postIndex])
|
||||
m.AbstainCount = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field No", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field NoCount", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@ -2102,11 +2106,11 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.No = string(dAtA[iNdEx:postIndex])
|
||||
m.NoCount = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field NoWithVeto", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field NoWithVetoCount", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@ -2134,7 +2138,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.NoWithVeto = string(dAtA[iNdEx:postIndex])
|
||||
m.NoWithVetoCount = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
|
||||
@ -33,7 +33,7 @@ func NewProposal(messages []sdk.Msg, id uint64, metadata []byte, submitTime, dep
|
||||
tally := EmptyTallyResult()
|
||||
|
||||
p := Proposal{
|
||||
ProposalId: id,
|
||||
Id: id,
|
||||
Messages: msgs,
|
||||
Metadata: metadata,
|
||||
Status: StatusDepositPeriod,
|
||||
@ -65,7 +65,7 @@ func (p Proposals) String() string {
|
||||
out := "ID - (Status) [Type] Title\n"
|
||||
for _, prop := range p {
|
||||
out += fmt.Sprintf("%d - %s\n",
|
||||
prop.ProposalId, prop.Status)
|
||||
prop.Id, prop.Status)
|
||||
}
|
||||
return strings.TrimSpace(out)
|
||||
}
|
||||
|
||||
@ -29,10 +29,10 @@ func NewValidatorGovInfo(address sdk.ValAddress, bondedTokens sdk.Int, delegator
|
||||
// NewTallyResult creates a new TallyResult instance
|
||||
func NewTallyResult(yes, abstain, no, noWithVeto sdk.Int) TallyResult {
|
||||
return TallyResult{
|
||||
Yes: yes.String(),
|
||||
Abstain: abstain.String(),
|
||||
No: no.String(),
|
||||
NoWithVeto: noWithVeto.String(),
|
||||
YesCount: yes.String(),
|
||||
AbstainCount: abstain.String(),
|
||||
NoCount: no.String(),
|
||||
NoWithVetoCount: noWithVeto.String(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,8 +53,8 @@ func EmptyTallyResult() TallyResult {
|
||||
|
||||
// Equals returns if two tally results are equal.
|
||||
func (tr TallyResult) Equals(comp TallyResult) bool {
|
||||
return tr.Yes == comp.Yes &&
|
||||
tr.Abstain == comp.Abstain &&
|
||||
tr.No == comp.No &&
|
||||
tr.NoWithVeto == comp.NoWithVeto
|
||||
return tr.YesCount == comp.YesCount &&
|
||||
tr.AbstainCount == comp.AbstainCount &&
|
||||
tr.NoCount == comp.NoCount &&
|
||||
tr.NoWithVetoCount == comp.NoWithVetoCount
|
||||
}
|
||||
|
||||
@ -14,7 +14,6 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
authclient "github.com/cosmos/cosmos-sdk/x/auth/client"
|
||||
"github.com/cosmos/cosmos-sdk/x/group"
|
||||
)
|
||||
|
||||
@ -42,7 +41,7 @@ func TxCmd(name string) *cobra.Command {
|
||||
MsgUpdateGroupPolicyAdminCmd(),
|
||||
MsgUpdateGroupPolicyDecisionPolicyCmd(),
|
||||
MsgUpdateGroupPolicyMetadataCmd(),
|
||||
MsgCreateProposalCmd(),
|
||||
MsgSubmitProposalCmd(),
|
||||
MsgVoteCmd(),
|
||||
MsgExecCmd(),
|
||||
)
|
||||
@ -479,49 +478,63 @@ func MsgUpdateGroupPolicyMetadataCmd() *cobra.Command {
|
||||
return cmd
|
||||
}
|
||||
|
||||
// MsgCreateProposalCmd creates a CLI command for Msg/CreateProposal.
|
||||
func MsgCreateProposalCmd() *cobra.Command {
|
||||
// MsgSubmitProposalCmd creates a CLI command for Msg/SubmitProposal.
|
||||
func MsgSubmitProposalCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "create-proposal [group-policy-account] [proposer[,proposer]*] [msg_tx_json_file] [metadata]",
|
||||
Use: "submit-proposal [proposal_json_file]",
|
||||
Short: "Submit a new proposal",
|
||||
Long: `Submit a new proposal.
|
||||
Long: fmt.Sprintf(`Submit a new proposal.
|
||||
|
||||
Parameters:
|
||||
group-policy-account: account address of the group policy
|
||||
proposer: comma separated (no spaces) list of proposer account addresses. Example: "addr1,addr2"
|
||||
Metadata: metadata for the proposal
|
||||
msg_tx_json_file: path to json file with messages that will be executed if the proposal is accepted.
|
||||
`,
|
||||
Args: cobra.ExactArgs(4),
|
||||
|
||||
Example:
|
||||
$ %s tx gov submit-proposal path/to/proposal.json
|
||||
|
||||
Where proposal.json contains:
|
||||
|
||||
{
|
||||
"group_policy_address": "cosmos1...",
|
||||
// array of proto-JSON-encoded sdk.Msgs
|
||||
"messages": [
|
||||
{
|
||||
"@type": "/cosmos.bank.v1beta1.MsgSend",
|
||||
"from_address": "cosmos1...",
|
||||
"to_address": "cosmos1...",
|
||||
"amount":[{"denom": "stake","amount": "10"}]
|
||||
}
|
||||
],
|
||||
"metadata: "4pIMOgIGx1vZGU=", // base64-encoded metadata
|
||||
"proposers": ["cosmos1...", "cosmos1..."],
|
||||
}`, version.AppName),
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
proposers := strings.Split(args[1], ",")
|
||||
for i := range proposers {
|
||||
proposers[i] = strings.TrimSpace(proposers[i])
|
||||
prop, err := parseCLIProposal(args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Since the --from flag is not required on this CLI command, we
|
||||
// ignore it, and just use the 1st proposer in the JSON file.
|
||||
cmd.Flags().Set(flags.FlagFrom, prop.Proposers[0])
|
||||
|
||||
clientCtx, err := client.GetClientTxContext(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
theTx, err := authclient.ReadTxFromFile(clientCtx, args[2])
|
||||
msgs, err := parseMsgs(clientCtx.Codec, prop)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
msgs := theTx.GetMsgs()
|
||||
|
||||
b, err := base64.StdEncoding.DecodeString(args[3])
|
||||
if err != nil {
|
||||
return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "metadata is malformed, proper base64 string is required")
|
||||
}
|
||||
|
||||
execStr, _ := cmd.Flags().GetString(FlagExec)
|
||||
|
||||
msg, err := group.NewMsgCreateProposalRequest(
|
||||
args[0],
|
||||
proposers,
|
||||
msg, err := group.NewMsgSubmitProposalRequest(
|
||||
prop.GroupPolicyAddress,
|
||||
prop.Proposers,
|
||||
msgs,
|
||||
b,
|
||||
prop.Metadata,
|
||||
execFromString(execStr),
|
||||
)
|
||||
if err != nil {
|
||||
@ -596,19 +609,19 @@ Parameters:
|
||||
// MsgVoteCmd creates a CLI command for Msg/Vote.
|
||||
func MsgVoteCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "vote [proposal-id] [voter] [choice] [metadata]",
|
||||
Use: "vote [proposal-id] [voter] [vote-option] [metadata]",
|
||||
Short: "Vote on a proposal",
|
||||
Long: `Vote on a proposal.
|
||||
|
||||
Parameters:
|
||||
proposal-id: unique ID of the proposal
|
||||
voter: voter account addresses.
|
||||
choice: choice of the voter(s)
|
||||
CHOICE_UNSPECIFIED: no-op
|
||||
CHOICE_NO: no
|
||||
CHOICE_YES: yes
|
||||
CHOICE_ABSTAIN: abstain
|
||||
CHOICE_VETO: veto
|
||||
vote-option: choice of the voter(s)
|
||||
VOTE_OPTION_UNSPECIFIED: no-op
|
||||
VOTE_OPTION_NO: no
|
||||
VOTE_OPTION_YES: yes
|
||||
VOTE_OPTION_ABSTAIN: abstain
|
||||
VOTE_OPTION_NO_WITH_VETO: no-with-veto
|
||||
Metadata: metadata for the vote
|
||||
`,
|
||||
Args: cobra.ExactArgs(4),
|
||||
@ -628,7 +641,7 @@ Parameters:
|
||||
return err
|
||||
}
|
||||
|
||||
choice, err := group.ChoiceFromString(args[2])
|
||||
voteOption, err := group.VoteOptionFromString(args[2])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -643,7 +656,7 @@ Parameters:
|
||||
msg := &group.MsgVote{
|
||||
ProposalId: proposalID,
|
||||
Voter: args[1],
|
||||
Choice: choice,
|
||||
Option: voteOption,
|
||||
Metadata: b,
|
||||
Exec: execFromString(execStr),
|
||||
}
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/group"
|
||||
)
|
||||
|
||||
@ -36,3 +39,43 @@ func execFromString(execStr string) group.Exec {
|
||||
}
|
||||
return exec
|
||||
}
|
||||
|
||||
// CLIProposal defines a Msg-based group proposal for CLI purposes.
|
||||
type CLIProposal struct {
|
||||
GroupPolicyAddress string
|
||||
// Messages defines an array of sdk.Msgs proto-JSON-encoded as Anys.
|
||||
Messages []json.RawMessage
|
||||
Metadata []byte
|
||||
Proposers []string
|
||||
}
|
||||
|
||||
func parseCLIProposal(path string) (CLIProposal, error) {
|
||||
var p CLIProposal
|
||||
|
||||
contents, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return CLIProposal{}, err
|
||||
}
|
||||
|
||||
err = json.Unmarshal(contents, &p)
|
||||
if err != nil {
|
||||
return CLIProposal{}, err
|
||||
}
|
||||
|
||||
return p, nil
|
||||
}
|
||||
|
||||
func parseMsgs(cdc codec.Codec, p CLIProposal) ([]sdk.Msg, error) {
|
||||
msgs := make([]sdk.Msg, len(p.Messages))
|
||||
for i, anyJSON := range p.Messages {
|
||||
var msg sdk.Msg
|
||||
err := cdc.UnmarshalInterfaceJSON(anyJSON, &msg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
msgs[i] = msg
|
||||
}
|
||||
|
||||
return msgs, nil
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ func (s *IntegrationTestSuite) TestQueryGroupInfo() {
|
||||
},
|
||||
{
|
||||
"group found",
|
||||
[]string{strconv.FormatUint(s.group.GroupId, 10), fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
|
||||
[]string{strconv.FormatUint(s.group.Id, 10), fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
|
||||
false,
|
||||
"",
|
||||
0,
|
||||
@ -61,7 +61,7 @@ func (s *IntegrationTestSuite) TestQueryGroupInfo() {
|
||||
|
||||
var g group.GroupInfo
|
||||
s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &g))
|
||||
s.Require().Equal(s.group.GroupId, g.GroupId)
|
||||
s.Require().Equal(s.group.Id, g.Id)
|
||||
s.Require().Equal(s.group.Admin, g.Admin)
|
||||
s.Require().Equal(s.group.TotalWeight, g.TotalWeight)
|
||||
s.Require().Equal(s.group.Metadata, g.Metadata)
|
||||
@ -85,7 +85,7 @@ func (s *IntegrationTestSuite) TestQueryGroupsByMembers() {
|
||||
require.Len(groups.Groups, 1)
|
||||
|
||||
cmd = client.QueryGroupMembersCmd()
|
||||
out, err = cli.ExecTestCLICmd(clientCtx, cmd, []string{fmt.Sprintf("%d", groups.Groups[0].GroupId), fmt.Sprintf("--%s=json", tmcli.OutputFlag)})
|
||||
out, err = cli.ExecTestCLICmd(clientCtx, cmd, []string{fmt.Sprintf("%d", groups.Groups[0].Id), fmt.Sprintf("--%s=json", tmcli.OutputFlag)})
|
||||
require.NoError(err)
|
||||
|
||||
var members group.QueryGroupMembersResponse
|
||||
@ -170,13 +170,13 @@ func (s *IntegrationTestSuite) TestQueryGroupMembers() {
|
||||
},
|
||||
{
|
||||
"members found",
|
||||
[]string{strconv.FormatUint(s.group.GroupId, 10), fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
|
||||
[]string{strconv.FormatUint(s.group.Id, 10), fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
|
||||
false,
|
||||
"",
|
||||
0,
|
||||
[]*group.GroupMember{
|
||||
{
|
||||
GroupId: s.group.GroupId,
|
||||
GroupId: s.group.Id,
|
||||
Member: &group.Member{
|
||||
Address: val.Address.String(),
|
||||
Weight: "3",
|
||||
@ -269,7 +269,7 @@ func (s *IntegrationTestSuite) TestQueryGroupsByAdmin() {
|
||||
s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &res))
|
||||
s.Require().Equal(len(res.Groups), len(tc.expectGroups))
|
||||
for i := range res.Groups {
|
||||
s.Require().Equal(res.Groups[i].GroupId, tc.expectGroups[i].GroupId)
|
||||
s.Require().Equal(res.Groups[i].Id, tc.expectGroups[i].Id)
|
||||
s.Require().Equal(res.Groups[i].Metadata, tc.expectGroups[i].Metadata)
|
||||
s.Require().Equal(res.Groups[i].Version, tc.expectGroups[i].Version)
|
||||
s.Require().Equal(res.Groups[i].TotalWeight, tc.expectGroups[i].TotalWeight)
|
||||
@ -362,7 +362,7 @@ func (s *IntegrationTestSuite) TestQueryGroupPoliciesByGroup() {
|
||||
},
|
||||
{
|
||||
"found group policies",
|
||||
[]string{strconv.FormatUint(s.group.GroupId, 10), fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
|
||||
[]string{strconv.FormatUint(s.group.Id, 10), fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
|
||||
false,
|
||||
"",
|
||||
0,
|
||||
|
||||
@ -1,22 +1,25 @@
|
||||
package testutil
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/stretchr/testify/suite"
|
||||
tmcli "github.com/tendermint/tendermint/libs/cli"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/hd"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||
"github.com/cosmos/cosmos-sdk/testutil"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/cli"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
banktestutil "github.com/cosmos/cosmos-sdk/x/bank/client/testutil"
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/stretchr/testify/suite"
|
||||
tmcli "github.com/tendermint/tendermint/libs/cli"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/group"
|
||||
client "github.com/cosmos/cosmos-sdk/x/group/client/cli"
|
||||
)
|
||||
@ -103,7 +106,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &txResp), out.String())
|
||||
s.Require().Equal(uint32(0), txResp.Code, out.String())
|
||||
|
||||
s.group = &group.GroupInfo{GroupId: 1, Admin: val.Address.String(), Metadata: []byte{1}, TotalWeight: "3", Version: 1}
|
||||
s.group = &group.GroupInfo{Id: 1, Admin: val.Address.String(), Metadata: []byte{1}, TotalWeight: "3", Version: 1}
|
||||
|
||||
// create 5 group policies
|
||||
for i := 0; i < 5; i++ {
|
||||
@ -155,15 +158,13 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.groupPolicies = res.GroupPolicies
|
||||
|
||||
// create a proposal
|
||||
validTxFileName := getTxSendFileName(s, s.groupPolicies[0].Address, val.Address.String())
|
||||
out, err = cli.ExecTestCLICmd(val.ClientCtx, client.MsgCreateProposalCmd(),
|
||||
out, err = cli.ExecTestCLICmd(val.ClientCtx, client.MsgSubmitProposalCmd(),
|
||||
append(
|
||||
[]string{
|
||||
s.groupPolicies[0].Address,
|
||||
val.Address.String(),
|
||||
validTxFileName,
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
""),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
@ -178,7 +179,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
||||
[]string{
|
||||
"1",
|
||||
val.Address.String(),
|
||||
"CHOICE_YES",
|
||||
"VOTE_OPTION_YES",
|
||||
"",
|
||||
},
|
||||
commonFlags...,
|
||||
@ -539,7 +540,7 @@ func (s *IntegrationTestSuite) TestTxUpdateGroupMetadata() {
|
||||
append(
|
||||
[]string{
|
||||
val.Address.String(),
|
||||
strconv.FormatUint(s.group.GroupId, 10),
|
||||
strconv.FormatUint(s.group.Id, 10),
|
||||
"AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ==",
|
||||
},
|
||||
commonFlags...,
|
||||
@ -646,7 +647,7 @@ func (s *IntegrationTestSuite) TestTxUpdateGroupMembers() {
|
||||
append(
|
||||
[]string{
|
||||
val.Address.String(),
|
||||
strconv.FormatUint(s.group.GroupId, 10),
|
||||
strconv.FormatUint(s.group.Id, 10),
|
||||
invalidMembersMetadataFileName,
|
||||
},
|
||||
commonFlags...,
|
||||
@ -704,7 +705,7 @@ func (s *IntegrationTestSuite) TestTxCreateGroupPolicy() {
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
|
||||
}
|
||||
|
||||
groupID := s.group.GroupId
|
||||
groupID := s.group.Id
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
@ -1234,6 +1235,14 @@ func (s *IntegrationTestSuite) TestTxUpdateGroupPolicyMetadata() {
|
||||
}
|
||||
}
|
||||
|
||||
// TestTxCreateProposal tests submitting proposal.
|
||||
//
|
||||
// Please don't rename this to TestTxSubmitProposal. It will redefine the order
|
||||
// of the tests being run in this file with `go test`, and will mess up the
|
||||
// proposal ids in other tests (e.g. voting or Exec tests).
|
||||
// This is a headache, but requires a bigger refactor of all tests in this file
|
||||
// so that each one is independent.
|
||||
// https://github.com/cosmos/cosmos-sdk/issues/11168
|
||||
func (s *IntegrationTestSuite) TestTxCreateProposal() {
|
||||
val := s.network.Validators[0]
|
||||
clientCtx := val.ClientCtx
|
||||
@ -1244,10 +1253,6 @@ func (s *IntegrationTestSuite) TestTxCreateProposal() {
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
|
||||
}
|
||||
|
||||
validTxFileName := getTxSendFileName(s, s.groupPolicies[0].Address, val.Address.String())
|
||||
unauthzTxFileName := getTxSendFileName(s, val.Address.String(), s.groupPolicies[0].Address)
|
||||
validTxFileName2 := getTxSendFileName(s, s.groupPolicies[3].Address, val.Address.String())
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
args []string
|
||||
@ -1260,11 +1265,11 @@ func (s *IntegrationTestSuite) TestTxCreateProposal() {
|
||||
"correct data",
|
||||
append(
|
||||
[]string{
|
||||
s.groupPolicies[0].Address,
|
||||
val.Address.String(),
|
||||
validTxFileName,
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
"",
|
||||
),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
@ -1277,11 +1282,11 @@ func (s *IntegrationTestSuite) TestTxCreateProposal() {
|
||||
"with try exec",
|
||||
append(
|
||||
[]string{
|
||||
s.groupPolicies[0].Address,
|
||||
val.Address.String(),
|
||||
validTxFileName,
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
"",
|
||||
),
|
||||
fmt.Sprintf("--%s=try", client.FlagExec),
|
||||
},
|
||||
commonFlags...,
|
||||
@ -1295,11 +1300,10 @@ func (s *IntegrationTestSuite) TestTxCreateProposal() {
|
||||
"with try exec, not enough yes votes for proposal to pass",
|
||||
append(
|
||||
[]string{
|
||||
s.groupPolicies[3].Address,
|
||||
val.Address.String(),
|
||||
validTxFileName2,
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
s.groupPolicies[3].Address, val.Address.String(),
|
||||
s.groupPolicies[3].Address, val.Address.String(),
|
||||
""),
|
||||
fmt.Sprintf("--%s=try", client.FlagExec),
|
||||
},
|
||||
commonFlags...,
|
||||
@ -1313,11 +1317,11 @@ func (s *IntegrationTestSuite) TestTxCreateProposal() {
|
||||
"with amino-json",
|
||||
append(
|
||||
[]string{
|
||||
s.groupPolicies[0].Address,
|
||||
val.Address.String(),
|
||||
validTxFileName,
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
"",
|
||||
),
|
||||
fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeLegacyAminoJSON),
|
||||
},
|
||||
commonFlags...,
|
||||
@ -1331,11 +1335,11 @@ func (s *IntegrationTestSuite) TestTxCreateProposal() {
|
||||
"metadata too long",
|
||||
append(
|
||||
[]string{
|
||||
s.groupPolicies[0].Address,
|
||||
val.Address.String(),
|
||||
validTxFileName,
|
||||
"AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ==",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
"AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ==",
|
||||
),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
@ -1348,11 +1352,10 @@ func (s *IntegrationTestSuite) TestTxCreateProposal() {
|
||||
"unauthorized msg",
|
||||
append(
|
||||
[]string{
|
||||
s.groupPolicies[0].Address,
|
||||
val.Address.String(),
|
||||
unauthzTxFileName,
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
val.Address.String(), s.groupPolicies[0].Address,
|
||||
""),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
@ -1365,16 +1368,16 @@ func (s *IntegrationTestSuite) TestTxCreateProposal() {
|
||||
"invalid proposers",
|
||||
append(
|
||||
[]string{
|
||||
s.groupPolicies[0].Address,
|
||||
"invalid",
|
||||
validTxFileName,
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
s.groupPolicies[0].Address, "invalid",
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
"",
|
||||
),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
true,
|
||||
"proposers: decoding bech32 failed",
|
||||
"invalid.info: key not found",
|
||||
nil,
|
||||
0,
|
||||
},
|
||||
@ -1382,11 +1385,11 @@ func (s *IntegrationTestSuite) TestTxCreateProposal() {
|
||||
"invalid group policy",
|
||||
append(
|
||||
[]string{
|
||||
"invalid",
|
||||
val.Address.String(),
|
||||
validTxFileName,
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
"invalid", val.Address.String(),
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
"",
|
||||
),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
@ -1399,11 +1402,11 @@ func (s *IntegrationTestSuite) TestTxCreateProposal() {
|
||||
"no group policy",
|
||||
append(
|
||||
[]string{
|
||||
val.Address.String(),
|
||||
val.Address.String(),
|
||||
validTxFileName,
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
val.Address.String(), val.Address.String(),
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
"",
|
||||
),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
@ -1418,7 +1421,7 @@ func (s *IntegrationTestSuite) TestTxCreateProposal() {
|
||||
tc := tc
|
||||
|
||||
s.Run(tc.name, func() {
|
||||
cmd := client.MsgCreateProposalCmd()
|
||||
cmd := client.MsgSubmitProposalCmd()
|
||||
|
||||
out, err := cli.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
||||
if tc.expectErr {
|
||||
@ -1444,16 +1447,14 @@ func (s *IntegrationTestSuite) TestTxVote() {
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
|
||||
}
|
||||
|
||||
validTxFileName := getTxSendFileName(s, s.groupPolicies[1].Address, val.Address.String())
|
||||
for i := 0; i < 2; i++ {
|
||||
out, err := cli.ExecTestCLICmd(val.ClientCtx, client.MsgCreateProposalCmd(),
|
||||
out, err := cli.ExecTestCLICmd(val.ClientCtx, client.MsgSubmitProposalCmd(),
|
||||
append(
|
||||
[]string{
|
||||
s.groupPolicies[1].Address,
|
||||
val.Address.String(),
|
||||
validTxFileName,
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
s.groupPolicies[1].Address, val.Address.String(),
|
||||
s.groupPolicies[1].Address, val.Address.String(),
|
||||
""),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
@ -1475,7 +1476,7 @@ func (s *IntegrationTestSuite) TestTxVote() {
|
||||
[]string{
|
||||
"2",
|
||||
val.Address.String(),
|
||||
"CHOICE_YES",
|
||||
"VOTE_OPTION_YES",
|
||||
"",
|
||||
},
|
||||
commonFlags...,
|
||||
@ -1491,7 +1492,7 @@ func (s *IntegrationTestSuite) TestTxVote() {
|
||||
[]string{
|
||||
"7",
|
||||
val.Address.String(),
|
||||
"CHOICE_YES",
|
||||
"VOTE_OPTION_YES",
|
||||
"",
|
||||
fmt.Sprintf("--%s=try", client.FlagExec),
|
||||
},
|
||||
@ -1508,7 +1509,7 @@ func (s *IntegrationTestSuite) TestTxVote() {
|
||||
[]string{
|
||||
"8",
|
||||
val.Address.String(),
|
||||
"CHOICE_NO",
|
||||
"VOTE_OPTION_NO",
|
||||
"",
|
||||
fmt.Sprintf("--%s=try", client.FlagExec),
|
||||
},
|
||||
@ -1525,7 +1526,7 @@ func (s *IntegrationTestSuite) TestTxVote() {
|
||||
[]string{
|
||||
"5",
|
||||
val.Address.String(),
|
||||
"CHOICE_YES",
|
||||
"VOTE_OPTION_YES",
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeLegacyAminoJSON),
|
||||
},
|
||||
@ -1542,7 +1543,7 @@ func (s *IntegrationTestSuite) TestTxVote() {
|
||||
[]string{
|
||||
"abcd",
|
||||
val.Address.String(),
|
||||
"CHOICE_YES",
|
||||
"VOTE_OPTION_YES",
|
||||
"",
|
||||
},
|
||||
commonFlags...,
|
||||
@ -1558,7 +1559,7 @@ func (s *IntegrationTestSuite) TestTxVote() {
|
||||
[]string{
|
||||
"1234",
|
||||
val.Address.String(),
|
||||
"CHOICE_YES",
|
||||
"VOTE_OPTION_YES",
|
||||
"",
|
||||
},
|
||||
commonFlags...,
|
||||
@ -1574,7 +1575,7 @@ func (s *IntegrationTestSuite) TestTxVote() {
|
||||
[]string{
|
||||
"2",
|
||||
val.Address.String(),
|
||||
"CHOICE_YES",
|
||||
"VOTE_OPTION_YES",
|
||||
"AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ==",
|
||||
},
|
||||
commonFlags...,
|
||||
@ -1585,18 +1586,18 @@ func (s *IntegrationTestSuite) TestTxVote() {
|
||||
0,
|
||||
},
|
||||
{
|
||||
"invalid choice",
|
||||
"invalid vote option",
|
||||
append(
|
||||
[]string{
|
||||
"2",
|
||||
val.Address.String(),
|
||||
"INVALID_CHOICE",
|
||||
"INVALID_VOTE_OPTION",
|
||||
"",
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
true,
|
||||
"not a valid vote choice",
|
||||
"not a valid vote option",
|
||||
nil,
|
||||
0,
|
||||
},
|
||||
@ -1634,16 +1635,14 @@ func (s *IntegrationTestSuite) TestTxWithdrawProposal() {
|
||||
|
||||
ids := make([]string, 2)
|
||||
|
||||
validTxFileName := getTxSendFileName(s, s.groupPolicies[1].Address, val.Address.String())
|
||||
for i := 0; i < 2; i++ {
|
||||
out, err := cli.ExecTestCLICmd(val.ClientCtx, client.MsgCreateProposalCmd(),
|
||||
out, err := cli.ExecTestCLICmd(val.ClientCtx, client.MsgSubmitProposalCmd(),
|
||||
append(
|
||||
[]string{
|
||||
s.groupPolicies[1].Address,
|
||||
val.Address.String(),
|
||||
validTxFileName,
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
s.groupPolicies[1].Address, val.Address.String(),
|
||||
s.groupPolicies[1].Address, val.Address.String(),
|
||||
""),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
@ -1688,7 +1687,7 @@ func (s *IntegrationTestSuite) TestTxWithdrawProposal() {
|
||||
commonFlags...,
|
||||
),
|
||||
true,
|
||||
"cannot withdraw a proposal with the status of STATUS_WITHDRAWN",
|
||||
"cannot withdraw a proposal with the status of PROPOSAL_STATUS_WITHDRAWN",
|
||||
&sdk.TxResponse{},
|
||||
0,
|
||||
},
|
||||
@ -1760,7 +1759,7 @@ func (s *IntegrationTestSuite) getProposalIdFromTxResponse(txResp sdk.TxResponse
|
||||
s.Require().Greater(len(txResp.Logs), 0)
|
||||
s.Require().NotNil(txResp.Logs[0].Events)
|
||||
events := txResp.Logs[0].Events
|
||||
createProposalEvent, _ := sdk.TypedEventToEvent(&group.EventCreateProposal{})
|
||||
createProposalEvent, _ := sdk.TypedEventToEvent(&group.EventSubmitProposal{})
|
||||
|
||||
for _, e := range events {
|
||||
if e.Type == createProposalEvent.Type {
|
||||
@ -1783,27 +1782,27 @@ func (s *IntegrationTestSuite) TestTxExec() {
|
||||
|
||||
// create proposals and vote
|
||||
for i := 3; i <= 4; i++ {
|
||||
validTxFileName := getTxSendFileName(s, s.groupPolicies[0].Address, val.Address.String())
|
||||
out, err := cli.ExecTestCLICmd(val.ClientCtx, client.MsgCreateProposalCmd(),
|
||||
out, err := cli.ExecTestCLICmd(val.ClientCtx, client.MsgSubmitProposalCmd(),
|
||||
append(
|
||||
[]string{
|
||||
s.groupPolicies[0].Address,
|
||||
val.Address.String(),
|
||||
validTxFileName,
|
||||
"",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
s.createCLIProposal(
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
s.groupPolicies[0].Address, val.Address.String(),
|
||||
"",
|
||||
),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
)
|
||||
s.Require().NoError(err, out.String())
|
||||
fmt.Println(out.String())
|
||||
|
||||
out, err = cli.ExecTestCLICmd(val.ClientCtx, client.MsgVoteCmd(),
|
||||
append(
|
||||
[]string{
|
||||
fmt.Sprintf("%d", i),
|
||||
val.Address.String(),
|
||||
"CHOICE_YES",
|
||||
"VOTE_OPTION_YES",
|
||||
"",
|
||||
},
|
||||
commonFlags...,
|
||||
@ -1820,20 +1819,20 @@ func (s *IntegrationTestSuite) TestTxExec() {
|
||||
respType proto.Message
|
||||
expectedCode uint32
|
||||
}{
|
||||
{
|
||||
"correct data",
|
||||
append(
|
||||
[]string{
|
||||
"3",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
false,
|
||||
"",
|
||||
&sdk.TxResponse{},
|
||||
0,
|
||||
},
|
||||
// {
|
||||
// "correct data",
|
||||
// append(
|
||||
// []string{
|
||||
// "3",
|
||||
// fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
// },
|
||||
// commonFlags...,
|
||||
// ),
|
||||
// false,
|
||||
// "",
|
||||
// &sdk.TxResponse{},
|
||||
// 0,
|
||||
// },
|
||||
{
|
||||
"with amino-json",
|
||||
append(
|
||||
@ -1849,34 +1848,34 @@ func (s *IntegrationTestSuite) TestTxExec() {
|
||||
&sdk.TxResponse{},
|
||||
0,
|
||||
},
|
||||
{
|
||||
"invalid proposal id",
|
||||
append(
|
||||
[]string{
|
||||
"abcd",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
true,
|
||||
"invalid syntax",
|
||||
nil,
|
||||
0,
|
||||
},
|
||||
{
|
||||
"proposal not found",
|
||||
append(
|
||||
[]string{
|
||||
"1234",
|
||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
},
|
||||
commonFlags...,
|
||||
),
|
||||
true,
|
||||
"proposal: not found",
|
||||
nil,
|
||||
0,
|
||||
},
|
||||
// {
|
||||
// "invalid proposal id",
|
||||
// append(
|
||||
// []string{
|
||||
// "abcd",
|
||||
// fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
// },
|
||||
// commonFlags...,
|
||||
// ),
|
||||
// true,
|
||||
// "invalid syntax",
|
||||
// nil,
|
||||
// 0,
|
||||
// },
|
||||
// {
|
||||
// "proposal not found",
|
||||
// append(
|
||||
// []string{
|
||||
// "1234",
|
||||
// fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
|
||||
// },
|
||||
// commonFlags...,
|
||||
// ),
|
||||
// true,
|
||||
// "proposal: not found",
|
||||
// nil,
|
||||
// 0,
|
||||
// },
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
@ -1899,10 +1898,29 @@ func (s *IntegrationTestSuite) TestTxExec() {
|
||||
}
|
||||
}
|
||||
|
||||
func getTxSendFileName(s *IntegrationTestSuite, from string, to string) string {
|
||||
tx := fmt.Sprintf(
|
||||
`{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"%s","to_address":"%s","amount":[{"denom":"%s","amount":"10"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`,
|
||||
from, to, s.cfg.BondDenom,
|
||||
)
|
||||
return testutil.WriteToNewTempFile(s.T(), tx).Name()
|
||||
// createCLIProposal writes a CLI proposal with a MsgSend to a file. Returns
|
||||
// the path to the JSON file.
|
||||
func (s *IntegrationTestSuite) createCLIProposal(groupPolicyAddress, proposer, sendFrom, sendTo, metadata string) string {
|
||||
bz, err := base64.StdEncoding.DecodeString(metadata)
|
||||
s.Require().NoError(err)
|
||||
|
||||
msg := banktypes.MsgSend{
|
||||
FromAddress: sendFrom,
|
||||
ToAddress: sendTo,
|
||||
Amount: sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))),
|
||||
}
|
||||
msgJSON, err := s.cfg.Codec.MarshalInterfaceJSON(&msg)
|
||||
s.Require().NoError(err)
|
||||
|
||||
p := client.CLIProposal{
|
||||
GroupPolicyAddress: groupPolicyAddress,
|
||||
Messages: []json.RawMessage{msgJSON},
|
||||
Metadata: bz,
|
||||
Proposers: []string{proposer},
|
||||
}
|
||||
|
||||
bz, err = json.Marshal(&p)
|
||||
s.Require().NoError(err)
|
||||
|
||||
return testutil.WriteToNewTempFile(s.T(), string(bz)).Name()
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
cdc.RegisterConcrete(&MsgUpdateGroupPolicyAdmin{}, "cosmos-sdk/MsgUpdateGroupPolicyAdmin", nil)
|
||||
cdc.RegisterConcrete(&MsgUpdateGroupPolicyDecisionPolicy{}, "cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicy", nil)
|
||||
cdc.RegisterConcrete(&MsgUpdateGroupPolicyMetadata{}, "cosmos-sdk/MsgUpdateGroupPolicyMetadata", nil)
|
||||
cdc.RegisterConcrete(&MsgCreateProposal{}, "cosmos-sdk/group/MsgCreateProposal", nil)
|
||||
cdc.RegisterConcrete(&MsgSubmitProposal{}, "cosmos-sdk/group/MsgSubmitProposal", nil)
|
||||
cdc.RegisterConcrete(&MsgWithdrawProposal{}, "cosmos-sdk/group/MsgWithdrawProposal", nil)
|
||||
cdc.RegisterConcrete(&MsgVote{}, "cosmos-sdk/group/MsgVote", nil)
|
||||
cdc.RegisterConcrete(&MsgExec{}, "cosmos-sdk/group/MsgExec", nil)
|
||||
@ -38,7 +38,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
|
||||
&MsgUpdateGroupPolicyAdmin{},
|
||||
&MsgUpdateGroupPolicyDecisionPolicy{},
|
||||
&MsgUpdateGroupPolicyMetadata{},
|
||||
&MsgCreateProposal{},
|
||||
&MsgSubmitProposal{},
|
||||
&MsgWithdrawProposal{},
|
||||
&MsgVote{},
|
||||
&MsgExec{},
|
||||
|
||||
@ -207,24 +207,24 @@ func (m *EventUpdateGroupPolicy) GetAddress() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// EventCreateProposal is an event emitted when a proposal is created.
|
||||
type EventCreateProposal struct {
|
||||
// EventSubmitProposal is an event emitted when a proposal is created.
|
||||
type EventSubmitProposal struct {
|
||||
// proposal_id is the unique ID of the proposal.
|
||||
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
|
||||
}
|
||||
|
||||
func (m *EventCreateProposal) Reset() { *m = EventCreateProposal{} }
|
||||
func (m *EventCreateProposal) String() string { return proto.CompactTextString(m) }
|
||||
func (*EventCreateProposal) ProtoMessage() {}
|
||||
func (*EventCreateProposal) Descriptor() ([]byte, []int) {
|
||||
func (m *EventSubmitProposal) Reset() { *m = EventSubmitProposal{} }
|
||||
func (m *EventSubmitProposal) String() string { return proto.CompactTextString(m) }
|
||||
func (*EventSubmitProposal) ProtoMessage() {}
|
||||
func (*EventSubmitProposal) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_7879e051fb126fc0, []int{4}
|
||||
}
|
||||
func (m *EventCreateProposal) XXX_Unmarshal(b []byte) error {
|
||||
func (m *EventSubmitProposal) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *EventCreateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
func (m *EventSubmitProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_EventCreateProposal.Marshal(b, m, deterministic)
|
||||
return xxx_messageInfo_EventSubmitProposal.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
@ -234,19 +234,19 @@ func (m *EventCreateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte,
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *EventCreateProposal) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_EventCreateProposal.Merge(m, src)
|
||||
func (m *EventSubmitProposal) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_EventSubmitProposal.Merge(m, src)
|
||||
}
|
||||
func (m *EventCreateProposal) XXX_Size() int {
|
||||
func (m *EventSubmitProposal) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *EventCreateProposal) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_EventCreateProposal.DiscardUnknown(m)
|
||||
func (m *EventSubmitProposal) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_EventSubmitProposal.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_EventCreateProposal proto.InternalMessageInfo
|
||||
var xxx_messageInfo_EventSubmitProposal proto.InternalMessageInfo
|
||||
|
||||
func (m *EventCreateProposal) GetProposalId() uint64 {
|
||||
func (m *EventSubmitProposal) GetProposalId() uint64 {
|
||||
if m != nil {
|
||||
return m.ProposalId
|
||||
}
|
||||
@ -396,7 +396,7 @@ func init() {
|
||||
proto.RegisterType((*EventUpdateGroup)(nil), "cosmos.group.v1beta1.EventUpdateGroup")
|
||||
proto.RegisterType((*EventCreateGroupPolicy)(nil), "cosmos.group.v1beta1.EventCreateGroupPolicy")
|
||||
proto.RegisterType((*EventUpdateGroupPolicy)(nil), "cosmos.group.v1beta1.EventUpdateGroupPolicy")
|
||||
proto.RegisterType((*EventCreateProposal)(nil), "cosmos.group.v1beta1.EventCreateProposal")
|
||||
proto.RegisterType((*EventSubmitProposal)(nil), "cosmos.group.v1beta1.EventSubmitProposal")
|
||||
proto.RegisterType((*EventWithdrawProposal)(nil), "cosmos.group.v1beta1.EventWithdrawProposal")
|
||||
proto.RegisterType((*EventVote)(nil), "cosmos.group.v1beta1.EventVote")
|
||||
proto.RegisterType((*EventExec)(nil), "cosmos.group.v1beta1.EventExec")
|
||||
@ -405,7 +405,7 @@ func init() {
|
||||
func init() { proto.RegisterFile("cosmos/group/v1beta1/events.proto", fileDescriptor_7879e051fb126fc0) }
|
||||
|
||||
var fileDescriptor_7879e051fb126fc0 = []byte{
|
||||
// 295 bytes of a gzipped FileDescriptorProto
|
||||
// 301 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0x2f, 0xce,
|
||||
0xcd, 0x2f, 0xd6, 0x4f, 0x2f, 0xca, 0x2f, 0x2d, 0xd0, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34,
|
||||
0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81,
|
||||
@ -416,15 +416,15 @@ var fileDescriptor_7879e051fb126fc0 = []byte{
|
||||
0x70, 0x89, 0xa1, 0x9b, 0x1e, 0x90, 0x9f, 0x93, 0x99, 0x5c, 0x29, 0x64, 0xc4, 0xc5, 0x9e, 0x98,
|
||||
0x92, 0x52, 0x94, 0x5a, 0x5c, 0x0c, 0xd6, 0xc3, 0xe9, 0x24, 0x71, 0x69, 0x8b, 0x2e, 0xcc, 0xf5,
|
||||
0x8e, 0x10, 0x99, 0xe0, 0x92, 0xa2, 0xcc, 0xbc, 0xf4, 0x20, 0x98, 0x42, 0xb8, 0x69, 0x48, 0x96,
|
||||
0x53, 0x60, 0x9a, 0x19, 0x97, 0x30, 0x92, 0xdb, 0x02, 0x8a, 0xf2, 0x0b, 0xf2, 0x8b, 0x13, 0x73,
|
||||
0x84, 0xe4, 0xb9, 0xb8, 0x0b, 0xa0, 0x6c, 0x84, 0x87, 0xb8, 0x60, 0x42, 0x9e, 0x29, 0x4a, 0x16,
|
||||
0x5c, 0xa2, 0x60, 0x7d, 0xe1, 0x99, 0x25, 0x19, 0x29, 0x45, 0x89, 0xe5, 0xc4, 0xeb, 0xd4, 0xe1,
|
||||
0xe2, 0x04, 0xeb, 0x0c, 0xcb, 0x2f, 0x49, 0x25, 0x5e, 0xb5, 0x6b, 0x45, 0x6a, 0x32, 0x41, 0xd5,
|
||||
0x4e, 0x76, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84,
|
||||
0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x92, 0x9e, 0x59,
|
||||
0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0x0b, 0x8d, 0x7a, 0x28, 0xa5, 0x5b, 0x9c, 0x92, 0xad,
|
||||
0x5f, 0x01, 0x49, 0x4d, 0x49, 0x6c, 0xe0, 0xe4, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xcc,
|
||||
0x13, 0x16, 0xd0, 0x64, 0x02, 0x00, 0x00,
|
||||
0x53, 0x60, 0x9a, 0x19, 0x97, 0x30, 0xd8, 0xb4, 0xe0, 0xd2, 0xa4, 0xdc, 0xcc, 0x92, 0x80, 0xa2,
|
||||
0xfc, 0x82, 0xfc, 0xe2, 0xc4, 0x1c, 0x21, 0x79, 0x2e, 0xee, 0x02, 0x28, 0x1b, 0xe1, 0x21, 0x2e,
|
||||
0x98, 0x90, 0x67, 0x8a, 0x92, 0x05, 0x97, 0x28, 0x58, 0x5f, 0x78, 0x66, 0x49, 0x46, 0x4a, 0x51,
|
||||
0x62, 0x39, 0xf1, 0x3a, 0x75, 0xb8, 0x38, 0xc1, 0x3a, 0xc3, 0xf2, 0x4b, 0x52, 0x89, 0x57, 0xed,
|
||||
0x5a, 0x91, 0x9a, 0x4c, 0x50, 0xb5, 0x93, 0xdd, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31,
|
||||
0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb,
|
||||
0x31, 0x44, 0xa9, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0x42, 0xa3, 0x1e,
|
||||
0x4a, 0xe9, 0x16, 0xa7, 0x64, 0xeb, 0x57, 0x40, 0x52, 0x53, 0x12, 0x1b, 0x38, 0x39, 0x18, 0x03,
|
||||
0x02, 0x00, 0x00, 0xff, 0xff, 0x54, 0x9c, 0xae, 0x89, 0x64, 0x02, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *EventCreateGroup) Marshal() (dAtA []byte, err error) {
|
||||
@ -543,7 +543,7 @@ func (m *EventUpdateGroupPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error)
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *EventCreateProposal) Marshal() (dAtA []byte, err error) {
|
||||
func (m *EventSubmitProposal) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
@ -553,12 +553,12 @@ func (m *EventCreateProposal) Marshal() (dAtA []byte, err error) {
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *EventCreateProposal) MarshalTo(dAtA []byte) (int, error) {
|
||||
func (m *EventSubmitProposal) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *EventCreateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
func (m *EventSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
@ -716,7 +716,7 @@ func (m *EventUpdateGroupPolicy) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *EventCreateProposal) Size() (n int) {
|
||||
func (m *EventSubmitProposal) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
@ -1072,7 +1072,7 @@ func (m *EventUpdateGroupPolicy) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *EventCreateProposal) Unmarshal(dAtA []byte) error {
|
||||
func (m *EventSubmitProposal) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
@ -1095,10 +1095,10 @@ func (m *EventCreateProposal) Unmarshal(dAtA []byte) error {
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: EventCreateProposal: wiretype end group for non-group")
|
||||
return fmt.Errorf("proto: EventSubmitProposal: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: EventCreateProposal: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
return fmt.Errorf("proto: EventSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
|
||||
@ -22,7 +22,7 @@ func (s GenesisState) Validate() error {
|
||||
if err := g.ValidateBasic(); err != nil {
|
||||
return sdkerrors.Wrap(err, "Group validation failed")
|
||||
}
|
||||
groups[g.GroupId] = *g
|
||||
groups[g.Id] = *g
|
||||
}
|
||||
|
||||
for _, g := range s.GroupPolicies {
|
||||
@ -61,7 +61,7 @@ func (s GenesisState) Validate() error {
|
||||
if err := p.ValidateBasic(); err != nil {
|
||||
return sdkerrors.Wrap(err, "Proposal validation failed")
|
||||
}
|
||||
proposals[p.ProposalId] = *p
|
||||
proposals[p.Id] = *p
|
||||
}
|
||||
|
||||
for _, v := range s.Votes {
|
||||
|
||||
@ -50,7 +50,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
proposal := &Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: accAddr.String(),
|
||||
Metadata: []byte("proposal metadata"),
|
||||
GroupVersion: 1,
|
||||
@ -58,17 +58,17 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
Proposers: []string{
|
||||
memberAddr.String(),
|
||||
},
|
||||
SubmittedAt: submittedAt,
|
||||
Status: ProposalStatusClosed,
|
||||
Result: ProposalResultAccepted,
|
||||
VoteState: Tally{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
SubmitTime: submittedAt,
|
||||
Status: PROPOSAL_STATUS_CLOSED,
|
||||
Result: PROPOSAL_RESULT_ACCEPTED,
|
||||
FinalTallyResult: TallyResult{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
Timeout: timeout,
|
||||
ExecutorResult: ProposalExecutorResultSuccess,
|
||||
ExecutorResult: PROPOSAL_EXECUTOR_RESULT_SUCCESS,
|
||||
}
|
||||
err = proposal.SetMsgs([]sdk.Msg{&banktypes.MsgSend{
|
||||
FromAddress: accAddr.String(),
|
||||
@ -85,14 +85,14 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
{
|
||||
"valid genesisState",
|
||||
GenesisState{
|
||||
GroupSeq: 2,
|
||||
Groups: []*GroupInfo{{GroupId: 1, Admin: accAddr.String(), Metadata: []byte("1"), Version: 1, TotalWeight: "1"}, {GroupId: 2, Admin: accAddr.String(), Metadata: []byte("2"), Version: 2, TotalWeight: "2"}},
|
||||
GroupMembers: []*GroupMember{{GroupId: 1, Member: &Member{Address: memberAddr.String(), Weight: "1", Metadata: []byte("member metadata")}}, {GroupId: 2, Member: &Member{Address: memberAddr.String(), Weight: "2", Metadata: []byte("member metadata")}}},
|
||||
GroupSeq: 2,
|
||||
Groups: []*GroupInfo{{Id: 1, Admin: accAddr.String(), Metadata: []byte("1"), Version: 1, TotalWeight: "1"}, {Id: 2, Admin: accAddr.String(), Metadata: []byte("2"), Version: 2, TotalWeight: "2"}},
|
||||
GroupMembers: []*GroupMember{{GroupId: 1, Member: &Member{Address: memberAddr.String(), Weight: "1", Metadata: []byte("member metadata")}}, {GroupId: 2, Member: &Member{Address: memberAddr.String(), Weight: "2", Metadata: []byte("member metadata")}}},
|
||||
GroupPolicySeq: 1,
|
||||
GroupPolicies: []*GroupPolicyInfo{groupPolicy},
|
||||
ProposalSeq: 1,
|
||||
Proposals: []*Proposal{proposal},
|
||||
Votes: []*Vote{{ProposalId: proposal.ProposalId, Voter: memberAddr.String(), SubmittedAt: submittedAt, Choice: Choice_CHOICE_YES}},
|
||||
GroupPolicies: []*GroupPolicyInfo{groupPolicy},
|
||||
ProposalSeq: 1,
|
||||
Proposals: []*Proposal{proposal},
|
||||
Votes: []*Vote{{ProposalId: proposal.Id, Voter: memberAddr.String(), SubmitTime: submittedAt, Option: VOTE_OPTION_YES}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -106,7 +106,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 0,
|
||||
Id: 0,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -121,7 +121,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: "invalid admin",
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -136,7 +136,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 0,
|
||||
@ -151,7 +151,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -166,7 +166,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -190,7 +190,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -214,7 +214,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -238,7 +238,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -262,7 +262,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -287,7 +287,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -311,7 +311,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -335,7 +335,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -359,7 +359,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -371,7 +371,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
},
|
||||
Proposals: []*Proposal{
|
||||
{
|
||||
ProposalId: 0,
|
||||
Id: 0,
|
||||
Address: accAddr.String(),
|
||||
Metadata: []byte("proposal metadata"),
|
||||
GroupVersion: 1,
|
||||
@ -386,7 +386,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -398,7 +398,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
},
|
||||
Proposals: []*Proposal{
|
||||
{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: "invalid address",
|
||||
Metadata: []byte("proposal metadata"),
|
||||
GroupVersion: 1,
|
||||
@ -413,7 +413,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -425,7 +425,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
},
|
||||
Proposals: []*Proposal{
|
||||
{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: accAddr.String(),
|
||||
Metadata: []byte("proposal metadata"),
|
||||
GroupVersion: 0,
|
||||
@ -440,7 +440,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -452,7 +452,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
},
|
||||
Proposals: []*Proposal{
|
||||
{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: accAddr.String(),
|
||||
Metadata: []byte("proposal metadata"),
|
||||
GroupVersion: 1,
|
||||
@ -463,11 +463,11 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
true,
|
||||
},
|
||||
{
|
||||
"invalid VoteState with negative YesCount",
|
||||
"invalid FinalTallyResult with negative YesCount",
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -479,7 +479,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
},
|
||||
Proposals: []*Proposal{
|
||||
{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: accAddr.String(),
|
||||
Metadata: []byte("proposal metadata"),
|
||||
GroupVersion: 1,
|
||||
@ -487,14 +487,14 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
Proposers: []string{
|
||||
memberAddr.String(),
|
||||
},
|
||||
SubmittedAt: submittedAt,
|
||||
Status: ProposalStatusClosed,
|
||||
Result: ProposalResultAccepted,
|
||||
VoteState: Tally{
|
||||
YesCount: "-1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
SubmitTime: submittedAt,
|
||||
Status: PROPOSAL_STATUS_CLOSED,
|
||||
Result: PROPOSAL_RESULT_ACCEPTED,
|
||||
FinalTallyResult: TallyResult{
|
||||
YesCount: "-1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -502,11 +502,11 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
true,
|
||||
},
|
||||
{
|
||||
"invalid VoteState with negative NoCount",
|
||||
"invalid FinalTallyResult with negative NoCount",
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -518,7 +518,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
},
|
||||
Proposals: []*Proposal{
|
||||
{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: accAddr.String(),
|
||||
Metadata: []byte("proposal metadata"),
|
||||
GroupVersion: 1,
|
||||
@ -526,14 +526,14 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
Proposers: []string{
|
||||
memberAddr.String(),
|
||||
},
|
||||
SubmittedAt: submittedAt,
|
||||
Status: ProposalStatusClosed,
|
||||
Result: ProposalResultAccepted,
|
||||
VoteState: Tally{
|
||||
YesCount: "0",
|
||||
NoCount: "-1",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
SubmitTime: submittedAt,
|
||||
Status: PROPOSAL_STATUS_CLOSED,
|
||||
Result: PROPOSAL_RESULT_ACCEPTED,
|
||||
FinalTallyResult: TallyResult{
|
||||
YesCount: "0",
|
||||
NoCount: "-1",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -541,11 +541,11 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
true,
|
||||
},
|
||||
{
|
||||
"invalid VoteState with negative AbstainCount",
|
||||
"invalid FinalTallyResult with negative AbstainCount",
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -557,7 +557,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
},
|
||||
Proposals: []*Proposal{
|
||||
{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: accAddr.String(),
|
||||
Metadata: []byte("proposal metadata"),
|
||||
GroupVersion: 1,
|
||||
@ -565,14 +565,14 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
Proposers: []string{
|
||||
memberAddr.String(),
|
||||
},
|
||||
SubmittedAt: submittedAt,
|
||||
Status: ProposalStatusClosed,
|
||||
Result: ProposalResultAccepted,
|
||||
VoteState: Tally{
|
||||
YesCount: "0",
|
||||
NoCount: "0",
|
||||
AbstainCount: "-1",
|
||||
VetoCount: "0",
|
||||
SubmitTime: submittedAt,
|
||||
Status: PROPOSAL_STATUS_CLOSED,
|
||||
Result: PROPOSAL_RESULT_ACCEPTED,
|
||||
FinalTallyResult: TallyResult{
|
||||
YesCount: "0",
|
||||
NoCount: "0",
|
||||
AbstainCount: "-1",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -580,11 +580,11 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
true,
|
||||
},
|
||||
{
|
||||
"invalid VoteState with negative VetoCount",
|
||||
"invalid FinalTallyResult with negative VetoCount",
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -596,7 +596,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
},
|
||||
Proposals: []*Proposal{
|
||||
{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: accAddr.String(),
|
||||
Metadata: []byte("proposal metadata"),
|
||||
GroupVersion: 1,
|
||||
@ -604,14 +604,14 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
Proposers: []string{
|
||||
memberAddr.String(),
|
||||
},
|
||||
SubmittedAt: submittedAt,
|
||||
Status: ProposalStatusClosed,
|
||||
Result: ProposalResultAccepted,
|
||||
VoteState: Tally{
|
||||
YesCount: "0",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "-1",
|
||||
SubmitTime: submittedAt,
|
||||
Status: PROPOSAL_STATUS_CLOSED,
|
||||
Result: PROPOSAL_RESULT_ACCEPTED,
|
||||
FinalTallyResult: TallyResult{
|
||||
YesCount: "0",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "-1",
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -623,7 +623,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -638,10 +638,10 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
},
|
||||
Votes: []*Vote{
|
||||
{
|
||||
ProposalId: proposal.ProposalId,
|
||||
Voter: "invalid voter",
|
||||
SubmittedAt: submittedAt,
|
||||
Choice: Choice_CHOICE_YES,
|
||||
ProposalId: proposal.Id,
|
||||
Voter: "invalid voter",
|
||||
SubmitTime: submittedAt,
|
||||
Option: VOTE_OPTION_YES,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -652,7 +652,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -667,10 +667,10 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
},
|
||||
Votes: []*Vote{
|
||||
{
|
||||
ProposalId: 0,
|
||||
Voter: memberAddr.String(),
|
||||
SubmittedAt: submittedAt,
|
||||
Choice: Choice_CHOICE_YES,
|
||||
ProposalId: 0,
|
||||
Voter: memberAddr.String(),
|
||||
SubmitTime: submittedAt,
|
||||
Option: VOTE_OPTION_YES,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -681,7 +681,7 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -696,21 +696,21 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
},
|
||||
Votes: []*Vote{
|
||||
{
|
||||
ProposalId: 2,
|
||||
Voter: memberAddr.String(),
|
||||
SubmittedAt: submittedAt,
|
||||
Choice: Choice_CHOICE_YES,
|
||||
ProposalId: 2,
|
||||
Voter: memberAddr.String(),
|
||||
SubmitTime: submittedAt,
|
||||
Option: VOTE_OPTION_YES,
|
||||
},
|
||||
},
|
||||
},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"invalid choice",
|
||||
"invalid vote option",
|
||||
GenesisState{
|
||||
Groups: []*GroupInfo{
|
||||
{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: accAddr.String(),
|
||||
Metadata: []byte("1"),
|
||||
Version: 1,
|
||||
@ -725,10 +725,10 @@ func TestGenesisStateValidate(t *testing.T) {
|
||||
},
|
||||
Votes: []*Vote{
|
||||
{
|
||||
ProposalId: proposal.ProposalId,
|
||||
Voter: memberAddr.String(),
|
||||
SubmittedAt: submittedAt,
|
||||
Choice: Choice_CHOICE_UNSPECIFIED,
|
||||
ProposalId: proposal.Id,
|
||||
Voter: memberAddr.String(),
|
||||
SubmitTime: submittedAt,
|
||||
Option: VOTE_OPTION_UNSPECIFIED,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -78,7 +78,7 @@ func (s *GenesisTestSuite) TestInitExportGenesis() {
|
||||
s.Require().NoError(err)
|
||||
|
||||
proposal := &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: accAddr.String(),
|
||||
Metadata: []byte("proposal metadata"),
|
||||
GroupVersion: 1,
|
||||
@ -86,17 +86,17 @@ func (s *GenesisTestSuite) TestInitExportGenesis() {
|
||||
Proposers: []string{
|
||||
memberAddr.String(),
|
||||
},
|
||||
SubmittedAt: submittedAt,
|
||||
Status: group.ProposalStatusClosed,
|
||||
Result: group.ProposalResultAccepted,
|
||||
VoteState: group.Tally{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
SubmitTime: submittedAt,
|
||||
Status: group.PROPOSAL_STATUS_CLOSED,
|
||||
Result: group.PROPOSAL_RESULT_ACCEPTED,
|
||||
FinalTallyResult: group.TallyResult{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
Timeout: timeout,
|
||||
ExecutorResult: group.ProposalExecutorResultSuccess,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_SUCCESS,
|
||||
}
|
||||
err = proposal.SetMsgs([]sdk.Msg{&banktypes.MsgSend{
|
||||
FromAddress: accAddr.String(),
|
||||
@ -106,14 +106,14 @@ func (s *GenesisTestSuite) TestInitExportGenesis() {
|
||||
s.Require().NoError(err)
|
||||
|
||||
genesisState := &group.GenesisState{
|
||||
GroupSeq: 2,
|
||||
Groups: []*group.GroupInfo{{GroupId: 1, Admin: accAddr.String(), Metadata: []byte("1"), Version: 1, TotalWeight: "1"}, {GroupId: 2, Admin: accAddr.String(), Metadata: []byte("2"), Version: 2, TotalWeight: "2"}},
|
||||
GroupMembers: []*group.GroupMember{{GroupId: 1, Member: &group.Member{Address: memberAddr.String(), Weight: "1", Metadata: []byte("member metadata")}}, {GroupId: 2, Member: &group.Member{Address: memberAddr.String(), Weight: "2", Metadata: []byte("member metadata")}}},
|
||||
GroupSeq: 2,
|
||||
Groups: []*group.GroupInfo{{Id: 1, Admin: accAddr.String(), Metadata: []byte("1"), Version: 1, TotalWeight: "1"}, {Id: 2, Admin: accAddr.String(), Metadata: []byte("2"), Version: 2, TotalWeight: "2"}},
|
||||
GroupMembers: []*group.GroupMember{{GroupId: 1, Member: &group.Member{Address: memberAddr.String(), Weight: "1", Metadata: []byte("member metadata")}}, {GroupId: 2, Member: &group.Member{Address: memberAddr.String(), Weight: "2", Metadata: []byte("member metadata")}}},
|
||||
GroupPolicySeq: 1,
|
||||
GroupPolicies: []*group.GroupPolicyInfo{groupPolicy},
|
||||
ProposalSeq: 1,
|
||||
Proposals: []*group.Proposal{proposal},
|
||||
Votes: []*group.Vote{{ProposalId: proposal.ProposalId, Voter: memberAddr.String(), SubmittedAt: submittedAt, Choice: group.Choice_CHOICE_YES}},
|
||||
GroupPolicies: []*group.GroupPolicyInfo{groupPolicy},
|
||||
ProposalSeq: 1,
|
||||
Proposals: []*group.Proposal{proposal},
|
||||
Votes: []*group.Vote{{ProposalId: proposal.Id, Voter: memberAddr.String(), SubmitTime: submittedAt, Option: group.VOTE_OPTION_YES}},
|
||||
}
|
||||
genesisBytes, err := cdc.MarshalJSON(genesisState)
|
||||
s.Require().NoError(err)
|
||||
@ -126,13 +126,13 @@ func (s *GenesisTestSuite) TestInitExportGenesis() {
|
||||
|
||||
for i, g := range genesisState.Groups {
|
||||
res, err := s.keeper.GroupInfo(ctx, &group.QueryGroupInfoRequest{
|
||||
GroupId: g.GroupId,
|
||||
GroupId: g.Id,
|
||||
})
|
||||
s.Require().NoError(err)
|
||||
s.Require().Equal(g, res.Info)
|
||||
|
||||
membersRes, err := s.keeper.GroupMembers(ctx, &group.QueryGroupMembersRequest{
|
||||
GroupId: g.GroupId,
|
||||
GroupId: g.Id,
|
||||
})
|
||||
s.Require().NoError(err)
|
||||
s.Require().Equal(len(membersRes.Members), 1)
|
||||
@ -149,13 +149,13 @@ func (s *GenesisTestSuite) TestInitExportGenesis() {
|
||||
|
||||
for _, g := range genesisState.Proposals {
|
||||
res, err := s.keeper.Proposal(ctx, &group.QueryProposalRequest{
|
||||
ProposalId: g.ProposalId,
|
||||
ProposalId: g.Id,
|
||||
})
|
||||
s.Require().NoError(err)
|
||||
s.assertProposalsEqual(g, res.Proposal)
|
||||
|
||||
votesRes, err := s.keeper.VotesByProposal(ctx, &group.QueryVotesByProposalRequest{
|
||||
ProposalId: g.ProposalId,
|
||||
ProposalId: g.Id,
|
||||
})
|
||||
s.Require().NoError(err)
|
||||
s.Require().Equal(len(votesRes.Votes), 1)
|
||||
@ -206,16 +206,16 @@ func (s *GenesisTestSuite) assertGroupPoliciesEqual(g *group.GroupPolicyInfo, ot
|
||||
|
||||
func (s *GenesisTestSuite) assertProposalsEqual(g *group.Proposal, other *group.Proposal) {
|
||||
require := s.Require()
|
||||
require.Equal(g.ProposalId, other.ProposalId)
|
||||
require.Equal(g.Id, other.Id)
|
||||
require.Equal(g.Address, other.Address)
|
||||
require.Equal(g.Metadata, other.Metadata)
|
||||
require.Equal(g.Proposers, other.Proposers)
|
||||
require.Equal(g.SubmittedAt, other.SubmittedAt)
|
||||
require.Equal(g.SubmitTime, other.SubmitTime)
|
||||
require.Equal(g.GroupVersion, other.GroupVersion)
|
||||
require.Equal(g.GroupPolicyVersion, other.GroupPolicyVersion)
|
||||
require.Equal(g.Status, other.Status)
|
||||
require.Equal(g.Result, other.Result)
|
||||
require.Equal(g.VoteState, other.VoteState)
|
||||
require.Equal(g.FinalTallyResult, other.FinalTallyResult)
|
||||
require.Equal(g.Timeout, other.Timeout)
|
||||
require.Equal(g.ExecutorResult, other.ExecutorResult)
|
||||
require.Equal(g.GetMsgs(), other.GetMsgs())
|
||||
|
||||
@ -46,7 +46,7 @@ func GroupTotalWeightInvariant(keeper Keeper) sdk.Invariant {
|
||||
}
|
||||
}
|
||||
|
||||
// TallyVotesSumInvariant checks that proposal VoteState must correspond to the vote choice.
|
||||
// TallyVotesSumInvariant checks that proposal FinalTallyResult must correspond to the vote option.
|
||||
func TallyVotesSumInvariant(keeper Keeper) sdk.Invariant {
|
||||
return func(ctx sdk.Context) (string, bool) {
|
||||
msg, broken := TallyVotesSumInvariantHelper(ctx, keeper.key, keeper.groupTable, keeper.proposalTable, keeper.groupMemberTable, keeper.voteByProposalIndex, keeper.groupPolicyTable)
|
||||
@ -86,43 +86,43 @@ func TallyVotesInvariantHelper(ctx sdk.Context, prevCtx sdk.Context, key storety
|
||||
}
|
||||
|
||||
for i := 0; i < len(prevProposals); i++ {
|
||||
if prevProposals[i].ProposalId == curProposals[i].ProposalId {
|
||||
prevYesCount, err := prevProposals[i].VoteState.GetYesCount()
|
||||
if prevProposals[i].Id == curProposals[i].Id {
|
||||
prevYesCount, err := prevProposals[i].FinalTallyResult.GetYesCount()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting yes votes weight of proposal at block height %d\n%v\n", prevCtx.BlockHeight(), err)
|
||||
return msg, broken
|
||||
}
|
||||
curYesCount, err := curProposals[i].VoteState.GetYesCount()
|
||||
curYesCount, err := curProposals[i].FinalTallyResult.GetYesCount()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting yes votes weight of proposal at block height %d\n%v\n", ctx.BlockHeight(), err)
|
||||
return msg, broken
|
||||
}
|
||||
prevNoCount, err := prevProposals[i].VoteState.GetNoCount()
|
||||
prevNoCount, err := prevProposals[i].FinalTallyResult.GetNoCount()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting no votes weight of proposal at block height %d\n%v\n", prevCtx.BlockHeight(), err)
|
||||
return msg, broken
|
||||
}
|
||||
curNoCount, err := curProposals[i].VoteState.GetNoCount()
|
||||
curNoCount, err := curProposals[i].FinalTallyResult.GetNoCount()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting no votes weight of proposal at block height %d\n%v\n", ctx.BlockHeight(), err)
|
||||
return msg, broken
|
||||
}
|
||||
prevAbstainCount, err := prevProposals[i].VoteState.GetAbstainCount()
|
||||
prevAbstainCount, err := prevProposals[i].FinalTallyResult.GetAbstainCount()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting abstain votes weight of proposal at block height %d\n%v\n", prevCtx.BlockHeight(), err)
|
||||
return msg, broken
|
||||
}
|
||||
curAbstainCount, err := curProposals[i].VoteState.GetAbstainCount()
|
||||
curAbstainCount, err := curProposals[i].FinalTallyResult.GetAbstainCount()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting abstain votes weight of proposal at block height %d\n%v\n", ctx.BlockHeight(), err)
|
||||
return msg, broken
|
||||
}
|
||||
prevVetoCount, err := prevProposals[i].VoteState.GetVetoCount()
|
||||
prevVetoCount, err := prevProposals[i].FinalTallyResult.GetNoWithVetoCount()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting veto votes weight of proposal at block height %d\n%v\n", prevCtx.BlockHeight(), err)
|
||||
return msg, broken
|
||||
}
|
||||
curVetoCount, err := curProposals[i].VoteState.GetVetoCount()
|
||||
curVetoCount, err := curProposals[i].FinalTallyResult.GetNoWithVetoCount()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting veto votes weight of proposal at block height %d\n%v\n", ctx.BlockHeight(), err)
|
||||
return msg, broken
|
||||
@ -162,9 +162,9 @@ func GroupTotalWeightInvariantHelper(ctx sdk.Context, key storetypes.StoreKey, g
|
||||
if errors.ErrORMIteratorDone.Is(err) {
|
||||
break
|
||||
}
|
||||
memIt, err := groupMemberByGroupIndex.Get(ctx.KVStore(key), groupInfo.GroupId)
|
||||
memIt, err := groupMemberByGroupIndex.Get(ctx.KVStore(key), groupInfo.Id)
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while returning group member iterator for group with ID %d\n%v\n", groupInfo.GroupId, err)
|
||||
msg += fmt.Sprintf("error while returning group member iterator for group with ID %d\n%v\n", groupInfo.Id, err)
|
||||
return msg, broken
|
||||
}
|
||||
defer memIt.Close()
|
||||
@ -187,7 +187,7 @@ func GroupTotalWeightInvariantHelper(ctx sdk.Context, key storetypes.StoreKey, g
|
||||
}
|
||||
groupWeight, err := groupmath.NewNonNegativeDecFromString(groupInfo.GetTotalWeight())
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while parsing non-nengative decimal for group with ID %d\n%v\n", groupInfo.GroupId, err)
|
||||
msg += fmt.Sprintf("error while parsing non-nengative decimal for group with ID %d\n%v\n", groupInfo.Id, err)
|
||||
return msg, broken
|
||||
}
|
||||
|
||||
@ -269,13 +269,13 @@ func TallyVotesSumInvariantHelper(ctx sdk.Context, key storetypes.StoreKey, grou
|
||||
}
|
||||
|
||||
if groupInfo.Version != proposal.GroupVersion {
|
||||
msg += fmt.Sprintf("group with id %d was modified\n", groupInfo.GroupId)
|
||||
msg += fmt.Sprintf("group with id %d was modified\n", groupInfo.Id)
|
||||
return msg, broken
|
||||
}
|
||||
|
||||
voteIt, err := voteByProposalIndex.Get(ctx.KVStore(key), proposal.ProposalId)
|
||||
voteIt, err := voteByProposalIndex.Get(ctx.KVStore(key), proposal.Id)
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while returning vote iterator for proposal with ID %d\n%v\n", proposal.ProposalId, err)
|
||||
msg += fmt.Sprintf("error while returning vote iterator for proposal with ID %d\n%v\n", proposal.Id, err)
|
||||
return msg, broken
|
||||
}
|
||||
defer voteIt.Close()
|
||||
@ -303,26 +303,26 @@ func TallyVotesSumInvariantHelper(ctx sdk.Context, key storetypes.StoreKey, grou
|
||||
return msg, broken
|
||||
}
|
||||
|
||||
switch vote.Choice {
|
||||
case group.Choice_CHOICE_YES:
|
||||
switch vote.Option {
|
||||
case group.VOTE_OPTION_YES:
|
||||
yesVoteWeight, err = groupmath.Add(yesVoteWeight, curMemVotingWeight)
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("decimal addition error\n%v\n", err)
|
||||
return msg, broken
|
||||
}
|
||||
case group.Choice_CHOICE_NO:
|
||||
case group.VOTE_OPTION_NO:
|
||||
noVoteWeight, err = groupmath.Add(noVoteWeight, curMemVotingWeight)
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("decimal addition error\n%v\n", err)
|
||||
return msg, broken
|
||||
}
|
||||
case group.Choice_CHOICE_ABSTAIN:
|
||||
case group.VOTE_OPTION_ABSTAIN:
|
||||
abstainVoteWeight, err = groupmath.Add(abstainVoteWeight, curMemVotingWeight)
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("decimal addition error\n%v\n", err)
|
||||
return msg, broken
|
||||
}
|
||||
case group.Choice_CHOICE_VETO:
|
||||
case group.VOTE_OPTION_NO_WITH_VETO:
|
||||
vetoVoteWeight, err = groupmath.Add(vetoVoteWeight, curMemVotingWeight)
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("decimal addition error\n%v\n", err)
|
||||
@ -331,41 +331,41 @@ func TallyVotesSumInvariantHelper(ctx sdk.Context, key storetypes.StoreKey, grou
|
||||
}
|
||||
}
|
||||
|
||||
totalProposalVotes, err := proposal.VoteState.TotalCounts()
|
||||
totalProposalVotes, err := proposal.FinalTallyResult.TotalCounts()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting total weighted votes of proposal with ID %d\n%v\n", proposal.ProposalId, err)
|
||||
msg += fmt.Sprintf("error while getting total weighted votes of proposal with ID %d\n%v\n", proposal.Id, err)
|
||||
return msg, broken
|
||||
}
|
||||
proposalYesCount, err := proposal.VoteState.GetYesCount()
|
||||
proposalYesCount, err := proposal.FinalTallyResult.GetYesCount()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting the weighted sum of yes votes for proposal with ID %d\n%v\n", proposal.ProposalId, err)
|
||||
msg += fmt.Sprintf("error while getting the weighted sum of yes votes for proposal with ID %d\n%v\n", proposal.Id, err)
|
||||
return msg, broken
|
||||
}
|
||||
proposalNoCount, err := proposal.VoteState.GetNoCount()
|
||||
proposalNoCount, err := proposal.FinalTallyResult.GetNoCount()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting the weighted sum of no votes for proposal with ID %d\n%v\n", proposal.ProposalId, err)
|
||||
msg += fmt.Sprintf("error while getting the weighted sum of no votes for proposal with ID %d\n%v\n", proposal.Id, err)
|
||||
return msg, broken
|
||||
}
|
||||
proposalAbstainCount, err := proposal.VoteState.GetAbstainCount()
|
||||
proposalAbstainCount, err := proposal.FinalTallyResult.GetAbstainCount()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting the weighted sum of abstain votes for proposal with ID %d\n%v\n", proposal.ProposalId, err)
|
||||
msg += fmt.Sprintf("error while getting the weighted sum of abstain votes for proposal with ID %d\n%v\n", proposal.Id, err)
|
||||
return msg, broken
|
||||
}
|
||||
proposalVetoCount, err := proposal.VoteState.GetVetoCount()
|
||||
proposalVetoCount, err := proposal.FinalTallyResult.GetNoWithVetoCount()
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf("error while getting the weighted sum of veto votes for proposal with ID %d\n%v\n", proposal.ProposalId, err)
|
||||
msg += fmt.Sprintf("error while getting the weighted sum of veto votes for proposal with ID %d\n%v\n", proposal.Id, err)
|
||||
return msg, broken
|
||||
}
|
||||
|
||||
if totalProposalVotes.Cmp(totalVotingWeight) != 0 {
|
||||
broken = true
|
||||
msg += fmt.Sprintf("proposal VoteState must correspond to the sum of votes weights\nProposal with ID %d has total proposal votes %s, but got sum of votes weights %s\n", proposal.ProposalId, totalProposalVotes.String(), totalVotingWeight.String())
|
||||
msg += fmt.Sprintf("proposal FinalTallyResult must correspond to the sum of votes weights\nProposal with ID %d has total proposal votes %s, but got sum of votes weights %s\n", proposal.Id, totalProposalVotes.String(), totalVotingWeight.String())
|
||||
break
|
||||
}
|
||||
|
||||
if (yesVoteWeight.Cmp(proposalYesCount) != 0) || (noVoteWeight.Cmp(proposalNoCount) != 0) || (abstainVoteWeight.Cmp(proposalAbstainCount) != 0) || (vetoVoteWeight.Cmp(proposalVetoCount) != 0) {
|
||||
broken = true
|
||||
msg += fmt.Sprintf("proposal VoteState must correspond to the vote choice\nProposal with ID %d and voter address %s must correspond to the vote choice\n", proposal.ProposalId, vote.Voter)
|
||||
msg += fmt.Sprintf("proposal FinalTallyResult must correspond to the vote option\nProposal with ID %d and voter address %s must correspond to the vote option\n", proposal.Id, vote.Voter)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,146 +72,146 @@ func (s *invariantTestSuite) TestTallyVotesInvariant() {
|
||||
}{
|
||||
"invariant not broken": {
|
||||
prevProposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr1.String(),
|
||||
Proposers: []string{addr1.String()},
|
||||
SubmittedAt: prevCtx.BlockTime(),
|
||||
SubmitTime: prevCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "1", NoCount: "0", AbstainCount: "0", VetoCount: "0"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "1", NoCount: "0", AbstainCount: "0", NoWithVetoCount: "0"},
|
||||
Timeout: prevCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
|
||||
curProposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr2.String(),
|
||||
Proposers: []string{addr2.String()},
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "2", NoCount: "0", AbstainCount: "0", VetoCount: "0"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "2", NoCount: "0", AbstainCount: "0", NoWithVetoCount: "0"},
|
||||
Timeout: curCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
},
|
||||
"current block yes vote count must be greater than previous block yes vote count": {
|
||||
prevProposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr1.String(),
|
||||
Proposers: []string{addr1.String()},
|
||||
SubmittedAt: prevCtx.BlockTime(),
|
||||
SubmitTime: prevCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "2", NoCount: "0", AbstainCount: "0", VetoCount: "0"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "2", NoCount: "0", AbstainCount: "0", NoWithVetoCount: "0"},
|
||||
Timeout: prevCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
curProposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr2.String(),
|
||||
Proposers: []string{addr2.String()},
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "1", NoCount: "0", AbstainCount: "0", VetoCount: "0"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "1", NoCount: "0", AbstainCount: "0", NoWithVetoCount: "0"},
|
||||
Timeout: curCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
expBroken: true,
|
||||
},
|
||||
"current block no vote count must be greater than previous block no vote count": {
|
||||
prevProposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr1.String(),
|
||||
Proposers: []string{addr1.String()},
|
||||
SubmittedAt: prevCtx.BlockTime(),
|
||||
SubmitTime: prevCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "0", NoCount: "2", AbstainCount: "0", VetoCount: "0"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "0", NoCount: "2", AbstainCount: "0", NoWithVetoCount: "0"},
|
||||
Timeout: prevCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
curProposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr2.String(),
|
||||
Proposers: []string{addr2.String()},
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "0", NoCount: "1", AbstainCount: "0", VetoCount: "0"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "0", NoCount: "1", AbstainCount: "0", NoWithVetoCount: "0"},
|
||||
Timeout: curCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
expBroken: true,
|
||||
},
|
||||
"current block abstain vote count must be greater than previous block abstain vote count": {
|
||||
prevProposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr1.String(),
|
||||
Proposers: []string{addr1.String()},
|
||||
SubmittedAt: prevCtx.BlockTime(),
|
||||
SubmitTime: prevCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "0", NoCount: "0", AbstainCount: "2", VetoCount: "0"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "0", NoCount: "0", AbstainCount: "2", NoWithVetoCount: "0"},
|
||||
Timeout: prevCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
curProposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr2.String(),
|
||||
Proposers: []string{addr2.String()},
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "0", NoCount: "0", AbstainCount: "1", VetoCount: "0"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "0", NoCount: "0", AbstainCount: "1", NoWithVetoCount: "0"},
|
||||
Timeout: curCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
expBroken: true,
|
||||
},
|
||||
"current block veto vote count must be greater than previous block veto vote count": {
|
||||
prevProposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr1.String(),
|
||||
Proposers: []string{addr1.String()},
|
||||
SubmittedAt: prevCtx.BlockTime(),
|
||||
SubmitTime: prevCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "0", NoCount: "0", AbstainCount: "0", VetoCount: "2"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "0", NoCount: "0", AbstainCount: "0", NoWithVetoCount: "2"},
|
||||
Timeout: prevCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
curProposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr2.String(),
|
||||
Proposers: []string{addr2.String()},
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "0", NoCount: "0", AbstainCount: "0", VetoCount: "1"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "0", NoCount: "0", AbstainCount: "0", NoWithVetoCount: "1"},
|
||||
Timeout: curCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
expBroken: true,
|
||||
},
|
||||
@ -263,7 +263,7 @@ func (s *invariantTestSuite) TestGroupTotalWeightInvariant() {
|
||||
}{
|
||||
"invariant not broken": {
|
||||
groupsInfo: &group.GroupInfo{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: addr1.String(),
|
||||
Version: 1,
|
||||
TotalWeight: "3",
|
||||
@ -289,7 +289,7 @@ func (s *invariantTestSuite) TestGroupTotalWeightInvariant() {
|
||||
|
||||
"group's TotalWeight must be equal to sum of its members weight ": {
|
||||
groupsInfo: &group.GroupInfo{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: addr1.String(),
|
||||
Version: 1,
|
||||
TotalWeight: "3",
|
||||
@ -376,7 +376,7 @@ func (s *invariantTestSuite) TestTallyVotesSumInvariant() {
|
||||
}{
|
||||
"invariant not broken": {
|
||||
groupsInfo: &group.GroupInfo{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: adminAddr.String(),
|
||||
Version: 1,
|
||||
TotalWeight: "7",
|
||||
@ -404,37 +404,37 @@ func (s *invariantTestSuite) TestTallyVotesSumInvariant() {
|
||||
},
|
||||
},
|
||||
proposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr1.String(),
|
||||
Proposers: []string{addr1.String()},
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "4", NoCount: "3", AbstainCount: "0", VetoCount: "0"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "4", NoCount: "3", AbstainCount: "0", NoWithVetoCount: "0"},
|
||||
Timeout: curCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
votes: []*group.Vote{
|
||||
{
|
||||
ProposalId: 1,
|
||||
Voter: addr1.String(),
|
||||
Choice: group.Choice_CHOICE_YES,
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
ProposalId: 1,
|
||||
Voter: addr1.String(),
|
||||
Option: group.VOTE_OPTION_YES,
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
},
|
||||
{
|
||||
ProposalId: 1,
|
||||
Voter: addr2.String(),
|
||||
Choice: group.Choice_CHOICE_NO,
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
ProposalId: 1,
|
||||
Voter: addr2.String(),
|
||||
Option: group.VOTE_OPTION_NO,
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
},
|
||||
},
|
||||
expBroken: false,
|
||||
},
|
||||
"proposal tally must correspond to the sum of vote weights": {
|
||||
groupsInfo: &group.GroupInfo{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: adminAddr.String(),
|
||||
Version: 1,
|
||||
TotalWeight: "5",
|
||||
@ -462,37 +462,37 @@ func (s *invariantTestSuite) TestTallyVotesSumInvariant() {
|
||||
},
|
||||
},
|
||||
proposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr1.String(),
|
||||
Proposers: []string{addr1.String()},
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "6", NoCount: "0", AbstainCount: "0", VetoCount: "0"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "6", NoCount: "0", AbstainCount: "0", NoWithVetoCount: "0"},
|
||||
Timeout: curCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
votes: []*group.Vote{
|
||||
{
|
||||
ProposalId: 1,
|
||||
Voter: addr1.String(),
|
||||
Choice: group.Choice_CHOICE_YES,
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
ProposalId: 1,
|
||||
Voter: addr1.String(),
|
||||
Option: group.VOTE_OPTION_YES,
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
},
|
||||
{
|
||||
ProposalId: 1,
|
||||
Voter: addr2.String(),
|
||||
Choice: group.Choice_CHOICE_YES,
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
ProposalId: 1,
|
||||
Voter: addr2.String(),
|
||||
Option: group.VOTE_OPTION_YES,
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
},
|
||||
},
|
||||
expBroken: true,
|
||||
},
|
||||
"proposal VoteState must correspond to the vote choice": {
|
||||
"proposal FinalTallyResult must correspond to the vote option": {
|
||||
groupsInfo: &group.GroupInfo{
|
||||
GroupId: 1,
|
||||
Id: 1,
|
||||
Admin: adminAddr.String(),
|
||||
Version: 1,
|
||||
TotalWeight: "7",
|
||||
@ -520,30 +520,30 @@ func (s *invariantTestSuite) TestTallyVotesSumInvariant() {
|
||||
},
|
||||
},
|
||||
proposal: &group.Proposal{
|
||||
ProposalId: 1,
|
||||
Id: 1,
|
||||
Address: addr1.String(),
|
||||
Proposers: []string{addr1.String()},
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
GroupVersion: 1,
|
||||
GroupPolicyVersion: 1,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
VoteState: group.Tally{YesCount: "4", NoCount: "3", AbstainCount: "0", VetoCount: "0"},
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
FinalTallyResult: group.TallyResult{YesCount: "4", NoCount: "3", AbstainCount: "0", NoWithVetoCount: "0"},
|
||||
Timeout: curCtx.BlockTime().Add(time.Second * 600),
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
},
|
||||
votes: []*group.Vote{
|
||||
{
|
||||
ProposalId: 1,
|
||||
Voter: addr1.String(),
|
||||
Choice: group.Choice_CHOICE_YES,
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
ProposalId: 1,
|
||||
Voter: addr1.String(),
|
||||
Option: group.VOTE_OPTION_YES,
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
},
|
||||
{
|
||||
ProposalId: 1,
|
||||
Voter: addr2.String(),
|
||||
Choice: group.Choice_CHOICE_ABSTAIN,
|
||||
SubmittedAt: curCtx.BlockTime(),
|
||||
ProposalId: 1,
|
||||
Voter: addr2.String(),
|
||||
Option: group.VOTE_OPTION_ABSTAIN,
|
||||
SubmitTime: curCtx.BlockTime(),
|
||||
},
|
||||
},
|
||||
expBroken: true,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -60,7 +60,7 @@ func (k Keeper) CreateGroup(goCtx context.Context, req *group.MsgCreateGroup) (*
|
||||
|
||||
// Create a new group in the groupTable.
|
||||
groupInfo := &group.GroupInfo{
|
||||
GroupId: k.groupTable.Sequence().PeekNextVal(ctx.KVStore(k.key)),
|
||||
Id: k.groupTable.Sequence().PeekNextVal(ctx.KVStore(k.key)),
|
||||
Admin: admin,
|
||||
Metadata: metadata,
|
||||
Version: 1,
|
||||
@ -185,7 +185,7 @@ func (k Keeper) UpdateGroupMembers(goCtx context.Context, req *group.MsgUpdateGr
|
||||
// Update group in the groupTable.
|
||||
g.TotalWeight = totalWeight.String()
|
||||
g.Version++
|
||||
return k.groupTable.Update(ctx.KVStore(k.key), g.GroupId, g)
|
||||
return k.groupTable.Update(ctx.KVStore(k.key), g.Id, g)
|
||||
}
|
||||
|
||||
err := k.doUpdateGroup(ctx, req, action, "members updated")
|
||||
@ -202,7 +202,7 @@ func (k Keeper) UpdateGroupAdmin(goCtx context.Context, req *group.MsgUpdateGrou
|
||||
g.Admin = req.NewAdmin
|
||||
g.Version++
|
||||
|
||||
return k.groupTable.Update(ctx.KVStore(k.key), g.GroupId, g)
|
||||
return k.groupTable.Update(ctx.KVStore(k.key), g.Id, g)
|
||||
}
|
||||
|
||||
err := k.doUpdateGroup(ctx, req, action, "admin updated")
|
||||
@ -218,7 +218,7 @@ func (k Keeper) UpdateGroupMetadata(goCtx context.Context, req *group.MsgUpdateG
|
||||
action := func(g *group.GroupInfo) error {
|
||||
g.Metadata = req.Metadata
|
||||
g.Version++
|
||||
return k.groupTable.Update(ctx.KVStore(k.key), g.GroupId, g)
|
||||
return k.groupTable.Update(ctx.KVStore(k.key), g.Id, g)
|
||||
}
|
||||
|
||||
if err := k.assertMetadataLength(req.Metadata, "group metadata"); err != nil {
|
||||
@ -371,7 +371,7 @@ func (k Keeper) UpdateGroupPolicyMetadata(goCtx context.Context, req *group.MsgU
|
||||
return &group.MsgUpdateGroupPolicyMetadataResponse{}, nil
|
||||
}
|
||||
|
||||
func (k Keeper) CreateProposal(goCtx context.Context, req *group.MsgCreateProposal) (*group.MsgCreateProposalResponse, error) {
|
||||
func (k Keeper) SubmitProposal(goCtx context.Context, req *group.MsgSubmitProposal) (*group.MsgSubmitProposalResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
accountAddress, err := sdk.AccAddressFromBech32(req.Address)
|
||||
if err != nil {
|
||||
@ -397,7 +397,7 @@ func (k Keeper) CreateProposal(goCtx context.Context, req *group.MsgCreatePropos
|
||||
|
||||
// Only members of the group can submit a new proposal.
|
||||
for i := range proposers {
|
||||
if !k.groupMemberTable.Has(ctx.KVStore(k.key), orm.PrimaryKey(&group.GroupMember{GroupId: g.GroupId, Member: &group.Member{Address: proposers[i]}})) {
|
||||
if !k.groupMemberTable.Has(ctx.KVStore(k.key), orm.PrimaryKey(&group.GroupMember{GroupId: g.Id, Member: &group.Member{Address: proposers[i]}})) {
|
||||
return nil, sdkerrors.Wrapf(errors.ErrUnauthorized, "not in group: %s", proposers[i])
|
||||
}
|
||||
}
|
||||
@ -424,22 +424,22 @@ func (k Keeper) CreateProposal(goCtx context.Context, req *group.MsgCreatePropos
|
||||
window := timeout
|
||||
|
||||
m := &group.Proposal{
|
||||
ProposalId: k.proposalTable.Sequence().PeekNextVal(ctx.KVStore(k.key)),
|
||||
Id: k.proposalTable.Sequence().PeekNextVal(ctx.KVStore(k.key)),
|
||||
Address: req.Address,
|
||||
Metadata: metadata,
|
||||
Proposers: proposers,
|
||||
SubmittedAt: ctx.BlockTime(),
|
||||
SubmitTime: ctx.BlockTime(),
|
||||
GroupVersion: g.Version,
|
||||
GroupPolicyVersion: policyAcc.Version,
|
||||
Result: group.ProposalResultUnfinalized,
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
Result: group.PROPOSAL_RESULT_UNFINALIZED,
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
Timeout: ctx.BlockTime().Add(window),
|
||||
VoteState: group.Tally{
|
||||
YesCount: "0",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
FinalTallyResult: group.TallyResult{
|
||||
YesCount: "0",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
}
|
||||
if err := m.SetMsgs(msgs); err != nil {
|
||||
@ -451,7 +451,7 @@ func (k Keeper) CreateProposal(goCtx context.Context, req *group.MsgCreatePropos
|
||||
return nil, sdkerrors.Wrap(err, "create proposal")
|
||||
}
|
||||
|
||||
err = ctx.EventManager().EmitTypedEvent(&group.EventCreateProposal{ProposalId: id})
|
||||
err = ctx.EventManager().EmitTypedEvent(&group.EventSubmitProposal{ProposalId: id})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -464,10 +464,10 @@ func (k Keeper) CreateProposal(goCtx context.Context, req *group.MsgCreatePropos
|
||||
_, err = k.Vote(sdk.WrapSDKContext(ctx), &group.MsgVote{
|
||||
ProposalId: id,
|
||||
Voter: proposers[i],
|
||||
Choice: group.Choice_CHOICE_YES,
|
||||
Option: group.VOTE_OPTION_YES,
|
||||
})
|
||||
if err != nil {
|
||||
return &group.MsgCreateProposalResponse{ProposalId: id}, sdkerrors.Wrap(err, "The proposal was created but failed on vote")
|
||||
return &group.MsgSubmitProposalResponse{ProposalId: id}, sdkerrors.Wrap(err, "The proposal was created but failed on vote")
|
||||
}
|
||||
}
|
||||
// Then try to execute the proposal
|
||||
@ -478,11 +478,11 @@ func (k Keeper) CreateProposal(goCtx context.Context, req *group.MsgCreatePropos
|
||||
Signer: proposers[0],
|
||||
})
|
||||
if err != nil {
|
||||
return &group.MsgCreateProposalResponse{ProposalId: id}, sdkerrors.Wrap(err, "The proposal was created but failed on exec")
|
||||
return &group.MsgSubmitProposalResponse{ProposalId: id}, sdkerrors.Wrap(err, "The proposal was created but failed on exec")
|
||||
}
|
||||
}
|
||||
|
||||
return &group.MsgCreateProposalResponse{ProposalId: id}, nil
|
||||
return &group.MsgSubmitProposalResponse{ProposalId: id}, nil
|
||||
}
|
||||
|
||||
func (k Keeper) WithdrawProposal(goCtx context.Context, req *group.MsgWithdrawProposal) (*group.MsgWithdrawProposalResponse, error) {
|
||||
@ -496,7 +496,7 @@ func (k Keeper) WithdrawProposal(goCtx context.Context, req *group.MsgWithdrawPr
|
||||
}
|
||||
|
||||
// Ensure the proposal can be withdrawn.
|
||||
if proposal.Status != group.ProposalStatusSubmitted {
|
||||
if proposal.Status != group.PROPOSAL_STATUS_SUBMITTED {
|
||||
return nil, sdkerrors.Wrapf(errors.ErrInvalid, "cannot withdraw a proposal with the status of %s", proposal.Status.String())
|
||||
}
|
||||
|
||||
@ -519,8 +519,8 @@ func (k Keeper) WithdrawProposal(goCtx context.Context, req *group.MsgWithdrawPr
|
||||
return nil, err
|
||||
}
|
||||
|
||||
proposal.Result = group.ProposalResultUnfinalized
|
||||
proposal.Status = group.ProposalStatusWithdrawn
|
||||
proposal.Result = group.PROPOSAL_RESULT_UNFINALIZED
|
||||
proposal.Status = group.PROPOSAL_STATUS_WITHDRAWN
|
||||
return storeUpdates()
|
||||
}
|
||||
|
||||
@ -542,15 +542,15 @@ func (k Keeper) WithdrawProposal(goCtx context.Context, req *group.MsgWithdrawPr
|
||||
return nil, err
|
||||
}
|
||||
|
||||
proposal.Result = group.ProposalResultUnfinalized
|
||||
proposal.Status = group.ProposalStatusWithdrawn
|
||||
proposal.Result = group.PROPOSAL_RESULT_UNFINALIZED
|
||||
proposal.Status = group.PROPOSAL_STATUS_WITHDRAWN
|
||||
return storeUpdates()
|
||||
}
|
||||
|
||||
func (k Keeper) Vote(goCtx context.Context, req *group.MsgVote) (*group.MsgVoteResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
id := req.ProposalId
|
||||
choice := req.Choice
|
||||
voteOption := req.Option
|
||||
metadata := req.Metadata
|
||||
|
||||
if err := k.assertMetadataLength(metadata, "metadata"); err != nil {
|
||||
@ -562,7 +562,7 @@ func (k Keeper) Vote(goCtx context.Context, req *group.MsgVote) (*group.MsgVoteR
|
||||
return nil, err
|
||||
}
|
||||
// Ensure that we can still accept votes for this proposal.
|
||||
if proposal.Status != group.ProposalStatusSubmitted {
|
||||
if proposal.Status != group.PROPOSAL_STATUS_SUBMITTED {
|
||||
return nil, sdkerrors.Wrap(errors.ErrInvalid, "proposal not open for voting")
|
||||
}
|
||||
proposalTimeout, err := gogotypes.TimestampProto(proposal.Timeout)
|
||||
@ -598,18 +598,18 @@ func (k Keeper) Vote(goCtx context.Context, req *group.MsgVote) (*group.MsgVoteR
|
||||
|
||||
// Count and store votes.
|
||||
voterAddr := req.Voter
|
||||
voter := group.GroupMember{GroupId: electorate.GroupId, Member: &group.Member{Address: voterAddr}}
|
||||
voter := group.GroupMember{GroupId: electorate.Id, Member: &group.Member{Address: voterAddr}}
|
||||
if err := k.groupMemberTable.GetOne(ctx.KVStore(k.key), orm.PrimaryKey(&voter), &voter); err != nil {
|
||||
return nil, sdkerrors.Wrapf(err, "address: %s", voterAddr)
|
||||
}
|
||||
newVote := group.Vote{
|
||||
ProposalId: id,
|
||||
Voter: voterAddr,
|
||||
Choice: choice,
|
||||
Metadata: metadata,
|
||||
SubmittedAt: ctx.BlockTime(),
|
||||
ProposalId: id,
|
||||
Voter: voterAddr,
|
||||
Option: voteOption,
|
||||
Metadata: metadata,
|
||||
SubmitTime: ctx.BlockTime(),
|
||||
}
|
||||
if err := proposal.VoteState.Add(newVote, voter.Member.Weight); err != nil {
|
||||
if err := proposal.FinalTallyResult.Add(newVote, voter.Member.Weight); err != nil {
|
||||
return nil, sdkerrors.Wrap(err, "add new vote")
|
||||
}
|
||||
|
||||
@ -650,7 +650,7 @@ func (k Keeper) Vote(goCtx context.Context, req *group.MsgVote) (*group.MsgVoteR
|
||||
// doTally updates the proposal status and tally if necessary based on the group policy's decision policy.
|
||||
func doTally(ctx sdk.Context, p *group.Proposal, electorate group.GroupInfo, policyInfo group.GroupPolicyInfo) error {
|
||||
policy := policyInfo.GetDecisionPolicy()
|
||||
pSubmittedAt, err := gogotypes.TimestampProto(p.SubmittedAt)
|
||||
pSubmittedAt, err := gogotypes.TimestampProto(p.SubmitTime)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -658,15 +658,15 @@ func doTally(ctx sdk.Context, p *group.Proposal, electorate group.GroupInfo, pol
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
switch result, err := policy.Allow(p.VoteState, electorate.TotalWeight, ctx.BlockTime().Sub(submittedAt)); {
|
||||
switch result, err := policy.Allow(p.FinalTallyResult, electorate.TotalWeight, ctx.BlockTime().Sub(submittedAt)); {
|
||||
case err != nil:
|
||||
return sdkerrors.Wrap(err, "policy execution")
|
||||
case result.Allow && result.Final:
|
||||
p.Result = group.ProposalResultAccepted
|
||||
p.Status = group.ProposalStatusClosed
|
||||
p.Result = group.PROPOSAL_RESULT_ACCEPTED
|
||||
p.Status = group.PROPOSAL_STATUS_CLOSED
|
||||
case !result.Allow && result.Final:
|
||||
p.Result = group.ProposalResultRejected
|
||||
p.Status = group.ProposalStatusClosed
|
||||
p.Result = group.PROPOSAL_RESULT_REJECTED
|
||||
p.Status = group.PROPOSAL_STATUS_CLOSED
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -681,7 +681,7 @@ func (k Keeper) Exec(goCtx context.Context, req *group.MsgExec) (*group.MsgExecR
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if proposal.Status != group.ProposalStatusSubmitted && proposal.Status != group.ProposalStatusClosed {
|
||||
if proposal.Status != group.PROPOSAL_STATUS_SUBMITTED && proposal.Status != group.PROPOSAL_STATUS_CLOSED {
|
||||
return nil, sdkerrors.Wrapf(errors.ErrInvalid, "not possible with proposal status %s", proposal.Status.String())
|
||||
}
|
||||
|
||||
@ -697,11 +697,11 @@ func (k Keeper) Exec(goCtx context.Context, req *group.MsgExec) (*group.MsgExecR
|
||||
return &group.MsgExecResponse{}, nil
|
||||
}
|
||||
|
||||
if proposal.Status == group.ProposalStatusSubmitted {
|
||||
if proposal.Status == group.PROPOSAL_STATUS_SUBMITTED {
|
||||
// Ensure that group policy hasn't been modified before tally.
|
||||
if proposal.GroupPolicyVersion != policyInfo.Version {
|
||||
proposal.Result = group.ProposalResultUnfinalized
|
||||
proposal.Status = group.ProposalStatusAborted
|
||||
proposal.Result = group.PROPOSAL_RESULT_UNFINALIZED
|
||||
proposal.Status = group.PROPOSAL_STATUS_ABORTED
|
||||
return storeUpdates()
|
||||
}
|
||||
|
||||
@ -712,8 +712,8 @@ func (k Keeper) Exec(goCtx context.Context, req *group.MsgExec) (*group.MsgExecR
|
||||
|
||||
// Ensure that group hasn't been modified before tally.
|
||||
if electorate.Version != proposal.GroupVersion {
|
||||
proposal.Result = group.ProposalResultUnfinalized
|
||||
proposal.Status = group.ProposalStatusAborted
|
||||
proposal.Result = group.PROPOSAL_RESULT_UNFINALIZED
|
||||
proposal.Status = group.PROPOSAL_STATUS_ABORTED
|
||||
return storeUpdates()
|
||||
}
|
||||
if err := doTally(ctx, &proposal, electorate, policyInfo); err != nil {
|
||||
@ -722,7 +722,7 @@ func (k Keeper) Exec(goCtx context.Context, req *group.MsgExec) (*group.MsgExecR
|
||||
}
|
||||
|
||||
// Execute proposal payload.
|
||||
if proposal.Status == group.ProposalStatusClosed && proposal.Result == group.ProposalResultAccepted && proposal.ExecutorResult != group.ProposalExecutorResultSuccess {
|
||||
if proposal.Status == group.PROPOSAL_STATUS_CLOSED && proposal.Result == group.PROPOSAL_RESULT_ACCEPTED && proposal.ExecutorResult != group.PROPOSAL_EXECUTOR_RESULT_SUCCESS {
|
||||
logger := ctx.Logger().With("module", fmt.Sprintf("x/%s", group.ModuleName))
|
||||
// Caching context so that we don't update the store in case of failure.
|
||||
ctx, flush := ctx.CacheContext()
|
||||
@ -733,11 +733,11 @@ func (k Keeper) Exec(goCtx context.Context, req *group.MsgExec) (*group.MsgExecR
|
||||
}
|
||||
_, err = k.doExecuteMsgs(ctx, k.router, proposal, addr)
|
||||
if err != nil {
|
||||
proposal.ExecutorResult = group.ProposalExecutorResultFailure
|
||||
proposal.ExecutorResult = group.PROPOSAL_EXECUTOR_RESULT_FAILURE
|
||||
proposalType := reflect.TypeOf(proposal).String()
|
||||
logger.Info("proposal execution failed", "cause", err, "type", proposalType, "proposalID", id)
|
||||
} else {
|
||||
proposal.ExecutorResult = group.ProposalExecutorResultSuccess
|
||||
proposal.ExecutorResult = group.PROPOSAL_EXECUTOR_RESULT_SUCCESS
|
||||
flush()
|
||||
}
|
||||
}
|
||||
|
||||
@ -501,11 +501,11 @@ func (m MsgCreateGroupPolicy) UnpackInterfaces(unpacker types.AnyUnpacker) error
|
||||
return unpacker.UnpackAny(m.DecisionPolicy, &decisionPolicy)
|
||||
}
|
||||
|
||||
var _ sdk.Msg = &MsgCreateProposal{}
|
||||
var _ sdk.Msg = &MsgSubmitProposal{}
|
||||
|
||||
// NewMsgCreateProposalRequest creates a new MsgCreateProposal.
|
||||
func NewMsgCreateProposalRequest(address string, proposers []string, msgs []sdk.Msg, metadata []byte, exec Exec) (*MsgCreateProposal, error) {
|
||||
m := &MsgCreateProposal{
|
||||
// NewMsgSubmitProposalRequest creates a new MsgSubmitProposal.
|
||||
func NewMsgSubmitProposalRequest(address string, proposers []string, msgs []sdk.Msg, metadata []byte, exec Exec) (*MsgSubmitProposal, error) {
|
||||
m := &MsgSubmitProposal{
|
||||
Address: address,
|
||||
Proposers: proposers,
|
||||
Metadata: metadata,
|
||||
@ -519,20 +519,20 @@ func NewMsgCreateProposalRequest(address string, proposers []string, msgs []sdk.
|
||||
}
|
||||
|
||||
// Route Implements Msg.
|
||||
func (m MsgCreateProposal) Route() string {
|
||||
func (m MsgSubmitProposal) Route() string {
|
||||
return sdk.MsgTypeURL(&m)
|
||||
}
|
||||
|
||||
// Type Implements Msg.
|
||||
func (m MsgCreateProposal) Type() string { return sdk.MsgTypeURL(&m) }
|
||||
func (m MsgSubmitProposal) Type() string { return sdk.MsgTypeURL(&m) }
|
||||
|
||||
// GetSignBytes Implements Msg.
|
||||
func (m MsgCreateProposal) GetSignBytes() []byte {
|
||||
func (m MsgSubmitProposal) GetSignBytes() []byte {
|
||||
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
|
||||
}
|
||||
|
||||
// GetSigners returns the expected signers for a MsgCreateProposal.
|
||||
func (m MsgCreateProposal) GetSigners() []sdk.AccAddress {
|
||||
// GetSigners returns the expected signers for a MsgSubmitProposal.
|
||||
func (m MsgSubmitProposal) GetSigners() []sdk.AccAddress {
|
||||
addrs := make([]sdk.AccAddress, len(m.Proposers))
|
||||
for i, proposer := range m.Proposers {
|
||||
addr, err := sdk.AccAddressFromBech32(proposer)
|
||||
@ -545,7 +545,7 @@ func (m MsgCreateProposal) GetSigners() []sdk.AccAddress {
|
||||
}
|
||||
|
||||
// ValidateBasic does a sanity check on the provided data
|
||||
func (m MsgCreateProposal) ValidateBasic() error {
|
||||
func (m MsgSubmitProposal) ValidateBasic() error {
|
||||
_, err := sdk.AccAddressFromBech32(m.Address)
|
||||
if err != nil {
|
||||
return sdkerrors.Wrap(err, "group policy")
|
||||
@ -576,18 +576,18 @@ func (m MsgCreateProposal) ValidateBasic() error {
|
||||
}
|
||||
|
||||
// SetMsgs packs msgs into Any's
|
||||
func (m *MsgCreateProposal) SetMsgs(msgs []sdk.Msg) error {
|
||||
func (m *MsgSubmitProposal) SetMsgs(msgs []sdk.Msg) error {
|
||||
anys, err := tx.SetMsgs(msgs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
m.Msgs = anys
|
||||
m.Messages = anys
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetMsgs unpacks m.Msgs Any's into sdk.Msg's
|
||||
func (m MsgCreateProposal) GetMsgs() []sdk.Msg {
|
||||
msgs, err := tx.GetMsgs(m.Msgs, "proposal")
|
||||
// GetMsgs unpacks m.Messages Any's into sdk.Msg's
|
||||
func (m MsgSubmitProposal) GetMsgs() []sdk.Msg {
|
||||
msgs, err := tx.GetMsgs(m.Messages, "proposal")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -595,8 +595,8 @@ func (m MsgCreateProposal) GetMsgs() []sdk.Msg {
|
||||
}
|
||||
|
||||
// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces
|
||||
func (m MsgCreateProposal) UnpackInterfaces(unpacker types.AnyUnpacker) error {
|
||||
return tx.UnpackInterfaces(unpacker, m.Msgs)
|
||||
func (m MsgSubmitProposal) UnpackInterfaces(unpacker types.AnyUnpacker) error {
|
||||
return tx.UnpackInterfaces(unpacker, m.Messages)
|
||||
}
|
||||
|
||||
var _ sdk.Msg = &MsgWithdrawProposal{}
|
||||
@ -668,11 +668,11 @@ func (m MsgVote) ValidateBasic() error {
|
||||
if m.ProposalId == 0 {
|
||||
return sdkerrors.Wrap(errors.ErrEmpty, "proposal id")
|
||||
}
|
||||
if m.Choice == Choice_CHOICE_UNSPECIFIED {
|
||||
return sdkerrors.Wrap(errors.ErrEmpty, "choice")
|
||||
if m.Option == VOTE_OPTION_UNSPECIFIED {
|
||||
return sdkerrors.Wrap(errors.ErrEmpty, "vote option")
|
||||
}
|
||||
if _, ok := Choice_name[int32(m.Choice)]; !ok {
|
||||
return sdkerrors.Wrap(errors.ErrInvalid, "choice")
|
||||
if _, ok := VoteOption_name[int32(m.Option)]; !ok {
|
||||
return sdkerrors.Wrap(errors.ErrInvalid, "vote option")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -690,16 +690,16 @@ func TestMsgUpdateGroupPolicyMetadata(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestMsgCreateProposal(t *testing.T) {
|
||||
func TestMsgSubmitProposal(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
msg *group.MsgCreateProposal
|
||||
msg *group.MsgSubmitProposal
|
||||
expErr bool
|
||||
errMsg string
|
||||
}{
|
||||
{
|
||||
"invalid group policy address",
|
||||
&group.MsgCreateProposal{
|
||||
&group.MsgSubmitProposal{
|
||||
Address: "address",
|
||||
},
|
||||
true,
|
||||
@ -707,7 +707,7 @@ func TestMsgCreateProposal(t *testing.T) {
|
||||
},
|
||||
{
|
||||
"proposers required",
|
||||
&group.MsgCreateProposal{
|
||||
&group.MsgSubmitProposal{
|
||||
Address: admin.String(),
|
||||
},
|
||||
true,
|
||||
@ -715,7 +715,7 @@ func TestMsgCreateProposal(t *testing.T) {
|
||||
},
|
||||
{
|
||||
"valid testcase",
|
||||
&group.MsgCreateProposal{
|
||||
&group.MsgSubmitProposal{
|
||||
Address: admin.String(),
|
||||
Proposers: []string{member1.String(), member2.String()},
|
||||
},
|
||||
@ -733,7 +733,7 @@ func TestMsgCreateProposal(t *testing.T) {
|
||||
require.Contains(t, err.Error(), tc.errMsg)
|
||||
} else {
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, msg.Type(), sdk.MsgTypeURL(&group.MsgCreateProposal{}))
|
||||
require.Equal(t, msg.Type(), sdk.MsgTypeURL(&group.MsgSubmitProposal{}))
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -763,20 +763,20 @@ func TestMsgVote(t *testing.T) {
|
||||
"proposal id: value is empty",
|
||||
},
|
||||
{
|
||||
"unspecified vote choice",
|
||||
"unspecified vote option",
|
||||
&group.MsgVote{
|
||||
Voter: member1.String(),
|
||||
ProposalId: 1,
|
||||
},
|
||||
true,
|
||||
"choice: value is empty",
|
||||
"vote option: value is empty",
|
||||
},
|
||||
{
|
||||
"valid test case",
|
||||
&group.MsgVote{
|
||||
Voter: member1.String(),
|
||||
ProposalId: 1,
|
||||
Choice: group.Choice_CHOICE_YES,
|
||||
Option: group.VOTE_OPTION_YES,
|
||||
},
|
||||
false,
|
||||
"",
|
||||
|
||||
@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func (p *Proposal) GetMsgs() []sdk.Msg {
|
||||
msgs, err := tx.GetMsgs(p.Msgs, "proposal")
|
||||
msgs, err := tx.GetMsgs(p.Messages, "proposal")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -19,11 +19,11 @@ func (p *Proposal) SetMsgs(msgs []sdk.Msg) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
p.Msgs = anys
|
||||
p.Messages = anys
|
||||
return nil
|
||||
}
|
||||
|
||||
// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces
|
||||
func (p Proposal) UnpackInterfaces(unpacker types.AnyUnpacker) error {
|
||||
return tx.UnpackInterfaces(unpacker, p.Msgs)
|
||||
return tx.UnpackInterfaces(unpacker, p.Messages)
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ func TestDecodeStore(t *testing.T) {
|
||||
cdc := simapp.MakeTestEncodingConfig().Codec
|
||||
dec := simulation.NewDecodeStore(cdc)
|
||||
|
||||
g := group.GroupInfo{GroupId: 1}
|
||||
g := group.GroupInfo{Id: 1}
|
||||
groupBz, err := cdc.Marshal(&g)
|
||||
require.NoError(t, err)
|
||||
|
||||
@ -35,7 +35,7 @@ func TestDecodeStore(t *testing.T) {
|
||||
accBz, err := cdc.Marshal(&acc)
|
||||
require.NoError(t, err)
|
||||
|
||||
proposal := group.Proposal{ProposalId: 1}
|
||||
proposal := group.Proposal{Id: 1}
|
||||
proposalBz, err := cdc.Marshal(&proposal)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ func getGroups(r *rand.Rand, accounts []simtypes.Account) []*group.GroupInfo {
|
||||
for i := 0; i < 3; i++ {
|
||||
acc, _ := simtypes.RandomAcc(r, accounts)
|
||||
groups[i] = &group.GroupInfo{
|
||||
GroupId: uint64(i + 1),
|
||||
Id: uint64(i + 1),
|
||||
Admin: acc.Address.String(),
|
||||
Metadata: []byte(simtypes.RandStringOfLength(r, 10)),
|
||||
Version: 1,
|
||||
@ -84,22 +84,22 @@ func getProposals(r *rand.Rand, simState *module.SimulationState) []*group.Propo
|
||||
timeout := submittedAt.Add(time.Second * 1000).UTC()
|
||||
|
||||
proposal := &group.Proposal{
|
||||
ProposalId: uint64(i + 1),
|
||||
Id: uint64(i + 1),
|
||||
Proposers: proposers,
|
||||
Address: fromAddr,
|
||||
GroupVersion: uint64(i + 1),
|
||||
GroupPolicyVersion: uint64(i + 1),
|
||||
Status: group.ProposalStatusSubmitted,
|
||||
Result: group.ProposalResultAccepted,
|
||||
VoteState: group.Tally{
|
||||
YesCount: "1",
|
||||
NoCount: "1",
|
||||
AbstainCount: "1",
|
||||
VetoCount: "0",
|
||||
Status: group.PROPOSAL_STATUS_SUBMITTED,
|
||||
Result: group.PROPOSAL_RESULT_ACCEPTED,
|
||||
FinalTallyResult: group.TallyResult{
|
||||
YesCount: "1",
|
||||
NoCount: "1",
|
||||
AbstainCount: "1",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
ExecutorResult: group.ProposalExecutorResultNotRun,
|
||||
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
|
||||
Metadata: []byte(simtypes.RandStringOfLength(r, 50)),
|
||||
SubmittedAt: submittedAt,
|
||||
SubmitTime: submittedAt,
|
||||
Timeout: timeout,
|
||||
}
|
||||
err := proposal.SetMsgs([]sdk.Msg{&banktypes.MsgSend{
|
||||
@ -122,27 +122,27 @@ func getVotes(r *rand.Rand, simState *module.SimulationState) []*group.Vote {
|
||||
|
||||
for i := 0; i < 3; i++ {
|
||||
votes[i] = &group.Vote{
|
||||
ProposalId: uint64(i + 1),
|
||||
Voter: simState.Accounts[i].Address.String(),
|
||||
Choice: getVoteChoice(i),
|
||||
Metadata: []byte(simtypes.RandStringOfLength(r, 50)),
|
||||
SubmittedAt: time.Unix(0, 0),
|
||||
ProposalId: uint64(i + 1),
|
||||
Voter: simState.Accounts[i].Address.String(),
|
||||
Option: getVoteOption(i),
|
||||
Metadata: []byte(simtypes.RandStringOfLength(r, 50)),
|
||||
SubmitTime: time.Unix(0, 0),
|
||||
}
|
||||
}
|
||||
|
||||
return votes
|
||||
}
|
||||
|
||||
func getVoteChoice(index int) group.Choice {
|
||||
func getVoteOption(index int) group.VoteOption {
|
||||
switch index {
|
||||
case 0:
|
||||
return group.Choice_CHOICE_YES
|
||||
return group.VOTE_OPTION_YES
|
||||
case 1:
|
||||
return group.Choice_CHOICE_NO
|
||||
return group.VOTE_OPTION_NO
|
||||
case 2:
|
||||
return group.Choice_CHOICE_ABSTAIN
|
||||
return group.VOTE_OPTION_ABSTAIN
|
||||
default:
|
||||
return group.Choice_CHOICE_VETO
|
||||
return group.VOTE_OPTION_NO_WITH_VETO
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ var (
|
||||
TypeMsgUpdateGroupPolicyAdmin = sdk.MsgTypeURL(&group.MsgUpdateGroupPolicyAdmin{})
|
||||
TypeMsgUpdateGroupPolicyDecisionPolicy = sdk.MsgTypeURL(&group.MsgUpdateGroupPolicyDecisionPolicy{})
|
||||
TypeMsgUpdateGroupPolicyMetadata = sdk.MsgTypeURL(&group.MsgUpdateGroupPolicyMetadata{})
|
||||
TypeMsgCreateProposal = sdk.MsgTypeURL(&group.MsgCreateProposal{})
|
||||
TypeMsgSubmitProposal = sdk.MsgTypeURL(&group.MsgSubmitProposal{})
|
||||
TypeMsgWithdrawProposal = sdk.MsgTypeURL(&group.MsgWithdrawProposal{})
|
||||
TypeMsgVote = sdk.MsgTypeURL(&group.MsgVote{})
|
||||
TypeMsgExec = sdk.MsgTypeURL(&group.MsgExec{})
|
||||
@ -49,7 +49,7 @@ const (
|
||||
OpMsgUpdateGroupPolicyAdmin = "op_weight_msg_update_group_policy_admin"
|
||||
OpMsgUpdateGroupPolicyDecisionPolicy = "op_weight_msg_update_group_policy_decision_policy"
|
||||
OpMsgUpdateGroupPolicyMetaData = "op_weight_msg_update_group_policy_metadata"
|
||||
OpMsgCreateProposal = "op_weight_msg_create_proposal"
|
||||
OpMsgSubmitProposal = "op_weight_msg_submit_proposal"
|
||||
OpMsgWithdrawProposal = "op_weight_msg_withdraw_proposal"
|
||||
OpMsgVote = "op_weight_msg_vote"
|
||||
OpMsgExec = "op_weight_msg_exec"
|
||||
@ -60,7 +60,7 @@ const (
|
||||
const (
|
||||
WeightMsgCreateGroup = 100
|
||||
WeightMsgCreateGroupPolicy = 100
|
||||
WeightMsgCreateProposal = 90
|
||||
WeightMsgSubmitProposal = 90
|
||||
WeightMsgVote = 90
|
||||
WeightMsgExec = 90
|
||||
WeightMsgUpdateGroupMetadata = 5
|
||||
@ -87,7 +87,7 @@ func WeightedOperations(
|
||||
weightMsgUpdateGroupPolicyAdmin int
|
||||
weightMsgUpdateGroupPolicyDecisionPolicy int
|
||||
weightMsgUpdateGroupPolicyMetadata int
|
||||
weightMsgCreateProposal int
|
||||
weightMsgSubmitProposal int
|
||||
weightMsgVote int
|
||||
weightMsgExec int
|
||||
weightMsgWithdrawProposal int
|
||||
@ -103,9 +103,9 @@ func WeightedOperations(
|
||||
weightMsgCreateGroupPolicy = WeightMsgCreateGroupPolicy
|
||||
},
|
||||
)
|
||||
appParams.GetOrGenerate(cdc, OpMsgCreateProposal, &weightMsgCreateProposal, nil,
|
||||
appParams.GetOrGenerate(cdc, OpMsgSubmitProposal, &weightMsgSubmitProposal, nil,
|
||||
func(_ *rand.Rand) {
|
||||
weightMsgCreateProposal = WeightMsgCreateProposal
|
||||
weightMsgSubmitProposal = WeightMsgSubmitProposal
|
||||
},
|
||||
)
|
||||
appParams.GetOrGenerate(cdc, OpMsgVote, &weightMsgVote, nil,
|
||||
@ -158,8 +158,8 @@ func WeightedOperations(
|
||||
var createProposalOps simulation.WeightedOperations
|
||||
for i := 0; i < 2; i++ {
|
||||
createProposalOps = append(createProposalOps, simulation.NewWeightedOperation(
|
||||
weightMsgCreateProposal,
|
||||
SimulateMsgCreateProposal(ak, bk, k),
|
||||
weightMsgSubmitProposal,
|
||||
SimulateMsgSubmitProposal(ak, bk, k),
|
||||
))
|
||||
}
|
||||
|
||||
@ -275,7 +275,7 @@ func SimulateMsgCreateGroupPolicy(ak group.AccountKeeper, bk group.BankKeeper, k
|
||||
if groupInfo == nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateGroupPolicy, ""), nil, nil
|
||||
}
|
||||
groupID := groupInfo.GroupId
|
||||
groupID := groupInfo.Id
|
||||
|
||||
spendableCoins := bk.SpendableCoins(sdkCtx, account.GetAddress())
|
||||
fees, err := simtypes.RandomFees(r, sdkCtx, spendableCoins)
|
||||
@ -321,47 +321,47 @@ func SimulateMsgCreateGroupPolicy(ak group.AccountKeeper, bk group.BankKeeper, k
|
||||
}
|
||||
}
|
||||
|
||||
// SimulateMsgCreateProposal generates a NewMsgCreateProposal with random values
|
||||
func SimulateMsgCreateProposal(ak group.AccountKeeper, bk group.BankKeeper, k keeper.Keeper) simtypes.Operation {
|
||||
// SimulateMsgSubmitProposal generates a NewMsgSubmitProposal with random values
|
||||
func SimulateMsgSubmitProposal(ak group.AccountKeeper, bk group.BankKeeper, k keeper.Keeper) simtypes.Operation {
|
||||
return func(
|
||||
r *rand.Rand, app *baseapp.BaseApp, sdkCtx sdk.Context, accounts []simtypes.Account, chainID string) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
|
||||
g, groupPolicy, _, _, err := randomGroupPolicy(r, k, ak, sdkCtx, accounts)
|
||||
if err != nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateProposal, ""), nil, err
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgSubmitProposal, ""), nil, err
|
||||
}
|
||||
if g == nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateProposal, "no group found"), nil, nil
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgSubmitProposal, "no group found"), nil, nil
|
||||
}
|
||||
if groupPolicy == nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateProposal, "no group policy found"), nil, nil
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgSubmitProposal, "no group policy found"), nil, nil
|
||||
}
|
||||
groupID := g.GroupId
|
||||
groupID := g.Id
|
||||
groupPolicyAddr := groupPolicy.Address
|
||||
|
||||
// Return a no-op if we know the proposal cannot be created
|
||||
policy := groupPolicy.GetDecisionPolicy()
|
||||
err = policy.Validate(*g)
|
||||
if err != nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateProposal, ""), nil, nil
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgSubmitProposal, ""), nil, nil
|
||||
}
|
||||
|
||||
// Pick a random member from the group
|
||||
ctx := sdk.WrapSDKContext(sdkCtx)
|
||||
acc, account, err := randomMember(r, k, ak, ctx, accounts, groupID)
|
||||
if err != nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateProposal, ""), nil, err
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgSubmitProposal, ""), nil, err
|
||||
}
|
||||
if account == nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateProposal, "no group member found"), nil, nil
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgSubmitProposal, "no group member found"), nil, nil
|
||||
}
|
||||
|
||||
spendableCoins := bk.SpendableCoins(sdkCtx, account.GetAddress())
|
||||
fees, err := simtypes.RandomFees(r, sdkCtx, spendableCoins)
|
||||
if err != nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateProposal, "fee error"), nil, err
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgSubmitProposal, "fee error"), nil, err
|
||||
}
|
||||
|
||||
msg := group.MsgCreateProposal{
|
||||
msg := group.MsgSubmitProposal{
|
||||
Address: groupPolicyAddr,
|
||||
Proposers: []string{acc.Address.String()},
|
||||
Metadata: []byte(simtypes.RandStringOfLength(r, 10)),
|
||||
@ -379,7 +379,7 @@ func SimulateMsgCreateProposal(ak group.AccountKeeper, bk group.BankKeeper, k ke
|
||||
acc.PrivKey,
|
||||
)
|
||||
if err != nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateProposal, "unable to generate mock tx"), nil, err
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgSubmitProposal, "unable to generate mock tx"), nil, err
|
||||
}
|
||||
|
||||
_, _, err = app.SimDeliver(txGen.TxEncoder(), tx)
|
||||
@ -402,7 +402,7 @@ func SimulateMsgUpdateGroupAdmin(ak group.AccountKeeper, bk group.BankKeeper, k
|
||||
if groupInfo == nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupAdmin, ""), nil, nil
|
||||
}
|
||||
groupID := groupInfo.GroupId
|
||||
groupID := groupInfo.Id
|
||||
|
||||
spendableCoins := bk.SpendableCoins(sdkCtx, account.GetAddress())
|
||||
fees, err := simtypes.RandomFees(r, sdkCtx, spendableCoins)
|
||||
@ -460,7 +460,7 @@ func SimulateMsgUpdateGroupMetadata(ak group.AccountKeeper, bk group.BankKeeper,
|
||||
if groupInfo == nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupMetadata, ""), nil, nil
|
||||
}
|
||||
groupID := groupInfo.GroupId
|
||||
groupID := groupInfo.Id
|
||||
|
||||
spendableCoins := bk.SpendableCoins(sdkCtx, account.GetAddress())
|
||||
fees, err := simtypes.RandomFees(r, sdkCtx, spendableCoins)
|
||||
@ -510,7 +510,7 @@ func SimulateMsgUpdateGroupMembers(ak group.AccountKeeper,
|
||||
if groupInfo == nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupMembers, ""), nil, nil
|
||||
}
|
||||
groupID := groupInfo.GroupId
|
||||
groupID := groupInfo.Id
|
||||
|
||||
spendableCoins := bk.SpendableCoins(sdkCtx, account.GetAddress())
|
||||
fees, err := simtypes.RandomFees(r, sdkCtx, spendableCoins)
|
||||
@ -761,10 +761,10 @@ func SimulateMsgWithdrawProposal(ak group.AccountKeeper,
|
||||
proposalID := -1
|
||||
|
||||
for _, p := range proposals {
|
||||
if p.Status == group.ProposalStatusSubmitted {
|
||||
if p.Status == group.PROPOSAL_STATUS_SUBMITTED {
|
||||
timeout := p.Timeout
|
||||
proposal = p
|
||||
proposalID = int(p.ProposalId)
|
||||
proposalID = int(p.Id)
|
||||
if timeout.Before(sdkCtx.BlockTime()) || timeout.Equal(sdkCtx.BlockTime()) {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgWithdrawProposal, "voting period ended: skipping"), nil, nil
|
||||
}
|
||||
@ -853,7 +853,7 @@ func SimulateMsgVote(ak group.AccountKeeper,
|
||||
|
||||
// Pick a random member from the group
|
||||
ctx := sdk.WrapSDKContext(sdkCtx)
|
||||
acc, account, err := randomMember(r, k, ak, ctx, accounts, g.GroupId)
|
||||
acc, account, err := randomMember(r, k, ak, ctx, accounts, g.Id)
|
||||
if err != nil {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgVote, ""), nil, err
|
||||
}
|
||||
@ -880,10 +880,10 @@ func SimulateMsgVote(ak group.AccountKeeper,
|
||||
proposalID := -1
|
||||
|
||||
for _, p := range proposals {
|
||||
if p.Status == group.ProposalStatusSubmitted {
|
||||
if p.Status == group.PROPOSAL_STATUS_SUBMITTED {
|
||||
timeout := p.Timeout
|
||||
proposal = p
|
||||
proposalID = int(p.ProposalId)
|
||||
proposalID = int(p.Id)
|
||||
if timeout.Before(sdkCtx.BlockTime()) || timeout.Equal(sdkCtx.BlockTime()) {
|
||||
return simtypes.NoOpMsg(group.ModuleName, TypeMsgVote, "voting period ended: skipping"), nil, nil
|
||||
}
|
||||
@ -916,7 +916,7 @@ func SimulateMsgVote(ak group.AccountKeeper,
|
||||
msg := group.MsgVote{
|
||||
ProposalId: uint64(proposalID),
|
||||
Voter: acc.Address.String(),
|
||||
Choice: group.Choice_CHOICE_YES,
|
||||
Option: group.VOTE_OPTION_YES,
|
||||
Metadata: []byte(simtypes.RandStringOfLength(r, 10)),
|
||||
}
|
||||
txGen := simappparams.MakeTestEncodingConfig().TxConfig
|
||||
@ -980,8 +980,8 @@ func SimulateMsgExec(ak group.AccountKeeper,
|
||||
proposalID := -1
|
||||
|
||||
for _, proposal := range proposals {
|
||||
if proposal.Status == group.ProposalStatusClosed {
|
||||
proposalID = int(proposal.ProposalId)
|
||||
if proposal.Status == group.PROPOSAL_STATUS_CLOSED {
|
||||
proposalID = int(proposal.Id)
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -1068,7 +1068,7 @@ func randomGroupPolicy(r *rand.Rand, k keeper.Keeper, ak group.AccountKeeper,
|
||||
if groupInfo == nil {
|
||||
return nil, nil, simtypes.Account{}, nil, nil
|
||||
}
|
||||
groupID := groupInfo.GroupId
|
||||
groupID := groupInfo.Id
|
||||
|
||||
result, err := k.GroupPoliciesByGroup(sdk.WrapSDKContext(ctx), &group.QueryGroupPoliciesByGroupRequest{GroupId: groupID})
|
||||
if err != nil {
|
||||
|
||||
@ -51,8 +51,8 @@ func (suite *SimTestSuite) TestWeightedOperations() {
|
||||
}{
|
||||
{simulation.WeightMsgCreateGroup, group.MsgCreateGroup{}.Route(), simulation.TypeMsgCreateGroup},
|
||||
{simulation.WeightMsgCreateGroupPolicy, group.MsgCreateGroupPolicy{}.Route(), simulation.TypeMsgCreateGroupPolicy},
|
||||
{simulation.WeightMsgCreateProposal, group.MsgCreateProposal{}.Route(), simulation.TypeMsgCreateProposal},
|
||||
{simulation.WeightMsgCreateProposal, group.MsgCreateProposal{}.Route(), simulation.TypeMsgCreateProposal},
|
||||
{simulation.WeightMsgSubmitProposal, group.MsgSubmitProposal{}.Route(), simulation.TypeMsgSubmitProposal},
|
||||
{simulation.WeightMsgSubmitProposal, group.MsgSubmitProposal{}.Route(), simulation.TypeMsgSubmitProposal},
|
||||
{simulation.WeightMsgWithdrawProposal, group.MsgWithdrawProposal{}.Route(), simulation.TypeMsgWithdrawProposal},
|
||||
{simulation.WeightMsgVote, group.MsgVote{}.Route(), simulation.TypeMsgVote},
|
||||
{simulation.WeightMsgExec, group.MsgExec{}.Route(), simulation.TypeMsgExec},
|
||||
@ -162,7 +162,7 @@ func (suite *SimTestSuite) TestSimulateCreateGroupPolicy() {
|
||||
suite.Require().Len(futureOperations, 0)
|
||||
}
|
||||
|
||||
func (suite *SimTestSuite) TestSimulateCreateProposal() {
|
||||
func (suite *SimTestSuite) TestSimulateSubmitProposal() {
|
||||
// setup 1 account
|
||||
s := rand.NewSource(1)
|
||||
r := rand.New(s)
|
||||
@ -204,11 +204,11 @@ func (suite *SimTestSuite) TestSimulateCreateProposal() {
|
||||
})
|
||||
|
||||
// execute operation
|
||||
op := simulation.SimulateMsgCreateProposal(suite.app.AccountKeeper, suite.app.BankKeeper, suite.app.GroupKeeper)
|
||||
op := simulation.SimulateMsgSubmitProposal(suite.app.AccountKeeper, suite.app.BankKeeper, suite.app.GroupKeeper)
|
||||
operationMsg, futureOperations, err := op(r, suite.app.BaseApp, suite.ctx, accounts, "")
|
||||
suite.Require().NoError(err)
|
||||
|
||||
var msg group.MsgCreateProposal
|
||||
var msg group.MsgSubmitProposal
|
||||
err = group.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg)
|
||||
suite.Require().NoError(err)
|
||||
suite.Require().True(operationMsg.OK)
|
||||
@ -251,7 +251,7 @@ func (suite *SimTestSuite) TestWithdrawProposal() {
|
||||
suite.Require().NoError(err)
|
||||
|
||||
// setup a proposal
|
||||
proposalReq, err := group.NewMsgCreateProposalRequest(groupPolicyRes.Address, []string{addr}, []sdk.Msg{
|
||||
proposalReq, err := group.NewMsgSubmitProposalRequest(groupPolicyRes.Address, []string{addr}, []sdk.Msg{
|
||||
&banktypes.MsgSend{
|
||||
FromAddress: groupPolicyRes.Address,
|
||||
ToAddress: addr,
|
||||
@ -259,7 +259,7 @@ func (suite *SimTestSuite) TestWithdrawProposal() {
|
||||
},
|
||||
}, []byte{}, 0)
|
||||
suite.Require().NoError(err)
|
||||
_, err = suite.app.GroupKeeper.CreateProposal(ctx, proposalReq)
|
||||
_, err = suite.app.GroupKeeper.SubmitProposal(ctx, proposalReq)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
// begin a new block
|
||||
@ -318,7 +318,7 @@ func (suite *SimTestSuite) TestSimulateVote() {
|
||||
suite.Require().NoError(err)
|
||||
|
||||
// setup a proposal
|
||||
proposalReq, err := group.NewMsgCreateProposalRequest(groupPolicyRes.Address, []string{addr}, []sdk.Msg{
|
||||
proposalReq, err := group.NewMsgSubmitProposalRequest(groupPolicyRes.Address, []string{addr}, []sdk.Msg{
|
||||
&banktypes.MsgSend{
|
||||
FromAddress: groupPolicyRes.Address,
|
||||
ToAddress: addr,
|
||||
@ -326,7 +326,7 @@ func (suite *SimTestSuite) TestSimulateVote() {
|
||||
},
|
||||
}, []byte{}, 0)
|
||||
suite.Require().NoError(err)
|
||||
_, err = suite.app.GroupKeeper.CreateProposal(ctx, proposalReq)
|
||||
_, err = suite.app.GroupKeeper.SubmitProposal(ctx, proposalReq)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
// begin a new block
|
||||
@ -385,7 +385,7 @@ func (suite *SimTestSuite) TestSimulateExec() {
|
||||
suite.Require().NoError(err)
|
||||
|
||||
// setup a proposal
|
||||
proposalReq, err := group.NewMsgCreateProposalRequest(groupPolicyRes.Address, []string{addr}, []sdk.Msg{
|
||||
proposalReq, err := group.NewMsgSubmitProposalRequest(groupPolicyRes.Address, []string{addr}, []sdk.Msg{
|
||||
&banktypes.MsgSend{
|
||||
FromAddress: groupPolicyRes.Address,
|
||||
ToAddress: addr,
|
||||
@ -393,14 +393,14 @@ func (suite *SimTestSuite) TestSimulateExec() {
|
||||
},
|
||||
}, []byte{}, 0)
|
||||
suite.Require().NoError(err)
|
||||
proposalRes, err := suite.app.GroupKeeper.CreateProposal(ctx, proposalReq)
|
||||
proposalRes, err := suite.app.GroupKeeper.SubmitProposal(ctx, proposalReq)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
// vote
|
||||
_, err = suite.app.GroupKeeper.Vote(ctx, &group.MsgVote{
|
||||
ProposalId: proposalRes.ProposalId,
|
||||
Voter: addr,
|
||||
Choice: group.Choice_CHOICE_YES,
|
||||
Option: group.VOTE_OPTION_YES,
|
||||
})
|
||||
suite.Require().NoError(err)
|
||||
|
||||
|
||||
309
x/group/tx.pb.go
309
x/group/tx.pb.go
@ -854,8 +854,8 @@ func (m *MsgUpdateGroupPolicyMetadataResponse) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_MsgUpdateGroupPolicyMetadataResponse proto.InternalMessageInfo
|
||||
|
||||
// MsgCreateProposal is the Msg/CreateProposal request type.
|
||||
type MsgCreateProposal struct {
|
||||
// MsgSubmitProposal is the Msg/SubmitProposal request type.
|
||||
type MsgSubmitProposal struct {
|
||||
// address is the account address of group policy.
|
||||
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
|
||||
// proposers are the account addresses of the proposers.
|
||||
@ -863,26 +863,26 @@ type MsgCreateProposal struct {
|
||||
Proposers []string `protobuf:"bytes,2,rep,name=proposers,proto3" json:"proposers,omitempty"`
|
||||
// metadata is any arbitrary metadata to attached to the proposal.
|
||||
Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
||||
// msgs is a list of Msgs that will be executed if the proposal passes.
|
||||
Msgs []*types.Any `protobuf:"bytes,4,rep,name=msgs,proto3" json:"msgs,omitempty"`
|
||||
// messages is a list of `sdk.Msg`s that will be executed if the proposal passes.
|
||||
Messages []*types.Any `protobuf:"bytes,4,rep,name=messages,proto3" json:"messages,omitempty"`
|
||||
// exec defines the mode of execution of the proposal,
|
||||
// whether it should be executed immediately on creation or not.
|
||||
// If so, proposers signatures are considered as Yes votes.
|
||||
Exec Exec `protobuf:"varint,5,opt,name=exec,proto3,enum=cosmos.group.v1beta1.Exec" json:"exec,omitempty"`
|
||||
}
|
||||
|
||||
func (m *MsgCreateProposal) Reset() { *m = MsgCreateProposal{} }
|
||||
func (m *MsgCreateProposal) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgCreateProposal) ProtoMessage() {}
|
||||
func (*MsgCreateProposal) Descriptor() ([]byte, []int) {
|
||||
func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} }
|
||||
func (m *MsgSubmitProposal) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgSubmitProposal) ProtoMessage() {}
|
||||
func (*MsgSubmitProposal) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_da0de9d603d844fb, []int{16}
|
||||
}
|
||||
func (m *MsgCreateProposal) XXX_Unmarshal(b []byte) error {
|
||||
func (m *MsgSubmitProposal) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgCreateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
func (m *MsgSubmitProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgCreateProposal.Marshal(b, m, deterministic)
|
||||
return xxx_messageInfo_MsgSubmitProposal.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
@ -892,36 +892,36 @@ func (m *MsgCreateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, e
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *MsgCreateProposal) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgCreateProposal.Merge(m, src)
|
||||
func (m *MsgSubmitProposal) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgSubmitProposal.Merge(m, src)
|
||||
}
|
||||
func (m *MsgCreateProposal) XXX_Size() int {
|
||||
func (m *MsgSubmitProposal) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgCreateProposal) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgCreateProposal.DiscardUnknown(m)
|
||||
func (m *MsgSubmitProposal) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgSubmitProposal.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgCreateProposal proto.InternalMessageInfo
|
||||
var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo
|
||||
|
||||
// MsgCreateProposalResponse is the Msg/CreateProposal response type.
|
||||
type MsgCreateProposalResponse struct {
|
||||
// MsgSubmitProposalResponse is the Msg/SubmitProposal response type.
|
||||
type MsgSubmitProposalResponse struct {
|
||||
// proposal is the unique ID of the proposal.
|
||||
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
|
||||
}
|
||||
|
||||
func (m *MsgCreateProposalResponse) Reset() { *m = MsgCreateProposalResponse{} }
|
||||
func (m *MsgCreateProposalResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgCreateProposalResponse) ProtoMessage() {}
|
||||
func (*MsgCreateProposalResponse) Descriptor() ([]byte, []int) {
|
||||
func (m *MsgSubmitProposalResponse) Reset() { *m = MsgSubmitProposalResponse{} }
|
||||
func (m *MsgSubmitProposalResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgSubmitProposalResponse) ProtoMessage() {}
|
||||
func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_da0de9d603d844fb, []int{17}
|
||||
}
|
||||
func (m *MsgCreateProposalResponse) XXX_Unmarshal(b []byte) error {
|
||||
func (m *MsgSubmitProposalResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgCreateProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
func (m *MsgSubmitProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgCreateProposalResponse.Marshal(b, m, deterministic)
|
||||
return xxx_messageInfo_MsgSubmitProposalResponse.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
@ -931,19 +931,19 @@ func (m *MsgCreateProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *MsgCreateProposalResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgCreateProposalResponse.Merge(m, src)
|
||||
func (m *MsgSubmitProposalResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgSubmitProposalResponse.Merge(m, src)
|
||||
}
|
||||
func (m *MsgCreateProposalResponse) XXX_Size() int {
|
||||
func (m *MsgSubmitProposalResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgCreateProposalResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgCreateProposalResponse.DiscardUnknown(m)
|
||||
func (m *MsgSubmitProposalResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgSubmitProposalResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgCreateProposalResponse proto.InternalMessageInfo
|
||||
var xxx_messageInfo_MsgSubmitProposalResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgCreateProposalResponse) GetProposalId() uint64 {
|
||||
func (m *MsgSubmitProposalResponse) GetProposalId() uint64 {
|
||||
if m != nil {
|
||||
return m.ProposalId
|
||||
}
|
||||
@ -1048,8 +1048,8 @@ type MsgVote struct {
|
||||
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
|
||||
// voter is the voter account address.
|
||||
Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"`
|
||||
// choice is the voter's choice on the proposal.
|
||||
Choice Choice `protobuf:"varint,3,opt,name=choice,proto3,enum=cosmos.group.v1beta1.Choice" json:"choice,omitempty"`
|
||||
// option is the voter's choice on the proposal.
|
||||
Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.group.v1beta1.VoteOption" json:"option,omitempty"`
|
||||
// metadata is any arbitrary metadata to attached to the vote.
|
||||
Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
||||
// exec defines whether the proposal should be executed
|
||||
@ -1104,11 +1104,11 @@ func (m *MsgVote) GetVoter() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgVote) GetChoice() Choice {
|
||||
func (m *MsgVote) GetOption() VoteOption {
|
||||
if m != nil {
|
||||
return m.Choice
|
||||
return m.Option
|
||||
}
|
||||
return Choice_CHOICE_UNSPECIFIED
|
||||
return VOTE_OPTION_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (m *MsgVote) GetMetadata() []byte {
|
||||
@ -1272,8 +1272,8 @@ func init() {
|
||||
proto.RegisterType((*MsgUpdateGroupPolicyDecisionPolicyResponse)(nil), "cosmos.group.v1beta1.MsgUpdateGroupPolicyDecisionPolicyResponse")
|
||||
proto.RegisterType((*MsgUpdateGroupPolicyMetadata)(nil), "cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadata")
|
||||
proto.RegisterType((*MsgUpdateGroupPolicyMetadataResponse)(nil), "cosmos.group.v1beta1.MsgUpdateGroupPolicyMetadataResponse")
|
||||
proto.RegisterType((*MsgCreateProposal)(nil), "cosmos.group.v1beta1.MsgCreateProposal")
|
||||
proto.RegisterType((*MsgCreateProposalResponse)(nil), "cosmos.group.v1beta1.MsgCreateProposalResponse")
|
||||
proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.group.v1beta1.MsgSubmitProposal")
|
||||
proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.group.v1beta1.MsgSubmitProposalResponse")
|
||||
proto.RegisterType((*MsgWithdrawProposal)(nil), "cosmos.group.v1beta1.MsgWithdrawProposal")
|
||||
proto.RegisterType((*MsgWithdrawProposalResponse)(nil), "cosmos.group.v1beta1.MsgWithdrawProposalResponse")
|
||||
proto.RegisterType((*MsgVote)(nil), "cosmos.group.v1beta1.MsgVote")
|
||||
@ -1285,75 +1285,76 @@ func init() {
|
||||
func init() { proto.RegisterFile("cosmos/group/v1beta1/tx.proto", fileDescriptor_da0de9d603d844fb) }
|
||||
|
||||
var fileDescriptor_da0de9d603d844fb = []byte{
|
||||
// 1077 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6f, 0x1b, 0x45,
|
||||
0x14, 0xf7, 0xc4, 0x6e, 0x3e, 0x9e, 0x8b, 0x9b, 0x6c, 0x4d, 0x71, 0x96, 0xc4, 0x36, 0x26, 0x80,
|
||||
0x31, 0xc9, 0x2e, 0x71, 0x8a, 0x40, 0x56, 0x85, 0x48, 0x52, 0x83, 0x2c, 0x61, 0x14, 0xb6, 0x94,
|
||||
0xaf, 0x8b, 0xb5, 0xf6, 0x0e, 0x9b, 0x2d, 0xb1, 0x67, 0xe5, 0xd9, 0x7c, 0xf8, 0xda, 0x13, 0x52,
|
||||
0x2f, 0xfc, 0x03, 0x48, 0x48, 0x48, 0x1c, 0x38, 0x71, 0xe8, 0x85, 0x2b, 0xa7, 0x8a, 0x53, 0xc5,
|
||||
0x89, 0x13, 0xaa, 0x92, 0x03, 0x48, 0x1c, 0xfa, 0x2f, 0x20, 0xcf, 0xec, 0x4e, 0xbc, 0xf1, 0xae,
|
||||
0xbd, 0xb6, 0xa2, 0x9c, 0x92, 0xd9, 0xf9, 0xbd, 0xf7, 0x7e, 0xbf, 0x79, 0x6f, 0xe6, 0x3d, 0x19,
|
||||
0x56, 0x5b, 0x84, 0xb6, 0x09, 0x55, 0xcd, 0x2e, 0x39, 0xb4, 0xd5, 0xa3, 0xcd, 0x26, 0x76, 0xf4,
|
||||
0x4d, 0xd5, 0x39, 0x51, 0xec, 0x2e, 0x71, 0x88, 0x94, 0xe6, 0xdb, 0x0a, 0xdb, 0x56, 0xdc, 0x6d,
|
||||
0x39, 0x6d, 0x12, 0x93, 0x30, 0x80, 0xda, 0xff, 0x8f, 0x63, 0xe5, 0x65, 0x8e, 0x6d, 0xf0, 0x0d,
|
||||
0xd7, 0xd0, 0xdd, 0x32, 0x09, 0x31, 0x0f, 0xb0, 0xca, 0x56, 0xcd, 0xc3, 0x6f, 0x54, 0xbd, 0xd3,
|
||||
0x73, 0xb7, 0xf2, 0xc1, 0x04, 0x7a, 0x36, 0xf6, 0x8c, 0x5f, 0x72, 0x11, 0x6d, 0x6a, 0xaa, 0x47,
|
||||
0x9b, 0xfd, 0x3f, 0x7c, 0xa3, 0xf0, 0x33, 0x82, 0x54, 0x9d, 0x9a, 0xbb, 0x5d, 0xac, 0x3b, 0xf8,
|
||||
0xa3, 0xbe, 0xbd, 0xa4, 0xc0, 0x35, 0xdd, 0x68, 0x5b, 0x9d, 0x0c, 0xca, 0xa3, 0xe2, 0xc2, 0x4e,
|
||||
0xe6, 0xcf, 0xc7, 0x1b, 0x9e, 0x84, 0x6d, 0xc3, 0xe8, 0x62, 0x4a, 0xef, 0x39, 0x5d, 0xab, 0x63,
|
||||
0x6a, 0x1c, 0x26, 0xdd, 0x81, 0xb9, 0x36, 0x6e, 0x37, 0x71, 0x97, 0x66, 0x66, 0xf2, 0xf1, 0x62,
|
||||
0xb2, 0xbc, 0xa2, 0x04, 0x29, 0x56, 0xea, 0x0c, 0xb4, 0x93, 0x78, 0xf2, 0x77, 0x2e, 0xa6, 0x79,
|
||||
0x26, 0x92, 0x0c, 0xf3, 0x6d, 0xec, 0xe8, 0x86, 0xee, 0xe8, 0x99, 0x78, 0x1e, 0x15, 0xaf, 0x6b,
|
||||
0x62, 0x5d, 0x81, 0x87, 0xff, 0xfc, 0x5a, 0xe2, 0x51, 0x0a, 0x5b, 0x70, 0xcb, 0xcf, 0x53, 0xc3,
|
||||
0xd4, 0x26, 0x1d, 0x8a, 0xa5, 0x65, 0x98, 0x67, 0x81, 0x1a, 0x96, 0xc1, 0x28, 0x27, 0xb4, 0x39,
|
||||
0xb6, 0xae, 0x19, 0x85, 0xdf, 0x10, 0xbc, 0x58, 0xa7, 0xe6, 0x7d, 0xdb, 0xf0, 0xac, 0xea, 0x6e,
|
||||
0xd8, 0x49, 0x45, 0x0e, 0x06, 0x99, 0xf1, 0x05, 0x91, 0x6a, 0x90, 0xe2, 0x62, 0x1a, 0x87, 0x2c,
|
||||
0x0e, 0xcd, 0xc4, 0x23, 0x1f, 0xc3, 0x0b, 0xdc, 0x92, 0x13, 0xa4, 0x3e, 0xc1, 0x39, 0x58, 0x0d,
|
||||
0xa4, 0xee, 0xe9, 0x2e, 0xfc, 0x84, 0xe0, 0xa6, 0x1f, 0xb1, 0xcd, 0xa8, 0x5e, 0xa2, 0xb4, 0x77,
|
||||
0x60, 0xa1, 0x83, 0x8f, 0x1b, 0xdc, 0x5d, 0x7c, 0x8c, 0xbb, 0xf9, 0x0e, 0x3e, 0x66, 0x0c, 0x7c,
|
||||
0x32, 0x56, 0xe1, 0xe5, 0x00, 0x92, 0x42, 0xc4, 0x23, 0xc4, 0xf2, 0xea, 0x93, 0xc9, 0xb3, 0x7f,
|
||||
0x99, 0x3a, 0xa2, 0x16, 0x59, 0x1e, 0xb2, 0xc1, 0x64, 0x04, 0xdf, 0x67, 0x08, 0xd2, 0xfe, 0x3a,
|
||||
0xdc, 0x23, 0x07, 0x56, 0xab, 0x77, 0x45, 0x6c, 0xa5, 0x4f, 0xe1, 0x86, 0x81, 0x5b, 0x16, 0xb5,
|
||||
0x48, 0xa7, 0x61, 0xb3, 0xc8, 0x99, 0x44, 0x1e, 0x15, 0x93, 0xe5, 0xb4, 0xc2, 0xdf, 0x07, 0xc5,
|
||||
0x7b, 0x1f, 0x94, 0xed, 0x4e, 0x6f, 0x47, 0xfa, 0xe3, 0xf1, 0x46, 0xea, 0xae, 0x6b, 0xc0, 0x99,
|
||||
0x6a, 0x29, 0xc3, 0xb7, 0xae, 0xa4, 0xbe, 0xfb, 0x31, 0x17, 0x1b, 0x38, 0x04, 0x0d, 0x56, 0x82,
|
||||
0x14, 0x8a, 0xfb, 0x56, 0x86, 0x39, 0x9d, 0x2b, 0x1a, 0xab, 0xd5, 0x03, 0x16, 0x7e, 0x47, 0xb0,
|
||||
0xec, 0x3f, 0x59, 0xee, 0x74, 0xba, 0x8a, 0x1d, 0x60, 0x30, 0x13, 0x91, 0xc1, 0x65, 0x94, 0xf2,
|
||||
0xab, 0xf0, 0x4a, 0xa8, 0x06, 0x51, 0x20, 0xff, 0x21, 0x28, 0x04, 0xa1, 0xfc, 0x49, 0xb8, 0x12,
|
||||
0xc9, 0x01, 0xb5, 0x12, 0xbf, 0xe4, 0x5a, 0x59, 0x87, 0xd2, 0x78, 0xb1, 0xe2, 0x6c, 0x7e, 0x41,
|
||||
0xac, 0xb4, 0x86, 0xe0, 0x53, 0x5f, 0xf9, 0x69, 0x4e, 0x25, 0xea, 0x5b, 0xf0, 0x3a, 0xac, 0x8d,
|
||||
0xe2, 0x2a, 0x44, 0x3d, 0x47, 0xb0, 0x24, 0xee, 0xcb, 0x5e, 0x97, 0xd8, 0x84, 0xea, 0x07, 0xd3,
|
||||
0x5c, 0x12, 0x69, 0x05, 0x16, 0x6c, 0x66, 0xef, 0xb5, 0xd2, 0x05, 0xed, 0xfc, 0xc3, 0xc8, 0x57,
|
||||
0xa1, 0x08, 0x89, 0x36, 0x35, 0x69, 0x26, 0xc1, 0x1a, 0x4f, 0x60, 0x7a, 0x35, 0x86, 0x90, 0x14,
|
||||
0x48, 0xe0, 0x13, 0xdc, 0xca, 0x5c, 0xcb, 0xa3, 0x62, 0xaa, 0x2c, 0x07, 0xb7, 0xa8, 0xea, 0x09,
|
||||
0x6e, 0x69, 0x0c, 0x57, 0x91, 0xbc, 0x84, 0x9f, 0x33, 0x29, 0xdc, 0x61, 0x77, 0xd9, 0x2f, 0x58,
|
||||
0xbc, 0x0e, 0x39, 0x48, 0xda, 0xee, 0xb7, 0xf3, 0x86, 0x0c, 0xde, 0xa7, 0x9a, 0x51, 0x78, 0xc0,
|
||||
0xba, 0xd6, 0x17, 0x96, 0xb3, 0x6f, 0x74, 0xf5, 0x63, 0x71, 0x60, 0xe3, 0xec, 0xa6, 0xc9, 0xb5,
|
||||
0xdb, 0x7c, 0x2e, 0xc6, 0x12, 0xa9, 0xfb, 0x17, 0xc1, 0x5c, 0x9d, 0x9a, 0x9f, 0x13, 0x67, 0x3c,
|
||||
0xef, 0x7e, 0x6d, 0x1e, 0x11, 0x07, 0x77, 0xc7, 0x46, 0xe7, 0x30, 0xe9, 0x36, 0xcc, 0xb6, 0xf6,
|
||||
0x89, 0xd5, 0xc2, 0x2c, 0x5b, 0xa9, 0xb0, 0x71, 0x60, 0x97, 0x61, 0x34, 0x17, 0xeb, 0xcb, 0x72,
|
||||
0xe2, 0x42, 0x96, 0x27, 0xcd, 0x1d, 0xaf, 0x66, 0xc6, 0xa6, 0xb0, 0x04, 0x37, 0x5c, 0xa5, 0x42,
|
||||
0xbd, 0xc5, 0xc4, 0xf7, 0xf1, 0xe3, 0xc5, 0xbf, 0x0d, 0xb3, 0xd4, 0x32, 0x3b, 0x11, 0xd4, 0xbb,
|
||||
0xb8, 0x4a, 0xb2, 0x1f, 0xdc, 0x5d, 0xb8, 0xd1, 0x19, 0x35, 0x37, 0x7a, 0xa9, 0x04, 0x09, 0x16,
|
||||
0x3a, 0x0d, 0x8b, 0xd5, 0x2f, 0xab, 0xbb, 0x8d, 0xfb, 0x9f, 0xdc, 0xdb, 0xab, 0xee, 0xd6, 0x3e,
|
||||
0xac, 0x55, 0xef, 0x2e, 0xc6, 0xa4, 0xeb, 0x30, 0xcf, 0xbe, 0x7e, 0xa6, 0x7d, 0xb5, 0x88, 0xca,
|
||||
0xcf, 0x01, 0xe2, 0x75, 0x6a, 0x4a, 0x3a, 0x24, 0x07, 0x07, 0xd5, 0xb5, 0x90, 0x01, 0xcb, 0xd7,
|
||||
0xbc, 0xe4, 0xf5, 0x28, 0x28, 0x51, 0xbe, 0x47, 0x20, 0x05, 0x4c, 0x8b, 0x6f, 0x85, 0xfa, 0x18,
|
||||
0x06, 0xcb, 0x5b, 0x13, 0x80, 0x45, 0x5c, 0x1b, 0x16, 0x87, 0x06, 0xb9, 0x37, 0xa3, 0x38, 0x62,
|
||||
0x50, 0x79, 0x33, 0x32, 0x54, 0x44, 0xec, 0xc1, 0xcd, 0xa0, 0xa9, 0x6b, 0x3d, 0x1a, 0x7b, 0x8e,
|
||||
0x96, 0x6f, 0x4f, 0x82, 0x16, 0xa1, 0x29, 0x2c, 0x0d, 0x0f, 0x50, 0xa5, 0x28, 0x79, 0xe2, 0x58,
|
||||
0xb9, 0x1c, 0x1d, 0x2b, 0x82, 0x3e, 0x44, 0x70, 0x2b, 0x64, 0xfe, 0x50, 0xa3, 0xa8, 0x18, 0x30,
|
||||
0x90, 0xdf, 0x9d, 0xd0, 0x40, 0x90, 0xf8, 0x01, 0x41, 0x6e, 0xdc, 0x68, 0xf0, 0x5e, 0x74, 0xe7,
|
||||
0x7e, 0x4b, 0xf9, 0x83, 0x69, 0x2d, 0x05, 0xbf, 0x47, 0x08, 0x96, 0xc3, 0xdb, 0x73, 0x39, 0xba,
|
||||
0x7f, 0x51, 0x21, 0x95, 0xc9, 0x6d, 0x04, 0x9b, 0x07, 0x90, 0xba, 0xd0, 0x56, 0xdf, 0x18, 0x93,
|
||||
0x78, 0x0f, 0x28, 0xab, 0x11, 0x81, 0x83, 0x17, 0x70, 0xa8, 0x27, 0x85, 0x5f, 0xc0, 0x8b, 0xd0,
|
||||
0x11, 0x17, 0x30, 0xac, 0xfb, 0x48, 0x1f, 0x43, 0x82, 0x75, 0x9e, 0xd5, 0x50, 0xd3, 0xfe, 0xb6,
|
||||
0xfc, 0xda, 0xc8, 0xed, 0x41, 0x6f, 0xec, 0x3d, 0x0d, 0xf7, 0xd6, 0xdf, 0x1e, 0xe1, 0x6d, 0xf0,
|
||||
0x75, 0xde, 0x79, 0xff, 0xc9, 0x69, 0x16, 0x3d, 0x3d, 0xcd, 0xa2, 0x67, 0xa7, 0x59, 0xf4, 0xfd,
|
||||
0x59, 0x36, 0xf6, 0xf4, 0x2c, 0x1b, 0xfb, 0xeb, 0x2c, 0x1b, 0xfb, 0x7a, 0xcd, 0xb4, 0x9c, 0xfd,
|
||||
0xc3, 0xa6, 0xd2, 0x22, 0x6d, 0xf7, 0xf7, 0x09, 0xf7, 0xcf, 0x06, 0x35, 0xbe, 0x55, 0x4f, 0xf8,
|
||||
0x6f, 0x10, 0xcd, 0x59, 0x36, 0x7a, 0x6c, 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x1d, 0x8e,
|
||||
0x60, 0x1b, 0x11, 0x00, 0x00,
|
||||
// 1089 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcf, 0x6f, 0x1b, 0x45,
|
||||
0x14, 0xf6, 0xc4, 0x6e, 0x7e, 0xbc, 0x14, 0x37, 0xd9, 0x86, 0xe2, 0x2c, 0x89, 0x63, 0x4c, 0x00,
|
||||
0x63, 0x92, 0xdd, 0xc6, 0x01, 0x51, 0x59, 0x15, 0x22, 0x49, 0x0d, 0xb2, 0x84, 0x21, 0x6c, 0x28,
|
||||
0xbf, 0x2e, 0xd6, 0xda, 0x3b, 0x6c, 0xb7, 0xc4, 0x9e, 0x95, 0x67, 0x9d, 0xc4, 0xd7, 0x9e, 0x90,
|
||||
0x7a, 0xe1, 0x1f, 0x40, 0x42, 0x42, 0xe2, 0xc0, 0x89, 0x43, 0x2f, 0x5c, 0x39, 0x55, 0x9c, 0x2a,
|
||||
0x4e, 0x9c, 0x50, 0x95, 0x1c, 0x38, 0x80, 0xc4, 0x91, 0x2b, 0xda, 0x99, 0xdd, 0x89, 0x37, 0xde,
|
||||
0xb5, 0xd7, 0x56, 0xd4, 0x53, 0x32, 0x3b, 0xdf, 0x7b, 0xef, 0xfb, 0xde, 0x7b, 0x33, 0x6f, 0x64,
|
||||
0x58, 0x6d, 0x12, 0xda, 0x22, 0x54, 0x35, 0x3b, 0xa4, 0x6b, 0xab, 0x47, 0x5b, 0x0d, 0xec, 0xe8,
|
||||
0x5b, 0xaa, 0x73, 0xa2, 0xd8, 0x1d, 0xe2, 0x10, 0x69, 0x89, 0x6f, 0x2b, 0x6c, 0x5b, 0xf1, 0xb6,
|
||||
0xe5, 0x25, 0x93, 0x98, 0x84, 0x01, 0x54, 0xf7, 0x3f, 0x8e, 0x95, 0x97, 0x39, 0xb6, 0xce, 0x37,
|
||||
0x3c, 0x43, 0x6f, 0xcb, 0x24, 0xc4, 0x3c, 0xc4, 0x2a, 0x5b, 0x35, 0xba, 0x5f, 0xa9, 0x7a, 0xbb,
|
||||
0xe7, 0x6d, 0xe5, 0xc2, 0x09, 0xf4, 0x6c, 0xec, 0x1b, 0xbf, 0xe0, 0x21, 0x5a, 0xd4, 0x54, 0x8f,
|
||||
0xb6, 0xdc, 0x3f, 0x7c, 0x23, 0xff, 0x23, 0x82, 0x74, 0x8d, 0x9a, 0x7b, 0x1d, 0xac, 0x3b, 0xf8,
|
||||
0x7d, 0xd7, 0x5e, 0x52, 0xe0, 0x8a, 0x6e, 0xb4, 0xac, 0x76, 0x06, 0xe5, 0x50, 0x61, 0x6e, 0x37,
|
||||
0xf3, 0xfb, 0xa3, 0x4d, 0x5f, 0xc2, 0x8e, 0x61, 0x74, 0x30, 0xa5, 0x07, 0x4e, 0xc7, 0x6a, 0x9b,
|
||||
0x1a, 0x87, 0x49, 0xb7, 0x61, 0xa6, 0x85, 0x5b, 0x0d, 0xdc, 0xa1, 0x99, 0xa9, 0x5c, 0xb2, 0x30,
|
||||
0x5f, 0x5a, 0x51, 0xc2, 0x14, 0x2b, 0x35, 0x06, 0xda, 0x4d, 0x3d, 0xfe, 0x73, 0x2d, 0xa1, 0xf9,
|
||||
0x26, 0x92, 0x0c, 0xb3, 0x2d, 0xec, 0xe8, 0x86, 0xee, 0xe8, 0x99, 0x64, 0x0e, 0x15, 0xae, 0x6a,
|
||||
0x62, 0x5d, 0x86, 0x07, 0x7f, 0xfd, 0x5c, 0xe4, 0x51, 0xf2, 0xdb, 0x70, 0x23, 0xc8, 0x53, 0xc3,
|
||||
0xd4, 0x26, 0x6d, 0x8a, 0xa5, 0x65, 0x98, 0x65, 0x81, 0xea, 0x96, 0xc1, 0x28, 0xa7, 0xb4, 0x19,
|
||||
0xb6, 0xae, 0x1a, 0xf9, 0x5f, 0x10, 0x3c, 0x5f, 0xa3, 0xe6, 0x5d, 0xdb, 0xf0, 0xad, 0x6a, 0x5e,
|
||||
0xd8, 0x71, 0x45, 0xf6, 0x07, 0x99, 0x0a, 0x04, 0x91, 0xaa, 0x90, 0xe6, 0x62, 0xea, 0x5d, 0x16,
|
||||
0x87, 0x66, 0x92, 0xb1, 0xd3, 0xf0, 0x1c, 0xb7, 0xe4, 0x04, 0x69, 0x40, 0xf0, 0x1a, 0xac, 0x86,
|
||||
0x52, 0xf7, 0x75, 0xe7, 0x7f, 0x40, 0x70, 0x3d, 0x88, 0xd8, 0x61, 0x54, 0x2f, 0x51, 0xda, 0x5b,
|
||||
0x30, 0xd7, 0xc6, 0xc7, 0x75, 0xee, 0x2e, 0x39, 0xc2, 0xdd, 0x6c, 0x1b, 0x1f, 0x33, 0x06, 0x01,
|
||||
0x19, 0xab, 0xf0, 0x62, 0x08, 0x49, 0x21, 0xe2, 0x21, 0x62, 0x75, 0x0d, 0xc8, 0xe4, 0xd5, 0xbf,
|
||||
0x4c, 0x1d, 0x71, 0x9b, 0x2c, 0x07, 0xd9, 0x70, 0x32, 0x82, 0xef, 0x53, 0x04, 0x4b, 0xc1, 0x3e,
|
||||
0xdc, 0x27, 0x87, 0x56, 0xb3, 0xf7, 0x8c, 0xd8, 0x4a, 0x1f, 0xc3, 0x35, 0x03, 0x37, 0x2d, 0x6a,
|
||||
0x91, 0x76, 0xdd, 0x66, 0x91, 0x33, 0xa9, 0x1c, 0x2a, 0xcc, 0x97, 0x96, 0x14, 0x7e, 0x3f, 0x28,
|
||||
0xfe, 0xfd, 0xa0, 0xec, 0xb4, 0x7b, 0xbb, 0xd2, 0x6f, 0x8f, 0x36, 0xd3, 0x77, 0x3c, 0x03, 0xce,
|
||||
0x54, 0x4b, 0x1b, 0x81, 0x75, 0x39, 0xfd, 0xcd, 0xf7, 0x6b, 0x89, 0xbe, 0x24, 0x68, 0xb0, 0x12,
|
||||
0xa6, 0x50, 0x9c, 0xb7, 0x12, 0xcc, 0xe8, 0x5c, 0xd1, 0x48, 0xad, 0x3e, 0x30, 0xff, 0x2b, 0x82,
|
||||
0xe5, 0x60, 0x66, 0xb9, 0xd3, 0xc9, 0x3a, 0xb6, 0x8f, 0xc1, 0x54, 0x4c, 0x06, 0x97, 0xd1, 0xca,
|
||||
0x2f, 0xc3, 0x4b, 0x91, 0x1a, 0x44, 0x83, 0xfc, 0x8d, 0x20, 0x1f, 0x86, 0x0a, 0x16, 0xe1, 0x99,
|
||||
0x48, 0x0e, 0xe9, 0x95, 0xe4, 0x25, 0xf7, 0xca, 0x06, 0x14, 0x47, 0x8b, 0x15, 0xb9, 0xf9, 0x09,
|
||||
0xb1, 0xd6, 0x1a, 0x80, 0x4f, 0x7c, 0xe4, 0x27, 0xc9, 0x4a, 0xdc, 0xbb, 0xe0, 0x55, 0x58, 0x1f,
|
||||
0xc6, 0x55, 0x88, 0xfa, 0x0f, 0xc1, 0x62, 0x8d, 0x9a, 0x07, 0xdd, 0x46, 0xcb, 0x72, 0xf6, 0x3b,
|
||||
0xc4, 0x26, 0x54, 0x3f, 0x9c, 0xe4, 0x90, 0x48, 0x2b, 0x30, 0x67, 0x33, 0x7b, 0x7f, 0x94, 0xce,
|
||||
0x69, 0xe7, 0x1f, 0x86, 0xde, 0x0a, 0x37, 0xdd, 0x3d, 0x4a, 0x75, 0x13, 0xd3, 0x4c, 0x8a, 0x0d,
|
||||
0x9f, 0xd0, 0x12, 0x6b, 0x02, 0x25, 0x29, 0x90, 0xc2, 0x27, 0xb8, 0x99, 0xb9, 0x92, 0x43, 0x85,
|
||||
0x74, 0x49, 0x0e, 0x1f, 0x55, 0x95, 0x13, 0xdc, 0xd4, 0x18, 0xae, 0x2c, 0xf9, 0x85, 0x3f, 0x67,
|
||||
0x94, 0xbf, 0xcd, 0xce, 0x74, 0x50, 0xb8, 0xb8, 0x25, 0xd6, 0x60, 0xde, 0xf6, 0xbe, 0x9d, 0x0f,
|
||||
0x66, 0xf0, 0x3f, 0x55, 0x8d, 0xfc, 0x7d, 0x36, 0xbd, 0x3e, 0xb3, 0x9c, 0x7b, 0x46, 0x47, 0x3f,
|
||||
0x16, 0x89, 0x1b, 0x65, 0x37, 0x49, 0xcd, 0xbd, 0x21, 0x74, 0x31, 0x96, 0x28, 0xe1, 0x3f, 0x08,
|
||||
0x66, 0x6a, 0xd4, 0xfc, 0x94, 0x38, 0xa3, 0x79, 0xbb, 0x3d, 0x7a, 0x44, 0x1c, 0xdc, 0x19, 0x19,
|
||||
0x9d, 0xc3, 0xa4, 0x5b, 0x30, 0x4d, 0x6c, 0xc7, 0x22, 0xfc, 0xd6, 0x49, 0x97, 0x72, 0xe1, 0xb9,
|
||||
0x76, 0x83, 0x7f, 0xc4, 0x70, 0x9a, 0x87, 0x0f, 0x54, 0x3c, 0x75, 0xa1, 0xe2, 0xe3, 0xd6, 0x8f,
|
||||
0x77, 0x36, 0x63, 0x94, 0x5f, 0x84, 0x6b, 0x9e, 0x5a, 0x91, 0x01, 0x8b, 0x25, 0xc0, 0xc5, 0x8f,
|
||||
0x4e, 0xc0, 0x4d, 0x98, 0xa6, 0x96, 0xd9, 0x8e, 0x91, 0x01, 0x0f, 0x57, 0x9e, 0x77, 0x83, 0x7b,
|
||||
0x0b, 0x2f, 0x3a, 0xa3, 0xe6, 0x45, 0x2f, 0x16, 0x21, 0xc5, 0x42, 0x2f, 0xc1, 0x42, 0xe5, 0xf3,
|
||||
0xca, 0x5e, 0xfd, 0xee, 0x87, 0x07, 0xfb, 0x95, 0xbd, 0xea, 0x7b, 0xd5, 0xca, 0x9d, 0x85, 0x84,
|
||||
0x74, 0x15, 0x66, 0xd9, 0xd7, 0x4f, 0xb4, 0x2f, 0x16, 0x50, 0xe9, 0x5f, 0x80, 0x64, 0x8d, 0x9a,
|
||||
0x92, 0x0e, 0xf3, 0xfd, 0x8f, 0xd6, 0xf5, 0x88, 0xc7, 0x56, 0x60, 0x90, 0xc9, 0x1b, 0x71, 0x50,
|
||||
0xa2, 0x85, 0x8f, 0x40, 0x0a, 0x79, 0x39, 0xbe, 0x11, 0xe9, 0x63, 0x10, 0x2c, 0x6f, 0x8f, 0x01,
|
||||
0x16, 0x71, 0x6d, 0x58, 0x18, 0x78, 0xd4, 0xbd, 0x1e, 0xc7, 0x11, 0x83, 0xca, 0x5b, 0xb1, 0xa1,
|
||||
0x22, 0x62, 0x0f, 0xae, 0x87, 0xbd, 0xc0, 0x36, 0xe2, 0xb1, 0xe7, 0x68, 0xf9, 0xcd, 0x71, 0xd0,
|
||||
0x22, 0x34, 0x85, 0xc5, 0xc1, 0xc7, 0x54, 0x31, 0x4e, 0x9d, 0x38, 0x56, 0x2e, 0xc5, 0xc7, 0x8a,
|
||||
0xa0, 0x0f, 0x10, 0xdc, 0x88, 0x78, 0x8b, 0xa8, 0x71, 0x54, 0xf4, 0x19, 0xc8, 0x6f, 0x8f, 0x69,
|
||||
0x20, 0x48, 0x7c, 0x87, 0x60, 0x6d, 0xd4, 0x33, 0xe1, 0x56, 0x7c, 0xe7, 0x41, 0x4b, 0xf9, 0xdd,
|
||||
0x49, 0x2d, 0x05, 0xbf, 0x87, 0x08, 0x96, 0xa3, 0x47, 0x75, 0x29, 0xbe, 0x7f, 0xd1, 0x21, 0xe5,
|
||||
0xf1, 0x6d, 0x04, 0x9b, 0xfb, 0x90, 0xbe, 0x30, 0x62, 0x5f, 0x8b, 0xf4, 0x16, 0x04, 0xca, 0x6a,
|
||||
0x4c, 0x60, 0xff, 0x01, 0x1c, 0x98, 0x4b, 0xd1, 0x07, 0xf0, 0x22, 0x74, 0xc8, 0x01, 0x8c, 0x9a,
|
||||
0x40, 0xd2, 0x07, 0x90, 0x62, 0xd3, 0x67, 0x35, 0xd2, 0xd4, 0xdd, 0x96, 0x5f, 0x19, 0xba, 0xdd,
|
||||
0xef, 0x8d, 0xdd, 0xa7, 0xd1, 0xde, 0xdc, 0xed, 0x21, 0xde, 0xfa, 0x6f, 0xe7, 0xdd, 0x77, 0x1e,
|
||||
0x9f, 0x66, 0xd1, 0x93, 0xd3, 0x2c, 0x7a, 0x7a, 0x9a, 0x45, 0xdf, 0x9e, 0x65, 0x13, 0x4f, 0xce,
|
||||
0xb2, 0x89, 0x3f, 0xce, 0xb2, 0x89, 0x2f, 0xd7, 0x4d, 0xcb, 0xb9, 0xd7, 0x6d, 0x28, 0x4d, 0xd2,
|
||||
0xf2, 0x7e, 0xab, 0xf0, 0xfe, 0x6c, 0x52, 0xe3, 0x6b, 0xf5, 0x84, 0xff, 0x1e, 0xd1, 0x98, 0x66,
|
||||
0x4f, 0x90, 0xed, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x9f, 0x5f, 0xcd, 0x27, 0x11, 0x00,
|
||||
0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@ -1384,8 +1385,8 @@ type MsgClient interface {
|
||||
UpdateGroupPolicyDecisionPolicy(ctx context.Context, in *MsgUpdateGroupPolicyDecisionPolicy, opts ...grpc.CallOption) (*MsgUpdateGroupPolicyDecisionPolicyResponse, error)
|
||||
// UpdateGroupPolicyMetadata updates a group policy metadata.
|
||||
UpdateGroupPolicyMetadata(ctx context.Context, in *MsgUpdateGroupPolicyMetadata, opts ...grpc.CallOption) (*MsgUpdateGroupPolicyMetadataResponse, error)
|
||||
// CreateProposal submits a new proposal.
|
||||
CreateProposal(ctx context.Context, in *MsgCreateProposal, opts ...grpc.CallOption) (*MsgCreateProposalResponse, error)
|
||||
// SubmitProposal submits a new proposal.
|
||||
SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error)
|
||||
// WithdrawProposal aborts a proposal.
|
||||
WithdrawProposal(ctx context.Context, in *MsgWithdrawProposal, opts ...grpc.CallOption) (*MsgWithdrawProposalResponse, error)
|
||||
// Vote allows a voter to vote on a proposal.
|
||||
@ -1474,9 +1475,9 @@ func (c *msgClient) UpdateGroupPolicyMetadata(ctx context.Context, in *MsgUpdate
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) CreateProposal(ctx context.Context, in *MsgCreateProposal, opts ...grpc.CallOption) (*MsgCreateProposalResponse, error) {
|
||||
out := new(MsgCreateProposalResponse)
|
||||
err := c.cc.Invoke(ctx, "/cosmos.group.v1beta1.Msg/CreateProposal", in, out, opts...)
|
||||
func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) {
|
||||
out := new(MsgSubmitProposalResponse)
|
||||
err := c.cc.Invoke(ctx, "/cosmos.group.v1beta1.Msg/SubmitProposal", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -1528,8 +1529,8 @@ type MsgServer interface {
|
||||
UpdateGroupPolicyDecisionPolicy(context.Context, *MsgUpdateGroupPolicyDecisionPolicy) (*MsgUpdateGroupPolicyDecisionPolicyResponse, error)
|
||||
// UpdateGroupPolicyMetadata updates a group policy metadata.
|
||||
UpdateGroupPolicyMetadata(context.Context, *MsgUpdateGroupPolicyMetadata) (*MsgUpdateGroupPolicyMetadataResponse, error)
|
||||
// CreateProposal submits a new proposal.
|
||||
CreateProposal(context.Context, *MsgCreateProposal) (*MsgCreateProposalResponse, error)
|
||||
// SubmitProposal submits a new proposal.
|
||||
SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error)
|
||||
// WithdrawProposal aborts a proposal.
|
||||
WithdrawProposal(context.Context, *MsgWithdrawProposal) (*MsgWithdrawProposalResponse, error)
|
||||
// Vote allows a voter to vote on a proposal.
|
||||
@ -1566,8 +1567,8 @@ func (*UnimplementedMsgServer) UpdateGroupPolicyDecisionPolicy(ctx context.Conte
|
||||
func (*UnimplementedMsgServer) UpdateGroupPolicyMetadata(ctx context.Context, req *MsgUpdateGroupPolicyMetadata) (*MsgUpdateGroupPolicyMetadataResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateGroupPolicyMetadata not implemented")
|
||||
}
|
||||
func (*UnimplementedMsgServer) CreateProposal(ctx context.Context, req *MsgCreateProposal) (*MsgCreateProposalResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateProposal not implemented")
|
||||
func (*UnimplementedMsgServer) SubmitProposal(ctx context.Context, req *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented")
|
||||
}
|
||||
func (*UnimplementedMsgServer) WithdrawProposal(ctx context.Context, req *MsgWithdrawProposal) (*MsgWithdrawProposalResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method WithdrawProposal not implemented")
|
||||
@ -1727,20 +1728,20 @@ func _Msg_UpdateGroupPolicyMetadata_Handler(srv interface{}, ctx context.Context
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_CreateProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgCreateProposal)
|
||||
func _Msg_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgSubmitProposal)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).CreateProposal(ctx, in)
|
||||
return srv.(MsgServer).SubmitProposal(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cosmos.group.v1beta1.Msg/CreateProposal",
|
||||
FullMethod: "/cosmos.group.v1beta1.Msg/SubmitProposal",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).CreateProposal(ctx, req.(*MsgCreateProposal))
|
||||
return srv.(MsgServer).SubmitProposal(ctx, req.(*MsgSubmitProposal))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@ -1836,8 +1837,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
Handler: _Msg_UpdateGroupPolicyMetadata_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateProposal",
|
||||
Handler: _Msg_CreateProposal_Handler,
|
||||
MethodName: "SubmitProposal",
|
||||
Handler: _Msg_SubmitProposal_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "WithdrawProposal",
|
||||
@ -2427,7 +2428,7 @@ func (m *MsgUpdateGroupPolicyMetadataResponse) MarshalToSizedBuffer(dAtA []byte)
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgCreateProposal) Marshal() (dAtA []byte, err error) {
|
||||
func (m *MsgSubmitProposal) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
@ -2437,12 +2438,12 @@ func (m *MsgCreateProposal) Marshal() (dAtA []byte, err error) {
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *MsgCreateProposal) MarshalTo(dAtA []byte) (int, error) {
|
||||
func (m *MsgSubmitProposal) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgCreateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
@ -2452,10 +2453,10 @@ func (m *MsgCreateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i--
|
||||
dAtA[i] = 0x28
|
||||
}
|
||||
if len(m.Msgs) > 0 {
|
||||
for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- {
|
||||
if len(m.Messages) > 0 {
|
||||
for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@ -2492,7 +2493,7 @@ func (m *MsgCreateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgCreateProposalResponse) Marshal() (dAtA []byte, err error) {
|
||||
func (m *MsgSubmitProposalResponse) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
@ -2502,12 +2503,12 @@ func (m *MsgCreateProposalResponse) Marshal() (dAtA []byte, err error) {
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *MsgCreateProposalResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
func (m *MsgSubmitProposalResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgCreateProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
func (m *MsgSubmitProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
@ -2610,8 +2611,8 @@ func (m *MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if m.Choice != 0 {
|
||||
i = encodeVarintTx(dAtA, i, uint64(m.Choice))
|
||||
if m.Option != 0 {
|
||||
i = encodeVarintTx(dAtA, i, uint64(m.Option))
|
||||
i--
|
||||
dAtA[i] = 0x18
|
||||
}
|
||||
@ -2973,7 +2974,7 @@ func (m *MsgUpdateGroupPolicyMetadataResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgCreateProposal) Size() (n int) {
|
||||
func (m *MsgSubmitProposal) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
@ -2993,8 +2994,8 @@ func (m *MsgCreateProposal) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
if len(m.Msgs) > 0 {
|
||||
for _, e := range m.Msgs {
|
||||
if len(m.Messages) > 0 {
|
||||
for _, e := range m.Messages {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
@ -3005,7 +3006,7 @@ func (m *MsgCreateProposal) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgCreateProposalResponse) Size() (n int) {
|
||||
func (m *MsgSubmitProposalResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
@ -3055,8 +3056,8 @@ func (m *MsgVote) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
if m.Choice != 0 {
|
||||
n += 1 + sovTx(uint64(m.Choice))
|
||||
if m.Option != 0 {
|
||||
n += 1 + sovTx(uint64(m.Option))
|
||||
}
|
||||
l = len(m.Metadata)
|
||||
if l > 0 {
|
||||
@ -4727,7 +4728,7 @@ func (m *MsgUpdateGroupPolicyMetadataResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgCreateProposal) Unmarshal(dAtA []byte) error {
|
||||
func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
@ -4750,10 +4751,10 @@ func (m *MsgCreateProposal) Unmarshal(dAtA []byte) error {
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: MsgCreateProposal: wiretype end group for non-group")
|
||||
return fmt.Errorf("proto: MsgSubmitProposal: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgCreateProposal: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
return fmt.Errorf("proto: MsgSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
@ -4856,7 +4857,7 @@ func (m *MsgCreateProposal) Unmarshal(dAtA []byte) error {
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@ -4883,8 +4884,8 @@ func (m *MsgCreateProposal) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Msgs = append(m.Msgs, &types.Any{})
|
||||
if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
m.Messages = append(m.Messages, &types.Any{})
|
||||
if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
@ -4928,7 +4929,7 @@ func (m *MsgCreateProposal) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgCreateProposalResponse) Unmarshal(dAtA []byte) error {
|
||||
func (m *MsgSubmitProposalResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
@ -4951,10 +4952,10 @@ func (m *MsgCreateProposalResponse) Unmarshal(dAtA []byte) error {
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: MsgCreateProposalResponse: wiretype end group for non-group")
|
||||
return fmt.Errorf("proto: MsgSubmitProposalResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgCreateProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
return fmt.Errorf("proto: MsgSubmitProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
@ -5230,9 +5231,9 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error {
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Choice", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType)
|
||||
}
|
||||
m.Choice = 0
|
||||
m.Option = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
@ -5242,7 +5243,7 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Choice |= Choice(b&0x7F) << shift
|
||||
m.Option |= VoteOption(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ type DecisionPolicy interface {
|
||||
|
||||
ValidateBasic() error
|
||||
GetTimeout() time.Duration
|
||||
Allow(tally Tally, totalPower string, votingDuration time.Duration) (DecisionPolicyResult, error)
|
||||
Allow(tallyResult TallyResult, totalPower string, votingDuration time.Duration) (DecisionPolicyResult, error)
|
||||
Validate(g GroupInfo) error
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ func (p ThresholdDecisionPolicy) ValidateBasic() error {
|
||||
}
|
||||
|
||||
// Allow allows a proposal to pass when the tally of yes votes equals or exceeds the threshold before the timeout.
|
||||
func (p ThresholdDecisionPolicy) Allow(tally Tally, totalPower string, votingDuration time.Duration) (DecisionPolicyResult, error) {
|
||||
func (p ThresholdDecisionPolicy) Allow(tallyResult TallyResult, totalPower string, votingDuration time.Duration) (DecisionPolicyResult, error) {
|
||||
timeout := p.Timeout
|
||||
if timeout <= votingDuration {
|
||||
return DecisionPolicyResult{Allow: false, Final: true}, nil
|
||||
@ -62,7 +62,7 @@ func (p ThresholdDecisionPolicy) Allow(tally Tally, totalPower string, votingDur
|
||||
if err != nil {
|
||||
return DecisionPolicyResult{}, err
|
||||
}
|
||||
yesCount, err := math.NewNonNegativeDecFromString(tally.YesCount)
|
||||
yesCount, err := math.NewNonNegativeDecFromString(tallyResult.YesCount)
|
||||
if err != nil {
|
||||
return DecisionPolicyResult{}, err
|
||||
}
|
||||
@ -74,7 +74,7 @@ func (p ThresholdDecisionPolicy) Allow(tally Tally, totalPower string, votingDur
|
||||
if err != nil {
|
||||
return DecisionPolicyResult{}, err
|
||||
}
|
||||
totalCounts, err := tally.TotalCounts()
|
||||
totalCounts, err := tallyResult.TotalCounts()
|
||||
if err != nil {
|
||||
return DecisionPolicyResult{}, err
|
||||
}
|
||||
@ -137,7 +137,7 @@ func (p *PercentageDecisionPolicy) Validate(g GroupInfo) error {
|
||||
}
|
||||
|
||||
// Allow allows a proposal to pass when the tally of yes votes equals or exceeds the percentage threshold before the timeout.
|
||||
func (p PercentageDecisionPolicy) Allow(tally Tally, totalPower string, votingDuration time.Duration) (DecisionPolicyResult, error) {
|
||||
func (p PercentageDecisionPolicy) Allow(tally TallyResult, totalPower string, votingDuration time.Duration) (DecisionPolicyResult, error) {
|
||||
timeout := p.Timeout
|
||||
if timeout <= votingDuration {
|
||||
return DecisionPolicyResult{Allow: false, Final: true}, nil
|
||||
@ -237,11 +237,11 @@ func (g GroupPolicyInfo) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
|
||||
}
|
||||
|
||||
func (g GroupInfo) PrimaryKeyFields() []interface{} {
|
||||
return []interface{}{g.GroupId}
|
||||
return []interface{}{g.Id}
|
||||
}
|
||||
|
||||
func (g GroupInfo) ValidateBasic() error {
|
||||
if g.GroupId == 0 {
|
||||
if g.Id == 0 {
|
||||
return sdkerrors.Wrap(errors.ErrEmpty, "group's GroupId")
|
||||
}
|
||||
|
||||
@ -268,7 +268,7 @@ func (g GroupPolicyInfo) PrimaryKeyFields() []interface{} {
|
||||
}
|
||||
|
||||
func (g Proposal) PrimaryKeyFields() []interface{} {
|
||||
return []interface{}{g.ProposalId}
|
||||
return []interface{}{g.Id}
|
||||
}
|
||||
|
||||
func (g GroupPolicyInfo) ValidateBasic() error {
|
||||
@ -320,7 +320,7 @@ func (g GroupMember) ValidateBasic() error {
|
||||
|
||||
func (p Proposal) ValidateBasic() error {
|
||||
|
||||
if p.ProposalId == 0 {
|
||||
if p.Id == 0 {
|
||||
return sdkerrors.Wrap(errors.ErrEmpty, "proposal id")
|
||||
}
|
||||
_, err := sdk.AccAddressFromBech32(p.Address)
|
||||
@ -333,21 +333,21 @@ func (p Proposal) ValidateBasic() error {
|
||||
if p.GroupPolicyVersion == 0 {
|
||||
return sdkerrors.Wrap(errors.ErrEmpty, "proposal group policy version")
|
||||
}
|
||||
_, err = p.VoteState.GetYesCount()
|
||||
_, err = p.FinalTallyResult.GetYesCount()
|
||||
if err != nil {
|
||||
return sdkerrors.Wrap(err, "proposal VoteState yes count")
|
||||
return sdkerrors.Wrap(err, "proposal FinalTallyResult yes count")
|
||||
}
|
||||
_, err = p.VoteState.GetNoCount()
|
||||
_, err = p.FinalTallyResult.GetNoCount()
|
||||
if err != nil {
|
||||
return sdkerrors.Wrap(err, "proposal VoteState no count")
|
||||
return sdkerrors.Wrap(err, "proposal FinalTallyResult no count")
|
||||
}
|
||||
_, err = p.VoteState.GetAbstainCount()
|
||||
_, err = p.FinalTallyResult.GetAbstainCount()
|
||||
if err != nil {
|
||||
return sdkerrors.Wrap(err, "proposal VoteState abstain count")
|
||||
return sdkerrors.Wrap(err, "proposal FinalTallyResult abstain count")
|
||||
}
|
||||
_, err = p.VoteState.GetVetoCount()
|
||||
_, err = p.FinalTallyResult.GetNoWithVetoCount()
|
||||
if err != nil {
|
||||
return sdkerrors.Wrap(err, "proposal VoteState veto count")
|
||||
return sdkerrors.Wrap(err, "proposal FinalTallyResult veto count")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -371,11 +371,11 @@ func (v Vote) ValidateBasic() error {
|
||||
if v.ProposalId == 0 {
|
||||
return sdkerrors.Wrap(errors.ErrEmpty, "voter ProposalId")
|
||||
}
|
||||
if v.Choice == Choice_CHOICE_UNSPECIFIED {
|
||||
return sdkerrors.Wrap(errors.ErrEmpty, "voter choice")
|
||||
if v.Option == VOTE_OPTION_UNSPECIFIED {
|
||||
return sdkerrors.Wrap(errors.ErrEmpty, "voter vote option")
|
||||
}
|
||||
if _, ok := Choice_name[int32(v.Choice)]; !ok {
|
||||
return sdkerrors.Wrap(errors.ErrInvalid, "choice")
|
||||
if _, ok := VoteOption_name[int32(v.Option)]; !ok {
|
||||
return sdkerrors.Wrap(errors.ErrInvalid, "vote option")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -403,7 +403,7 @@ func unpackGroupPolicies(unpacker codectypes.AnyUnpacker, accs []*GroupPolicyInf
|
||||
|
||||
type operation func(x, y math.Dec) (math.Dec, error)
|
||||
|
||||
func (t *Tally) operation(vote Vote, weight string, op operation) error {
|
||||
func (t *TallyResult) operation(vote Vote, weight string, op operation) error {
|
||||
weightDec, err := math.NewPositiveDecFromString(weight)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -421,43 +421,43 @@ func (t *Tally) operation(vote Vote, weight string, op operation) error {
|
||||
if err != nil {
|
||||
return sdkerrors.Wrap(err, "abstain count")
|
||||
}
|
||||
vetoCount, err := t.GetVetoCount()
|
||||
vetoCount, err := t.GetNoWithVetoCount()
|
||||
if err != nil {
|
||||
return sdkerrors.Wrap(err, "veto count")
|
||||
}
|
||||
|
||||
switch vote.Choice {
|
||||
case Choice_CHOICE_YES:
|
||||
switch vote.Option {
|
||||
case VOTE_OPTION_YES:
|
||||
yesCount, err := op(yesCount, weightDec)
|
||||
if err != nil {
|
||||
return sdkerrors.Wrap(err, "yes count")
|
||||
}
|
||||
t.YesCount = yesCount.String()
|
||||
case Choice_CHOICE_NO:
|
||||
case VOTE_OPTION_NO:
|
||||
noCount, err := op(noCount, weightDec)
|
||||
if err != nil {
|
||||
return sdkerrors.Wrap(err, "no count")
|
||||
}
|
||||
t.NoCount = noCount.String()
|
||||
case Choice_CHOICE_ABSTAIN:
|
||||
case VOTE_OPTION_ABSTAIN:
|
||||
abstainCount, err := op(abstainCount, weightDec)
|
||||
if err != nil {
|
||||
return sdkerrors.Wrap(err, "abstain count")
|
||||
}
|
||||
t.AbstainCount = abstainCount.String()
|
||||
case Choice_CHOICE_VETO:
|
||||
case VOTE_OPTION_NO_WITH_VETO:
|
||||
vetoCount, err := op(vetoCount, weightDec)
|
||||
if err != nil {
|
||||
return sdkerrors.Wrap(err, "veto count")
|
||||
}
|
||||
t.VetoCount = vetoCount.String()
|
||||
t.NoWithVetoCount = vetoCount.String()
|
||||
default:
|
||||
return sdkerrors.Wrapf(errors.ErrInvalid, "unknown choice %s", vote.Choice.String())
|
||||
return sdkerrors.Wrapf(errors.ErrInvalid, "unknown vote option %s", vote.Option.String())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t Tally) GetYesCount() (math.Dec, error) {
|
||||
func (t TallyResult) GetYesCount() (math.Dec, error) {
|
||||
yesCount, err := math.NewNonNegativeDecFromString(t.YesCount)
|
||||
if err != nil {
|
||||
return math.Dec{}, err
|
||||
@ -465,7 +465,7 @@ func (t Tally) GetYesCount() (math.Dec, error) {
|
||||
return yesCount, nil
|
||||
}
|
||||
|
||||
func (t Tally) GetNoCount() (math.Dec, error) {
|
||||
func (t TallyResult) GetNoCount() (math.Dec, error) {
|
||||
noCount, err := math.NewNonNegativeDecFromString(t.NoCount)
|
||||
if err != nil {
|
||||
return math.Dec{}, err
|
||||
@ -473,7 +473,7 @@ func (t Tally) GetNoCount() (math.Dec, error) {
|
||||
return noCount, nil
|
||||
}
|
||||
|
||||
func (t Tally) GetAbstainCount() (math.Dec, error) {
|
||||
func (t TallyResult) GetAbstainCount() (math.Dec, error) {
|
||||
abstainCount, err := math.NewNonNegativeDecFromString(t.AbstainCount)
|
||||
if err != nil {
|
||||
return math.Dec{}, err
|
||||
@ -481,15 +481,15 @@ func (t Tally) GetAbstainCount() (math.Dec, error) {
|
||||
return abstainCount, nil
|
||||
}
|
||||
|
||||
func (t Tally) GetVetoCount() (math.Dec, error) {
|
||||
vetoCount, err := math.NewNonNegativeDecFromString(t.VetoCount)
|
||||
func (t TallyResult) GetNoWithVetoCount() (math.Dec, error) {
|
||||
vetoCount, err := math.NewNonNegativeDecFromString(t.NoWithVetoCount)
|
||||
if err != nil {
|
||||
return math.Dec{}, err
|
||||
}
|
||||
return vetoCount, nil
|
||||
}
|
||||
|
||||
func (t *Tally) Add(vote Vote, weight string) error {
|
||||
func (t *TallyResult) Add(vote Vote, weight string) error {
|
||||
if err := t.operation(vote, weight, math.Add); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -497,7 +497,7 @@ func (t *Tally) Add(vote Vote, weight string) error {
|
||||
}
|
||||
|
||||
// TotalCounts is the sum of all weights.
|
||||
func (t Tally) TotalCounts() (math.Dec, error) {
|
||||
func (t TallyResult) TotalCounts() (math.Dec, error) {
|
||||
yesCount, err := t.GetYesCount()
|
||||
if err != nil {
|
||||
return math.Dec{}, sdkerrors.Wrap(err, "yes count")
|
||||
@ -510,7 +510,7 @@ func (t Tally) TotalCounts() (math.Dec, error) {
|
||||
if err != nil {
|
||||
return math.Dec{}, sdkerrors.Wrap(err, "abstain count")
|
||||
}
|
||||
vetoCount, err := t.GetVetoCount()
|
||||
vetoCount, err := t.GetNoWithVetoCount()
|
||||
if err != nil {
|
||||
return math.Dec{}, sdkerrors.Wrap(err, "veto count")
|
||||
}
|
||||
@ -535,12 +535,12 @@ func (t Tally) TotalCounts() (math.Dec, error) {
|
||||
return totalCounts, nil
|
||||
}
|
||||
|
||||
// ChoiceFromString returns a Choice from a string. It returns an error
|
||||
// VoteOptionFromString returns a VoteOption from a string. It returns an error
|
||||
// if the string is invalid.
|
||||
func ChoiceFromString(str string) (Choice, error) {
|
||||
choice, ok := Choice_value[str]
|
||||
func VoteOptionFromString(str string) (VoteOption, error) {
|
||||
vo, ok := VoteOption_value[str]
|
||||
if !ok {
|
||||
return Choice_CHOICE_UNSPECIFIED, fmt.Errorf("'%s' is not a valid vote choice", str)
|
||||
return VOTE_OPTION_UNSPECIFIED, fmt.Errorf("'%s' is not a valid vote option", str)
|
||||
}
|
||||
return Choice(choice), nil
|
||||
return VoteOption(vo), nil
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,7 @@ func TestPercentageDecisionPolicyAllow(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
policy *group.PercentageDecisionPolicy
|
||||
tally *group.Tally
|
||||
tally *group.TallyResult
|
||||
totalPower string
|
||||
votingDuration time.Duration
|
||||
result group.DecisionPolicyResult
|
||||
@ -24,11 +24,11 @@ func TestPercentageDecisionPolicyAllow(t *testing.T) {
|
||||
Percentage: "0.5",
|
||||
Timeout: time.Second * 100,
|
||||
},
|
||||
&group.Tally{
|
||||
YesCount: "2",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
&group.TallyResult{
|
||||
YesCount: "2",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
"3",
|
||||
time.Duration(time.Second * 50),
|
||||
@ -43,11 +43,11 @@ func TestPercentageDecisionPolicyAllow(t *testing.T) {
|
||||
Percentage: "0.5",
|
||||
Timeout: time.Second * 100,
|
||||
},
|
||||
&group.Tally{
|
||||
YesCount: "2",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
&group.TallyResult{
|
||||
YesCount: "2",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
"4",
|
||||
time.Duration(time.Second * 50),
|
||||
@ -62,11 +62,11 @@ func TestPercentageDecisionPolicyAllow(t *testing.T) {
|
||||
Percentage: "0.5",
|
||||
Timeout: time.Second * 100,
|
||||
},
|
||||
&group.Tally{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
&group.TallyResult{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
"3",
|
||||
time.Duration(time.Second * 50),
|
||||
@ -81,11 +81,11 @@ func TestPercentageDecisionPolicyAllow(t *testing.T) {
|
||||
Percentage: "0.5",
|
||||
Timeout: time.Second * 100,
|
||||
},
|
||||
&group.Tally{
|
||||
YesCount: "1",
|
||||
NoCount: "2",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
&group.TallyResult{
|
||||
YesCount: "1",
|
||||
NoCount: "2",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
"3",
|
||||
time.Duration(time.Second * 50),
|
||||
@ -100,11 +100,11 @@ func TestPercentageDecisionPolicyAllow(t *testing.T) {
|
||||
Percentage: "0.5",
|
||||
Timeout: time.Second * 100,
|
||||
},
|
||||
&group.Tally{
|
||||
YesCount: "1",
|
||||
NoCount: "2",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
&group.TallyResult{
|
||||
YesCount: "1",
|
||||
NoCount: "2",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
"4",
|
||||
time.Duration(time.Second * 50),
|
||||
@ -119,11 +119,11 @@ func TestPercentageDecisionPolicyAllow(t *testing.T) {
|
||||
Percentage: "0.5",
|
||||
Timeout: time.Second * 100,
|
||||
},
|
||||
&group.Tally{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
&group.TallyResult{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
"3",
|
||||
time.Duration(time.Second * 50),
|
||||
@ -138,11 +138,11 @@ func TestPercentageDecisionPolicyAllow(t *testing.T) {
|
||||
Percentage: "0.5",
|
||||
Timeout: time.Second * 10,
|
||||
},
|
||||
&group.Tally{
|
||||
YesCount: "2",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
&group.TallyResult{
|
||||
YesCount: "2",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
"3",
|
||||
time.Duration(time.Second * 50),
|
||||
@ -165,7 +165,7 @@ func TestThresholdDecisionPolicyAllow(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
policy *group.ThresholdDecisionPolicy
|
||||
tally *group.Tally
|
||||
tally *group.TallyResult
|
||||
totalPower string
|
||||
votingDuration time.Duration
|
||||
result group.DecisionPolicyResult
|
||||
@ -176,11 +176,11 @@ func TestThresholdDecisionPolicyAllow(t *testing.T) {
|
||||
Threshold: "3",
|
||||
Timeout: time.Second * 100,
|
||||
},
|
||||
&group.Tally{
|
||||
YesCount: "3",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
&group.TallyResult{
|
||||
YesCount: "3",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
"3",
|
||||
time.Duration(time.Second * 50),
|
||||
@ -195,11 +195,11 @@ func TestThresholdDecisionPolicyAllow(t *testing.T) {
|
||||
Threshold: "3",
|
||||
Timeout: time.Second * 100,
|
||||
},
|
||||
&group.Tally{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
&group.TallyResult{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
"3",
|
||||
time.Duration(time.Second * 50),
|
||||
@ -214,11 +214,11 @@ func TestThresholdDecisionPolicyAllow(t *testing.T) {
|
||||
Threshold: "3",
|
||||
Timeout: time.Second * 100,
|
||||
},
|
||||
&group.Tally{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
&group.TallyResult{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
"2",
|
||||
time.Duration(time.Second * 50),
|
||||
@ -233,11 +233,11 @@ func TestThresholdDecisionPolicyAllow(t *testing.T) {
|
||||
Threshold: "3",
|
||||
Timeout: time.Second * 100,
|
||||
},
|
||||
&group.Tally{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
&group.TallyResult{
|
||||
YesCount: "1",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
"3",
|
||||
time.Duration(time.Second * 50),
|
||||
@ -252,11 +252,11 @@ func TestThresholdDecisionPolicyAllow(t *testing.T) {
|
||||
Threshold: "3",
|
||||
Timeout: time.Second * 10,
|
||||
},
|
||||
&group.Tally{
|
||||
YesCount: "3",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
VetoCount: "0",
|
||||
&group.TallyResult{
|
||||
YesCount: "3",
|
||||
NoCount: "0",
|
||||
AbstainCount: "0",
|
||||
NoWithVetoCount: "0",
|
||||
},
|
||||
"3",
|
||||
time.Duration(time.Second * 50),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user