refactor(group): API naming audit (#11515)

## Description

ref: #10968 



---

### 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:
Amaury 2022-04-06 13:16:23 +02:00 committed by GitHub
parent f133317cfe
commit e52556b916
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 1393 additions and 1526 deletions

View File

@ -3793,6 +3793,8 @@ func (x *fastReflection_EventLeaveGroup) ProtoMethods() *protoiface.Methods {
}
}
// Since: cosmos-sdk 0.46
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0

View File

@ -1202,6 +1202,8 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods {
}
}
// Since: cosmos-sdk 0.46
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0

View File

@ -12819,6 +12819,8 @@ func (x *fastReflection_QueryTallyResultResponse) ProtoMethods() *protoiface.Met
}
}
// Since: cosmos-sdk 0.46
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0

View File

@ -46,7 +46,11 @@ type QueryClient interface {
VotesByVoter(ctx context.Context, in *QueryVotesByVoterRequest, opts ...grpc.CallOption) (*QueryVotesByVoterResponse, error)
// GroupsByMember queries groups by member address.
GroupsByMember(ctx context.Context, in *QueryGroupsByMemberRequest, opts ...grpc.CallOption) (*QueryGroupsByMemberResponse, error)
// TallyResult queries the tally of a proposal votes.
// TallyResult returns the tally result of a proposal. If the proposal is
// still in voting period, then this query computes the current tally state,
// which might not be final. On the other hand, if the proposal is final,
// then it simply returns the `final_tally_result` state stored in the
// proposal itself.
TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error)
}
@ -203,7 +207,11 @@ type QueryServer interface {
VotesByVoter(context.Context, *QueryVotesByVoterRequest) (*QueryVotesByVoterResponse, error)
// GroupsByMember queries groups by member address.
GroupsByMember(context.Context, *QueryGroupsByMemberRequest) (*QueryGroupsByMemberResponse, error)
// TallyResult queries the tally of a proposal votes.
// TallyResult returns the tally result of a proposal. If the proposal is
// still in voting period, then this query computes the current tally state,
// which might not be final. On the other hand, if the proposal is final,
// then it simply returns the `final_tally_result` state stored in the
// proposal itself.
TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error)
mustEmbedUnimplementedQueryServer()
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
// Since: cosmos-sdk 0.46
syntax = "proto3";
package cosmos.group.v1;

View File

@ -1,3 +1,4 @@
// Since: cosmos-sdk 0.46
syntax = "proto3";
package cosmos.group.v1;

View File

@ -1,3 +1,4 @@
// Since: cosmos-sdk 0.46
syntax = "proto3";
package cosmos.group.v1;
@ -73,7 +74,11 @@ service Query {
option (google.api.http).get = "/cosmos/group/v1/groups_by_member/{address}";
};
// TallyResult queries the tally of a proposal votes.
// TallyResult returns the tally result of a proposal. If the proposal is
// still in voting period, then this query computes the current tally state,
// which might not be final. On the other hand, if the proposal is final,
// then it simply returns the `final_tally_result` state stored in the
// proposal itself.
rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) {
option (google.api.http).get = "/cosmos/group/v1/proposals/{proposal_id}/tally";
};

View File

@ -1,3 +1,4 @@
// Since: cosmos-sdk 0.46
syntax = "proto3";
package cosmos.group.v1;
@ -65,6 +66,7 @@ service Msg {
// MsgCreateGroup is the Msg/CreateGroup request type.
message MsgCreateGroup {
option (cosmos.msg.v1.signer) = "admin";
// admin is the account address of the group admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
@ -171,8 +173,8 @@ message MsgUpdateGroupPolicyAdmin {
// admin is the account address of the group admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// address is the account address of the group policy.
string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// group_policy_address is the account address of the group policy.
string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// new_admin is the new group policy admin.
string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
@ -180,6 +182,7 @@ message MsgUpdateGroupPolicyAdmin {
// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type.
message MsgCreateGroupWithPolicy {
option (cosmos.msg.v1.signer) = "admin";
option (gogoproto.goproto_getters) = false;
// admin is the account address of the group and group policy admin.
@ -194,8 +197,9 @@ message MsgCreateGroupWithPolicy {
// group_policy_metadata is any arbitrary metadata attached to the group policy.
string group_policy_metadata = 4;
// group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin.
bool group_policy_as_admin = 5;
// group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group
// and group policy admin.
bool group_policy_as_admin = 5;
// decision_policy specifies the group policy's decision policy.
google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "DecisionPolicy"];
@ -223,8 +227,8 @@ message MsgUpdateGroupPolicyDecisionPolicy {
// admin is the account address of the group admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// address is the account address of group policy.
string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// group_policy_address is the account address of group policy.
string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// decision_policy is the updated group policy's decision policy.
google.protobuf.Any decision_policy = 3 [(cosmos_proto.accepts_interface) = "DecisionPolicy"];
@ -240,8 +244,8 @@ message MsgUpdateGroupPolicyMetadata {
// admin is the account address of the group admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// address is the account address of group policy.
string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// group_policy_address is the account address of group policy.
string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// metadata is the updated group policy metadata.
string metadata = 3;
@ -274,8 +278,8 @@ message MsgSubmitProposal {
option (gogoproto.goproto_getters) = false;
// address is the account address of group policy.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// group_policy_address is the account address of group policy.
string group_policy_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// proposers are the account addresses of the proposers.
// Proposers signatures will be counted as yes votes.
@ -302,6 +306,8 @@ message MsgSubmitProposalResponse {
// MsgWithdrawProposal is the Msg/WithdrawProposal request type.
message MsgWithdrawProposal {
option (cosmos.msg.v1.signer) = "address";
// proposal is the unique ID of the proposal.
uint64 proposal_id = 1;
@ -342,8 +348,8 @@ message MsgExec {
// proposal is the unique ID of the proposal.
uint64 proposal_id = 1;
// signer is the account address used to execute the proposal.
string signer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// executor is the account address used to execute the proposal.
string executor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}
// MsgExecResponse is the Msg/Exec request type.

View File

@ -1,3 +1,4 @@
// Since: cosmos-sdk 0.46
syntax = "proto3";
package cosmos.group.v1;
@ -20,7 +21,7 @@ message Member {
// weight is the member's voting weight that should be greater than 0.
string weight = 2;
// metadata is any arbitrary metadata to attached to the member.
// metadata is any arbitrary metadata attached to the member.
string metadata = 3;
// added_at is a timestamp specifying when a member was added.
@ -34,22 +35,34 @@ message Members {
repeated Member members = 1 [(gogoproto.nullable) = false];
}
// ThresholdDecisionPolicy implements the DecisionPolicy interface
// ThresholdDecisionPolicy is a decision policy where a proposal passes when it
// satisfies the two following conditions:
// 1. The sum of all `YES` voters' weights is greater or equal than the defined
// `threshold`.
// 2. The voting and execution periods of the proposal respect the parameters
// given by `windows`.
message ThresholdDecisionPolicy {
option (cosmos_proto.implements_interface) = "DecisionPolicy";
// threshold is the minimum weighted sum of yes votes that must be met or exceeded for a proposal to succeed.
// threshold is the minimum weighted sum of `YES` votes that must be met or
// exceeded for a proposal to succeed.
string threshold = 1;
// windows defines the different windows for voting and execution.
DecisionPolicyWindows windows = 2;
}
// PercentageDecisionPolicy implements the DecisionPolicy interface
// PercentageDecisionPolicy is a decision policy where a proposal passes when
// it satisfies the two following conditions:
// 1. The percentage of all `YES` voters' weights out of the total group weight
// is greater or equal than the given `percentage`.
// 2. The voting and execution periods of the proposal respect the parameters
// given by `windows`.
message PercentageDecisionPolicy {
option (cosmos_proto.implements_interface) = "DecisionPolicy";
// percentage is the minimum percentage the weighted sum of yes votes must meet for a proposal to succeed.
// percentage is the minimum percentage the weighted sum of `YES` votes must
// meet for a proposal to succeed.
string percentage = 1;
// windows defines the different windows for voting and execution.
@ -80,7 +93,8 @@ message DecisionPolicyWindows {
enum VoteOption {
option (gogoproto.goproto_enum_prefix) = false;
// VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
// VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will
// return an error.
VOTE_OPTION_UNSPECIFIED = 0;
// VOTE_OPTION_YES defines a yes vote option.
VOTE_OPTION_YES = 1;
@ -169,8 +183,8 @@ message Proposal {
// 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"];
// group_policy_address is the account address of group policy.
string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// metadata is any arbitrary metadata to attached to the proposal.
string metadata = 3;
@ -181,39 +195,37 @@ message Proposal {
// 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.
// group_version tracks the version of the group at proposal submission.
// This field is here for informational purposes only.
uint64 group_version = 6;
// group_policy_version tracks the version of the group policy that this proposal corresponds to.
// When a decision policy is changed, existing proposals from previous policy versions will become invalid.
// group_policy_version tracks the version of the group policy at proposal submission.
// When a decision policy is changed, existing proposals from previous policy
// versions will become invalid with the `ABORTED` status.
// This field is here for informational purposes only.
uint64 group_policy_version = 7;
// 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.
ProposalResult result = 9;
// 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];
// proposal for each vote option. It is empty at submission, and only
// populated after tallying, at voting period end or at proposal execution,
// whichever happens first.
TallyResult final_tally_result = 9 [(gogoproto.nullable) = false];
// voting_period_end is the timestamp before which voting must be done.
// Unless a successfull MsgExec is called before (to execute a proposal whose
// tally is successful before the voting period ends), tallying will be done
// at this point, and the `final_tally_result`, as well
// as `status` and `result` fields will be accordingly updated.
google.protobuf.Timestamp voting_period_end = 11 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
// at this point, and the `final_tally_result`and `status` fields will be
// accordingly updated.
google.protobuf.Timestamp voting_period_end = 10 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
// executor_result is the final result based on the votes and election rule. Initial value is NotRun.
ProposalExecutorResult executor_result = 12;
ProposalExecutorResult executor_result = 11;
// messages is a list of Msgs that will be executed if the proposal passes.
repeated google.protobuf.Any messages = 13;
// messages is a list of `sdk.Msg`s that will be executed if the proposal passes.
repeated google.protobuf.Any messages = 12;
}
// ProposalStatus defines proposal statuses.
@ -223,35 +235,24 @@ enum ProposalStatus {
// An empty value is invalid and not allowed.
PROPOSAL_STATUS_UNSPECIFIED = 0;
// Initial status of a proposal when persisted.
// Initial status of a proposal when submitted.
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 final tally is done and the outcome
// passes the group policy's decision policy.
PROPOSAL_STATUS_ACCEPTED = 2;
// Final status of a proposal when the group was modified before the final tally.
PROPOSAL_STATUS_ABORTED = 3;
// Final status of a proposal when the final tally is done and the outcome
// is rejected by the group policy's decision policy.
PROPOSAL_STATUS_REJECTED = 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;
}
// Final status of a proposal when the group policy is modified before the
// final tally.
PROPOSAL_STATUS_ABORTED = 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;
// A proposal can be withdrawn before the voting start time by the owner.
// When this happens the final status is Withdrawn.
PROPOSAL_STATUS_WITHDRAWN = 5;
}
// ProposalExecutorResult defines types of proposal executor results.
@ -281,7 +282,7 @@ message TallyResult {
// abstain_count is the weighted sum of abstainers.
string abstain_count = 2;
// no is the weighted sum of no votes.
// no_count is the weighted sum of no votes.
string no_count = 3;
// no_with_veto_count is the weighted sum of veto.

View File

@ -448,9 +448,9 @@ func MsgUpdateGroupPolicyAdminCmd() *cobra.Command {
}
msg := &group.MsgUpdateGroupPolicyAdmin{
Admin: clientCtx.GetFromAddress().String(),
Address: args[1],
NewAdmin: args[2],
Admin: clientCtx.GetFromAddress().String(),
GroupPolicyAddress: args[1],
NewAdmin: args[2],
}
if err = msg.ValidateBasic(); err != nil {
return fmt.Errorf("message validation failed: %w", err)
@ -532,9 +532,9 @@ func MsgUpdateGroupPolicyMetadataCmd() *cobra.Command {
}
msg := &group.MsgUpdateGroupPolicyMetadata{
Admin: clientCtx.GetFromAddress().String(),
Address: args[1],
Metadata: args[2],
Admin: clientCtx.GetFromAddress().String(),
GroupPolicyAddress: args[1],
Metadata: args[2],
}
if err = msg.ValidateBasic(); err != nil {
return fmt.Errorf("message validation failed: %w", err)
@ -763,7 +763,7 @@ func MsgExecCmd() *cobra.Command {
msg := &group.MsgExec{
ProposalId: proposalID,
Signer: clientCtx.GetFromAddress().String(),
Executor: clientCtx.GetFromAddress().String(),
}
if err != nil {
return err

View File

@ -54,8 +54,8 @@ func (s GenesisState) Validate() error {
for _, p := range s.Proposals {
// check that group policy with proposal address exists
if _, exists := groupPolicies[p.Address]; !exists {
return sdkerrors.Wrap(sdkerrors.ErrNotFound, fmt.Sprintf("group policy account with address %s doesn't correspond to proposal address", p.Address))
if _, exists := groupPolicies[p.GroupPolicyAddress]; !exists {
return sdkerrors.Wrap(sdkerrors.ErrNotFound, fmt.Sprintf("group policy account with address %s doesn't correspond to proposal address", p.GroupPolicyAddress))
}
if err := p.ValidateBasic(); err != nil {

View File

@ -55,7 +55,7 @@ func TestGenesisStateValidate(t *testing.T) {
proposal := &Proposal{
Id: 1,
Address: accAddr.String(),
GroupPolicyAddress: accAddr.String(),
Metadata: "proposal metadata",
GroupVersion: 1,
GroupPolicyVersion: 1,
@ -63,8 +63,7 @@ func TestGenesisStateValidate(t *testing.T) {
memberAddr.String(),
},
SubmitTime: submittedAt,
Status: PROPOSAL_STATUS_CLOSED,
Result: PROPOSAL_RESULT_ACCEPTED,
Status: PROPOSAL_STATUS_ACCEPTED,
FinalTallyResult: TallyResult{
YesCount: "1",
NoCount: "0",
@ -376,7 +375,7 @@ func TestGenesisStateValidate(t *testing.T) {
Proposals: []*Proposal{
{
Id: 0,
Address: accAddr.String(),
GroupPolicyAddress: accAddr.String(),
Metadata: "proposal metadata",
GroupVersion: 1,
GroupPolicyVersion: 1,
@ -403,7 +402,7 @@ func TestGenesisStateValidate(t *testing.T) {
Proposals: []*Proposal{
{
Id: 1,
Address: "invalid address",
GroupPolicyAddress: "invalid address",
Metadata: "proposal metadata",
GroupVersion: 1,
GroupPolicyVersion: 1,
@ -430,7 +429,7 @@ func TestGenesisStateValidate(t *testing.T) {
Proposals: []*Proposal{
{
Id: 1,
Address: accAddr.String(),
GroupPolicyAddress: accAddr.String(),
Metadata: "proposal metadata",
GroupVersion: 0,
GroupPolicyVersion: 1,
@ -457,7 +456,7 @@ func TestGenesisStateValidate(t *testing.T) {
Proposals: []*Proposal{
{
Id: 1,
Address: accAddr.String(),
GroupPolicyAddress: accAddr.String(),
Metadata: "proposal metadata",
GroupVersion: 1,
GroupPolicyVersion: 0,
@ -484,7 +483,7 @@ func TestGenesisStateValidate(t *testing.T) {
Proposals: []*Proposal{
{
Id: 1,
Address: accAddr.String(),
GroupPolicyAddress: accAddr.String(),
Metadata: "proposal metadata",
GroupVersion: 1,
GroupPolicyVersion: 1,
@ -492,8 +491,7 @@ func TestGenesisStateValidate(t *testing.T) {
memberAddr.String(),
},
SubmitTime: submittedAt,
Status: PROPOSAL_STATUS_CLOSED,
Result: PROPOSAL_RESULT_ACCEPTED,
Status: PROPOSAL_STATUS_ACCEPTED,
FinalTallyResult: TallyResult{
YesCount: "-1",
NoCount: "0",
@ -523,7 +521,7 @@ func TestGenesisStateValidate(t *testing.T) {
Proposals: []*Proposal{
{
Id: 1,
Address: accAddr.String(),
GroupPolicyAddress: accAddr.String(),
Metadata: "proposal metadata",
GroupVersion: 1,
GroupPolicyVersion: 1,
@ -531,8 +529,7 @@ func TestGenesisStateValidate(t *testing.T) {
memberAddr.String(),
},
SubmitTime: submittedAt,
Status: PROPOSAL_STATUS_CLOSED,
Result: PROPOSAL_RESULT_ACCEPTED,
Status: PROPOSAL_STATUS_ACCEPTED,
FinalTallyResult: TallyResult{
YesCount: "0",
NoCount: "-1",
@ -562,7 +559,7 @@ func TestGenesisStateValidate(t *testing.T) {
Proposals: []*Proposal{
{
Id: 1,
Address: accAddr.String(),
GroupPolicyAddress: accAddr.String(),
Metadata: "proposal metadata",
GroupVersion: 1,
GroupPolicyVersion: 1,
@ -570,8 +567,7 @@ func TestGenesisStateValidate(t *testing.T) {
memberAddr.String(),
},
SubmitTime: submittedAt,
Status: PROPOSAL_STATUS_CLOSED,
Result: PROPOSAL_RESULT_ACCEPTED,
Status: PROPOSAL_STATUS_ACCEPTED,
FinalTallyResult: TallyResult{
YesCount: "0",
NoCount: "0",
@ -601,7 +597,7 @@ func TestGenesisStateValidate(t *testing.T) {
Proposals: []*Proposal{
{
Id: 1,
Address: accAddr.String(),
GroupPolicyAddress: accAddr.String(),
Metadata: "proposal metadata",
GroupVersion: 1,
GroupPolicyVersion: 1,
@ -609,8 +605,7 @@ func TestGenesisStateValidate(t *testing.T) {
memberAddr.String(),
},
SubmitTime: submittedAt,
Status: PROPOSAL_STATUS_CLOSED,
Result: PROPOSAL_RESULT_ACCEPTED,
Status: PROPOSAL_STATUS_ACCEPTED,
FinalTallyResult: TallyResult{
YesCount: "0",
NoCount: "0",

View File

@ -81,7 +81,7 @@ func (s *GenesisTestSuite) TestInitExportGenesis() {
proposal := &group.Proposal{
Id: 1,
Address: accAddr.String(),
GroupPolicyAddress: accAddr.String(),
Metadata: "proposal metadata",
GroupVersion: 1,
GroupPolicyVersion: 1,
@ -89,8 +89,7 @@ func (s *GenesisTestSuite) TestInitExportGenesis() {
memberAddr.String(),
},
SubmitTime: submittedAt,
Status: group.PROPOSAL_STATUS_CLOSED,
Result: group.PROPOSAL_RESULT_ACCEPTED,
Status: group.PROPOSAL_STATUS_ACCEPTED,
FinalTallyResult: group.TallyResult{
YesCount: "1",
NoCount: "0",
@ -209,14 +208,13 @@ func (s *GenesisTestSuite) assertGroupPoliciesEqual(g *group.GroupPolicyInfo, ot
func (s *GenesisTestSuite) assertProposalsEqual(g *group.Proposal, other *group.Proposal) {
require := s.Require()
require.Equal(g.Id, other.Id)
require.Equal(g.Address, other.Address)
require.Equal(g.GroupPolicyAddress, other.GroupPolicyAddress)
require.Equal(g.Metadata, other.Metadata)
require.Equal(g.Proposers, other.Proposers)
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.FinalTallyResult, other.FinalTallyResult)
require.Equal(g.VotingPeriodEnd, other.VotingPeriodEnd)
require.Equal(g.ExecutorResult, other.ExecutorResult)

View File

@ -16,10 +16,11 @@ import (
var _ group.QueryServer = Keeper{}
func (q Keeper) GroupInfo(goCtx context.Context, request *group.QueryGroupInfoRequest) (*group.QueryGroupInfoResponse, error) {
// GroupInfo queries info about a group.
func (k Keeper) GroupInfo(goCtx context.Context, request *group.QueryGroupInfoRequest) (*group.QueryGroupInfoResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
groupID := request.GroupId
groupInfo, err := q.getGroupInfo(ctx, groupID)
groupInfo, err := k.getGroupInfo(ctx, groupID)
if err != nil {
return nil, sdkerrors.Wrap(err, "group")
}
@ -27,15 +28,16 @@ func (q Keeper) GroupInfo(goCtx context.Context, request *group.QueryGroupInfoRe
return &group.QueryGroupInfoResponse{Info: &groupInfo}, nil
}
func (q Keeper) getGroupInfo(ctx sdk.Context, id uint64) (group.GroupInfo, error) {
func (k Keeper) getGroupInfo(ctx sdk.Context, id uint64) (group.GroupInfo, error) {
var obj group.GroupInfo
_, err := q.groupTable.GetOne(ctx.KVStore(q.key), id, &obj)
_, err := k.groupTable.GetOne(ctx.KVStore(k.key), id, &obj)
return obj, err
}
func (q Keeper) GroupPolicyInfo(goCtx context.Context, request *group.QueryGroupPolicyInfoRequest) (*group.QueryGroupPolicyInfoResponse, error) {
// GroupPolicyInfo queries info about a group policy.
func (k Keeper) GroupPolicyInfo(goCtx context.Context, request *group.QueryGroupPolicyInfoRequest) (*group.QueryGroupPolicyInfoResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
groupPolicyInfo, err := q.getGroupPolicyInfo(ctx, request.Address)
groupPolicyInfo, err := k.getGroupPolicyInfo(ctx, request.Address)
if err != nil {
return nil, sdkerrors.Wrap(err, "group policy")
}
@ -43,15 +45,16 @@ func (q Keeper) GroupPolicyInfo(goCtx context.Context, request *group.QueryGroup
return &group.QueryGroupPolicyInfoResponse{Info: &groupPolicyInfo}, nil
}
func (q Keeper) getGroupPolicyInfo(ctx sdk.Context, accountAddress string) (group.GroupPolicyInfo, error) {
func (k Keeper) getGroupPolicyInfo(ctx sdk.Context, accountAddress string) (group.GroupPolicyInfo, error) {
var obj group.GroupPolicyInfo
return obj, q.groupPolicyTable.GetOne(ctx.KVStore(q.key), orm.PrimaryKey(&group.GroupPolicyInfo{Address: accountAddress}), &obj)
return obj, k.groupPolicyTable.GetOne(ctx.KVStore(k.key), orm.PrimaryKey(&group.GroupPolicyInfo{Address: accountAddress}), &obj)
}
func (q Keeper) GroupMembers(goCtx context.Context, request *group.QueryGroupMembersRequest) (*group.QueryGroupMembersResponse, error) {
// GroupMembers queries all members of a group.
func (k Keeper) GroupMembers(goCtx context.Context, request *group.QueryGroupMembersRequest) (*group.QueryGroupMembersResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
groupID := request.GroupId
it, err := q.getGroupMembers(ctx, groupID, request.Pagination)
it, err := k.getGroupMembers(ctx, groupID, request.Pagination)
if err != nil {
return nil, err
}
@ -68,17 +71,18 @@ func (q Keeper) GroupMembers(goCtx context.Context, request *group.QueryGroupMem
}, nil
}
func (q Keeper) getGroupMembers(ctx sdk.Context, id uint64, pageRequest *query.PageRequest) (orm.Iterator, error) {
return q.groupMemberByGroupIndex.GetPaginated(ctx.KVStore(q.key), id, pageRequest)
func (k Keeper) getGroupMembers(ctx sdk.Context, id uint64, pageRequest *query.PageRequest) (orm.Iterator, error) {
return k.groupMemberByGroupIndex.GetPaginated(ctx.KVStore(k.key), id, pageRequest)
}
func (q Keeper) GroupsByAdmin(goCtx context.Context, request *group.QueryGroupsByAdminRequest) (*group.QueryGroupsByAdminResponse, error) {
// GroupsByAdmin queries all groups where a given address is admin.
func (k Keeper) GroupsByAdmin(goCtx context.Context, request *group.QueryGroupsByAdminRequest) (*group.QueryGroupsByAdminResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
addr, err := sdk.AccAddressFromBech32(request.Admin)
if err != nil {
return nil, err
}
it, err := q.getGroupsByAdmin(ctx, addr, request.Pagination)
it, err := k.getGroupsByAdmin(ctx, addr, request.Pagination)
if err != nil {
return nil, err
}
@ -95,14 +99,15 @@ func (q Keeper) GroupsByAdmin(goCtx context.Context, request *group.QueryGroupsB
}, nil
}
func (q Keeper) getGroupsByAdmin(ctx sdk.Context, admin sdk.AccAddress, pageRequest *query.PageRequest) (orm.Iterator, error) {
return q.groupByAdminIndex.GetPaginated(ctx.KVStore(q.key), admin.Bytes(), pageRequest)
func (k Keeper) getGroupsByAdmin(ctx sdk.Context, admin sdk.AccAddress, pageRequest *query.PageRequest) (orm.Iterator, error) {
return k.groupByAdminIndex.GetPaginated(ctx.KVStore(k.key), admin.Bytes(), pageRequest)
}
func (q Keeper) GroupPoliciesByGroup(goCtx context.Context, request *group.QueryGroupPoliciesByGroupRequest) (*group.QueryGroupPoliciesByGroupResponse, error) {
// GroupPoliciesByGroup queries all groups policies of a given group.
func (k Keeper) GroupPoliciesByGroup(goCtx context.Context, request *group.QueryGroupPoliciesByGroupRequest) (*group.QueryGroupPoliciesByGroupResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
groupID := request.GroupId
it, err := q.getGroupPoliciesByGroup(ctx, groupID, request.Pagination)
it, err := k.getGroupPoliciesByGroup(ctx, groupID, request.Pagination)
if err != nil {
return nil, err
}
@ -119,17 +124,19 @@ func (q Keeper) GroupPoliciesByGroup(goCtx context.Context, request *group.Query
}, nil
}
func (q Keeper) getGroupPoliciesByGroup(ctx sdk.Context, id uint64, pageRequest *query.PageRequest) (orm.Iterator, error) {
return q.groupPolicyByGroupIndex.GetPaginated(ctx.KVStore(q.key), id, pageRequest)
func (k Keeper) getGroupPoliciesByGroup(ctx sdk.Context, id uint64, pageRequest *query.PageRequest) (orm.Iterator, error) {
return k.groupPolicyByGroupIndex.GetPaginated(ctx.KVStore(k.key), id, pageRequest)
}
func (q Keeper) GroupPoliciesByAdmin(goCtx context.Context, request *group.QueryGroupPoliciesByAdminRequest) (*group.QueryGroupPoliciesByAdminResponse, error) {
// GroupPoliciesByAdmin queries all groups policies where a given address is
// admin.
func (k Keeper) GroupPoliciesByAdmin(goCtx context.Context, request *group.QueryGroupPoliciesByAdminRequest) (*group.QueryGroupPoliciesByAdminResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
addr, err := sdk.AccAddressFromBech32(request.Admin)
if err != nil {
return nil, err
}
it, err := q.getGroupPoliciesByAdmin(ctx, addr, request.Pagination)
it, err := k.getGroupPoliciesByAdmin(ctx, addr, request.Pagination)
if err != nil {
return nil, err
}
@ -146,14 +153,15 @@ func (q Keeper) GroupPoliciesByAdmin(goCtx context.Context, request *group.Query
}, nil
}
func (q Keeper) getGroupPoliciesByAdmin(ctx sdk.Context, admin sdk.AccAddress, pageRequest *query.PageRequest) (orm.Iterator, error) {
return q.groupPolicyByAdminIndex.GetPaginated(ctx.KVStore(q.key), admin.Bytes(), pageRequest)
func (k Keeper) getGroupPoliciesByAdmin(ctx sdk.Context, admin sdk.AccAddress, pageRequest *query.PageRequest) (orm.Iterator, error) {
return k.groupPolicyByAdminIndex.GetPaginated(ctx.KVStore(k.key), admin.Bytes(), pageRequest)
}
func (q Keeper) Proposal(goCtx context.Context, request *group.QueryProposalRequest) (*group.QueryProposalResponse, error) {
// Proposal queries a proposal.
func (k Keeper) Proposal(goCtx context.Context, request *group.QueryProposalRequest) (*group.QueryProposalResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
proposalID := request.ProposalId
proposal, err := q.getProposal(ctx, proposalID)
proposal, err := k.getProposal(ctx, proposalID)
if err != nil {
return nil, err
}
@ -161,13 +169,14 @@ func (q Keeper) Proposal(goCtx context.Context, request *group.QueryProposalRequ
return &group.QueryProposalResponse{Proposal: &proposal}, nil
}
func (q Keeper) ProposalsByGroupPolicy(goCtx context.Context, request *group.QueryProposalsByGroupPolicyRequest) (*group.QueryProposalsByGroupPolicyResponse, error) {
// Proposal queries all proposals of a group policy.
func (k Keeper) ProposalsByGroupPolicy(goCtx context.Context, request *group.QueryProposalsByGroupPolicyRequest) (*group.QueryProposalsByGroupPolicyResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
addr, err := sdk.AccAddressFromBech32(request.Address)
if err != nil {
return nil, err
}
it, err := q.getProposalsByGroupPolicy(ctx, addr, request.Pagination)
it, err := k.getProposalsByGroupPolicy(ctx, addr, request.Pagination)
if err != nil {
return nil, err
}
@ -184,26 +193,27 @@ func (q Keeper) ProposalsByGroupPolicy(goCtx context.Context, request *group.Que
}, nil
}
func (q Keeper) getProposalsByGroupPolicy(ctx sdk.Context, account sdk.AccAddress, pageRequest *query.PageRequest) (orm.Iterator, error) {
return q.proposalByGroupPolicyIndex.GetPaginated(ctx.KVStore(q.key), account.Bytes(), pageRequest)
func (k Keeper) getProposalsByGroupPolicy(ctx sdk.Context, account sdk.AccAddress, pageRequest *query.PageRequest) (orm.Iterator, error) {
return k.proposalByGroupPolicyIndex.GetPaginated(ctx.KVStore(k.key), account.Bytes(), pageRequest)
}
func (q Keeper) getProposal(ctx sdk.Context, proposalID uint64) (group.Proposal, error) {
func (k Keeper) getProposal(ctx sdk.Context, proposalID uint64) (group.Proposal, error) {
var p group.Proposal
if _, err := q.proposalTable.GetOne(ctx.KVStore(q.key), proposalID, &p); err != nil {
if _, err := k.proposalTable.GetOne(ctx.KVStore(k.key), proposalID, &p); err != nil {
return group.Proposal{}, sdkerrors.Wrap(err, "load proposal")
}
return p, nil
}
func (q Keeper) VoteByProposalVoter(goCtx context.Context, request *group.QueryVoteByProposalVoterRequest) (*group.QueryVoteByProposalVoterResponse, error) {
// VoteByProposalVoter queries a vote given a voter and a proposal ID.
func (k Keeper) VoteByProposalVoter(goCtx context.Context, request *group.QueryVoteByProposalVoterRequest) (*group.QueryVoteByProposalVoterResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
addr, err := sdk.AccAddressFromBech32(request.Voter)
if err != nil {
return nil, err
}
proposalID := request.ProposalId
vote, err := q.getVote(ctx, proposalID, addr)
vote, err := k.getVote(ctx, proposalID, addr)
if err != nil {
return nil, err
}
@ -212,10 +222,11 @@ func (q Keeper) VoteByProposalVoter(goCtx context.Context, request *group.QueryV
}, nil
}
func (q Keeper) VotesByProposal(goCtx context.Context, request *group.QueryVotesByProposalRequest) (*group.QueryVotesByProposalResponse, error) {
// VotesByProposal queries all votes on a proposal.
func (k Keeper) VotesByProposal(goCtx context.Context, request *group.QueryVotesByProposalRequest) (*group.QueryVotesByProposalResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
proposalID := request.ProposalId
it, err := q.getVotesByProposal(ctx, proposalID, request.Pagination)
it, err := k.getVotesByProposal(ctx, proposalID, request.Pagination)
if err != nil {
return nil, err
}
@ -232,13 +243,14 @@ func (q Keeper) VotesByProposal(goCtx context.Context, request *group.QueryVotes
}, nil
}
func (q Keeper) VotesByVoter(goCtx context.Context, request *group.QueryVotesByVoterRequest) (*group.QueryVotesByVoterResponse, error) {
// VotesByProposal queries all votes of a voter.
func (k Keeper) VotesByVoter(goCtx context.Context, request *group.QueryVotesByVoterRequest) (*group.QueryVotesByVoterResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
addr, err := sdk.AccAddressFromBech32(request.Voter)
if err != nil {
return nil, err
}
it, err := q.getVotesByVoter(ctx, addr, request.Pagination)
it, err := k.getVotesByVoter(ctx, addr, request.Pagination)
if err != nil {
return nil, err
}
@ -255,7 +267,8 @@ func (q Keeper) VotesByVoter(goCtx context.Context, request *group.QueryVotesByV
}, nil
}
func (q Keeper) GroupsByMember(goCtx context.Context, request *group.QueryGroupsByMemberRequest) (*group.QueryGroupsByMemberResponse, error) {
// GroupsByMember queries all groups where the given address is a member of.
func (k Keeper) GroupsByMember(goCtx context.Context, request *group.QueryGroupsByMemberRequest) (*group.QueryGroupsByMemberResponse, error) {
if request == nil {
return nil, status.Errorf(codes.InvalidArgument, "empty request")
}
@ -266,7 +279,7 @@ func (q Keeper) GroupsByMember(goCtx context.Context, request *group.QueryGroups
return nil, err
}
iter, err := q.groupMemberByMemberIndex.GetPaginated(ctx.KVStore(q.key), member.Bytes(), request.Pagination)
iter, err := k.groupMemberByMemberIndex.GetPaginated(ctx.KVStore(k.key), member.Bytes(), request.Pagination)
if err != nil {
return nil, err
}
@ -279,7 +292,7 @@ func (q Keeper) GroupsByMember(goCtx context.Context, request *group.QueryGroups
var groups []*group.GroupInfo
for _, gm := range members {
groupInfo, err := q.getGroupInfo(ctx, gm.GroupId)
groupInfo, err := k.getGroupInfo(ctx, gm.GroupId)
if err != nil {
return nil, err
}
@ -292,24 +305,25 @@ func (q Keeper) GroupsByMember(goCtx context.Context, request *group.QueryGroups
}, nil
}
func (q Keeper) getVote(ctx sdk.Context, proposalID uint64, voter sdk.AccAddress) (group.Vote, error) {
func (k Keeper) getVote(ctx sdk.Context, proposalID uint64, voter sdk.AccAddress) (group.Vote, error) {
var v group.Vote
return v, q.voteTable.GetOne(ctx.KVStore(q.key), orm.PrimaryKey(&group.Vote{ProposalId: proposalID, Voter: voter.String()}), &v)
return v, k.voteTable.GetOne(ctx.KVStore(k.key), orm.PrimaryKey(&group.Vote{ProposalId: proposalID, Voter: voter.String()}), &v)
}
func (q Keeper) getVotesByProposal(ctx sdk.Context, proposalID uint64, pageRequest *query.PageRequest) (orm.Iterator, error) {
return q.voteByProposalIndex.GetPaginated(ctx.KVStore(q.key), proposalID, pageRequest)
func (k Keeper) getVotesByProposal(ctx sdk.Context, proposalID uint64, pageRequest *query.PageRequest) (orm.Iterator, error) {
return k.voteByProposalIndex.GetPaginated(ctx.KVStore(k.key), proposalID, pageRequest)
}
func (q Keeper) getVotesByVoter(ctx sdk.Context, voter sdk.AccAddress, pageRequest *query.PageRequest) (orm.Iterator, error) {
return q.voteByVoterIndex.GetPaginated(ctx.KVStore(q.key), voter.Bytes(), pageRequest)
func (k Keeper) getVotesByVoter(ctx sdk.Context, voter sdk.AccAddress, pageRequest *query.PageRequest) (orm.Iterator, error) {
return k.voteByVoterIndex.GetPaginated(ctx.KVStore(k.key), voter.Bytes(), pageRequest)
}
func (q Keeper) TallyResult(goCtx context.Context, request *group.QueryTallyResultRequest) (*group.QueryTallyResultResponse, error) {
// TallyResult computes the live tally result of a proposal.
func (k Keeper) TallyResult(goCtx context.Context, request *group.QueryTallyResultRequest) (*group.QueryTallyResultResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
proposalId := request.ProposalId
proposal, err := q.getProposal(ctx, proposalId)
proposal, err := k.getProposal(ctx, proposalId)
if err != nil {
return nil, err
}
@ -319,11 +333,11 @@ func (q Keeper) TallyResult(goCtx context.Context, request *group.QueryTallyResu
}
var policyInfo group.GroupPolicyInfo
if policyInfo, err = q.getGroupPolicyInfo(ctx, proposal.Address); err != nil {
if policyInfo, err = k.getGroupPolicyInfo(ctx, proposal.GroupPolicyAddress); err != nil {
return nil, sdkerrors.Wrap(err, "load group policy")
}
tallyResult, err := q.Tally(ctx, proposal, policyInfo.GroupId)
tallyResult, err := k.Tally(ctx, proposal, policyInfo.GroupId)
if err != nil {
return nil, err
}

View File

@ -14,7 +14,7 @@ import (
const weightInvariant = "Group-TotalWeight"
// RegisterInvariants registers all group invariants
// RegisterInvariants registers all group invariants.
func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper) {
ir.RegisterRoute(group.ModuleName, weightInvariant, GroupTotalWeightInvariant(keeper))
}

View File

@ -80,6 +80,7 @@ type Keeper struct {
config group.Config
}
// NewKeeper creates a new group keeper.
func NewKeeper(storeKey storetypes.StoreKey, cdc codec.Codec, router *authmiddleware.MsgServiceRouter, accKeeper group.AccountKeeper, config group.Config) Keeper {
k := Keeper{
key: storeKey,
@ -159,7 +160,7 @@ func NewKeeper(storeKey storetypes.StoreKey, cdc codec.Codec, router *authmiddle
panic(err.Error())
}
k.proposalByGroupPolicyIndex, err = orm.NewIndex(proposalTable, ProposalByGroupPolicyIndexPrefix, func(value interface{}) ([]interface{}, error) {
account := value.(*group.Proposal).Address
account := value.(*group.Proposal).GroupPolicyAddress
addr, err := sdk.AccAddressFromBech32(account)
if err != nil {
return nil, err
@ -324,9 +325,12 @@ func (k Keeper) PruneProposals(ctx sdk.Context) error {
return nil
}
func (k Keeper) UpdateTallyOfVPEndProposals(ctx sdk.Context) error {
// TallyProposalsAtVPEnd iterates over all proposals whose voting period
// has ended, tallies their votes, prunes them, and updates the proposal's
// `FinalTallyResult` field.
func (k Keeper) TallyProposalsAtVPEnd(ctx sdk.Context) error {
return k.iterateProposalsByVPEnd(ctx, ctx.BlockTime(), func(proposal group.Proposal) (bool, error) {
policyInfo, err := k.getGroupPolicyInfo(ctx, proposal.Address)
policyInfo, err := k.getGroupPolicyInfo(ctx, proposal.GroupPolicyAddress)
if err != nil {
return true, sdkerrors.Wrap(err, "group policy")
}

View File

@ -1036,9 +1036,9 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() {
}{
"with wrong admin": {
req: &group.MsgUpdateGroupPolicyAdmin{
Admin: addr5.String(),
Address: groupPolicyAddr,
NewAdmin: newAdmin.String(),
Admin: addr5.String(),
GroupPolicyAddress: groupPolicyAddr,
NewAdmin: newAdmin.String(),
},
expGroupPolicy: &group.GroupPolicyInfo{
Admin: admin.String(),
@ -1052,9 +1052,9 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() {
},
"with wrong group policy": {
req: &group.MsgUpdateGroupPolicyAdmin{
Admin: admin.String(),
Address: addr5.String(),
NewAdmin: newAdmin.String(),
Admin: admin.String(),
GroupPolicyAddress: addr5.String(),
NewAdmin: newAdmin.String(),
},
expGroupPolicy: &group.GroupPolicyInfo{
Admin: admin.String(),
@ -1068,9 +1068,9 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() {
},
"correct data": {
req: &group.MsgUpdateGroupPolicyAdmin{
Admin: admin.String(),
Address: groupPolicyAddr,
NewAdmin: newAdmin.String(),
Admin: admin.String(),
GroupPolicyAddress: groupPolicyAddr,
NewAdmin: newAdmin.String(),
},
expGroupPolicy: &group.GroupPolicyInfo{
Admin: newAdmin.String(),
@ -1124,32 +1124,32 @@ func (s *TestSuite) TestUpdateGroupPolicyMetadata() {
}{
"with wrong admin": {
req: &group.MsgUpdateGroupPolicyMetadata{
Admin: addr5.String(),
Address: groupPolicyAddr,
Admin: addr5.String(),
GroupPolicyAddress: groupPolicyAddr,
},
expGroupPolicy: &group.GroupPolicyInfo{},
expErr: true,
},
"with wrong group policy": {
req: &group.MsgUpdateGroupPolicyMetadata{
Admin: admin.String(),
Address: addr5.String(),
Admin: admin.String(),
GroupPolicyAddress: addr5.String(),
},
expGroupPolicy: &group.GroupPolicyInfo{},
expErr: true,
},
"with comment too long": {
req: &group.MsgUpdateGroupPolicyMetadata{
Admin: admin.String(),
Address: addr5.String(),
Admin: admin.String(),
GroupPolicyAddress: addr5.String(),
},
expGroupPolicy: &group.GroupPolicyInfo{},
expErr: true,
},
"correct data": {
req: &group.MsgUpdateGroupPolicyMetadata{
Admin: admin.String(),
Address: groupPolicyAddr,
Admin: admin.String(),
GroupPolicyAddress: groupPolicyAddr,
},
expGroupPolicy: &group.GroupPolicyInfo{
Admin: admin.String(),
@ -1205,8 +1205,8 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() {
}{
"with wrong admin": {
req: &group.MsgUpdateGroupPolicyDecisionPolicy{
Admin: addr5.String(),
Address: groupPolicyAddr,
Admin: addr5.String(),
GroupPolicyAddress: groupPolicyAddr,
},
policy: policy,
expGroupPolicy: &group.GroupPolicyInfo{},
@ -1214,8 +1214,8 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() {
},
"with wrong group policy": {
req: &group.MsgUpdateGroupPolicyDecisionPolicy{
Admin: admin.String(),
Address: addr5.String(),
Admin: admin.String(),
GroupPolicyAddress: addr5.String(),
},
policy: policy,
expGroupPolicy: &group.GroupPolicyInfo{},
@ -1223,8 +1223,8 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() {
},
"correct data": {
req: &group.MsgUpdateGroupPolicyDecisionPolicy{
Admin: admin.String(),
Address: groupPolicyAddr,
Admin: admin.String(),
GroupPolicyAddress: groupPolicyAddr,
},
policy: group.NewThresholdDecisionPolicy(
"2",
@ -1246,8 +1246,8 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() {
return s.createGroupAndGroupPolicy(admin, nil, policy)
},
req: &group.MsgUpdateGroupPolicyDecisionPolicy{
Admin: admin.String(),
Address: groupPolicyAddr,
Admin: admin.String(),
GroupPolicyAddress: groupPolicyAddr,
},
policy: group.NewPercentageDecisionPolicy(
"0.5",
@ -1277,7 +1277,7 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() {
spec.expGroupPolicy.GroupId = groupId
// update req with new group policy addr
spec.req.Address = policyAddr1
spec.req.GroupPolicyAddress = policyAddr1
}
err = spec.req.SetDecisionPolicy(spec.policy)
@ -1425,9 +1425,8 @@ func (s *TestSuite) TestSubmitProposal() {
bigThresholdAddr := bigThresholdRes.Address
defaultProposal := group.Proposal{
Address: accountAddr.String(),
Status: group.PROPOSAL_STATUS_SUBMITTED,
Result: group.PROPOSAL_RESULT_UNFINALIZED,
GroupPolicyAddress: accountAddr.String(),
Status: group.PROPOSAL_STATUS_SUBMITTED,
FinalTallyResult: group.TallyResult{
YesCount: "0",
NoCount: "0",
@ -1445,16 +1444,16 @@ func (s *TestSuite) TestSubmitProposal() {
}{
"all good with minimal fields set": {
req: &group.MsgSubmitProposal{
Address: accountAddr.String(),
Proposers: []string{addr2.String()},
GroupPolicyAddress: accountAddr.String(),
Proposers: []string{addr2.String()},
},
expProposal: defaultProposal,
postRun: func(sdkCtx sdk.Context) {},
},
"all good with good msg payload": {
req: &group.MsgSubmitProposal{
Address: accountAddr.String(),
Proposers: []string{addr2.String()},
GroupPolicyAddress: accountAddr.String(),
Proposers: []string{addr2.String()},
},
msgs: []sdk.Msg{&banktypes.MsgSend{
FromAddress: accountAddr.String(),
@ -1466,9 +1465,9 @@ func (s *TestSuite) TestSubmitProposal() {
},
"metadata too long": {
req: &group.MsgSubmitProposal{
Address: accountAddr.String(),
Proposers: []string{addr2.String()},
Metadata: strings.Repeat("a", 256),
GroupPolicyAddress: accountAddr.String(),
Proposers: []string{addr2.String()},
Metadata: strings.Repeat("a", 256),
},
expErr: true,
postRun: func(sdkCtx sdk.Context) {},
@ -1482,55 +1481,54 @@ func (s *TestSuite) TestSubmitProposal() {
},
"existing group policy required": {
req: &group.MsgSubmitProposal{
Address: addr1.String(),
Proposers: []string{addr2.String()},
GroupPolicyAddress: addr1.String(),
Proposers: []string{addr2.String()},
},
expErr: true,
postRun: func(sdkCtx sdk.Context) {},
},
"decision policy threshold > total group weight": {
req: &group.MsgSubmitProposal{
Address: bigThresholdAddr,
Proposers: []string{addr2.String()},
GroupPolicyAddress: bigThresholdAddr,
Proposers: []string{addr2.String()},
},
expErr: false,
expProposal: group.Proposal{
Address: bigThresholdAddr,
Status: group.PROPOSAL_STATUS_SUBMITTED,
Result: group.PROPOSAL_RESULT_UNFINALIZED,
FinalTallyResult: group.DefaultTallyResult(),
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
GroupPolicyAddress: bigThresholdAddr,
Status: group.PROPOSAL_STATUS_SUBMITTED,
FinalTallyResult: group.DefaultTallyResult(),
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
},
postRun: func(sdkCtx sdk.Context) {},
},
"only group members can create a proposal": {
req: &group.MsgSubmitProposal{
Address: accountAddr.String(),
Proposers: []string{addr4.String()},
GroupPolicyAddress: accountAddr.String(),
Proposers: []string{addr4.String()},
},
expErr: true,
postRun: func(sdkCtx sdk.Context) {},
},
"all proposers must be in group": {
req: &group.MsgSubmitProposal{
Address: accountAddr.String(),
Proposers: []string{addr2.String(), addr4.String()},
GroupPolicyAddress: accountAddr.String(),
Proposers: []string{addr2.String(), addr4.String()},
},
expErr: true,
postRun: func(sdkCtx sdk.Context) {},
},
"admin that is not a group member can not create proposal": {
req: &group.MsgSubmitProposal{
Address: accountAddr.String(),
Proposers: []string{addr1.String()},
GroupPolicyAddress: accountAddr.String(),
Proposers: []string{addr1.String()},
},
expErr: true,
postRun: func(sdkCtx sdk.Context) {},
},
"reject msgs that are not authz by group policy": {
req: &group.MsgSubmitProposal{
Address: accountAddr.String(),
Proposers: []string{addr2.String()},
GroupPolicyAddress: accountAddr.String(),
Proposers: []string{addr2.String()},
},
msgs: []sdk.Msg{&testdata.TestMsg{Signers: []string{addr1.String()}}},
expErr: true,
@ -1538,15 +1536,14 @@ func (s *TestSuite) TestSubmitProposal() {
},
"with try exec": {
req: &group.MsgSubmitProposal{
Address: accountAddr.String(),
Proposers: []string{addr2.String()},
Exec: group.Exec_EXEC_TRY,
GroupPolicyAddress: accountAddr.String(),
Proposers: []string{addr2.String()},
Exec: group.Exec_EXEC_TRY,
},
msgs: []sdk.Msg{msgSend},
expProposal: group.Proposal{
Address: accountAddr.String(),
Status: group.PROPOSAL_STATUS_CLOSED,
Result: group.PROPOSAL_RESULT_ACCEPTED,
GroupPolicyAddress: accountAddr.String(),
Status: group.PROPOSAL_STATUS_ACCEPTED,
FinalTallyResult: group.TallyResult{
YesCount: "2",
NoCount: "0",
@ -1564,15 +1561,14 @@ func (s *TestSuite) TestSubmitProposal() {
},
"with try exec, not enough yes votes for proposal to pass": {
req: &group.MsgSubmitProposal{
Address: accountAddr.String(),
Proposers: []string{addr5.String()},
Exec: group.Exec_EXEC_TRY,
GroupPolicyAddress: accountAddr.String(),
Proposers: []string{addr5.String()},
Exec: group.Exec_EXEC_TRY,
},
msgs: []sdk.Msg{msgSend},
expProposal: group.Proposal{
Address: accountAddr.String(),
Status: group.PROPOSAL_STATUS_SUBMITTED,
Result: group.PROPOSAL_RESULT_UNFINALIZED,
GroupPolicyAddress: accountAddr.String(),
Status: group.PROPOSAL_STATUS_SUBMITTED,
FinalTallyResult: group.TallyResult{
YesCount: "0", // Since tally doesn't pass Allow(), we consider the proposal not final
NoCount: "0",
@ -1604,14 +1600,13 @@ func (s *TestSuite) TestSubmitProposal() {
s.Require().NoError(err)
proposal := proposalRes.Proposal
s.Assert().Equal(spec.expProposal.Address, proposal.Address)
s.Assert().Equal(spec.expProposal.GroupPolicyAddress, proposal.GroupPolicyAddress)
s.Assert().Equal(spec.req.Metadata, proposal.Metadata)
s.Assert().Equal(spec.req.Proposers, proposal.Proposers)
s.Assert().Equal(s.blockTime, proposal.SubmitTime)
s.Assert().Equal(uint64(1), proposal.GroupVersion)
s.Assert().Equal(uint64(1), proposal.GroupPolicyVersion)
s.Assert().Equal(spec.expProposal.Status, proposal.Status)
s.Assert().Equal(spec.expProposal.Result, proposal.Result)
s.Assert().Equal(spec.expProposal.FinalTallyResult, proposal.FinalTallyResult)
s.Assert().Equal(spec.expProposal.ExecutorResult, proposal.ExecutorResult)
s.Assert().Equal(s.blockTime.Add(time.Second), proposal.VotingPeriodEnd)
@ -1755,9 +1750,9 @@ func (s *TestSuite) TestVote() {
s.Require().NoError(testutil.FundAccount(s.app.BankKeeper, s.sdkCtx, groupPolicy, sdk.Coins{sdk.NewInt64Coin("test", 10000)}))
req := &group.MsgSubmitProposal{
Address: accountAddr,
Proposers: []string{addr4.String()},
Messages: nil,
GroupPolicyAddress: accountAddr,
Proposers: []string{addr4.String()},
Messages: nil,
}
err = req.SetMsgs([]sdk.Msg{&banktypes.MsgSend{
FromAddress: accountAddr,
@ -1777,15 +1772,13 @@ func (s *TestSuite) TestVote() {
s.Require().NoError(err)
proposals := proposalsRes.Proposals
s.Require().Equal(len(proposals), 1)
s.Assert().Equal(req.Address, proposals[0].Address)
s.Assert().Equal(req.GroupPolicyAddress, proposals[0].GroupPolicyAddress)
s.Assert().Equal(req.Metadata, proposals[0].Metadata)
s.Assert().Equal(req.Proposers, proposals[0].Proposers)
s.Assert().Equal(s.blockTime, proposals[0].SubmitTime)
s.Assert().Equal(uint64(1), proposals[0].GroupVersion)
s.Assert().Equal(uint64(1), proposals[0].GroupPolicyVersion)
s.Assert().Equal(group.PROPOSAL_STATUS_SUBMITTED, proposals[0].Status)
s.Assert().Equal(group.PROPOSAL_RESULT_UNFINALIZED, proposals[0].Result)
s.Assert().Equal(group.DefaultTallyResult(), proposals[0].FinalTallyResult)
specs := map[string]struct {
@ -1796,7 +1789,6 @@ func (s *TestSuite) TestVote() {
doBefore func(ctx context.Context)
postRun func(sdkCtx sdk.Context)
expProposalStatus group.ProposalStatus // expected after tallying
expResult group.ProposalResult // expected after tallying
expExecutorResult group.ProposalExecutorResult // expected after tallying
expErr bool
}{
@ -1813,7 +1805,6 @@ func (s *TestSuite) TestVote() {
NoWithVetoCount: "0",
},
expProposalStatus: group.PROPOSAL_STATUS_SUBMITTED,
expResult: group.PROPOSAL_RESULT_UNFINALIZED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
postRun: func(sdkCtx sdk.Context) {},
},
@ -1831,8 +1822,7 @@ func (s *TestSuite) TestVote() {
NoWithVetoCount: "0",
},
isFinal: true,
expProposalStatus: group.PROPOSAL_STATUS_CLOSED,
expResult: group.PROPOSAL_RESULT_ACCEPTED,
expProposalStatus: group.PROPOSAL_STATUS_ACCEPTED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_SUCCESS,
postRun: func(sdkCtx sdk.Context) {
fromBalances := s.app.BankKeeper.GetAllBalances(sdkCtx, groupPolicy)
@ -1855,7 +1845,6 @@ func (s *TestSuite) TestVote() {
NoWithVetoCount: "0",
},
expProposalStatus: group.PROPOSAL_STATUS_SUBMITTED,
expResult: group.PROPOSAL_RESULT_UNFINALIZED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
postRun: func(sdkCtx sdk.Context) {},
},
@ -1872,7 +1861,6 @@ func (s *TestSuite) TestVote() {
NoWithVetoCount: "0",
},
expProposalStatus: group.PROPOSAL_STATUS_SUBMITTED,
expResult: group.PROPOSAL_RESULT_UNFINALIZED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
postRun: func(sdkCtx sdk.Context) {},
},
@ -1889,7 +1877,6 @@ func (s *TestSuite) TestVote() {
NoWithVetoCount: "0",
},
expProposalStatus: group.PROPOSAL_STATUS_SUBMITTED,
expResult: group.PROPOSAL_RESULT_UNFINALIZED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
postRun: func(sdkCtx sdk.Context) {},
},
@ -1906,7 +1893,6 @@ func (s *TestSuite) TestVote() {
NoWithVetoCount: "1",
},
expProposalStatus: group.PROPOSAL_STATUS_SUBMITTED,
expResult: group.PROPOSAL_RESULT_UNFINALIZED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
postRun: func(sdkCtx sdk.Context) {},
},
@ -1922,8 +1908,7 @@ func (s *TestSuite) TestVote() {
AbstainCount: "0",
NoWithVetoCount: "0",
},
expProposalStatus: group.PROPOSAL_STATUS_CLOSED,
expResult: group.PROPOSAL_RESULT_ACCEPTED,
expProposalStatus: group.PROPOSAL_STATUS_ACCEPTED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
postRun: func(sdkCtx sdk.Context) {},
},
@ -2117,7 +2102,6 @@ func (s *TestSuite) TestVote() {
proposal := proposalRes.Proposal
if spec.isFinal {
s.Assert().Equal(spec.expTallyResult, proposal.FinalTallyResult)
s.Assert().Equal(spec.expResult, proposal.Result)
s.Assert().Equal(spec.expProposalStatus, proposal.Status)
s.Assert().Equal(spec.expExecutorResult, proposal.ExecutorResult)
} else {
@ -2161,8 +2145,8 @@ func (s *TestSuite) TestVote() {
policyAddr := result.GroupPolicyAddress
groupID := result.GroupId
reqProposal := &group.MsgSubmitProposal{
Address: policyAddr,
Proposers: []string{addr4.String()},
GroupPolicyAddress: policyAddr,
Proposers: []string{addr4.String()},
}
require.NoError(reqProposal.SetMsgs([]sdk.Msg{&banktypes.MsgSend{
FromAddress: policyAddr,
@ -2220,7 +2204,6 @@ func (s *TestSuite) TestExecProposal() {
setupProposal func(ctx context.Context) uint64
expErr bool
expProposalStatus group.ProposalStatus
expProposalResult group.ProposalResult
expExecutorResult group.ProposalExecutorResult
expBalance bool
expFromBalances sdk.Coin
@ -2231,8 +2214,7 @@ func (s *TestSuite) TestExecProposal() {
msgs := []sdk.Msg{msgSend1}
return submitProposalAndVote(ctx, s, msgs, proposers, group.VOTE_OPTION_YES)
},
expProposalStatus: group.PROPOSAL_STATUS_CLOSED,
expProposalResult: group.PROPOSAL_RESULT_ACCEPTED,
expProposalStatus: group.PROPOSAL_STATUS_ACCEPTED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_SUCCESS,
expBalance: true,
expFromBalances: sdk.NewInt64Coin("test", 9900),
@ -2243,8 +2225,7 @@ func (s *TestSuite) TestExecProposal() {
msgs := []sdk.Msg{msgSend1, msgSend1}
return submitProposalAndVote(ctx, s, msgs, proposers, group.VOTE_OPTION_YES)
},
expProposalStatus: group.PROPOSAL_STATUS_CLOSED,
expProposalResult: group.PROPOSAL_RESULT_ACCEPTED,
expProposalStatus: group.PROPOSAL_STATUS_ACCEPTED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_SUCCESS,
expBalance: true,
expFromBalances: sdk.NewInt64Coin("test", 9800),
@ -2255,8 +2236,7 @@ func (s *TestSuite) TestExecProposal() {
msgs := []sdk.Msg{msgSend1}
return submitProposalAndVote(ctx, s, msgs, proposers, group.VOTE_OPTION_NO)
},
expProposalStatus: group.PROPOSAL_STATUS_CLOSED,
expProposalResult: group.PROPOSAL_RESULT_REJECTED,
expProposalStatus: group.PROPOSAL_STATUS_REJECTED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
},
"open proposal must not fail": {
@ -2264,7 +2244,6 @@ func (s *TestSuite) TestExecProposal() {
return submitProposal(ctx, s, []sdk.Msg{msgSend1}, proposers)
},
expProposalStatus: group.PROPOSAL_STATUS_SUBMITTED,
expProposalResult: group.PROPOSAL_RESULT_UNFINALIZED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
},
"existing proposal required": {
@ -2279,8 +2258,7 @@ func (s *TestSuite) TestExecProposal() {
return submitProposalAndVote(ctx, s, msgs, proposers, group.VOTE_OPTION_NO)
},
srcBlockTime: s.blockTime.Add(time.Second),
expProposalStatus: group.PROPOSAL_STATUS_CLOSED,
expProposalResult: group.PROPOSAL_RESULT_REJECTED,
expProposalStatus: group.PROPOSAL_STATUS_REJECTED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
},
"Decision policy also applied after timeout": {
@ -2289,21 +2267,19 @@ func (s *TestSuite) TestExecProposal() {
return submitProposalAndVote(ctx, s, msgs, proposers, group.VOTE_OPTION_NO)
},
srcBlockTime: s.blockTime.Add(time.Second).Add(time.Millisecond),
expProposalStatus: group.PROPOSAL_STATUS_CLOSED,
expProposalResult: group.PROPOSAL_RESULT_REJECTED,
expProposalStatus: group.PROPOSAL_STATUS_REJECTED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
},
"prevent double execution when successful": {
setupProposal: func(ctx context.Context) uint64 {
myProposalID := submitProposalAndVote(ctx, s, []sdk.Msg{msgSend1}, proposers, group.VOTE_OPTION_YES)
_, err := s.keeper.Exec(ctx, &group.MsgExec{Signer: addr1.String(), ProposalId: myProposalID})
_, err := s.keeper.Exec(ctx, &group.MsgExec{Executor: addr1.String(), ProposalId: myProposalID})
s.Require().NoError(err)
return myProposalID
},
expErr: true, // since proposal is pruned after a successful MsgExec
expProposalStatus: group.PROPOSAL_STATUS_CLOSED,
expProposalResult: group.PROPOSAL_RESULT_ACCEPTED,
expProposalStatus: group.PROPOSAL_STATUS_ACCEPTED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_SUCCESS,
expBalance: true,
expFromBalances: sdk.NewInt64Coin("test", 9900),
@ -2314,8 +2290,7 @@ func (s *TestSuite) TestExecProposal() {
msgs := []sdk.Msg{msgSend1, msgSend2}
return submitProposalAndVote(ctx, s, msgs, proposers, group.VOTE_OPTION_YES)
},
expProposalStatus: group.PROPOSAL_STATUS_CLOSED,
expProposalResult: group.PROPOSAL_RESULT_ACCEPTED,
expProposalStatus: group.PROPOSAL_STATUS_ACCEPTED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_FAILURE,
},
"executable when failed before": {
@ -2323,15 +2298,14 @@ func (s *TestSuite) TestExecProposal() {
msgs := []sdk.Msg{msgSend2}
myProposalID := submitProposalAndVote(ctx, s, msgs, proposers, group.VOTE_OPTION_YES)
_, err := s.keeper.Exec(ctx, &group.MsgExec{Signer: addr1.String(), ProposalId: myProposalID})
_, err := s.keeper.Exec(ctx, &group.MsgExec{Executor: addr1.String(), ProposalId: myProposalID})
s.Require().NoError(err)
sdkCtx := sdk.UnwrapSDKContext(ctx)
s.Require().NoError(testutil.FundAccount(s.app.BankKeeper, sdkCtx, s.groupPolicyAddr, sdk.Coins{sdk.NewInt64Coin("test", 10002)}))
return myProposalID
},
expProposalStatus: group.PROPOSAL_STATUS_CLOSED,
expProposalResult: group.PROPOSAL_RESULT_ACCEPTED,
expProposalStatus: group.PROPOSAL_STATUS_ACCEPTED,
expExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_SUCCESS,
},
}
@ -2347,7 +2321,7 @@ func (s *TestSuite) TestExecProposal() {
}
ctx = sdk.WrapSDKContext(sdkCtx)
_, err := s.keeper.Exec(ctx, &group.MsgExec{Signer: addr1.String(), ProposalId: proposalID})
_, err := s.keeper.Exec(ctx, &group.MsgExec{Executor: addr1.String(), ProposalId: proposalID})
if spec.expErr {
s.Require().Error(err)
return
@ -2361,12 +2335,8 @@ func (s *TestSuite) TestExecProposal() {
s.Require().NoError(err)
proposal := res.Proposal
exp := group.ProposalResult_name[int32(spec.expProposalResult)]
got := group.ProposalResult_name[int32(proposal.Result)]
s.Assert().Equal(exp, got)
exp = group.ProposalStatus_name[int32(spec.expProposalStatus)]
got = group.ProposalStatus_name[int32(proposal.Status)]
exp := group.ProposalStatus_name[int32(spec.expProposalStatus)]
got := group.ProposalStatus_name[int32(proposal.Status)]
s.Assert().Equal(exp, got)
exp = group.ProposalExecutorResult_name[int32(spec.expExecutorResult)]
@ -2454,8 +2424,8 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() {
setupProposal: func(ctx context.Context) uint64 {
myProposalID := submitProposal(ctx, s, []sdk.Msg{msgSend1}, proposers)
_, err := s.keeper.UpdateGroupPolicyMetadata(ctx, &group.MsgUpdateGroupPolicyMetadata{
Admin: addr1.String(),
Address: s.groupPolicyAddr.String(),
Admin: addr1.String(),
GroupPolicyAddress: s.groupPolicyAddr.String(),
})
s.Require().NoError(err)
return myProposalID
@ -2474,7 +2444,7 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() {
msgs := []sdk.Msg{msgSend2}
myProposalID := submitProposalAndVote(ctx, s, msgs, proposers, group.VOTE_OPTION_YES)
_, err := s.keeper.Exec(ctx, &group.MsgExec{Signer: addr1.String(), ProposalId: myProposalID})
_, err := s.keeper.Exec(ctx, &group.MsgExec{Executor: addr1.String(), ProposalId: myProposalID})
s.Require().NoError(err)
sdkCtx := sdk.UnwrapSDKContext(ctx)
s.Require().NoError(testutil.FundAccount(s.app.BankKeeper, sdkCtx, s.groupPolicyAddr, sdk.Coins{sdk.NewInt64Coin("test", 10002)}))
@ -2497,7 +2467,7 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() {
}
ctx = sdk.WrapSDKContext(sdkCtx)
_, err := s.keeper.Exec(ctx, &group.MsgExec{Signer: addr1.String(), ProposalId: proposalID})
_, err := s.keeper.Exec(ctx, &group.MsgExec{Executor: addr1.String(), ProposalId: proposalID})
if spec.expErr {
s.Require().Error(err)
return
@ -2546,44 +2516,40 @@ func (s *TestSuite) TestProposalsByVPEnd() {
proposers := []string{addr2.String()}
specs := map[string]struct {
preRun func(sdkCtx sdk.Context) uint64
proposalId uint64
admin string
expErrMsg string
newCtx sdk.Context
tallyRes group.TallyResult
expStatus group.ProposalStatus
expExecutorResult group.ProposalResult
preRun func(sdkCtx sdk.Context) uint64
proposalId uint64
admin string
expErrMsg string
newCtx sdk.Context
tallyRes group.TallyResult
expStatus group.ProposalStatus
}{
"tally updated after voting power end": {
preRun: func(sdkCtx sdk.Context) uint64 {
return submitProposal(sdkCtx, s, []sdk.Msg{msgSend}, proposers)
},
admin: proposers[0],
newCtx: ctx.WithBlockTime(now.Add(votingPeriod).Add(time.Hour)),
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_SUBMITTED,
expExecutorResult: group.PROPOSAL_RESULT_UNFINALIZED,
admin: proposers[0],
newCtx: ctx.WithBlockTime(now.Add(votingPeriod).Add(time.Hour)),
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_SUBMITTED,
},
"tally within voting period": {
preRun: func(sdkCtx sdk.Context) uint64 {
return submitProposal(s.ctx, s, []sdk.Msg{msgSend}, proposers)
},
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_SUBMITTED,
expExecutorResult: group.PROPOSAL_RESULT_UNFINALIZED,
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_SUBMITTED,
},
"tally within voting period(with votes)": {
preRun: func(sdkCtx sdk.Context) uint64 {
return submitProposalAndVote(s.ctx, s, []sdk.Msg{msgSend}, proposers, group.VOTE_OPTION_YES)
},
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_SUBMITTED,
expExecutorResult: group.PROPOSAL_RESULT_UNFINALIZED,
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_SUBMITTED,
},
"tally after voting period(with votes)": {
preRun: func(sdkCtx sdk.Context) uint64 {
@ -2597,8 +2563,7 @@ func (s *TestSuite) TestProposalsByVPEnd() {
NoWithVetoCount: "0",
AbstainCount: "0",
},
expStatus: group.PROPOSAL_STATUS_CLOSED,
expExecutorResult: group.PROPOSAL_RESULT_ACCEPTED,
expStatus: group.PROPOSAL_STATUS_ACCEPTED,
},
"tally of closed proposal": {
preRun: func(sdkCtx sdk.Context) uint64 {
@ -2611,11 +2576,10 @@ func (s *TestSuite) TestProposalsByVPEnd() {
s.Require().NoError(err)
return pId
},
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_WITHDRAWN,
expExecutorResult: group.PROPOSAL_RESULT_UNFINALIZED,
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_WITHDRAWN,
},
"tally of closed proposal (with votes)": {
preRun: func(sdkCtx sdk.Context) uint64 {
@ -2628,11 +2592,10 @@ func (s *TestSuite) TestProposalsByVPEnd() {
s.Require().NoError(err)
return pId
},
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_WITHDRAWN,
expExecutorResult: group.PROPOSAL_RESULT_UNFINALIZED,
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_WITHDRAWN,
},
}
@ -2655,7 +2618,6 @@ func (s *TestSuite) TestProposalsByVPEnd() {
s.Require().NoError(err)
s.Require().Equal(resp.GetProposal().FinalTallyResult, spec.tallyRes)
s.Require().Equal(resp.GetProposal().Status, spec.expStatus)
s.Require().Equal(resp.GetProposal().Result, spec.expExecutorResult)
})
}
}
@ -2844,8 +2806,8 @@ func submitProposal(
ctx context.Context, s *TestSuite, msgs []sdk.Msg,
proposers []string) uint64 {
proposalReq := &group.MsgSubmitProposal{
Address: s.groupPolicyAddr.String(),
Proposers: proposers,
GroupPolicyAddress: s.groupPolicyAddr.String(),
Proposers: proposers,
}
err := proposalReq.SetMsgs(msgs)
s.Require().NoError(err)

View File

@ -20,7 +20,7 @@ import (
var _ group.MsgServer = Keeper{}
// TODO: Revisit this once we have propoer gas fee framework.
// TODO: Revisit this once we have proper gas fee framework.
// Tracking issues https://github.com/cosmos/cosmos-sdk/issues/9054, https://github.com/cosmos/cosmos-sdk/discussions/9072
const gasCostPerIteration = uint64(20)
@ -279,9 +279,9 @@ func (k Keeper) CreateGroupWithPolicy(goCtx context.Context, req *group.MsgCreat
}
updatePolicyAddressReq := &group.MsgUpdateGroupPolicyAdmin{
Admin: req.Admin,
Address: groupPolicyAddress,
NewAdmin: groupPolicyAddress,
Admin: req.Admin,
GroupPolicyAddress: groupPolicyAddress,
NewAdmin: groupPolicyAddress,
}
_, err = k.UpdateGroupPolicyAdmin(goCtx, updatePolicyAddressReq)
if err != nil {
@ -383,7 +383,7 @@ func (k Keeper) UpdateGroupPolicyAdmin(goCtx context.Context, req *group.MsgUpda
return k.groupPolicyTable.Update(ctx.KVStore(k.key), groupPolicy)
}
err := k.doUpdateGroupPolicy(ctx, req.Address, req.Admin, action, "group policy admin updated")
err := k.doUpdateGroupPolicy(ctx, req.GroupPolicyAddress, req.Admin, action, "group policy admin updated")
if err != nil {
return nil, err
}
@ -415,7 +415,7 @@ func (k Keeper) UpdateGroupPolicyDecisionPolicy(goCtx context.Context, req *grou
return k.groupPolicyTable.Update(ctx.KVStore(k.key), groupPolicy)
}
err := k.doUpdateGroupPolicy(ctx, req.Address, req.Admin, action, "group policy's decision policy updated")
err := k.doUpdateGroupPolicy(ctx, req.GroupPolicyAddress, req.Admin, action, "group policy's decision policy updated")
if err != nil {
return nil, err
}
@ -437,7 +437,7 @@ func (k Keeper) UpdateGroupPolicyMetadata(goCtx context.Context, req *group.MsgU
return nil, err
}
err := k.doUpdateGroupPolicy(ctx, req.Address, req.Admin, action, "group policy metadata updated")
err := k.doUpdateGroupPolicy(ctx, req.GroupPolicyAddress, req.Admin, action, "group policy metadata updated")
if err != nil {
return nil, err
}
@ -447,7 +447,7 @@ func (k Keeper) UpdateGroupPolicyMetadata(goCtx context.Context, req *group.MsgU
func (k Keeper) SubmitProposal(goCtx context.Context, req *group.MsgSubmitProposal) (*group.MsgSubmitProposalResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
accountAddress, err := sdk.AccAddressFromBech32(req.Address)
accountAddress, err := sdk.AccAddressFromBech32(req.GroupPolicyAddress)
if err != nil {
return nil, sdkerrors.Wrap(err, "request account address of group policy")
}
@ -459,7 +459,7 @@ func (k Keeper) SubmitProposal(goCtx context.Context, req *group.MsgSubmitPropos
return nil, err
}
policyAcc, err := k.getGroupPolicyInfo(ctx, req.Address)
policyAcc, err := k.getGroupPolicyInfo(ctx, req.GroupPolicyAddress)
if err != nil {
return nil, sdkerrors.Wrap(err, "load group policy")
}
@ -494,13 +494,12 @@ func (k Keeper) SubmitProposal(goCtx context.Context, req *group.MsgSubmitPropos
m := &group.Proposal{
Id: k.proposalTable.Sequence().PeekNextVal(ctx.KVStore(k.key)),
Address: req.Address,
GroupPolicyAddress: req.GroupPolicyAddress,
Metadata: metadata,
Proposers: proposers,
SubmitTime: ctx.BlockTime(),
GroupVersion: g.Version,
GroupPolicyVersion: policyAcc.Version,
Result: group.PROPOSAL_RESULT_UNFINALIZED,
Status: group.PROPOSAL_STATUS_SUBMITTED,
ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_NOT_RUN,
VotingPeriodEnd: ctx.BlockTime().Add(policy.GetVotingPeriod()), // The voting window begins as soon as the proposal is submitted.
@ -541,7 +540,7 @@ func (k Keeper) SubmitProposal(goCtx context.Context, req *group.MsgSubmitPropos
ProposalId: id,
// We consider the first proposer as the MsgExecRequest signer
// but that could be revisited (eg using the group policy)
Signer: proposers[0],
Executor: proposers[0],
})
if err != nil {
return &group.MsgSubmitProposalResponse{ProposalId: id}, sdkerrors.Wrap(err, "The proposal was created but failed on exec")
@ -567,7 +566,7 @@ func (k Keeper) WithdrawProposal(goCtx context.Context, req *group.MsgWithdrawPr
}
var policyInfo group.GroupPolicyInfo
if policyInfo, err = k.getGroupPolicyInfo(ctx, proposal.Address); err != nil {
if policyInfo, err = k.getGroupPolicyInfo(ctx, proposal.GroupPolicyAddress); err != nil {
return nil, sdkerrors.Wrap(err, "load group policy")
}
@ -585,7 +584,6 @@ func (k Keeper) WithdrawProposal(goCtx context.Context, req *group.MsgWithdrawPr
return nil, err
}
proposal.Result = group.PROPOSAL_RESULT_UNFINALIZED
proposal.Status = group.PROPOSAL_STATUS_WITHDRAWN
return storeUpdates()
}
@ -608,7 +606,6 @@ func (k Keeper) WithdrawProposal(goCtx context.Context, req *group.MsgWithdrawPr
return nil, err
}
proposal.Result = group.PROPOSAL_RESULT_UNFINALIZED
proposal.Status = group.PROPOSAL_STATUS_WITHDRAWN
return storeUpdates()
}
@ -637,7 +634,7 @@ func (k Keeper) Vote(goCtx context.Context, req *group.MsgVote) (*group.MsgVoteR
var policyInfo group.GroupPolicyInfo
if policyInfo, err = k.getGroupPolicyInfo(ctx, proposal.Address); err != nil {
if policyInfo, err = k.getGroupPolicyInfo(ctx, proposal.GroupPolicyAddress); err != nil {
return nil, sdkerrors.Wrap(err, "load group policy")
}
@ -675,7 +672,7 @@ func (k Keeper) Vote(goCtx context.Context, req *group.MsgVote) (*group.MsgVoteR
if req.Exec == group.Exec_EXEC_TRY {
_, err = k.Exec(sdk.WrapSDKContext(ctx), &group.MsgExec{
ProposalId: id,
Signer: voterAddr,
Executor: voterAddr,
})
if err != nil {
return nil, err
@ -713,11 +710,9 @@ func (k Keeper) doTallyAndUpdate(ctx sdk.Context, p *group.Proposal, electorate
}
p.FinalTallyResult = tallyResult
if result.Allow {
p.Result = group.PROPOSAL_RESULT_ACCEPTED
p.Status = group.PROPOSAL_STATUS_CLOSED
p.Status = group.PROPOSAL_STATUS_ACCEPTED
} else {
p.Result = group.PROPOSAL_RESULT_REJECTED
p.Status = group.PROPOSAL_STATUS_CLOSED
p.Status = group.PROPOSAL_STATUS_REJECTED
}
}
@ -734,12 +729,12 @@ func (k Keeper) Exec(goCtx context.Context, req *group.MsgExec) (*group.MsgExecR
return nil, err
}
if proposal.Status != group.PROPOSAL_STATUS_SUBMITTED && proposal.Status != group.PROPOSAL_STATUS_CLOSED {
if proposal.Status != group.PROPOSAL_STATUS_SUBMITTED && proposal.Status != group.PROPOSAL_STATUS_ACCEPTED {
return nil, sdkerrors.Wrapf(errors.ErrInvalid, "not possible with proposal status %s", proposal.Status.String())
}
var policyInfo group.GroupPolicyInfo
if policyInfo, err = k.getGroupPolicyInfo(ctx, proposal.Address); err != nil {
if policyInfo, err = k.getGroupPolicyInfo(ctx, proposal.GroupPolicyAddress); err != nil {
return nil, sdkerrors.Wrap(err, "load group policy")
}
@ -772,7 +767,7 @@ func (k Keeper) Exec(goCtx context.Context, req *group.MsgExec) (*group.MsgExecR
}
// Execute proposal payload.
if proposal.Status == group.PROPOSAL_STATUS_CLOSED && proposal.Result == group.PROPOSAL_RESULT_ACCEPTED && proposal.ExecutorResult != group.PROPOSAL_EXECUTOR_RESULT_SUCCESS {
if proposal.Status == group.PROPOSAL_STATUS_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()

View File

@ -9,7 +9,7 @@ import (
)
// doExecuteMsgs routes the messages to the registered handlers. Messages are limited to those that require no authZ or
// by the account of group policy only. Otherwise this gives access to other peoples accounts as the sdk ant handler is bypassed
// by the account of group policy only. Otherwise this gives access to other peoples accounts as the sdk middlewares are bypassed
func (s Keeper) doExecuteMsgs(ctx sdk.Context, router *authmiddleware.MsgServiceRouter, proposal group.Proposal, groupPolicyAcc sdk.AccAddress) ([]sdk.Result, error) {
// Ensure it's not too late to execute the messages.
// After https://github.com/cosmos/cosmos-sdk/issues/11245, proposals should

View File

@ -10,14 +10,17 @@ import (
// Tally is a function that tallies a proposal by iterating through its votes,
// and returns the tally result without modifying the proposal or any state.
func (q Keeper) Tally(ctx sdk.Context, p group.Proposal, groupId uint64) (group.TallyResult, error) {
func (k Keeper) Tally(ctx sdk.Context, p group.Proposal, groupId uint64) (group.TallyResult, error) {
// If proposal has already been tallied and updated, then its status is
// closed, in which case we just return the previously stored result.
if p.Status == group.PROPOSAL_STATUS_CLOSED {
// accepted/rejected, in which case we just return the previously stored result.
//
// In all other cases (including withdrawn, aborted...) we do the tally
// again.
if p.Status == group.PROPOSAL_STATUS_ACCEPTED || p.Status == group.PROPOSAL_STATUS_REJECTED {
return p.FinalTallyResult, nil
}
it, err := q.voteByProposalIndex.Get(ctx.KVStore(q.key), p.Id)
it, err := k.voteByProposalIndex.Get(ctx.KVStore(k.key), p.Id)
if err != nil {
return group.TallyResult{}, err
}
@ -36,7 +39,7 @@ func (q Keeper) Tally(ctx sdk.Context, p group.Proposal, groupId uint64) (group.
}
var member group.GroupMember
err := q.groupMemberTable.GetOne(ctx.KVStore(q.key), orm.PrimaryKey(&group.GroupMember{
err := k.groupMemberTable.GetOne(ctx.KVStore(k.key), orm.PrimaryKey(&group.GroupMember{
GroupId: groupId,
Member: &group.Member{Address: vote.Voter},
}), &member)

View File

@ -6,7 +6,7 @@ import (
)
func EndBlocker(ctx sdk.Context, k keeper.Keeper) {
if err := k.UpdateTallyOfVPEndProposals(ctx); err != nil {
if err := k.TallyProposalsAtVPEnd(ctx); err != nil {
panic(err)
}
pruneProposals(ctx, k)

View File

@ -77,7 +77,7 @@ func TestEndBlockerPruning(t *testing.T) {
msgs := []sdk.Msg{msgSend1}
pID, err := submitProposalAndVote(app, ctx, msgs, proposers, groupPolicyAddr, group.VOTE_OPTION_YES)
require.NoError(t, err)
_, err = app.GroupKeeper.Exec(ctx, &group.MsgExec{Signer: addr3.String(), ProposalId: pID})
_, err = app.GroupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3.String(), ProposalId: pID})
require.NoError(t, err)
sdkCtx := sdk.UnwrapSDKContext(ctx)
require.NoError(t, testutil.FundAccount(app.BankKeeper, sdkCtx, groupPolicyAddr, sdk.Coins{sdk.NewInt64Coin("test", 10002)}))
@ -92,7 +92,7 @@ func TestEndBlockerPruning(t *testing.T) {
msgs := []sdk.Msg{msgSend1, msgSend1}
pID, err := submitProposalAndVote(app, ctx, msgs, proposers, groupPolicyAddr, group.VOTE_OPTION_YES)
require.NoError(t, err)
_, err = app.GroupKeeper.Exec(ctx, &group.MsgExec{Signer: addr3.String(), ProposalId: pID})
_, err = app.GroupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3.String(), ProposalId: pID})
require.NoError(t, err)
sdkCtx := sdk.UnwrapSDKContext(ctx)
require.NoError(t, testutil.FundAccount(app.BankKeeper, sdkCtx, groupPolicyAddr, sdk.Coins{sdk.NewInt64Coin("test", 10002)}))
@ -107,7 +107,7 @@ func TestEndBlockerPruning(t *testing.T) {
msgs := []sdk.Msg{msgSend1}
pID, err := submitProposalAndVote(app, ctx, msgs, proposers, groupPolicyAddr, group.VOTE_OPTION_NO)
require.NoError(t, err)
_, err = app.GroupKeeper.Exec(ctx, &group.MsgExec{Signer: addr3.String(), ProposalId: pID})
_, err = app.GroupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3.String(), ProposalId: pID})
require.NoError(t, err)
sdkCtx := sdk.UnwrapSDKContext(ctx)
require.NoError(t, testutil.FundAccount(app.BankKeeper, sdkCtx, groupPolicyAddr, sdk.Coins{sdk.NewInt64Coin("test", 10002)}))
@ -120,7 +120,7 @@ func TestEndBlockerPruning(t *testing.T) {
setupProposal: func(ctx context.Context) uint64 {
pID, err := submitProposal(app, ctx, []sdk.Msg{msgSend1}, proposers, groupPolicyAddr)
require.NoError(t, err)
_, err = app.GroupKeeper.Exec(ctx, &group.MsgExec{Signer: addr3.String(), ProposalId: pID})
_, err = app.GroupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3.String(), ProposalId: pID})
require.NoError(t, err)
sdkCtx := sdk.UnwrapSDKContext(ctx)
require.NoError(t, testutil.FundAccount(app.BankKeeper, sdkCtx, groupPolicyAddr, sdk.Coins{sdk.NewInt64Coin("test", 10002)}))
@ -134,11 +134,11 @@ func TestEndBlockerPruning(t *testing.T) {
pID, err := submitProposal(app, ctx, []sdk.Msg{msgSend1}, proposers, groupPolicyAddr)
require.NoError(t, err)
_, err = app.GroupKeeper.UpdateGroupPolicyMetadata(ctx, &group.MsgUpdateGroupPolicyMetadata{
Admin: addr1.String(),
Address: groupPolicyAddr.String(),
Admin: addr1.String(),
GroupPolicyAddress: groupPolicyAddr.String(),
})
require.NoError(t, err)
_, err = app.GroupKeeper.Exec(ctx, &group.MsgExec{Signer: addr3.String(), ProposalId: pID})
_, err = app.GroupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3.String(), ProposalId: pID})
require.NoError(t, err)
sdkCtx := sdk.UnwrapSDKContext(ctx)
require.NoError(t, testutil.FundAccount(app.BankKeeper, sdkCtx, groupPolicyAddr, sdk.Coins{sdk.NewInt64Coin("test", 10002)}))
@ -152,7 +152,7 @@ func TestEndBlockerPruning(t *testing.T) {
msgs := []sdk.Msg{msgSend1}
pID, err := submitProposalAndVote(app, ctx, msgs, proposers, groupPolicyAddr, group.VOTE_OPTION_YES)
require.NoError(t, err)
_, err = app.GroupKeeper.Exec(ctx, &group.MsgExec{Signer: addrs[2].String(), ProposalId: pID})
_, err = app.GroupKeeper.Exec(ctx, &group.MsgExec{Executor: addrs[2].String(), ProposalId: pID})
require.NoError(t, err)
return pID
},
@ -240,14 +240,13 @@ func TestEndBlocker(t *testing.T) {
proposers := []string{addrs[2].String()}
specs := map[string]struct {
preRun func(sdkCtx sdk.Context) uint64
proposalId uint64
admin string
expErrMsg string
newCtx sdk.Context
tallyRes group.TallyResult
expStatus group.ProposalStatus
expExecutorResult group.ProposalResult
preRun func(sdkCtx sdk.Context) uint64
proposalId uint64
admin string
expErrMsg string
newCtx sdk.Context
tallyRes group.TallyResult
expStatus group.ProposalStatus
}{
"tally updated after voting power end": {
preRun: func(sdkCtx sdk.Context) uint64 {
@ -255,11 +254,10 @@ func TestEndBlocker(t *testing.T) {
require.NoError(t, err)
return pId
},
admin: proposers[0],
newCtx: ctx.WithBlockTime(ctx.BlockTime().Add(votingPeriod).Add(time.Hour)),
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_SUBMITTED,
expExecutorResult: group.PROPOSAL_RESULT_UNFINALIZED,
admin: proposers[0],
newCtx: ctx.WithBlockTime(ctx.BlockTime().Add(votingPeriod).Add(time.Hour)),
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_SUBMITTED,
},
"tally within voting period": {
preRun: func(sdkCtx sdk.Context) uint64 {
@ -268,11 +266,10 @@ func TestEndBlocker(t *testing.T) {
return pId
},
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_SUBMITTED,
expExecutorResult: group.PROPOSAL_RESULT_UNFINALIZED,
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_SUBMITTED,
},
"tally within voting period(with votes)": {
preRun: func(sdkCtx sdk.Context) uint64 {
@ -281,11 +278,10 @@ func TestEndBlocker(t *testing.T) {
return pId
},
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_SUBMITTED,
expExecutorResult: group.PROPOSAL_RESULT_UNFINALIZED,
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_SUBMITTED,
},
"tally after voting period(with votes)": {
preRun: func(sdkCtx sdk.Context) uint64 {
@ -302,8 +298,7 @@ func TestEndBlocker(t *testing.T) {
NoWithVetoCount: "0",
AbstainCount: "0",
},
expStatus: group.PROPOSAL_STATUS_CLOSED,
expExecutorResult: group.PROPOSAL_RESULT_ACCEPTED,
expStatus: group.PROPOSAL_STATUS_ACCEPTED,
},
"tally of closed proposal": {
preRun: func(sdkCtx sdk.Context) uint64 {
@ -318,11 +313,10 @@ func TestEndBlocker(t *testing.T) {
require.NoError(t, err)
return pId
},
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_WITHDRAWN,
expExecutorResult: group.PROPOSAL_RESULT_UNFINALIZED,
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_WITHDRAWN,
},
"tally of closed proposal (with votes)": {
preRun: func(sdkCtx sdk.Context) uint64 {
@ -337,11 +331,10 @@ func TestEndBlocker(t *testing.T) {
require.NoError(t, err)
return pId
},
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_WITHDRAWN,
expExecutorResult: group.PROPOSAL_RESULT_UNFINALIZED,
admin: proposers[0],
newCtx: ctx,
tallyRes: group.DefaultTallyResult(),
expStatus: group.PROPOSAL_STATUS_WITHDRAWN,
},
}
@ -364,7 +357,6 @@ func TestEndBlocker(t *testing.T) {
require.NoError(t, err)
require.Equal(t, resp.GetProposal().FinalTallyResult, spec.tallyRes)
require.Equal(t, resp.GetProposal().Status, spec.expStatus)
require.Equal(t, resp.GetProposal().Result, spec.expExecutorResult)
})
}
}
@ -373,8 +365,8 @@ func submitProposal(
app *simapp.SimApp, ctx context.Context, msgs []sdk.Msg,
proposers []string, groupPolicyAddr sdk.AccAddress) (uint64, error) {
proposalReq := &group.MsgSubmitProposal{
Address: groupPolicyAddr.String(),
Proposers: proposers,
GroupPolicyAddress: groupPolicyAddr.String(),
Proposers: proposers,
}
err := proposalReq.SetMsgs(msgs)
if err != nil {

View File

@ -389,7 +389,7 @@ func (m MsgUpdateGroupPolicyAdmin) ValidateBasic() error {
return sdkerrors.Wrap(err, "new admin")
}
_, err = sdk.AccAddressFromBech32(m.Address)
_, err = sdk.AccAddressFromBech32(m.GroupPolicyAddress)
if err != nil {
return sdkerrors.Wrap(err, "group policy")
}
@ -405,8 +405,8 @@ var _ types.UnpackInterfacesMessage = MsgUpdateGroupPolicyDecisionPolicy{}
func NewMsgUpdateGroupPolicyDecisionPolicyRequest(admin sdk.AccAddress, address sdk.AccAddress, decisionPolicy DecisionPolicy) (*MsgUpdateGroupPolicyDecisionPolicy, error) {
m := &MsgUpdateGroupPolicyDecisionPolicy{
Admin: admin.String(),
Address: address.String(),
Admin: admin.String(),
GroupPolicyAddress: address.String(),
}
err := m.SetDecisionPolicy(decisionPolicy)
if err != nil {
@ -459,7 +459,7 @@ func (m MsgUpdateGroupPolicyDecisionPolicy) ValidateBasic() error {
return sdkerrors.Wrap(err, "admin")
}
_, err = sdk.AccAddressFromBech32(m.Address)
_, err = sdk.AccAddressFromBech32(m.GroupPolicyAddress)
if err != nil {
return sdkerrors.Wrap(err, "group policy")
}
@ -521,7 +521,7 @@ func (m MsgUpdateGroupPolicyMetadata) ValidateBasic() error {
return sdkerrors.Wrap(err, "admin")
}
_, err = sdk.AccAddressFromBech32(m.Address)
_, err = sdk.AccAddressFromBech32(m.GroupPolicyAddress)
if err != nil {
return sdkerrors.Wrap(err, "group policy")
}
@ -590,10 +590,10 @@ var _ sdk.Msg = &MsgSubmitProposal{}
// NewMsgSubmitProposalRequest creates a new MsgSubmitProposal.
func NewMsgSubmitProposalRequest(address string, proposers []string, msgs []sdk.Msg, metadata string, exec Exec) (*MsgSubmitProposal, error) {
m := &MsgSubmitProposal{
Address: address,
Proposers: proposers,
Metadata: metadata,
Exec: exec,
GroupPolicyAddress: address,
Proposers: proposers,
Metadata: metadata,
Exec: exec,
}
err := m.SetMsgs(msgs)
if err != nil {
@ -630,7 +630,7 @@ func (m MsgSubmitProposal) GetSigners() []sdk.AccAddress {
// ValidateBasic does a sanity check on the provided data
func (m MsgSubmitProposal) ValidateBasic() error {
_, err := sdk.AccAddressFromBech32(m.Address)
_, err := sdk.AccAddressFromBech32(m.GroupPolicyAddress)
if err != nil {
return sdkerrors.Wrap(err, "group policy")
}
@ -778,7 +778,7 @@ func (m MsgExec) GetSignBytes() []byte {
// GetSigners returns the expected signers for a MsgExec.
func (m MsgExec) GetSigners() []sdk.AccAddress {
signer, err := sdk.AccAddressFromBech32(m.Signer)
signer, err := sdk.AccAddressFromBech32(m.Executor)
if err != nil {
panic(err)
}
@ -787,7 +787,7 @@ func (m MsgExec) GetSigners() []sdk.AccAddress {
// ValidateBasic does a sanity check on the provided data
func (m MsgExec) ValidateBasic() error {
_, err := sdk.AccAddressFromBech32(m.Signer)
_, err := sdk.AccAddressFromBech32(m.Executor)
if err != nil {
return sdkerrors.Wrap(err, "signer")
}

View File

@ -728,8 +728,8 @@ func TestMsgUpdateGroupPolicyDecisionPolicy(t *testing.T) {
{
"group policy: invalid bech32 address",
&group.MsgUpdateGroupPolicyDecisionPolicy{
Admin: admin.String(),
Address: "address",
Admin: admin.String(),
GroupPolicyAddress: "address",
},
true,
"group policy: decoding bech32 failed",
@ -737,8 +737,8 @@ func TestMsgUpdateGroupPolicyDecisionPolicy(t *testing.T) {
{
"group policy: invalid bech32 address",
&group.MsgUpdateGroupPolicyDecisionPolicy{
Admin: admin.String(),
Address: "address",
Admin: admin.String(),
GroupPolicyAddress: "address",
},
true,
"group policy: decoding bech32 failed",
@ -808,9 +808,9 @@ func TestMsgUpdateGroupPolicyAdmin(t *testing.T) {
{
"policy address: invalid bech32 address",
&group.MsgUpdateGroupPolicyAdmin{
Admin: admin.String(),
NewAdmin: member1.String(),
Address: "address",
Admin: admin.String(),
NewAdmin: member1.String(),
GroupPolicyAddress: "address",
},
true,
"group policy: decoding bech32 failed",
@ -818,9 +818,9 @@ func TestMsgUpdateGroupPolicyAdmin(t *testing.T) {
{
"new admin: invalid bech32 address",
&group.MsgUpdateGroupPolicyAdmin{
Admin: admin.String(),
Address: admin.String(),
NewAdmin: "new-admin",
Admin: admin.String(),
GroupPolicyAddress: admin.String(),
NewAdmin: "new-admin",
},
true,
"new admin: decoding bech32 failed",
@ -828,9 +828,9 @@ func TestMsgUpdateGroupPolicyAdmin(t *testing.T) {
{
"same old and new admin",
&group.MsgUpdateGroupPolicyAdmin{
Admin: admin.String(),
Address: admin.String(),
NewAdmin: admin.String(),
Admin: admin.String(),
GroupPolicyAddress: admin.String(),
NewAdmin: admin.String(),
},
true,
"new and old admin are same",
@ -838,9 +838,9 @@ func TestMsgUpdateGroupPolicyAdmin(t *testing.T) {
{
"valid test",
&group.MsgUpdateGroupPolicyAdmin{
Admin: admin.String(),
Address: admin.String(),
NewAdmin: member1.String(),
Admin: admin.String(),
GroupPolicyAddress: admin.String(),
NewAdmin: member1.String(),
},
false,
"",
@ -880,8 +880,8 @@ func TestMsgUpdateGroupPolicyMetadata(t *testing.T) {
{
"group policy address: invalid bech32 address",
&group.MsgUpdateGroupPolicyMetadata{
Admin: admin.String(),
Address: "address",
Admin: admin.String(),
GroupPolicyAddress: "address",
},
true,
"group policy: decoding bech32 failed",
@ -889,9 +889,9 @@ func TestMsgUpdateGroupPolicyMetadata(t *testing.T) {
{
"valid testcase",
&group.MsgUpdateGroupPolicyMetadata{
Admin: admin.String(),
Address: member1.String(),
Metadata: "metadata",
Admin: admin.String(),
GroupPolicyAddress: member1.String(),
Metadata: "metadata",
},
false,
"",
@ -923,7 +923,7 @@ func TestMsgSubmitProposal(t *testing.T) {
{
"invalid group policy address",
&group.MsgSubmitProposal{
Address: "address",
GroupPolicyAddress: "address",
},
true,
"group policy: decoding bech32 failed",
@ -931,7 +931,7 @@ func TestMsgSubmitProposal(t *testing.T) {
{
"proposers required",
&group.MsgSubmitProposal{
Address: admin.String(),
GroupPolicyAddress: admin.String(),
},
true,
"proposers: value is empty",
@ -939,8 +939,8 @@ func TestMsgSubmitProposal(t *testing.T) {
{
"valid testcase",
&group.MsgSubmitProposal{
Address: admin.String(),
Proposers: []string{member1.String(), member2.String()},
GroupPolicyAddress: admin.String(),
Proposers: []string{member1.String(), member2.String()},
},
false,
"",
@ -1080,7 +1080,7 @@ func TestMsgExec(t *testing.T) {
{
"invalid signer address",
&group.MsgExec{
Signer: "signer",
Executor: "signer",
},
true,
"signer: decoding bech32 failed",
@ -1088,7 +1088,7 @@ func TestMsgExec(t *testing.T) {
{
"proposal is required",
&group.MsgExec{
Signer: admin.String(),
Executor: admin.String(),
},
true,
"proposal id: value is empty",
@ -1096,7 +1096,7 @@ func TestMsgExec(t *testing.T) {
{
"valid testcase",
&group.MsgExec{
Signer: admin.String(),
Executor: admin.String(),
ProposalId: 1,
},
false,
@ -1145,7 +1145,7 @@ func TestMsgLeaveGroup(t *testing.T) {
"valid testcase",
&group.MsgLeaveGroup{
Address: admin.String(),
GroupId: 1,
GroupId: 1,
},
false,
"",

View File

@ -1530,7 +1530,11 @@ type QueryClient interface {
VotesByVoter(ctx context.Context, in *QueryVotesByVoterRequest, opts ...grpc.CallOption) (*QueryVotesByVoterResponse, error)
// GroupsByMember queries groups by member address.
GroupsByMember(ctx context.Context, in *QueryGroupsByMemberRequest, opts ...grpc.CallOption) (*QueryGroupsByMemberResponse, error)
// TallyResult queries the tally of a proposal votes.
// TallyResult returns the tally result of a proposal. If the proposal is
// still in voting period, then this query computes the current tally state,
// which might not be final. On the other hand, if the proposal is final,
// then it simply returns the `final_tally_result` state stored in the
// proposal itself.
TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error)
}
@ -1685,7 +1689,11 @@ type QueryServer interface {
VotesByVoter(context.Context, *QueryVotesByVoterRequest) (*QueryVotesByVoterResponse, error)
// GroupsByMember queries groups by member address.
GroupsByMember(context.Context, *QueryGroupsByMemberRequest) (*QueryGroupsByMemberResponse, error)
// TallyResult queries the tally of a proposal votes.
// TallyResult returns the tally result of a proposal. If the proposal is
// still in voting period, then this query computes the current tally state,
// which might not be final. On the other hand, if the proposal is final,
// then it simply returns the `final_tally_result` state stored in the
// proposal itself.
TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error)
}

View File

@ -86,11 +86,10 @@ func getProposals(r *rand.Rand, simState *module.SimulationState, groupPolicies
proposal := &group.Proposal{
Id: uint64(i + 1),
Proposers: proposers,
Address: groupPolicyAddress,
GroupPolicyAddress: groupPolicyAddress,
GroupVersion: uint64(i + 1),
GroupPolicyVersion: uint64(i + 1),
Status: group.PROPOSAL_STATUS_SUBMITTED,
Result: group.PROPOSAL_RESULT_ACCEPTED,
FinalTallyResult: group.TallyResult{
YesCount: "1",
NoCount: "1",

View File

@ -439,9 +439,9 @@ func SimulateMsgSubmitProposal(ak group.AccountKeeper, bk group.BankKeeper, k ke
}
msg := group.MsgSubmitProposal{
Address: groupPolicyAddr,
Proposers: []string{acc.Address.String()},
Metadata: simtypes.RandStringOfLength(r, 10),
GroupPolicyAddress: groupPolicyAddr,
Proposers: []string{acc.Address.String()},
Metadata: simtypes.RandStringOfLength(r, 10),
}
txGen := simappparams.MakeTestEncodingConfig().TxConfig
@ -681,9 +681,9 @@ func SimulateMsgUpdateGroupPolicyAdmin(ak group.AccountKeeper, bk group.BankKeep
}
msg := group.MsgUpdateGroupPolicyAdmin{
Admin: acc.Address.String(),
Address: groupPolicyAddr,
NewAdmin: newAdmin.Address.String(),
Admin: acc.Address.String(),
GroupPolicyAddress: groupPolicyAddr,
NewAdmin: newAdmin.Address.String(),
}
txGen := simappparams.MakeTestEncodingConfig().TxConfig
@ -789,9 +789,9 @@ func SimulateMsgUpdateGroupPolicyMetadata(ak group.AccountKeeper,
}
msg := group.MsgUpdateGroupPolicyMetadata{
Admin: acc.Address.String(),
Address: groupPolicyAddr,
Metadata: simtypes.RandStringOfLength(r, 10),
Admin: acc.Address.String(),
GroupPolicyAddress: groupPolicyAddr,
Metadata: simtypes.RandStringOfLength(r, 10),
}
txGen := simappparams.MakeTestEncodingConfig().TxConfig
@ -1056,7 +1056,7 @@ func SimulateMsgExec(ak group.AccountKeeper,
proposalID := -1
for _, proposal := range proposals {
if proposal.Status == group.PROPOSAL_STATUS_CLOSED {
if proposal.Status == group.PROPOSAL_STATUS_ACCEPTED {
proposalID = int(proposal.Id)
break
}
@ -1069,7 +1069,7 @@ func SimulateMsgExec(ak group.AccountKeeper,
msg := group.MsgExec{
ProposalId: uint64(proposalID),
Signer: acc.Address.String(),
Executor: acc.Address.String(),
}
txGen := simappparams.MakeTestEncodingConfig().TxConfig
tx, err := helpers.GenTx(

View File

@ -244,7 +244,7 @@ func (suite *SimTestSuite) TestSimulateSubmitProposal() {
err = legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg)
suite.Require().NoError(err)
suite.Require().True(operationMsg.OK)
suite.Require().Equal(groupPolicyRes.Address, msg.Address)
suite.Require().Equal(groupPolicyRes.Address, msg.GroupPolicyAddress)
suite.Require().Len(futureOperations, 0)
}
@ -452,7 +452,7 @@ func (suite *SimTestSuite) TestSimulateExec() {
err = legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg)
suite.Require().NoError(err)
suite.Require().True(operationMsg.OK)
suite.Require().Equal(addr, msg.Signer)
suite.Require().Equal(addr, msg.Executor)
suite.Require().Len(futureOperations, 0)
}
@ -631,7 +631,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyAdmin() {
err = legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg)
suite.Require().NoError(err)
suite.Require().True(operationMsg.OK)
suite.Require().Equal(groupPolicyRes.Address, msg.Address)
suite.Require().Equal(groupPolicyRes.Address, msg.GroupPolicyAddress)
suite.Require().Len(futureOperations, 0)
}
@ -684,7 +684,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyDecisionPolicy() {
err = legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg)
suite.Require().NoError(err)
suite.Require().True(operationMsg.OK)
suite.Require().Equal(groupPolicyRes.Address, msg.Address)
suite.Require().Equal(groupPolicyRes.Address, msg.GroupPolicyAddress)
suite.Require().Len(futureOperations, 0)
}
@ -737,7 +737,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyMetadata() {
err = legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg)
suite.Require().NoError(err)
suite.Require().True(operationMsg.OK)
suite.Require().Equal(groupPolicyRes.Address, msg.Address)
suite.Require().Equal(groupPolicyRes.Address, msg.GroupPolicyAddress)
suite.Require().Len(futureOperations, 0)
}

View File

@ -572,8 +572,8 @@ func (m *MsgCreateGroupPolicyResponse) GetAddress() string {
type MsgUpdateGroupPolicyAdmin struct {
// admin is the account address of the group admin.
Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"`
// address is the account address of the group policy.
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
// group_policy_address is the account address of the group policy.
GroupPolicyAddress string `protobuf:"bytes,2,opt,name=group_policy_address,json=groupPolicyAddress,proto3" json:"group_policy_address,omitempty"`
// new_admin is the new group policy admin.
NewAdmin string `protobuf:"bytes,3,opt,name=new_admin,json=newAdmin,proto3" json:"new_admin,omitempty"`
}
@ -618,9 +618,9 @@ func (m *MsgUpdateGroupPolicyAdmin) GetAdmin() string {
return ""
}
func (m *MsgUpdateGroupPolicyAdmin) GetAddress() string {
func (m *MsgUpdateGroupPolicyAdmin) GetGroupPolicyAddress() string {
if m != nil {
return m.Address
return m.GroupPolicyAddress
}
return ""
}
@ -642,7 +642,8 @@ type MsgCreateGroupWithPolicy struct {
GroupMetadata string `protobuf:"bytes,3,opt,name=group_metadata,json=groupMetadata,proto3" json:"group_metadata,omitempty"`
// group_policy_metadata is any arbitrary metadata attached to the group policy.
GroupPolicyMetadata string `protobuf:"bytes,4,opt,name=group_policy_metadata,json=groupPolicyMetadata,proto3" json:"group_policy_metadata,omitempty"`
// group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin.
// group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group
// and group policy admin.
GroupPolicyAsAdmin bool `protobuf:"varint,5,opt,name=group_policy_as_admin,json=groupPolicyAsAdmin,proto3" json:"group_policy_as_admin,omitempty"`
// decision_policy specifies the group policy's decision policy.
DecisionPolicy *types.Any `protobuf:"bytes,6,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"`
@ -777,8 +778,8 @@ var xxx_messageInfo_MsgUpdateGroupPolicyAdminResponse proto.InternalMessageInfo
type MsgUpdateGroupPolicyDecisionPolicy struct {
// admin is the account address of the group admin.
Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"`
// address is the account address of group policy.
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
// group_policy_address is the account address of group policy.
GroupPolicyAddress string `protobuf:"bytes,2,opt,name=group_policy_address,json=groupPolicyAddress,proto3" json:"group_policy_address,omitempty"`
// decision_policy is the updated group policy's decision policy.
DecisionPolicy *types.Any `protobuf:"bytes,3,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"`
}
@ -861,8 +862,8 @@ var xxx_messageInfo_MsgUpdateGroupPolicyDecisionPolicyResponse proto.InternalMes
type MsgUpdateGroupPolicyMetadata struct {
// admin is the account address of the group admin.
Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"`
// address is the account address of group policy.
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
// group_policy_address is the account address of group policy.
GroupPolicyAddress string `protobuf:"bytes,2,opt,name=group_policy_address,json=groupPolicyAddress,proto3" json:"group_policy_address,omitempty"`
// metadata is the updated group policy metadata.
Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
}
@ -907,9 +908,9 @@ func (m *MsgUpdateGroupPolicyMetadata) GetAdmin() string {
return ""
}
func (m *MsgUpdateGroupPolicyMetadata) GetAddress() string {
func (m *MsgUpdateGroupPolicyMetadata) GetGroupPolicyAddress() string {
if m != nil {
return m.Address
return m.GroupPolicyAddress
}
return ""
}
@ -960,8 +961,8 @@ var xxx_messageInfo_MsgUpdateGroupPolicyMetadataResponse proto.InternalMessageIn
// 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"`
// group_policy_address is the account address of group policy.
GroupPolicyAddress string `protobuf:"bytes,1,opt,name=group_policy_address,json=groupPolicyAddress,proto3" json:"group_policy_address,omitempty"`
// proposers are the account addresses of the proposers.
// Proposers signatures will be counted as yes votes.
Proposers []string `protobuf:"bytes,2,rep,name=proposers,proto3" json:"proposers,omitempty"`
@ -1270,8 +1271,8 @@ var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo
type MsgExec 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"`
// signer is the account address used to execute the proposal.
Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"`
// executor is the account address used to execute the proposal.
Executor string `protobuf:"bytes,2,opt,name=executor,proto3" json:"executor,omitempty"`
}
func (m *MsgExec) Reset() { *m = MsgExec{} }
@ -1314,9 +1315,9 @@ func (m *MsgExec) GetProposalId() uint64 {
return 0
}
func (m *MsgExec) GetSigner() string {
func (m *MsgExec) GetExecutor() string {
if m != nil {
return m.Signer
return m.Executor
}
return ""
}
@ -1485,84 +1486,85 @@ func init() {
func init() { proto.RegisterFile("cosmos/group/v1/tx.proto", fileDescriptor_6b8d3d629f136420) }
var fileDescriptor_6b8d3d629f136420 = []byte{
// 1232 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4b, 0x6f, 0xe3, 0x54,
0x14, 0xce, 0x6d, 0x32, 0x7d, 0x9c, 0x4c, 0xd3, 0xd6, 0x4d, 0xa7, 0xa9, 0x3b, 0x93, 0x04, 0xd3,
0xe9, 0x74, 0xa2, 0xa9, 0x33, 0x4d, 0x35, 0x42, 0x2a, 0x08, 0xa9, 0x2f, 0x50, 0x11, 0x81, 0xe2,
0xce, 0x30, 0xc0, 0x26, 0xb8, 0xb1, 0xc7, 0x63, 0x68, 0x72, 0xad, 0x5c, 0xa7, 0x8f, 0x25, 0xac,
0x40, 0x6c, 0x90, 0xf8, 0x03, 0x20, 0x76, 0xac, 0x58, 0xf4, 0x17, 0xc0, 0x66, 0xc4, 0x6a, 0xc4,
0x8a, 0x15, 0x1a, 0xb5, 0x0b, 0x24, 0xd8, 0xf1, 0x0b, 0x90, 0xef, 0xb5, 0x6f, 0xec, 0xc4, 0xa9,
0xdd, 0x50, 0xcd, 0xaa, 0xb5, 0xcf, 0x77, 0x1e, 0xdf, 0x39, 0xe7, 0x9e, 0x7b, 0x1c, 0xc8, 0xd5,
0x31, 0x69, 0x60, 0x52, 0x36, 0x5a, 0xb8, 0x6d, 0x95, 0x0f, 0x57, 0xca, 0xf6, 0xb1, 0x6c, 0xb5,
0xb0, 0x8d, 0x85, 0x09, 0x26, 0x91, 0xa9, 0x44, 0x3e, 0x5c, 0x11, 0xb3, 0x06, 0x36, 0x30, 0x95,
0x95, 0x9d, 0xff, 0x18, 0x4c, 0x9c, 0x63, 0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e, 0x1b, 0x8a, 0xfc, 0x36, 0x24, 0xc9, 0x40, 0xcc,
0x05, 0x79, 0xd9, 0x16, 0xa1, 0x38, 0xcc, 0xe2, 0x8d, 0x41, 0xce, 0xd5, 0xc0, 0x18, 0xb6, 0x25,
0x38, 0x86, 0x77, 0x44, 0xf0, 0x0f, 0x01, 0x3c, 0xf3, 0x21, 0x1f, 0x84, 0xef, 0xd9, 0x85, 0x95,
0xcb, 0xed, 0x6e, 0xd4, 0xed, 0x37, 0x9f, 0x9d, 0xe7, 0xb9, 0xe7, 0xe7, 0x79, 0xee, 0xc5, 0x79,
0x9e, 0xfb, 0xee, 0x22, 0x1f, 0x7b, 0x7e, 0x91, 0x8f, 0xfd, 0x71, 0x91, 0x8f, 0x7d, 0xb2, 0xac,
0x1b, 0xd6, 0xd3, 0xce, 0x91, 0x54, 0x47, 0x4d, 0xe7, 0xd7, 0x3d, 0xe7, 0xcf, 0x1a, 0x56, 0x3f,
0x2b, 0x77, 0xe9, 0x2f, 0x78, 0x47, 0x13, 0xe4, 0x82, 0xb5, 0xf1, 0x6f, 0x00, 0x00, 0x00, 0xff,
0xff, 0x91, 0xea, 0x5a, 0x20, 0x4f, 0x14, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -2533,10 +2535,10 @@ func (m *MsgUpdateGroupPolicyAdmin) MarshalToSizedBuffer(dAtA []byte) (int, erro
i--
dAtA[i] = 0x1a
}
if len(m.Address) > 0 {
i -= len(m.Address)
copy(dAtA[i:], m.Address)
i = encodeVarintTx(dAtA, i, uint64(len(m.Address)))
if len(m.GroupPolicyAddress) > 0 {
i -= len(m.GroupPolicyAddress)
copy(dAtA[i:], m.GroupPolicyAddress)
i = encodeVarintTx(dAtA, i, uint64(len(m.GroupPolicyAddress)))
i--
dAtA[i] = 0x12
}
@ -2720,10 +2722,10 @@ func (m *MsgUpdateGroupPolicyDecisionPolicy) MarshalToSizedBuffer(dAtA []byte) (
i--
dAtA[i] = 0x1a
}
if len(m.Address) > 0 {
i -= len(m.Address)
copy(dAtA[i:], m.Address)
i = encodeVarintTx(dAtA, i, uint64(len(m.Address)))
if len(m.GroupPolicyAddress) > 0 {
i -= len(m.GroupPolicyAddress)
copy(dAtA[i:], m.GroupPolicyAddress)
i = encodeVarintTx(dAtA, i, uint64(len(m.GroupPolicyAddress)))
i--
dAtA[i] = 0x12
}
@ -2787,10 +2789,10 @@ func (m *MsgUpdateGroupPolicyMetadata) MarshalToSizedBuffer(dAtA []byte) (int, e
i--
dAtA[i] = 0x1a
}
if len(m.Address) > 0 {
i -= len(m.Address)
copy(dAtA[i:], m.Address)
i = encodeVarintTx(dAtA, i, uint64(len(m.Address)))
if len(m.GroupPolicyAddress) > 0 {
i -= len(m.GroupPolicyAddress)
copy(dAtA[i:], m.GroupPolicyAddress)
i = encodeVarintTx(dAtA, i, uint64(len(m.GroupPolicyAddress)))
i--
dAtA[i] = 0x12
}
@ -2882,10 +2884,10 @@ func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
dAtA[i] = 0x12
}
}
if len(m.Address) > 0 {
i -= len(m.Address)
copy(dAtA[i:], m.Address)
i = encodeVarintTx(dAtA, i, uint64(len(m.Address)))
if len(m.GroupPolicyAddress) > 0 {
i -= len(m.GroupPolicyAddress)
copy(dAtA[i:], m.GroupPolicyAddress)
i = encodeVarintTx(dAtA, i, uint64(len(m.GroupPolicyAddress)))
i--
dAtA[i] = 0xa
}
@ -3073,10 +3075,10 @@ func (m *MsgExec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if len(m.Signer) > 0 {
i -= len(m.Signer)
copy(dAtA[i:], m.Signer)
i = encodeVarintTx(dAtA, i, uint64(len(m.Signer)))
if len(m.Executor) > 0 {
i -= len(m.Executor)
copy(dAtA[i:], m.Executor)
i = encodeVarintTx(dAtA, i, uint64(len(m.Executor)))
i--
dAtA[i] = 0x12
}
@ -3351,7 +3353,7 @@ func (m *MsgUpdateGroupPolicyAdmin) Size() (n int) {
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
l = len(m.Address)
l = len(m.GroupPolicyAddress)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
@ -3431,7 +3433,7 @@ func (m *MsgUpdateGroupPolicyDecisionPolicy) Size() (n int) {
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
l = len(m.Address)
l = len(m.GroupPolicyAddress)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
@ -3461,7 +3463,7 @@ func (m *MsgUpdateGroupPolicyMetadata) Size() (n int) {
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
l = len(m.Address)
l = len(m.GroupPolicyAddress)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
@ -3487,7 +3489,7 @@ func (m *MsgSubmitProposal) Size() (n int) {
}
var l int
_ = l
l = len(m.Address)
l = len(m.GroupPolicyAddress)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
@ -3594,7 +3596,7 @@ func (m *MsgExec) Size() (n int) {
if m.ProposalId != 0 {
n += 1 + sovTx(uint64(m.ProposalId))
}
l = len(m.Signer)
l = len(m.Executor)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
@ -4723,7 +4725,7 @@ func (m *MsgUpdateGroupPolicyAdmin) Unmarshal(dAtA []byte) error {
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field GroupPolicyAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@ -4751,7 +4753,7 @@ func (m *MsgUpdateGroupPolicyAdmin) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Address = string(dAtA[iNdEx:postIndex])
m.GroupPolicyAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
@ -5256,7 +5258,7 @@ func (m *MsgUpdateGroupPolicyDecisionPolicy) Unmarshal(dAtA []byte) error {
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field GroupPolicyAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@ -5284,7 +5286,7 @@ func (m *MsgUpdateGroupPolicyDecisionPolicy) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Address = string(dAtA[iNdEx:postIndex])
m.GroupPolicyAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
@ -5456,7 +5458,7 @@ func (m *MsgUpdateGroupPolicyMetadata) Unmarshal(dAtA []byte) error {
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field GroupPolicyAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@ -5484,7 +5486,7 @@ func (m *MsgUpdateGroupPolicyMetadata) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Address = string(dAtA[iNdEx:postIndex])
m.GroupPolicyAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
@ -5620,7 +5622,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error {
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field GroupPolicyAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@ -5648,7 +5650,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Address = string(dAtA[iNdEx:postIndex])
m.GroupPolicyAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
@ -6279,7 +6281,7 @@ func (m *MsgExec) Unmarshal(dAtA []byte) error {
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field Executor", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@ -6307,7 +6309,7 @@ func (m *MsgExec) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Signer = string(dAtA[iNdEx:postIndex])
m.Executor = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex

View File

@ -15,8 +15,14 @@ import (
"github.com/cosmos/cosmos-sdk/x/group/internal/orm"
)
// DecisionPolicyResult is the result of whether a proposal passes or not a
// decision policy.
type DecisionPolicyResult struct {
// Allow determines if the proposal is allowed to pass.
Allow bool
// Final determines if the tally result is final or not. If final, then
// votes are pruned, and the tally result is saved in the proposal's
// `FinalTallyResult` field.
Final bool
}
@ -359,7 +365,7 @@ func (p Proposal) ValidateBasic() error {
if p.Id == 0 {
return sdkerrors.Wrap(errors.ErrEmpty, "proposal id")
}
_, err := sdk.AccAddressFromBech32(p.Address)
_, err := sdk.AccAddressFromBech32(p.GroupPolicyAddress)
if err != nil {
return sdkerrors.Wrap(err, "proposal group policy address")
}

View File

@ -34,7 +34,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type VoteOption int32
const (
// VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
// VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will
// return an error.
VOTE_OPTION_UNSPECIFIED VoteOption = 0
// VOTE_OPTION_YES defines a yes vote option.
VOTE_OPTION_YES VoteOption = 1
@ -76,31 +77,38 @@ type ProposalStatus int32
const (
// An empty value is invalid and not allowed.
PROPOSAL_STATUS_UNSPECIFIED ProposalStatus = 0
// Initial status of a proposal when persisted.
// Initial status of a proposal when submitted.
PROPOSAL_STATUS_SUBMITTED ProposalStatus = 1
// Final status of a proposal when the final tally was executed.
PROPOSAL_STATUS_CLOSED ProposalStatus = 2
// Final status of a proposal when the group was modified before the final tally.
PROPOSAL_STATUS_ABORTED ProposalStatus = 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 ProposalStatus = 4
// Final status of a proposal when the final tally is done and the outcome
// passes the group policy's decision policy.
PROPOSAL_STATUS_ACCEPTED ProposalStatus = 2
// Final status of a proposal when the final tally is done and the outcome
// is rejected by the group policy's decision policy.
PROPOSAL_STATUS_REJECTED ProposalStatus = 3
// Final status of a proposal when the group policy is modified before the
// final tally.
PROPOSAL_STATUS_ABORTED ProposalStatus = 4
// A proposal can be withdrawn before the voting start time by the owner.
// When this happens the final status is Withdrawn.
PROPOSAL_STATUS_WITHDRAWN ProposalStatus = 5
)
var ProposalStatus_name = map[int32]string{
0: "PROPOSAL_STATUS_UNSPECIFIED",
1: "PROPOSAL_STATUS_SUBMITTED",
2: "PROPOSAL_STATUS_CLOSED",
3: "PROPOSAL_STATUS_ABORTED",
4: "PROPOSAL_STATUS_WITHDRAWN",
2: "PROPOSAL_STATUS_ACCEPTED",
3: "PROPOSAL_STATUS_REJECTED",
4: "PROPOSAL_STATUS_ABORTED",
5: "PROPOSAL_STATUS_WITHDRAWN",
}
var ProposalStatus_value = map[string]int32{
"PROPOSAL_STATUS_UNSPECIFIED": 0,
"PROPOSAL_STATUS_SUBMITTED": 1,
"PROPOSAL_STATUS_CLOSED": 2,
"PROPOSAL_STATUS_ABORTED": 3,
"PROPOSAL_STATUS_WITHDRAWN": 4,
"PROPOSAL_STATUS_ACCEPTED": 2,
"PROPOSAL_STATUS_REJECTED": 3,
"PROPOSAL_STATUS_ABORTED": 4,
"PROPOSAL_STATUS_WITHDRAWN": 5,
}
func (x ProposalStatus) String() string {
@ -111,42 +119,6 @@ func (ProposalStatus) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_f5bddd15d7a54a9d, []int{1}
}
// ProposalResult defines types of proposal results.
type ProposalResult int32
const (
// An empty value is invalid and not allowed
PROPOSAL_RESULT_UNSPECIFIED ProposalResult = 0
// Until a final tally has happened the status is unfinalized
PROPOSAL_RESULT_UNFINALIZED ProposalResult = 1
// Final result of the tally
PROPOSAL_RESULT_ACCEPTED ProposalResult = 2
// Final result of the tally
PROPOSAL_RESULT_REJECTED ProposalResult = 3
)
var ProposalResult_name = map[int32]string{
0: "PROPOSAL_RESULT_UNSPECIFIED",
1: "PROPOSAL_RESULT_UNFINALIZED",
2: "PROPOSAL_RESULT_ACCEPTED",
3: "PROPOSAL_RESULT_REJECTED",
}
var ProposalResult_value = map[string]int32{
"PROPOSAL_RESULT_UNSPECIFIED": 0,
"PROPOSAL_RESULT_UNFINALIZED": 1,
"PROPOSAL_RESULT_ACCEPTED": 2,
"PROPOSAL_RESULT_REJECTED": 3,
}
func (x ProposalResult) String() string {
return proto.EnumName(ProposalResult_name, int32(x))
}
func (ProposalResult) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_f5bddd15d7a54a9d, []int{2}
}
// ProposalExecutorResult defines types of proposal executor results.
type ProposalExecutorResult int32
@ -180,7 +152,7 @@ func (x ProposalExecutorResult) String() string {
}
func (ProposalExecutorResult) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_f5bddd15d7a54a9d, []int{3}
return fileDescriptor_f5bddd15d7a54a9d, []int{2}
}
// Member represents a group member with an account address,
@ -190,7 +162,7 @@ type Member struct {
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// weight is the member's voting weight that should be greater than 0.
Weight string `protobuf:"bytes,2,opt,name=weight,proto3" json:"weight,omitempty"`
// metadata is any arbitrary metadata to attached to the member.
// metadata is any arbitrary metadata attached to the member.
Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
// added_at is a timestamp specifying when a member was added.
AddedAt time.Time `protobuf:"bytes,4,opt,name=added_at,json=addedAt,proto3,stdtime" json:"added_at"`
@ -303,9 +275,15 @@ func (m *Members) GetMembers() []Member {
return nil
}
// ThresholdDecisionPolicy implements the DecisionPolicy interface
// ThresholdDecisionPolicy is a decision policy where a proposal passes when it
// satisfies the two following conditions:
// 1. The sum of all `YES` voters' weights is greater or equal than the defined
// `threshold`.
// 2. The voting and execution periods of the proposal respect the parameters
// given by `windows`.
type ThresholdDecisionPolicy struct {
// threshold is the minimum weighted sum of yes votes that must be met or exceeded for a proposal to succeed.
// threshold is the minimum weighted sum of `YES` votes that must be met or
// exceeded for a proposal to succeed.
Threshold string `protobuf:"bytes,1,opt,name=threshold,proto3" json:"threshold,omitempty"`
// windows defines the different windows for voting and execution.
Windows *DecisionPolicyWindows `protobuf:"bytes,2,opt,name=windows,proto3" json:"windows,omitempty"`
@ -358,9 +336,15 @@ func (m *ThresholdDecisionPolicy) GetWindows() *DecisionPolicyWindows {
return nil
}
// PercentageDecisionPolicy implements the DecisionPolicy interface
// PercentageDecisionPolicy is a decision policy where a proposal passes when
// it satisfies the two following conditions:
// 1. The percentage of all `YES` voters' weights out of the total group weight
// is greater or equal than the given `percentage`.
// 2. The voting and execution periods of the proposal respect the parameters
// given by `windows`.
type PercentageDecisionPolicy struct {
// percentage is the minimum percentage the weighted sum of yes votes must meet for a proposal to succeed.
// percentage is the minimum percentage the weighted sum of `YES` votes must
// meet for a proposal to succeed.
Percentage string `protobuf:"bytes,1,opt,name=percentage,proto3" json:"percentage,omitempty"`
// windows defines the different windows for voting and execution.
Windows *DecisionPolicyWindows `protobuf:"bytes,2,opt,name=windows,proto3" json:"windows,omitempty"`
@ -687,40 +671,39 @@ var xxx_messageInfo_GroupPolicyInfo proto.InternalMessageInfo
type Proposal struct {
// id is the unique id of the proposal.
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// address is the account address of group policy.
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
// group_policy_address is the account address of group policy.
GroupPolicyAddress string `protobuf:"bytes,2,opt,name=group_policy_address,json=groupPolicyAddress,proto3" json:"group_policy_address,omitempty"`
// metadata is any arbitrary metadata to attached to the proposal.
Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
// proposers are the account addresses of the proposers.
Proposers []string `protobuf:"bytes,4,rep,name=proposers,proto3" json:"proposers,omitempty"`
// submit_time is a timestamp specifying when a proposal was submitted.
SubmitTime time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time"`
// 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.
// group_version tracks the version of the group at proposal submission.
// This field is here for informational purposes only.
GroupVersion uint64 `protobuf:"varint,6,opt,name=group_version,json=groupVersion,proto3" json:"group_version,omitempty"`
// group_policy_version tracks the version of the group policy that this proposal corresponds to.
// When a decision policy is changed, existing proposals from previous policy versions will become invalid.
// group_policy_version tracks the version of the group policy at proposal submission.
// When a decision policy is changed, existing proposals from previous policy
// versions will become invalid with the `ABORTED` status.
// This field is here for informational purposes only.
GroupPolicyVersion uint64 `protobuf:"varint,7,opt,name=group_policy_version,json=groupPolicyVersion,proto3" json:"group_policy_version,omitempty"`
// status represents the high level position in the life cycle of the proposal. Initial value is Submitted.
Status ProposalStatus `protobuf:"varint,8,opt,name=status,proto3,enum=cosmos.group.v1.ProposalStatus" json:"status,omitempty"`
// 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 ProposalResult `protobuf:"varint,9,opt,name=result,proto3,enum=cosmos.group.v1.ProposalResult" json:"result,omitempty"`
// 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.
FinalTallyResult TallyResult `protobuf:"bytes,10,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result"`
// proposal for each vote option. It is empty at submission, and only
// populated after tallying, at voting period end or at proposal execution,
// whichever happens first.
FinalTallyResult TallyResult `protobuf:"bytes,9,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result"`
// voting_period_end is the timestamp before which voting must be done.
// Unless a successfull MsgExec is called before (to execute a proposal whose
// tally is successful before the voting period ends), tallying will be done
// at this point, and the `final_tally_result`, as well
// as `status` and `result` fields will be accordingly updated.
VotingPeriodEnd time.Time `protobuf:"bytes,11,opt,name=voting_period_end,json=votingPeriodEnd,proto3,stdtime" json:"voting_period_end"`
// at this point, and the `final_tally_result`and `status` fields will be
// accordingly updated.
VotingPeriodEnd time.Time `protobuf:"bytes,10,opt,name=voting_period_end,json=votingPeriodEnd,proto3,stdtime" json:"voting_period_end"`
// executor_result is the final result based on the votes and election rule. Initial value is NotRun.
ExecutorResult ProposalExecutorResult `protobuf:"varint,12,opt,name=executor_result,json=executorResult,proto3,enum=cosmos.group.v1.ProposalExecutorResult" json:"executor_result,omitempty"`
// messages is a list of Msgs that will be executed if the proposal passes.
Messages []*types.Any `protobuf:"bytes,13,rep,name=messages,proto3" json:"messages,omitempty"`
ExecutorResult ProposalExecutorResult `protobuf:"varint,11,opt,name=executor_result,json=executorResult,proto3,enum=cosmos.group.v1.ProposalExecutorResult" json:"executor_result,omitempty"`
// messages is a list of `sdk.Msg`s that will be executed if the proposal passes.
Messages []*types.Any `protobuf:"bytes,12,rep,name=messages,proto3" json:"messages,omitempty"`
}
func (m *Proposal) Reset() { *m = Proposal{} }
@ -762,7 +745,7 @@ type TallyResult struct {
YesCount string `protobuf:"bytes,1,opt,name=yes_count,json=yesCount,proto3" json:"yes_count,omitempty"`
// abstain_count is the weighted sum of abstainers.
AbstainCount string `protobuf:"bytes,2,opt,name=abstain_count,json=abstainCount,proto3" json:"abstain_count,omitempty"`
// no is the weighted sum of no votes.
// no_count is the weighted sum of no votes.
NoCount string `protobuf:"bytes,3,opt,name=no_count,json=noCount,proto3" json:"no_count,omitempty"`
// no_with_veto_count is the weighted sum of veto.
NoWithVetoCount string `protobuf:"bytes,4,opt,name=no_with_veto_count,json=noWithVetoCount,proto3" json:"no_with_veto_count,omitempty"`
@ -886,7 +869,6 @@ func (m *Vote) GetSubmitTime() time.Time {
func init() {
proto.RegisterEnum("cosmos.group.v1.VoteOption", VoteOption_name, VoteOption_value)
proto.RegisterEnum("cosmos.group.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value)
proto.RegisterEnum("cosmos.group.v1.ProposalResult", ProposalResult_name, ProposalResult_value)
proto.RegisterEnum("cosmos.group.v1.ProposalExecutorResult", ProposalExecutorResult_name, ProposalExecutorResult_value)
proto.RegisterType((*Member)(nil), "cosmos.group.v1.Member")
proto.RegisterType((*Members)(nil), "cosmos.group.v1.Members")
@ -904,91 +886,89 @@ func init() {
func init() { proto.RegisterFile("cosmos/group/v1/types.proto", fileDescriptor_f5bddd15d7a54a9d) }
var fileDescriptor_f5bddd15d7a54a9d = []byte{
// 1340 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcd, 0x6f, 0x1b, 0x45,
0x14, 0xf7, 0x3a, 0x8e, 0x3f, 0x9e, 0x53, 0xdb, 0x4c, 0x43, 0xb3, 0xf9, 0xc0, 0x0e, 0xa6, 0x82,
0xa8, 0xa8, 0x76, 0xeb, 0x4a, 0x54, 0xea, 0x01, 0xb0, 0x9d, 0x2d, 0x35, 0x4a, 0x6d, 0xb3, 0xbb,
0x4e, 0x68, 0x2f, 0xab, 0x8d, 0x77, 0xea, 0xac, 0xb0, 0x77, 0xac, 0xdd, 0x71, 0x52, 0xff, 0x07,
0xbd, 0x20, 0x7a, 0xe0, 0xc0, 0x05, 0xa9, 0x12, 0x77, 0x24, 0xa4, 0x1e, 0x10, 0x7f, 0x41, 0xc5,
0xa9, 0xe2, 0xc4, 0x09, 0xaa, 0xf6, 0x52, 0x4e, 0xfc, 0x0b, 0x68, 0x67, 0x66, 0x1d, 0x7f, 0xc5,
0xb4, 0x15, 0x9c, 0xe2, 0x79, 0xef, 0xf7, 0xde, 0xfc, 0xde, 0xe7, 0x64, 0x61, 0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, 0x58, 0x90, 0x91, 0x39, 0xdd, 0x7a, 0x5b, 0x0d, 0xc0, 0xf8, 0x49, 0xf7, 0x06,
0x01, 0x6d, 0xab, 0xb5, 0xdd, 0x56, 0x7e, 0x49, 0x04, 0xf4, 0x83, 0x04, 0x17, 0x4e, 0x9e, 0x2b,
0xb4, 0x05, 0x97, 0x8e, 0xf4, 0x95, 0xcf, 0x94, 0x46, 0x57, 0x6f, 0xab, 0x86, 0xaa, 0x68, 0xdd,
0xbb, 0xfa, 0x4c, 0x84, 0x97, 0x60, 0xf3, 0x54, 0x66, 0xab, 0xad, 0x1b, 0x6a, 0xb7, 0x95, 0x97,
0x16, 0xb2, 0xb4, 0x6e, 0xa3, 0xa1, 0x68, 0x5a, 0x3e, 0xba, 0x90, 0x75, 0xab, 0xd6, 0xbc, 0xdb,
0x55, 0x95, 0x7c, 0x8c, 0x3b, 0x5f, 0xff, 0xf0, 0xd9, 0x8b, 0x82, 0xf4, 0xfc, 0x45, 0x41, 0xfa,
0xe3, 0x45, 0x41, 0x7a, 0xfc, 0xb2, 0x10, 0x79, 0xfe, 0xb2, 0x10, 0xf9, 0xf5, 0x65, 0x21, 0xf2,
0xf9, 0x25, 0xdb, 0xa1, 0xfb, 0xa3, 0xbd, 0x72, 0x8f, 0x0c, 0xc4, 0x97, 0x84, 0xf8, 0x73, 0xc5,
0xb7, 0xbe, 0xa8, 0x3c, 0xe4, 0x1f, 0x3a, 0x7b, 0x09, 0xd6, 0x89, 0xd7, 0xff, 0x0e, 0x00, 0x00,
0xff, 0xff, 0x5b, 0x5c, 0x1c, 0x07, 0xff, 0x0c, 0x00, 0x00,
}
func (this *GroupPolicyInfo) Equal(that interface{}) bool {
@ -1452,13 +1432,13 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintTypes(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x6a
dAtA[i] = 0x62
}
}
if m.ExecutorResult != 0 {
i = encodeVarintTypes(dAtA, i, uint64(m.ExecutorResult))
i--
dAtA[i] = 0x60
dAtA[i] = 0x58
}
n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.VotingPeriodEnd, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingPeriodEnd):])
if err10 != nil {
@ -1467,7 +1447,7 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i -= n10
i = encodeVarintTypes(dAtA, i, uint64(n10))
i--
dAtA[i] = 0x5a
dAtA[i] = 0x52
{
size, err := m.FinalTallyResult.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
@ -1477,12 +1457,7 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintTypes(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x52
if m.Result != 0 {
i = encodeVarintTypes(dAtA, i, uint64(m.Result))
i--
dAtA[i] = 0x48
}
dAtA[i] = 0x4a
if m.Status != 0 {
i = encodeVarintTypes(dAtA, i, uint64(m.Status))
i--
@ -1522,10 +1497,10 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x1a
}
if len(m.Address) > 0 {
i -= len(m.Address)
copy(dAtA[i:], m.Address)
i = encodeVarintTypes(dAtA, i, uint64(len(m.Address)))
if len(m.GroupPolicyAddress) > 0 {
i -= len(m.GroupPolicyAddress)
copy(dAtA[i:], m.GroupPolicyAddress)
i = encodeVarintTypes(dAtA, i, uint64(len(m.GroupPolicyAddress)))
i--
dAtA[i] = 0x12
}
@ -1826,7 +1801,7 @@ func (m *Proposal) Size() (n int) {
if m.Id != 0 {
n += 1 + sovTypes(uint64(m.Id))
}
l = len(m.Address)
l = len(m.GroupPolicyAddress)
if l > 0 {
n += 1 + l + sovTypes(uint64(l))
}
@ -1851,9 +1826,6 @@ func (m *Proposal) Size() (n int) {
if m.Status != 0 {
n += 1 + sovTypes(uint64(m.Status))
}
if m.Result != 0 {
n += 1 + sovTypes(uint64(m.Result))
}
l = m.FinalTallyResult.Size()
n += 1 + l + sovTypes(uint64(l))
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingPeriodEnd)
@ -3166,7 +3138,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error {
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field GroupPolicyAddress", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@ -3194,7 +3166,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Address = string(dAtA[iNdEx:postIndex])
m.GroupPolicyAddress = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
@ -3351,25 +3323,6 @@ func (m *Proposal) Unmarshal(dAtA []byte) error {
}
}
case 9:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType)
}
m.Result = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTypes
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Result |= ProposalResult(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 10:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field FinalTallyResult", wireType)
}
@ -3402,7 +3355,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
case 11:
case 10:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field VotingPeriodEnd", wireType)
}
@ -3435,7 +3388,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
case 12:
case 11:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ExecutorResult", wireType)
}
@ -3454,7 +3407,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error {
break
}
}
case 13:
case 12:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType)
}