diff --git a/incubator/group/integration_test.go b/incubator/group/integration_test.go index fd30054..c5ecd84 100644 --- a/incubator/group/integration_test.go +++ b/incubator/group/integration_test.go @@ -276,7 +276,7 @@ func TestFullProposalWorkflow(t *testing.T) { Proposers: []sdk.AccAddress{myAddr}, Comment: "ok", }, - Msgs: []testdata.MyAppMsg{{Sum: &testdata.MyAppMsg_A{A: &testdata.MyAppProposalPayloadMsgA{}}}}, + Msgs: []testdata.MyAppMsg{{Sum: &testdata.MyAppMsg_A{A: &testdata.MsgAlwaysSucceed{}}}}, }, testdata.MsgPropose{ Base: group.MsgProposeBase{ diff --git a/incubator/group/keeper.go b/incubator/group/keeper.go index e6096dd..946113a 100644 --- a/incubator/group/keeper.go +++ b/incubator/group/keeper.go @@ -344,7 +344,6 @@ func (k Keeper) Vote(ctx sdk.Context, id ProposalID, voters []sdk.AccAddress, ch return errors.Wrap(err, "load group account") } if base.GroupAccountVersion != accountMetadata.Base.Version { - // todo: this is not the voters fault so we return an error to rollback the TX return errors.Wrap(ErrModified, "group account was modified") } @@ -353,7 +352,6 @@ func (k Keeper) Vote(ctx sdk.Context, id ProposalID, voters []sdk.AccAddress, ch return err } if electorate.Version != base.GroupVersion { - // todo: this is not the voters fault so we return an error to rollback the TX return errors.Wrap(ErrModified, "group was modified") } @@ -380,7 +378,15 @@ func (k Keeper) Vote(ctx sdk.Context, id ProposalID, voters []sdk.AccAddress, ch } // run tally with new votes to close early + if err := doTally(ctx, &base, electorate, accountMetadata); err != nil { + return err + } + + proposal.SetBase(base) + return k.proposalTable.Save(ctx, id.Uint64(), proposal) +} +func doTally(ctx sdk.Context, base *ProposalBase, electorate GroupMetadata, accountMetadata StdGroupAccountMetadata) error { policy := accountMetadata.DecisionPolicy.GetThreshold() submittedAt, err := types.TimestampFromProto(&base.SubmittedAt) if err != nil { @@ -396,9 +402,7 @@ func (k Keeper) Vote(ctx sdk.Context, id ProposalID, voters []sdk.AccAddress, ch base.Result = ProposalResultRejected base.Status = ProposalStatusClosed } - - proposal.SetBase(base) - return k.proposalTable.Save(ctx, id.Uint64(), proposal) + return nil } // ExecProposal can be executed n times before the timeout. It will update the proposal status and executes the msg payload. @@ -415,13 +419,6 @@ func (k Keeper) ExecProposal(ctx sdk.Context, id ProposalID) error { if base.Status != ProposalStatusSubmitted && base.Status != ProposalStatusClosed { return errors.Wrapf(ErrInvalid, "not possible with proposal status %s", base.Status.String()) } - votingPeriodEnd, err := types.TimestampFromProto(&base.Timeout) - if err != nil { - return err - } - if ctx.BlockTime().After(votingPeriodEnd) { - return errors.Wrap(ErrExpired, "proposal has timed out already") - } var accountMetadata StdGroupAccountMetadata if err := k.groupAccountTable.GetOne(ctx, base.GroupAccount.Bytes(), &accountMetadata); err != nil { @@ -433,75 +430,41 @@ func (k Keeper) ExecProposal(ctx sdk.Context, id ProposalID) error { return k.proposalTable.Save(ctx, id.Uint64(), proposal) } - if base.GroupAccountVersion != accountMetadata.Base.Version { - base.Result = ProposalResultUndefined - base.Status = ProposalStatusAborted - return storeUpdates() - } - - electorate, err := k.GetGroup(ctx, accountMetadata.Base.Group) - if err != nil { - return errors.Wrap(err, "load group") - } - - if electorate.Version != base.GroupVersion { - base.Result = ProposalResultUndefined - base.Status = ProposalStatusAborted - return storeUpdates() - } - if base.Status == ProposalStatusSubmitted { - // proposal was not closed early so run decision policy - policy := accountMetadata.DecisionPolicy.GetThreshold() - if policy == nil { - return errors.Wrap(ErrInvalid, "unknown decision policy") + if base.GroupAccountVersion != accountMetadata.Base.Version { + base.Result = ProposalResultUndefined + base.Status = ProposalStatusAborted + return storeUpdates() } - submittedAt, err := types.TimestampFromProto(&base.SubmittedAt) + electorate, err := k.GetGroup(ctx, accountMetadata.Base.Group) if err != nil { - return errors.Wrap(err, "from proto time") + return errors.Wrap(err, "load group") } - switch result, err := policy.Allow(base.VoteState, electorate.TotalWeight, ctx.BlockTime().Sub(submittedAt)); { - case err != nil: - return errors.Wrap(err, "policy execution") - case result == DecisionPolicyResult{Allow: true, Final: true}: - base.Result = ProposalResultAccepted - base.Status = ProposalStatusClosed - case result == DecisionPolicyResult{Allow: false, Final: true}: - base.Result = ProposalResultRejected - base.Status = ProposalStatusClosed - default: - // there might be votes coming so we can not close it + + if electorate.Version != base.GroupVersion { + base.Result = ProposalResultUndefined + base.Status = ProposalStatusAborted + return storeUpdates() + } + if err := doTally(ctx, &base, electorate, accountMetadata); err != nil { + return err } } - if base.Status == ProposalStatusClosed && base.Result == ProposalResultAccepted { - + // execute proposal payload + if base.Status == ProposalStatusClosed && base.Result == ProposalResultAccepted && base.ExecutorResult != ProposalExecutorResultSuccess { logger := ctx.Logger().With("module", fmt.Sprintf("x/%s", ModuleName)) - proposalType := reflect.TypeOf(proposal).String() - - msgs := proposal.GetMsgs() - results := make([]sdk.Result, len(msgs)) - for i, msg := range msgs { - for _, acct := range msg.GetSigners() { - _ = acct - if !accountMetadata.Base.GroupAccount.Equals(acct) { - return errors.Wrap(errors.ErrUnauthorized, "proposal msg does not have permission") - } - } - - handler := k.router.Route(ctx, msg.Route()) - if handler == nil { - logger.Debug("no handler found", "type", proposalType, "proposalID", id, "route", msg.Route(), "pos", i) - return errors.Wrap(ErrInvalid, "no message handler found") - } - r, err := handler(ctx, msg) - if err != nil { - return errors.Wrapf(err, "message %q at position %d", msg.Type(), i) - } - results[i] = *r + ctx, flush := ctx.CacheContext() + _, err := doExecuteMsgs(ctx, k.router, accountMetadata.Base.GroupAccount, proposal.GetMsgs()) + if err != nil { + base.ExecutorResult = ProposalExecutorResultFailure + proposalType := reflect.TypeOf(proposal).String() + logger.Info("proposal execution failed", "cause", err, "type", proposalType, "proposalID", id) + } else { + base.ExecutorResult = ProposalExecutorResultSuccess + flush() } - _ = results // todo: merge results } return storeUpdates() } @@ -530,12 +493,17 @@ func (k Keeper) CreateProposal(ctx sdk.Context, accountAddress sdk.AccAddress, c return 0, errors.Wrap(err, "get group by account") } + // only members can propose for i := range proposers { if !k.groupMemberTable.Has(ctx, GroupMember{Group: g.Group, Member: proposers[i]}.NaturalKey()) { return 0, errors.Wrapf(ErrUnauthorized, "not in group: %s", proposers[i]) } } + if err := ensureMsgAuthZ(msgs, account.Base.GroupAccount); err != nil { + return 0, err + } + blockTime, err := types.TimestampProto(ctx.BlockTime()) if err != nil { return 0, errors.Wrap(err, "block time conversion") @@ -565,6 +533,7 @@ func (k Keeper) CreateProposal(ctx sdk.Context, accountAddress sdk.AccAddress, c GroupAccountVersion: account.Base.Version, Result: ProposalResultUndefined, Status: ProposalStatusSubmitted, + ExecutorResult: ProposalExecutorResultNotRun, Timeout: *endTime, VoteState: Tally{ YesCount: sdk.ZeroDec(), diff --git a/incubator/group/keeper_test.go b/incubator/group/keeper_test.go index 8768bb7..915017e 100644 --- a/incubator/group/keeper_test.go +++ b/incubator/group/keeper_test.go @@ -245,12 +245,12 @@ func TestCreateProposal(t *testing.T) { "all good with good msg payload": { srcAccount: accountAddr, srcProposers: []sdk.AccAddress{[]byte("valid-member-address")}, - srcMsgs: []sdk.Msg{&testdata.MyAppProposalPayloadMsgA{}, &testdata.MyAppProposalPayloadMsgB{}}, + srcMsgs: []sdk.Msg{&testdata.MsgAlwaysSucceed{}, &testdata.MsgAlwaysFail{}}, }, "invalid payload should be rejected": { srcAccount: accountAddr, srcProposers: []sdk.AccAddress{[]byte("valid-member-address")}, - srcMsgs: []sdk.Msg{testdata.MyAppProposalPayloadMsgA{}}, + srcMsgs: []sdk.Msg{testdata.MsgAlwaysSucceed{}}, srcComment: "payload not a pointer", expErr: true, }, @@ -296,6 +296,13 @@ func TestCreateProposal(t *testing.T) { srcProposers: []sdk.AccAddress{[]byte("valid--admin-address")}, expErr: true, }, + "reject msgs that are not authz by group account": { + srcAccount: accountAddr, + srcComment: "test", + srcMsgs: []sdk.Msg{&testdata.MsgAuthenticate{Signers: []sdk.AccAddress{[]byte("not-group-acct-addrs")}}}, + srcProposers: []sdk.AccAddress{[]byte("valid-member-address")}, + expErr: true, + }, } for msg, spec := range specs { t.Run(msg, func(t *testing.T) { @@ -377,7 +384,7 @@ func TestVote(t *testing.T) { srcChoice group.Choice srcComment string srcCtx sdk.Context - doBefore func(ctx sdk.Context) + doBefore func(t *testing.T, ctx sdk.Context) expErr bool expVoteState group.Tally expProposalStatus group.ProposalBase_Status @@ -448,6 +455,15 @@ func TestVote(t *testing.T) { expProposalStatus: group.ProposalStatusClosed, expResult: group.ProposalResultAccepted, }, + "reject new votes when final decision is made already": { + srcProposalID: myProposalID, + srcVoters: []sdk.AccAddress{[]byte("valid-member-address")}, + srcChoice: group.Choice_YES, + doBefore: func(t *testing.T, ctx sdk.Context) { + require.NoError(t, k.Vote(ctx, myProposalID, []sdk.AccAddress{[]byte("power-member-address")}, group.Choice_VETO, "")) + }, + expErr: true, + }, "comment too long": { srcProposalID: myProposalID, srcComment: strings.Repeat("a", 256), @@ -501,7 +517,7 @@ func TestVote(t *testing.T) { srcChoice: group.Choice_NO, expErr: true, }, - "after timeout": { + "on timeout": { srcProposalID: myProposalID, srcVoters: []sdk.AccAddress{[]byte("valid-member-address")}, srcChoice: group.Choice_NO, @@ -512,7 +528,7 @@ func TestVote(t *testing.T) { srcProposalID: myProposalID, srcVoters: []sdk.AccAddress{[]byte("valid-member-address")}, srcChoice: group.Choice_NO, - doBefore: func(ctx sdk.Context) { + doBefore: func(t *testing.T, ctx sdk.Context) { err := k.Vote(ctx, myProposalID, []sdk.AccAddress{[]byte("power-member-address")}, group.Choice_YES, "") require.NoError(t, err) }, @@ -522,7 +538,7 @@ func TestVote(t *testing.T) { srcProposalID: myProposalID, srcVoters: []sdk.AccAddress{[]byte("valid-member-address")}, srcChoice: group.Choice_NO, - doBefore: func(ctx sdk.Context) { + doBefore: func(t *testing.T, ctx sdk.Context) { err := k.Vote(ctx, myProposalID, []sdk.AccAddress{[]byte("valid-member-address")}, group.Choice_YES, "") require.NoError(t, err) }, @@ -532,10 +548,10 @@ func TestVote(t *testing.T) { srcProposalID: myProposalID, srcVoters: []sdk.AccAddress{[]byte("valid-member-address")}, srcChoice: group.Choice_NO, - doBefore: func(ctx sdk.Context) { + doBefore: func(t *testing.T, ctx sdk.Context) { g, err := k.GetGroup(ctx, myGroupID) require.NoError(t, err) - g.Comment = "modifed" + g.Comment = "modified" require.NoError(t, k.UpdateGroup(ctx, &g)) }, expErr: true, @@ -544,10 +560,10 @@ func TestVote(t *testing.T) { srcProposalID: myProposalID, srcVoters: []sdk.AccAddress{[]byte("valid-member-address")}, srcChoice: group.Choice_NO, - doBefore: func(ctx sdk.Context) { + doBefore: func(t *testing.T, ctx sdk.Context) { a, err := k.GetGroupAccount(ctx, accountAddr) require.NoError(t, err) - a.Base.Comment = "modifed" + a.Base.Comment = "modified" require.NoError(t, k.UpdateGroupAccount(ctx, &a)) }, expErr: true, @@ -562,7 +578,7 @@ func TestVote(t *testing.T) { ctx, _ = ctx.CacheContext() if spec.doBefore != nil { - spec.doBefore(ctx) + spec.doBefore(t, ctx) } err := k.Vote(ctx, spec.srcProposalID, spec.srcVoters, spec.srcChoice, spec.srcComment) if spec.expErr { @@ -595,6 +611,295 @@ func TestVote(t *testing.T) { } } +func TestExecProposal(t *testing.T) { + amino := codec.New() + pKey, pTKey := sdk.NewKVStoreKey(params.StoreKey), sdk.NewTransientStoreKey(params.TStoreKey) + paramSpace := subspace.NewSubspace(amino, pKey, pTKey, group.DefaultParamspace) + + router := baseapp.NewRouter() + groupKey := sdk.NewKVStoreKey(group.StoreKeyName) + k := group.NewGroupKeeper(groupKey, paramSpace, router, &testdata.MyAppProposal{}) + testdataKey := sdk.NewKVStoreKey(testdata.ModuleName) + testdataKeeper := testdata.NewKeeper(testdataKey, k) + router.AddRoute(testdata.ModuleName, testdata.NewHandler(testdataKeeper)) + + blockTime := time.Now().UTC() + parentCtx := group.NewContext(pKey, pTKey, groupKey, testdataKey).WithBlockTime(blockTime) + defaultParams := group.DefaultParams() + paramSpace.SetParamSet(parentCtx, &defaultParams) + + members := []group.Member{ + {Address: []byte("valid-member-address"), Power: sdk.OneDec()}, + } + myGroupID, err := k.CreateGroup(parentCtx, []byte("valid--admin-address"), members, "test") + require.NoError(t, err) + + policy := group.ThresholdDecisionPolicy{ + Threshold: sdk.OneDec(), + Timout: types.Duration{Seconds: 1}, + } + accountAddr, err := k.CreateGroupAccount(parentCtx, []byte("valid--admin-address"), myGroupID, policy, "test") + require.NoError(t, err) + + specs := map[string]struct { + srcBlockTime time.Time + setupProposal func(t *testing.T, ctx sdk.Context) group.ProposalID + expErr bool + expProposalStatus group.ProposalBase_Status + expProposalResult group.ProposalBase_Result + expExecutorResult group.ProposalBase_ExecutorResult + expPayloadCounter uint64 + }{ + "proposal executed when accepted": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgIncCounter{}, + }) + require.NoError(t, err) + require.NoError(t, k.Vote(ctx, myProposalID, member, group.Choice_YES, "")) + return myProposalID + }, + expProposalStatus: group.ProposalStatusClosed, + expProposalResult: group.ProposalResultAccepted, + expExecutorResult: group.ProposalExecutorResultSuccess, + expPayloadCounter: 1, + }, + "proposal with multiple messages executed when accepted": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgIncCounter{}, &testdata.MsgIncCounter{}, + }) + require.NoError(t, err) + require.NoError(t, k.Vote(ctx, myProposalID, member, group.Choice_YES, "")) + return myProposalID + }, + expProposalStatus: group.ProposalStatusClosed, + expProposalResult: group.ProposalResultAccepted, + expExecutorResult: group.ProposalExecutorResultSuccess, + expPayloadCounter: 2, + }, + "proposal not executed when rejected": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgAlwaysFail{}, + }) + require.NoError(t, err) + require.NoError(t, k.Vote(ctx, myProposalID, member, group.Choice_NO, "")) + return myProposalID + }, + expProposalStatus: group.ProposalStatusClosed, + expProposalResult: group.ProposalResultRejected, + expExecutorResult: group.ProposalExecutorResultNotRun, + }, + "open proposal must not fail": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgAlwaysFail{}, + }) + require.NoError(t, err) + return myProposalID + }, + expProposalStatus: group.ProposalStatusSubmitted, + expProposalResult: group.ProposalResultUndefined, + expExecutorResult: group.ProposalExecutorResultNotRun, + }, + "existing proposal required": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + return 9999 + }, + expErr: true, + }, + "Decision policy also applied on timeout": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgAlwaysFail{}, + }) + require.NoError(t, err) + require.NoError(t, k.Vote(ctx, myProposalID, member, group.Choice_NO, "")) + return myProposalID + }, + srcBlockTime: blockTime.Add(time.Second), + expProposalStatus: group.ProposalStatusClosed, + expProposalResult: group.ProposalResultRejected, + expExecutorResult: group.ProposalExecutorResultNotRun, + }, + "Decision policy also applied after timeout": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgAlwaysFail{}, + }) + require.NoError(t, err) + require.NoError(t, k.Vote(ctx, myProposalID, member, group.Choice_NO, "")) + return myProposalID + }, + srcBlockTime: blockTime.Add(time.Second).Add(time.Millisecond), + expProposalStatus: group.ProposalStatusClosed, + expProposalResult: group.ProposalResultRejected, + expExecutorResult: group.ProposalExecutorResultNotRun, + }, + "with group modified before tally": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgAlwaysFail{}, + }) + require.NoError(t, err) + // then modify group + g, err := k.GetGroup(ctx, myGroupID) + require.NoError(t, err) + g.Comment = "modified" + require.NoError(t, k.UpdateGroup(ctx, &g)) + return myProposalID + }, + expProposalStatus: group.ProposalStatusAborted, + expProposalResult: group.ProposalResultUndefined, + expExecutorResult: group.ProposalExecutorResultNotRun, + }, + "with group account modified before tally": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgAlwaysFail{}, + }) + require.NoError(t, err) + // then modify group account + a, err := k.GetGroupAccount(ctx, accountAddr) + require.NoError(t, err) + a.Base.Comment = "modified" + require.NoError(t, k.UpdateGroupAccount(ctx, &a)) + return myProposalID + }, + expProposalStatus: group.ProposalStatusAborted, + expProposalResult: group.ProposalResultUndefined, + expExecutorResult: group.ProposalExecutorResultNotRun, + }, + "with group modified after tally": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgAlwaysFail{}, + }) + require.NoError(t, err) + require.NoError(t, k.Vote(ctx, myProposalID, member, group.Choice_YES, "")) + // then modify group after tally on vote + g, err := k.GetGroup(ctx, myGroupID) + require.NoError(t, err) + g.Comment = "modified" + require.NoError(t, k.UpdateGroup(ctx, &g)) + return myProposalID + }, + expProposalStatus: group.ProposalStatusClosed, + expProposalResult: group.ProposalResultAccepted, + expExecutorResult: group.ProposalExecutorResultFailure, + }, + "with group account modified after tally": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgAlwaysFail{}, + }) + require.NoError(t, err) + // then modify group account + a, err := k.GetGroupAccount(ctx, accountAddr) + require.NoError(t, err) + a.Base.Comment = "modified" + require.NoError(t, k.UpdateGroupAccount(ctx, &a)) + return myProposalID + }, + expProposalStatus: group.ProposalStatusAborted, + expProposalResult: group.ProposalResultUndefined, + expExecutorResult: group.ProposalExecutorResultNotRun, + }, + "prevent double execution when successful": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgIncCounter{}, + }) + require.NoError(t, err) + require.NoError(t, k.Vote(ctx, myProposalID, member, group.Choice_YES, "")) + require.NoError(t, k.ExecProposal(ctx, myProposalID)) + return myProposalID + }, + expPayloadCounter: 1, + expProposalStatus: group.ProposalStatusClosed, + expProposalResult: group.ProposalResultAccepted, + expExecutorResult: group.ProposalExecutorResultSuccess, + }, + "rollback all msg updates on failure": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgIncCounter{}, &testdata.MsgAlwaysFail{}, + }) + require.NoError(t, err) + require.NoError(t, k.Vote(ctx, myProposalID, member, group.Choice_YES, "")) + return myProposalID + }, + expProposalStatus: group.ProposalStatusClosed, + expProposalResult: group.ProposalResultAccepted, + expExecutorResult: group.ProposalExecutorResultFailure, + }, + "executable when failed before": { + setupProposal: func(t *testing.T, ctx sdk.Context) group.ProposalID { + member := []sdk.AccAddress{[]byte("valid-member-address")} + myProposalID, err := k.CreateProposal(ctx, accountAddr, "test", member, []sdk.Msg{ + &testdata.MsgConditional{ExpectedCounter: 1}, &testdata.MsgIncCounter{}, + }) + require.NoError(t, err) + require.NoError(t, k.Vote(ctx, myProposalID, member, group.Choice_YES, "")) + require.NoError(t, k.ExecProposal(ctx, myProposalID)) + testdataKeeper.IncCounter(ctx) + return myProposalID + }, + expPayloadCounter: 2, + expProposalStatus: group.ProposalStatusClosed, + expProposalResult: group.ProposalResultAccepted, + expExecutorResult: group.ProposalExecutorResultSuccess, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + ctx, _ := parentCtx.CacheContext() + proposalID := spec.setupProposal(t, ctx) + + if !spec.srcBlockTime.IsZero() { + ctx = ctx.WithBlockTime(spec.srcBlockTime) + } + err := k.ExecProposal(ctx, proposalID) + if spec.expErr { + require.Error(t, err) + return + } + require.NoError(t, err) + + // and proposal is updated + proposal, err := k.GetProposal(ctx, proposalID) + require.NoError(t, err) + exp := group.ProposalBase_Result_name[int32(spec.expProposalResult)] + got := group.ProposalBase_Result_name[int32(proposal.GetBase().Result)] + assert.Equal(t, exp, got) + + exp = group.ProposalBase_Status_name[int32(spec.expProposalStatus)] + got = group.ProposalBase_Status_name[int32(proposal.GetBase().Status)] + assert.Equal(t, exp, got) + + exp = group.ProposalBase_ExecutorResult_name[int32(spec.expExecutorResult)] + got = group.ProposalBase_ExecutorResult_name[int32(proposal.GetBase().ExecutorResult)] + assert.Equal(t, exp, got) + + // and proposal messages executed + assert.Equal(t, spec.expPayloadCounter, testdataKeeper.GetCounter(ctx), "counter") + }) + } +} + func TestLoadParam(t *testing.T) { amino := codec.New() pKey, pTKey := sdk.NewKVStoreKey(params.StoreKey), sdk.NewTransientStoreKey(params.TStoreKey) diff --git a/incubator/group/msg.go b/incubator/group/msg.go index d7b7b63..d44d65e 100644 --- a/incubator/group/msg.go +++ b/incubator/group/msg.go @@ -337,8 +337,11 @@ func (m MsgExec) GetSignBytes() []byte { // ValidateBasic does a sanity check on the provided data func (m MsgExec) ValidateBasic() error { + if m.Signer.Empty() { + return errors.Wrap(ErrEmpty, "signer") + } if err := sdk.VerifyAddressFormat(m.Signer); err != nil { - return errors.Wrap(ErrInvalid, "voter") + return errors.Wrap(ErrInvalid, "signer") } if m.Proposal == 0 { return errors.Wrap(ErrEmpty, "proposal") diff --git a/incubator/group/msg_test.go b/incubator/group/msg_test.go index f090229..f77ccbc 100644 --- a/incubator/group/msg_test.go +++ b/incubator/group/msg_test.go @@ -305,6 +305,7 @@ func TestMsgProposeBase(t *testing.T) { }) } } + func TestMsgVote(t *testing.T) { specs := map[string]struct { src MsgVote diff --git a/incubator/group/proposal_executor.go b/incubator/group/proposal_executor.go new file mode 100644 index 0000000..4b06ded --- /dev/null +++ b/incubator/group/proposal_executor.go @@ -0,0 +1,41 @@ +package group + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/errors" +) + +// ensureMsgAuthZ checks that if a message requires signers that all of them are equal to the given group account. +func ensureMsgAuthZ(msgs []sdk.Msg, groupAccount sdk.AccAddress) error { + for i := range msgs { + for _, acct := range msgs[i].GetSigners() { + if !groupAccount.Equals(acct) { + return errors.Wrap(errors.ErrUnauthorized, "msg does not have group account authorization") + } + } + } + return nil +} + +// doExecuteMsgs routes the messages to the registered handlers. Messages are limited to those that require no authZ or +// by the group account only. Otherwise this gives access to other peoples accounts as the sdk ant handler is bypassed +func doExecuteMsgs(ctx sdk.Context, router sdk.Router, groupAccount sdk.AccAddress, msgs []sdk.Msg) ([]sdk.Result, error) { + results := make([]sdk.Result, len(msgs)) + if err := ensureMsgAuthZ(msgs, groupAccount); err != nil { + return nil, err + } + for i, msg := range msgs { + handler := router.Route(ctx, msg.Route()) + if handler == nil { + return nil, errors.Wrapf(ErrInvalid, "no message handler found for %q", msg.Route()) + } + r, err := handler(ctx, msg) + if err != nil { + return nil, errors.Wrapf(err, "message %q at position %d", msg.Type(), i) + } + if r != nil { + results[i] = *r + } + } + return results, nil +} diff --git a/incubator/group/proposal_executor_test.go b/incubator/group/proposal_executor_test.go new file mode 100644 index 0000000..1566a1c --- /dev/null +++ b/incubator/group/proposal_executor_test.go @@ -0,0 +1,108 @@ +package group + +import ( + "testing" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +func TestDoExecuteMsgs(t *testing.T) { + specs := map[string]struct { + srcAccount sdk.AccAddress + srcMsgs []sdk.Msg + srcHandler sdk.Handler + expErr bool + }{ + "all good": { + srcAccount: []byte("my-group-acct-addrss"), + srcMsgs: []sdk.Msg{MyMsg{[]sdk.AccAddress{[]byte("my-group-acct-addrss")}}}, + srcHandler: mockHandler(&sdk.Result{}, nil), + }, + "not authz by group account": { + srcAccount: []byte("my-group-acct-addrss"), + srcMsgs: []sdk.Msg{MyMsg{[]sdk.AccAddress{[]byte("any--other---address")}}}, + srcHandler: alwaysPanicHandler(), + expErr: true, + }, + "mixed group account msgs": { + srcAccount: []byte("my-group-acct-addrss"), + srcMsgs: []sdk.Msg{ + MyMsg{[]sdk.AccAddress{[]byte("my-group-acct-addrss")}}, + MyMsg{[]sdk.AccAddress{[]byte("any--other---address")}}, + }, + srcHandler: alwaysPanicHandler(), + expErr: true, + }, + "no handler": { + srcAccount: []byte("my-group-acct-addrss"), + srcMsgs: []sdk.Msg{NonRoutableMsg{}}, + srcHandler: alwaysPanicHandler(), + expErr: true, + }, + "not panic on nil result": { + srcAccount: []byte("my-group-acct-addrss"), + srcMsgs: []sdk.Msg{MyMsg{[]sdk.AccAddress{[]byte("my-group-acct-addrss")}}}, + srcHandler: mockHandler(nil, nil), + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + router := baseapp.NewRouter().AddRoute("myRoute", spec.srcHandler) + _, err := doExecuteMsgs(NewContext(), router, spec.srcAccount, spec.srcMsgs) + if spec.expErr { + require.Error(t, err) + return + } + require.NoError(t, err) + }) + } +} + +func mockHandler(r *sdk.Result, t error) sdk.Handler { + return func(ctx sdk.Context, msg sdk.Msg) (result *sdk.Result, err error) { + return r, t + } +} + +func alwaysPanicHandler() sdk.Handler { + return func(ctx sdk.Context, msg sdk.Msg) (result *sdk.Result, err error) { + panic("not supposed to be called") + } +} + +type MyMsg struct { + s []sdk.AccAddress +} + +func (m MyMsg) Route() string { + return "myRoute" +} + +func (m MyMsg) GetSigners() []sdk.AccAddress { + return m.s +} + +func (m MyMsg) Type() string { + return "my test message type" +} + +func (m MyMsg) ValidateBasic() error { + return nil +} + +func (m MyMsg) GetSignBytes() []byte { + panic("implement me") +} + +type NonRoutableMsg struct { + sdk.Msg +} + +func (m NonRoutableMsg) Route() string { + return "not_routable" +} +func (m NonRoutableMsg) GetSigners() []sdk.AccAddress { + return nil +} diff --git a/incubator/group/testdata/codec.go b/incubator/group/testdata/codec.go index 2fcca12..a4635b1 100644 --- a/incubator/group/testdata/codec.go +++ b/incubator/group/testdata/codec.go @@ -24,8 +24,8 @@ func RegisterCodec(cdc *codec.Codec) { cdc.RegisterConcrete(MsgPropose{}, "testdata/MsgPropose", nil) // oh man... amino cdc.RegisterInterface((*isMyAppMsg_Sum)(nil), nil) - cdc.RegisterConcrete(&MyAppProposalPayloadMsgA{}, "testdata/MyAppProposalPayloadMsgA", nil) - cdc.RegisterConcrete(&MyAppProposalPayloadMsgB{}, "testdata/MyAppProposalPayloadMsgB", nil) + cdc.RegisterConcrete(&MsgAlwaysSucceed{}, "testdata/MsgAlwaysSucceed", nil) + cdc.RegisterConcrete(&MsgAlwaysFail{}, "testdata/MsgAlwaysFail", nil) cdc.RegisterConcrete(&MyAppMsg_A{}, "testdata/MyAppMsg_A", nil) cdc.RegisterConcrete(&MyAppMsg_B{}, "testdata/MyAppMsg_B", nil) } diff --git a/incubator/group/testdata/handler.go b/incubator/group/testdata/handler.go index e01c222..e4c5079 100644 --- a/incubator/group/testdata/handler.go +++ b/incubator/group/testdata/handler.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/modules/incubator/orm" ) func NewHandler(k Keeper) sdk.Handler { @@ -15,16 +16,48 @@ func NewHandler(k Keeper) sdk.Handler { switch msg := msg.(type) { case MsgPropose: return handleMsgPropose(ctx, k, msg) - case *MyAppProposalPayloadMsgA: - logger.Info("executed MyAppProposalPayloadMsgA msg") + case *MsgAlwaysSucceed: + logger.Info("executed MsgAlwaysSucceed msg") return &sdk.Result{ Data: nil, - Log: "MyAppProposalPayloadMsgA executed", + Log: "MsgAlwaysSucceed executed", + Events: ctx.EventManager().Events(), + }, nil + case *MsgAlwaysFail: + logger.Info("executed MsgAlwaysFail msg") + return nil, errors.New("execution of MsgAlwaysFail testdata always fails") + case *MsgSetValue: + logger.Info("executed MsgSetValue msg") + k.SetValue(ctx, msg.Value) + return &sdk.Result{ + Data: []byte(msg.Value), + Log: "MsgSetValue executed", + Events: ctx.EventManager().Events(), + }, nil + case *MsgIncCounter: + logger.Info("executed MsgIncCounter msg") + return &sdk.Result{ + Data: k.IncCounter(ctx), + Log: "MsgIncCounter executed", + Events: ctx.EventManager().Events(), + }, nil + case *MsgConditional: + logger.Info("executed MsgConditional msg") + if k.GetCounter(ctx) != msg.ExpectedCounter { + return nil, errors.New("counter condition not matched") + } + return &sdk.Result{ + Data: orm.EncodeSequence(msg.ExpectedCounter), + Log: "MsgConditional executed", + Events: ctx.EventManager().Events(), + }, nil + case *MsgAuthenticate: + logger.Info("executed MsgAuthenticate msg") + return &sdk.Result{ + Data: nil, + Log: "MsgAuthenticate executed", Events: ctx.EventManager().Events(), }, nil - case *MyAppProposalPayloadMsgB: - logger.Info("executed MyAppProposalPayloadMsgB msg") - return nil, errors.New("execution of MyAppProposalPayloadMsgB testdata always fails") default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message type: %T", msg) } @@ -32,8 +65,6 @@ func NewHandler(k Keeper) sdk.Handler { } func handleMsgPropose(ctx sdk.Context, k Keeper, msg MsgPropose) (*sdk.Result, error) { - // todo: vaidate - // check execNow id, err := k.CreateProposal(ctx, msg.Base.GroupAccount, msg.Base.Proposers, msg.Base.Comment, msg.Msgs) if err != nil { return nil, err diff --git a/incubator/group/testdata/keeper.go b/incubator/group/testdata/keeper.go index 3958b97..786b3a3 100644 --- a/incubator/group/testdata/keeper.go +++ b/incubator/group/testdata/keeper.go @@ -3,6 +3,7 @@ package testdata import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/modules/incubator/group" + "github.com/cosmos/modules/incubator/orm" ) type Keeper struct { @@ -10,14 +11,40 @@ type Keeper struct { key sdk.StoreKey } -func NewTestdataKeeper(storeKey sdk.StoreKey, groupKeeper group.Keeper) Keeper { +func NewKeeper(storeKey sdk.StoreKey, groupKeeper group.Keeper) Keeper { k := Keeper{ groupKeeper: groupKeeper, key: storeKey, } + return k } func (k Keeper) CreateProposal(ctx sdk.Context, accountAddress sdk.AccAddress, proposers []sdk.AccAddress, comment string, msgs MyAppMsgs) (group.ProposalID, error) { return k.groupKeeper.CreateProposal(ctx, accountAddress, comment, proposers, msgs.AsSDKMsgs()) } + +var ( + storageKey = []byte("key") + counterKey = []byte("counter") +) + +func (k Keeper) SetValue(ctx sdk.Context, value string) { + ctx.KVStore(k.key).Set(storageKey, []byte(value)) +} + +func (k Keeper) GetValue(ctx sdk.Context) string { + return string(ctx.KVStore(k.key).Get(storageKey)) +} + +func (k Keeper) IncCounter(ctx sdk.Context) []byte { + i := k.GetCounter(ctx) + i++ + v := orm.EncodeSequence(i) + ctx.KVStore(k.key).Set(counterKey, v) + return v +} + +func (k Keeper) GetCounter(ctx sdk.Context) uint64 { + return orm.DecodeSequence(ctx.KVStore(k.key).Get(counterKey)) +} diff --git a/incubator/group/testdata/msg.go b/incubator/group/testdata/msg.go index b7a07f8..d712317 100644 --- a/incubator/group/testdata/msg.go +++ b/incubator/group/testdata/msg.go @@ -9,9 +9,12 @@ import ( ) const ( - msgTypeCreateProposal = "create_proposal" - msgTypeMyMsgA = "my_msg_a" - msgTypeMyMsgB = "my_msg_b" + msgTypeMyMsgA = "always_succeed" + msgTypeMyMsgB = "always_fail" + msgTypeMyMsgC = "set_value" + msgTypeMyMsgD = "inc_counter" + msgTypeMyMsgE = "conditional" + msgTypeMyMsgF = "authenticate" ) var _ sdk.Msg = &MsgPropose{} @@ -48,19 +51,19 @@ func (m MsgPropose) ValidateBasic() error { return nil } -var _ sdk.Msg = &MyAppProposalPayloadMsgA{} +var _ sdk.Msg = &MsgAlwaysSucceed{} -func (m MyAppProposalPayloadMsgA) Route() string { return ModuleName } +func (m MsgAlwaysSucceed) Route() string { return ModuleName } -func (m MyAppProposalPayloadMsgA) Type() string { return msgTypeMyMsgA } +func (m MsgAlwaysSucceed) Type() string { return msgTypeMyMsgA } // GetSigners returns the addresses that must sign over msg.GetSignBytes() -func (m MyAppProposalPayloadMsgA) GetSigners() []sdk.AccAddress { +func (m MsgAlwaysSucceed) GetSigners() []sdk.AccAddress { return nil // nothing to do } // GetSignBytes returns the bytes for the message signer to sign on -func (m MyAppProposalPayloadMsgA) GetSignBytes() []byte { +func (m MsgAlwaysSucceed) GetSignBytes() []byte { var buf bytes.Buffer enc := jsonpb.Marshaler{} if err := enc.Marshal(&buf, &m); err != nil { @@ -70,23 +73,23 @@ func (m MyAppProposalPayloadMsgA) GetSignBytes() []byte { } // ValidateBasic does a sanity check on the provided data -func (m MyAppProposalPayloadMsgA) ValidateBasic() error { +func (m MsgAlwaysSucceed) ValidateBasic() error { return nil } -var _ sdk.Msg = &MyAppProposalPayloadMsgB{} +var _ sdk.Msg = &MsgAlwaysFail{} -func (m MyAppProposalPayloadMsgB) Route() string { return ModuleName } +func (m MsgAlwaysFail) Route() string { return ModuleName } -func (m MyAppProposalPayloadMsgB) Type() string { return msgTypeMyMsgB } +func (m MsgAlwaysFail) Type() string { return msgTypeMyMsgB } // GetSigners returns the addresses that must sign over msg.GetSignBytes() -func (m MyAppProposalPayloadMsgB) GetSigners() []sdk.AccAddress { +func (m MsgAlwaysFail) GetSigners() []sdk.AccAddress { return nil } // GetSignBytes returns the bytes for the message signer to sign on -func (m MyAppProposalPayloadMsgB) GetSignBytes() []byte { +func (m MsgAlwaysFail) GetSignBytes() []byte { var buf bytes.Buffer enc := jsonpb.Marshaler{} if err := enc.Marshal(&buf, &m); err != nil { @@ -96,6 +99,105 @@ func (m MyAppProposalPayloadMsgB) GetSignBytes() []byte { } // ValidateBasic does a sanity check on the provided data -func (m MyAppProposalPayloadMsgB) ValidateBasic() error { +func (m MsgAlwaysFail) ValidateBasic() error { return nil } + +var _ sdk.Msg = &MsgSetValue{} + +func (m MsgSetValue) Route() string { return ModuleName } + +func (m MsgSetValue) Type() string { return msgTypeMyMsgC } + +// GetSigners returns the addresses that must sign over msg.GetSignBytes() +func (m MsgSetValue) GetSigners() []sdk.AccAddress { + return nil +} + +// GetSignBytes returns the bytes for the message signer to sign on +func (m MsgSetValue) GetSignBytes() []byte { + var buf bytes.Buffer + enc := jsonpb.Marshaler{} + if err := enc.Marshal(&buf, &m); err != nil { + panic(err) + } + return sdk.MustSortJSON(buf.Bytes()) +} + +// ValidateBasic does a sanity check on the provided data +func (m MsgSetValue) ValidateBasic() error { + return nil +} + +var _ sdk.Msg = &MsgIncCounter{} + +func (m MsgIncCounter) Route() string { return ModuleName } + +func (m MsgIncCounter) Type() string { return msgTypeMyMsgD } + +// GetSigners returns the addresses that must sign over msg.GetSignBytes() +func (m MsgIncCounter) GetSigners() []sdk.AccAddress { + return nil +} + +// GetSignBytes returns the bytes for the message signer to sign on +func (m MsgIncCounter) GetSignBytes() []byte { + var buf bytes.Buffer + enc := jsonpb.Marshaler{} + if err := enc.Marshal(&buf, &m); err != nil { + panic(err) + } + return sdk.MustSortJSON(buf.Bytes()) +} + +// ValidateBasic does a sanity check on the provided data +func (m MsgIncCounter) ValidateBasic() error { + return nil +} + +var _ sdk.Msg = &MsgConditional{} + +func (m MsgConditional) Route() string { return ModuleName } + +func (m MsgConditional) Type() string { return msgTypeMyMsgE } + +// GetSigners returns the addresses that must sign over msg.GetSignBytes() +func (m MsgConditional) GetSigners() []sdk.AccAddress { + return nil +} + +// GetSignBytes returns the bytes for the message signer to sign on +func (m MsgConditional) GetSignBytes() []byte { + var buf bytes.Buffer + enc := jsonpb.Marshaler{} + if err := enc.Marshal(&buf, &m); err != nil { + panic(err) + } + return sdk.MustSortJSON(buf.Bytes()) +} + +// ValidateBasic does a sanity check on the provided data +func (m MsgConditional) ValidateBasic() error { + return nil +} + +var _ sdk.Msg = &MsgAuthenticate{} + +func (m MsgAuthenticate) Route() string { return ModuleName } + +func (m MsgAuthenticate) Type() string { return msgTypeMyMsgF } + +// GetSignBytes returns the bytes for the message signer to sign on +func (m MsgAuthenticate) GetSignBytes() []byte { + var buf bytes.Buffer + enc := jsonpb.Marshaler{} + if err := enc.Marshal(&buf, &m); err != nil { + panic(err) + } + return sdk.MustSortJSON(buf.Bytes()) +} + +// ValidateBasic does a sanity check on the provided data +func (m MsgAuthenticate) ValidateBasic() error { + return nil +} \ No newline at end of file diff --git a/incubator/group/testdata/sim_app.go b/incubator/group/testdata/sim_app.go index 19aaa7b..a2dde20 100644 --- a/incubator/group/testdata/sim_app.go +++ b/incubator/group/testdata/sim_app.go @@ -205,7 +205,7 @@ func NewSimApp( app.cdc, keys[evidence.StoreKey], app.subspaces[evidence.ModuleName], &app.StakingKeeper, app.SlashingKeeper, ) app.GroupKeeper = group.NewGroupKeeper(keys[group.StoreKeyName], app.subspaces[group.ModuleName], app.Router(), &MyAppProposal{} ) - app.TestdataKeeper = NewTestdataKeeper(keys[ModuleName], app.GroupKeeper) + app.TestdataKeeper = NewKeeper(keys[ModuleName], app.GroupKeeper) evidenceRouter := evidence.NewRouter() // TODO: Register evidence routes. evidenceKeeper.SetRouter(evidenceRouter) diff --git a/incubator/group/testdata/types.pb.go b/incubator/group/testdata/types.pb.go index 3288ace..58723e3 100644 --- a/incubator/group/testdata/types.pb.go +++ b/incubator/group/testdata/types.pb.go @@ -26,11 +26,15 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MyAppMsg is the payload stored with a proposal and executed on success +// MyAppMsg is the payload stored with a proposal and executed when approved type MyAppMsg struct { // Types that are valid to be assigned to Sum: // *MyAppMsg_A // *MyAppMsg_B + // *MyAppMsg_C + // *MyAppMsg_D + // *MyAppMsg_E + // *MyAppMsg_F Sum isMyAppMsg_Sum `protobuf_oneof:"sum"` } @@ -74,14 +78,30 @@ type isMyAppMsg_Sum interface { } type MyAppMsg_A struct { - A *MyAppProposalPayloadMsgA `protobuf:"bytes,1,opt,name=A,proto3,oneof" json:"A,omitempty"` + A *MsgAlwaysSucceed `protobuf:"bytes,1,opt,name=A,proto3,oneof" json:"A,omitempty"` } type MyAppMsg_B struct { - B *MyAppProposalPayloadMsgB `protobuf:"bytes,2,opt,name=B,proto3,oneof" json:"B,omitempty"` + B *MsgAlwaysFail `protobuf:"bytes,2,opt,name=B,proto3,oneof" json:"B,omitempty"` +} +type MyAppMsg_C struct { + C *MsgSetValue `protobuf:"bytes,3,opt,name=C,proto3,oneof" json:"C,omitempty"` +} +type MyAppMsg_D struct { + D *MsgIncCounter `protobuf:"bytes,4,opt,name=D,proto3,oneof" json:"D,omitempty"` +} +type MyAppMsg_E struct { + E *MsgConditional `protobuf:"bytes,5,opt,name=E,proto3,oneof" json:"E,omitempty"` +} +type MyAppMsg_F struct { + F *MsgAuthenticate `protobuf:"bytes,6,opt,name=F,proto3,oneof" json:"F,omitempty"` } func (*MyAppMsg_A) isMyAppMsg_Sum() {} func (*MyAppMsg_B) isMyAppMsg_Sum() {} +func (*MyAppMsg_C) isMyAppMsg_Sum() {} +func (*MyAppMsg_D) isMyAppMsg_Sum() {} +func (*MyAppMsg_E) isMyAppMsg_Sum() {} +func (*MyAppMsg_F) isMyAppMsg_Sum() {} func (m *MyAppMsg) GetSum() isMyAppMsg_Sum { if m != nil { @@ -90,25 +110,57 @@ func (m *MyAppMsg) GetSum() isMyAppMsg_Sum { return nil } -func (m *MyAppMsg) GetA() *MyAppProposalPayloadMsgA { +func (m *MyAppMsg) GetA() *MsgAlwaysSucceed { if x, ok := m.GetSum().(*MyAppMsg_A); ok { return x.A } return nil } -func (m *MyAppMsg) GetB() *MyAppProposalPayloadMsgB { +func (m *MyAppMsg) GetB() *MsgAlwaysFail { if x, ok := m.GetSum().(*MyAppMsg_B); ok { return x.B } return nil } +func (m *MyAppMsg) GetC() *MsgSetValue { + if x, ok := m.GetSum().(*MyAppMsg_C); ok { + return x.C + } + return nil +} + +func (m *MyAppMsg) GetD() *MsgIncCounter { + if x, ok := m.GetSum().(*MyAppMsg_D); ok { + return x.D + } + return nil +} + +func (m *MyAppMsg) GetE() *MsgConditional { + if x, ok := m.GetSum().(*MyAppMsg_E); ok { + return x.E + } + return nil +} + +func (m *MyAppMsg) GetF() *MsgAuthenticate { + if x, ok := m.GetSum().(*MyAppMsg_F); ok { + return x.F + } + return nil +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*MyAppMsg) XXX_OneofWrappers() []interface{} { return []interface{}{ (*MyAppMsg_A)(nil), (*MyAppMsg_B)(nil), + (*MyAppMsg_C)(nil), + (*MyAppMsg_D)(nil), + (*MyAppMsg_E)(nil), + (*MyAppMsg_F)(nil), } } @@ -150,21 +202,22 @@ func (m *MyAppProposal) XXX_DiscardUnknown() { var xxx_messageInfo_MyAppProposal proto.InternalMessageInfo -type MyAppProposalPayloadMsgA struct { +// MsgAlwaysSucceed is handled without errors +type MsgAlwaysSucceed struct { } -func (m *MyAppProposalPayloadMsgA) Reset() { *m = MyAppProposalPayloadMsgA{} } -func (m *MyAppProposalPayloadMsgA) String() string { return proto.CompactTextString(m) } -func (*MyAppProposalPayloadMsgA) ProtoMessage() {} -func (*MyAppProposalPayloadMsgA) Descriptor() ([]byte, []int) { +func (m *MsgAlwaysSucceed) Reset() { *m = MsgAlwaysSucceed{} } +func (m *MsgAlwaysSucceed) String() string { return proto.CompactTextString(m) } +func (*MsgAlwaysSucceed) ProtoMessage() {} +func (*MsgAlwaysSucceed) Descriptor() ([]byte, []int) { return fileDescriptor_2447ab8d7bf628b8, []int{2} } -func (m *MyAppProposalPayloadMsgA) XXX_Unmarshal(b []byte) error { +func (m *MsgAlwaysSucceed) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MyAppProposalPayloadMsgA) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgAlwaysSucceed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MyAppProposalPayloadMsgA.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgAlwaysSucceed.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -174,33 +227,199 @@ func (m *MyAppProposalPayloadMsgA) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *MyAppProposalPayloadMsgA) XXX_Merge(src proto.Message) { - xxx_messageInfo_MyAppProposalPayloadMsgA.Merge(m, src) +func (m *MsgAlwaysSucceed) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAlwaysSucceed.Merge(m, src) } -func (m *MyAppProposalPayloadMsgA) XXX_Size() int { +func (m *MsgAlwaysSucceed) XXX_Size() int { return m.Size() } -func (m *MyAppProposalPayloadMsgA) XXX_DiscardUnknown() { - xxx_messageInfo_MyAppProposalPayloadMsgA.DiscardUnknown(m) +func (m *MsgAlwaysSucceed) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAlwaysSucceed.DiscardUnknown(m) } -var xxx_messageInfo_MyAppProposalPayloadMsgA proto.InternalMessageInfo +var xxx_messageInfo_MsgAlwaysSucceed proto.InternalMessageInfo -type MyAppProposalPayloadMsgB struct { +// MsgAlwaysFail returns an error by the handler +type MsgAlwaysFail struct { } -func (m *MyAppProposalPayloadMsgB) Reset() { *m = MyAppProposalPayloadMsgB{} } -func (m *MyAppProposalPayloadMsgB) String() string { return proto.CompactTextString(m) } -func (*MyAppProposalPayloadMsgB) ProtoMessage() {} -func (*MyAppProposalPayloadMsgB) Descriptor() ([]byte, []int) { +func (m *MsgAlwaysFail) Reset() { *m = MsgAlwaysFail{} } +func (m *MsgAlwaysFail) String() string { return proto.CompactTextString(m) } +func (*MsgAlwaysFail) ProtoMessage() {} +func (*MsgAlwaysFail) Descriptor() ([]byte, []int) { return fileDescriptor_2447ab8d7bf628b8, []int{3} } -func (m *MyAppProposalPayloadMsgB) XXX_Unmarshal(b []byte) error { +func (m *MsgAlwaysFail) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAlwaysFail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAlwaysFail.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAlwaysFail) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAlwaysFail.Merge(m, src) +} +func (m *MsgAlwaysFail) XXX_Size() int { + return m.Size() +} +func (m *MsgAlwaysFail) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAlwaysFail.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAlwaysFail proto.InternalMessageInfo + +// MsgSetValue stores a value in the store +type MsgSetValue struct { + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *MsgSetValue) Reset() { *m = MsgSetValue{} } +func (m *MsgSetValue) String() string { return proto.CompactTextString(m) } +func (*MsgSetValue) ProtoMessage() {} +func (*MsgSetValue) Descriptor() ([]byte, []int) { + return fileDescriptor_2447ab8d7bf628b8, []int{4} +} +func (m *MsgSetValue) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetValue.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetValue.Merge(m, src) +} +func (m *MsgSetValue) XXX_Size() int { + return m.Size() +} +func (m *MsgSetValue) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetValue.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetValue proto.InternalMessageInfo + +func (m *MsgSetValue) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +// MsgIncCounter increments a counter value +type MsgIncCounter struct { +} + +func (m *MsgIncCounter) Reset() { *m = MsgIncCounter{} } +func (m *MsgIncCounter) String() string { return proto.CompactTextString(m) } +func (*MsgIncCounter) ProtoMessage() {} +func (*MsgIncCounter) Descriptor() ([]byte, []int) { + return fileDescriptor_2447ab8d7bf628b8, []int{5} +} +func (m *MsgIncCounter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgIncCounter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgIncCounter.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgIncCounter) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgIncCounter.Merge(m, src) +} +func (m *MsgIncCounter) XXX_Size() int { + return m.Size() +} +func (m *MsgIncCounter) XXX_DiscardUnknown() { + xxx_messageInfo_MsgIncCounter.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgIncCounter proto.InternalMessageInfo + +// MsgConditional execution depends on persistent counter value. When not equal then execution fails. +type MsgConditional struct { + ExpectedCounter uint64 `protobuf:"varint,1,opt,name=expectedCounter,proto3" json:"expectedCounter,omitempty"` +} + +func (m *MsgConditional) Reset() { *m = MsgConditional{} } +func (m *MsgConditional) String() string { return proto.CompactTextString(m) } +func (*MsgConditional) ProtoMessage() {} +func (*MsgConditional) Descriptor() ([]byte, []int) { + return fileDescriptor_2447ab8d7bf628b8, []int{6} +} +func (m *MsgConditional) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConditional) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConditional.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgConditional) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConditional.Merge(m, src) +} +func (m *MsgConditional) XXX_Size() int { + return m.Size() +} +func (m *MsgConditional) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConditional.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConditional proto.InternalMessageInfo + +func (m *MsgConditional) GetExpectedCounter() uint64 { + if m != nil { + return m.ExpectedCounter + } + return 0 +} + +// MsgAuthenticated contains a signer +type MsgAuthenticate struct { + Signers []github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,rep,name=signers,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"signers,omitempty"` +} + +func (m *MsgAuthenticate) Reset() { *m = MsgAuthenticate{} } +func (m *MsgAuthenticate) String() string { return proto.CompactTextString(m) } +func (*MsgAuthenticate) ProtoMessage() {} +func (*MsgAuthenticate) Descriptor() ([]byte, []int) { + return fileDescriptor_2447ab8d7bf628b8, []int{7} +} +func (m *MsgAuthenticate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MyAppProposalPayloadMsgB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgAuthenticate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MyAppProposalPayloadMsgB.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgAuthenticate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -210,17 +429,24 @@ func (m *MyAppProposalPayloadMsgB) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *MyAppProposalPayloadMsgB) XXX_Merge(src proto.Message) { - xxx_messageInfo_MyAppProposalPayloadMsgB.Merge(m, src) +func (m *MsgAuthenticate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAuthenticate.Merge(m, src) } -func (m *MyAppProposalPayloadMsgB) XXX_Size() int { +func (m *MsgAuthenticate) XXX_Size() int { return m.Size() } -func (m *MyAppProposalPayloadMsgB) XXX_DiscardUnknown() { - xxx_messageInfo_MyAppProposalPayloadMsgB.DiscardUnknown(m) +func (m *MsgAuthenticate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAuthenticate.DiscardUnknown(m) } -var xxx_messageInfo_MyAppProposalPayloadMsgB proto.InternalMessageInfo +var xxx_messageInfo_MsgAuthenticate proto.InternalMessageInfo + +func (m *MsgAuthenticate) GetSigners() []github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Signers + } + return nil +} type MsgPropose struct { Base group.MsgProposeBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base"` @@ -231,7 +457,7 @@ func (m *MsgPropose) Reset() { *m = MsgPropose{} } func (m *MsgPropose) String() string { return proto.CompactTextString(m) } func (*MsgPropose) ProtoMessage() {} func (*MsgPropose) Descriptor() ([]byte, []int) { - return fileDescriptor_2447ab8d7bf628b8, []int{4} + return fileDescriptor_2447ab8d7bf628b8, []int{8} } func (m *MsgPropose) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -277,40 +503,55 @@ func (m *MsgPropose) GetMsgs() []MyAppMsg { func init() { proto.RegisterType((*MyAppMsg)(nil), "cosmos_modules.incubator.group.v1_alpha.testdata.MyAppMsg") proto.RegisterType((*MyAppProposal)(nil), "cosmos_modules.incubator.group.v1_alpha.testdata.MyAppProposal") - proto.RegisterType((*MyAppProposalPayloadMsgA)(nil), "cosmos_modules.incubator.group.v1_alpha.testdata.MyAppProposalPayloadMsgA") - proto.RegisterType((*MyAppProposalPayloadMsgB)(nil), "cosmos_modules.incubator.group.v1_alpha.testdata.MyAppProposalPayloadMsgB") + proto.RegisterType((*MsgAlwaysSucceed)(nil), "cosmos_modules.incubator.group.v1_alpha.testdata.MsgAlwaysSucceed") + proto.RegisterType((*MsgAlwaysFail)(nil), "cosmos_modules.incubator.group.v1_alpha.testdata.MsgAlwaysFail") + proto.RegisterType((*MsgSetValue)(nil), "cosmos_modules.incubator.group.v1_alpha.testdata.MsgSetValue") + proto.RegisterType((*MsgIncCounter)(nil), "cosmos_modules.incubator.group.v1_alpha.testdata.MsgIncCounter") + proto.RegisterType((*MsgConditional)(nil), "cosmos_modules.incubator.group.v1_alpha.testdata.MsgConditional") + proto.RegisterType((*MsgAuthenticate)(nil), "cosmos_modules.incubator.group.v1_alpha.testdata.MsgAuthenticate") proto.RegisterType((*MsgPropose)(nil), "cosmos_modules.incubator.group.v1_alpha.testdata.MsgPropose") } func init() { proto.RegisterFile("testdata/types.proto", fileDescriptor_2447ab8d7bf628b8) } var fileDescriptor_2447ab8d7bf628b8 = []byte{ - // 385 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x29, 0x49, 0x2d, 0x2e, - 0x49, 0x49, 0x2c, 0x49, 0xd4, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, - 0x17, 0x32, 0x48, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0x8e, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, - 0xd6, 0xcb, 0xcc, 0x4b, 0x2e, 0x4d, 0x4a, 0x2c, 0xc9, 0x2f, 0xd2, 0x4b, 0x2f, 0xca, 0x2f, 0x2d, - 0xd0, 0x2b, 0x33, 0x8c, 0x4f, 0xcc, 0x29, 0xc8, 0x48, 0xd4, 0x83, 0xe9, 0x96, 0xd2, 0x2e, 0xc9, - 0xc8, 0x2c, 0x4a, 0x89, 0x2f, 0x48, 0x2c, 0x2a, 0xa9, 0xd4, 0x07, 0x1b, 0xa2, 0x0f, 0x31, 0x43, - 0x17, 0x99, 0x03, 0x31, 0x5e, 0x4a, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0x22, 0x0e, 0x62, 0x41, 0x45, - 0x05, 0xc1, 0x66, 0x23, 0xbb, 0x43, 0xe9, 0x1b, 0x23, 0x17, 0x87, 0x6f, 0xa5, 0x63, 0x41, 0x81, - 0x6f, 0x71, 0xba, 0x50, 0x14, 0x17, 0xa3, 0xa3, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x97, - 0x1e, 0xa9, 0x0e, 0xd4, 0x03, 0x1b, 0x13, 0x50, 0x94, 0x5f, 0x90, 0x5f, 0x9c, 0x98, 0x13, 0x90, - 0x58, 0x99, 0x93, 0x9f, 0x98, 0xe2, 0x5b, 0x9c, 0xee, 0xe8, 0xc1, 0x10, 0xc4, 0xe8, 0x08, 0x32, - 0xdb, 0x49, 0x82, 0x89, 0xca, 0x66, 0x3b, 0x81, 0xcc, 0x76, 0xb2, 0xd2, 0x3e, 0xb5, 0x45, 0x57, - 0x5d, 0x2b, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x17, 0x1a, 0x16, 0xb0, 0xf0, - 0x29, 0x4e, 0xc9, 0x86, 0xfa, 0x19, 0xa4, 0x85, 0x95, 0x8b, 0xb9, 0xb8, 0x34, 0x57, 0x69, 0x0f, - 0x23, 0x17, 0x2f, 0x8a, 0xa9, 0x42, 0xfe, 0x5c, 0x2c, 0x49, 0x89, 0xc5, 0xa9, 0xd0, 0x00, 0x30, - 0x25, 0xda, 0x91, 0x30, 0x03, 0x9c, 0x12, 0x8b, 0x53, 0x9d, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, - 0x02, 0x1b, 0x24, 0x14, 0xc2, 0xc5, 0x92, 0x5b, 0x9c, 0x5e, 0x2c, 0xc1, 0xa4, 0xc0, 0xac, 0xc1, - 0x6d, 0x64, 0x45, 0xa6, 0xaf, 0x41, 0x6e, 0x86, 0x9a, 0x0a, 0x32, 0xcd, 0x8a, 0xa5, 0x63, 0x81, - 0x3c, 0x83, 0x92, 0x14, 0x97, 0x04, 0xae, 0xf0, 0xc6, 0x23, 0xe7, 0xa4, 0xb4, 0x95, 0x91, 0x8b, - 0xcb, 0xb7, 0x38, 0x1d, 0x22, 0x95, 0x2a, 0x14, 0x88, 0xe2, 0x67, 0x73, 0xa2, 0x9d, 0x88, 0x30, - 0x82, 0x3e, 0xbe, 0x76, 0xf2, 0x39, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, - 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, - 0x23, 0xcc, 0x78, 0x87, 0xda, 0xa5, 0x0f, 0xb7, 0x4b, 0x1f, 0x9a, 0xf0, 0xa1, 0x56, 0x24, 0xb1, - 0x81, 0x13, 0xbf, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x3e, 0xa5, 0x88, 0x39, 0x9c, 0x03, 0x00, - 0x00, + // 570 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0xb1, 0x6e, 0xd3, 0x40, + 0x18, 0xc7, 0x7d, 0x8d, 0x53, 0xe0, 0x42, 0x09, 0x9c, 0x32, 0x58, 0x1d, 0x9c, 0xc8, 0x0c, 0x44, + 0x54, 0x71, 0x68, 0x10, 0x42, 0x8a, 0x84, 0xc0, 0x4e, 0x1b, 0x81, 0xc0, 0x6a, 0xeb, 0x22, 0x06, + 0x06, 0xa2, 0x8b, 0x7d, 0x72, 0x2c, 0x1c, 0x9f, 0xe5, 0x3b, 0x17, 0xf2, 0x06, 0x8c, 0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cd, 0x9d, 0x1e, 0xe4, + 0xad, 0x0b, 0xdf, 0x8d, 0x36, 0xbc, 0xb1, 0xe8, 0x1b, 0xaa, 0xc3, 0x32, 0x79, 0x9f, 0x10, 0x8f, + 0x13, 0x5f, 0xfe, 0x24, 0x10, 0xaa, 0xbb, 0x5c, 0x36, 0xde, 0xc0, 0xf2, 0x92, 0x43, 0xe8, 0x39, + 0xbc, 0xc2, 0xc2, 0x20, 0x26, 0x29, 0xd3, 0x40, 0xad, 0x50, 0xbf, 0x6e, 0xef, 0xfe, 0x3a, 0xaf, + 0x36, 0x56, 0x30, 0xcb, 0xf2, 0x3c, 0xcb, 0xf7, 0x53, 0xc2, 0x98, 0x3b, 0x23, 0x18, 0x5f, 0x01, + 0x84, 0x0e, 0x0b, 0xa6, 0x2b, 0x27, 0xe8, 0x68, 0xc1, 0xb2, 0x87, 0x2b, 0x6f, 0xf8, 0x02, 0xf1, + 0x7f, 0x4c, 0xb3, 0x5f, 0x9c, 0x8e, 0x75, 0x70, 0x36, 0xd6, 0xc1, 0xcf, 0xb1, 0x0e, 0x3e, 0x4e, + 0x74, 0xe5, 0x6c, 0xa2, 0x2b, 0x3f, 0x26, 0xba, 0xf2, 0xba, 0xf5, 0xf7, 0x26, 0x64, 0xaf, 0xe6, + 0x9f, 0x5e, 0x4d, 0xf9, 0xd2, 0xc9, 0x16, 0xfd, 0x4d, 0xf1, 0xda, 0xdd, 0xff, 0x1d, 0x00, 0x00, + 0xff, 0xff, 0x1a, 0xc9, 0xa3, 0xb8, 0x8d, 0x05, 0x00, 0x00, } func (this *MyAppMsg) GetMsg() github_com_cosmos_cosmos_sdk_types.Msg { @@ -320,6 +561,18 @@ func (this *MyAppMsg) GetMsg() github_com_cosmos_cosmos_sdk_types.Msg { if x := this.GetB(); x != nil { return x } + if x := this.GetC(); x != nil { + return x + } + if x := this.GetD(); x != nil { + return x + } + if x := this.GetE(); x != nil { + return x + } + if x := this.GetF(); x != nil { + return x + } return nil } @@ -329,12 +582,24 @@ func (this *MyAppMsg) SetMsg(value github_com_cosmos_cosmos_sdk_types.Msg) error return nil } switch vt := value.(type) { - case *MyAppProposalPayloadMsgA: + case *MsgAlwaysSucceed: this.Sum = &MyAppMsg_A{vt} return nil - case *MyAppProposalPayloadMsgB: + case *MsgAlwaysFail: this.Sum = &MyAppMsg_B{vt} return nil + case *MsgSetValue: + this.Sum = &MyAppMsg_C{vt} + return nil + case *MsgIncCounter: + this.Sum = &MyAppMsg_D{vt} + return nil + case *MsgConditional: + this.Sum = &MyAppMsg_E{vt} + return nil + case *MsgAuthenticate: + this.Sum = &MyAppMsg_F{vt} + return nil } return fmt.Errorf("can't encode value of type %T as message MyAppMsg", value) } @@ -413,6 +678,90 @@ func (m *MyAppMsg_B) MarshalToSizedBuffer(dAtA []byte) (int, error) { } return len(dAtA) - i, nil } +func (m *MyAppMsg_C) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MyAppMsg_C) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.C != nil { + { + size, err := m.C.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *MyAppMsg_D) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MyAppMsg_D) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.D != nil { + { + size, err := m.D.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *MyAppMsg_E) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MyAppMsg_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.E != nil { + { + size, err := m.E.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *MyAppMsg_F) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MyAppMsg_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.F != nil { + { + size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} func (m *MyAppProposal) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -460,7 +809,7 @@ func (m *MyAppProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MyAppProposalPayloadMsgA) Marshal() (dAtA []byte, err error) { +func (m *MsgAlwaysSucceed) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -470,12 +819,12 @@ func (m *MyAppProposalPayloadMsgA) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MyAppProposalPayloadMsgA) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgAlwaysSucceed) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MyAppProposalPayloadMsgA) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgAlwaysSucceed) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -483,7 +832,7 @@ func (m *MyAppProposalPayloadMsgA) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *MyAppProposalPayloadMsgB) Marshal() (dAtA []byte, err error) { +func (m *MsgAlwaysFail) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -493,12 +842,12 @@ func (m *MyAppProposalPayloadMsgB) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MyAppProposalPayloadMsgB) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgAlwaysFail) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MyAppProposalPayloadMsgB) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgAlwaysFail) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -506,7 +855,7 @@ func (m *MyAppProposalPayloadMsgB) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *MsgPropose) Marshal() (dAtA []byte, err error) { +func (m *MsgSetValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -516,68 +865,181 @@ func (m *MsgPropose) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgPropose) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSetValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgPropose) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSetValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Msgs) > 0 { - for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Base.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgIncCounter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MyAppMsg) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgIncCounter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgIncCounter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n + return len(dAtA) - i, nil } -func (m *MyAppMsg_A) Size() (n int) { - if m == nil { +func (m *MsgConditional) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgConditional) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConditional) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ExpectedCounter != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ExpectedCounter)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgAuthenticate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAuthenticate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAuthenticate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signers) > 0 { + for iNdEx := len(m.Signers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Signers[iNdEx]) + copy(dAtA[i:], m.Signers[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Signers[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgPropose) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPropose) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPropose) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msgs) > 0 { + for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Base.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MyAppMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *MyAppMsg_A) Size() (n int) { + if m == nil { return 0 } var l int @@ -600,6 +1062,54 @@ func (m *MyAppMsg_B) Size() (n int) { } return n } +func (m *MyAppMsg_C) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.C != nil { + l = m.C.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *MyAppMsg_D) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.D != nil { + l = m.D.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *MyAppMsg_E) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.E != nil { + l = m.E.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *MyAppMsg_F) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.F != nil { + l = m.F.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} func (m *MyAppProposal) Size() (n int) { if m == nil { return 0 @@ -617,16 +1127,38 @@ func (m *MyAppProposal) Size() (n int) { return n } -func (m *MyAppProposalPayloadMsgA) Size() (n int) { +func (m *MsgAlwaysSucceed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgAlwaysFail) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSetValue) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } return n } -func (m *MyAppProposalPayloadMsgB) Size() (n int) { +func (m *MsgIncCounter) Size() (n int) { if m == nil { return 0 } @@ -635,6 +1167,33 @@ func (m *MyAppProposalPayloadMsgB) Size() (n int) { return n } +func (m *MsgConditional) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ExpectedCounter != 0 { + n += 1 + sovTypes(uint64(m.ExpectedCounter)) + } + return n +} + +func (m *MsgAuthenticate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Signers) > 0 { + for _, b := range m.Signers { + l = len(b) + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + func (m *MsgPropose) Size() (n int) { if m == nil { return 0 @@ -649,16 +1208,279 @@ func (m *MsgPropose) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } - return n -} + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MyAppMsg) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MyAppMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MyAppMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgAlwaysSucceed{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &MyAppMsg_A{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgAlwaysFail{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &MyAppMsg_B{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field C", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgSetValue{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &MyAppMsg_C{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field D", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgIncCounter{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &MyAppMsg_D{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field E", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgConditional{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &MyAppMsg_E{v} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field F", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgAuthenticate{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &MyAppMsg_F{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *MyAppMsg) Unmarshal(dAtA []byte) error { +func (m *MyAppProposal) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -681,15 +1503,15 @@ func (m *MyAppMsg) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MyAppMsg: wiretype end group for non-group") + return fmt.Errorf("proto: MyAppProposal: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MyAppMsg: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MyAppProposal: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field A", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Base", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -716,15 +1538,13 @@ func (m *MyAppMsg) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &MyAppProposalPayloadMsgA{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Base.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &MyAppMsg_A{v} iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -751,11 +1571,10 @@ func (m *MyAppMsg) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &MyAppProposalPayloadMsgB{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Msgs = append(m.Msgs, MyAppMsg{}) + if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Sum = &MyAppMsg_B{v} iNdEx = postIndex default: iNdEx = preIndex @@ -781,7 +1600,7 @@ func (m *MyAppMsg) Unmarshal(dAtA []byte) error { } return nil } -func (m *MyAppProposal) Unmarshal(dAtA []byte) error { +func (m *MsgAlwaysSucceed) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -804,50 +1623,123 @@ func (m *MyAppProposal) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MyAppProposal: wiretype end group for non-group") + return fmt.Errorf("proto: MsgAlwaysSucceed: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MyAppProposal: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgAlwaysSucceed: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Base", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if skippy < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTypes } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if err := m.Base.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAlwaysFail) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAlwaysFail: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAlwaysFail: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex - case 2: + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetValue) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetValue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetValue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -857,26 +1749,77 @@ func (m *MyAppProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Msgs = append(m.Msgs, MyAppMsg{}) - if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgIncCounter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgIncCounter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgIncCounter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -901,7 +1844,7 @@ func (m *MyAppProposal) Unmarshal(dAtA []byte) error { } return nil } -func (m *MyAppProposalPayloadMsgA) Unmarshal(dAtA []byte) error { +func (m *MsgConditional) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -924,12 +1867,31 @@ func (m *MyAppProposalPayloadMsgA) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MyAppProposalPayloadMsgA: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConditional: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MyAppProposalPayloadMsgA: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConditional: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedCounter", wireType) + } + m.ExpectedCounter = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpectedCounter |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -954,7 +1916,7 @@ func (m *MyAppProposalPayloadMsgA) Unmarshal(dAtA []byte) error { } return nil } -func (m *MyAppProposalPayloadMsgB) Unmarshal(dAtA []byte) error { +func (m *MsgAuthenticate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -977,12 +1939,44 @@ func (m *MyAppProposalPayloadMsgB) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MyAppProposalPayloadMsgB: wiretype end group for non-group") + return fmt.Errorf("proto: MsgAuthenticate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MyAppProposalPayloadMsgB: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgAuthenticate: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signers = append(m.Signers, make([]byte, postIndex-iNdEx)) + copy(m.Signers[len(m.Signers)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) diff --git a/incubator/group/testdata/types.proto b/incubator/group/testdata/types.proto index 35d6f60..c60dcab 100644 --- a/incubator/group/testdata/types.proto +++ b/incubator/group/testdata/types.proto @@ -7,12 +7,16 @@ import "third_party/proto/cosmos-proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "group/types.proto"; -// MyAppMsg is the payload stored with a proposal and executed on success +// MyAppMsg is the payload stored with a proposal and executed when approved message MyAppMsg { option (cosmos_proto.interface_type) = "*github.com/cosmos/cosmos-sdk/types.Msg"; oneof sum { - MyAppProposalPayloadMsgA A = 1; - MyAppProposalPayloadMsgB B = 2; + MsgAlwaysSucceed A = 1; + MsgAlwaysFail B = 2; + MsgSetValue C = 3; + MsgIncCounter D = 4; + MsgConditional E = 5; + MsgAuthenticate F = 6; } } @@ -23,10 +27,29 @@ message MyAppProposal { repeated MyAppMsg msgs = 2 [(gogoproto.nullable) = false]; } -message MyAppProposalPayloadMsgA { +// MsgAlwaysSucceed is handled without errors +message MsgAlwaysSucceed { } -message MyAppProposalPayloadMsgB { +// MsgAlwaysFail returns an error by the handler +message MsgAlwaysFail { +} +// MsgSetValue stores a value in the store +message MsgSetValue { + string value = 1; +} +// MsgIncCounter increments a counter value +message MsgIncCounter { +} + +// MsgConditional execution depends on persistent counter value. When not equal then execution fails. +message MsgConditional { + uint64 expectedCounter = 1; +} + +// MsgAuthenticated contains a signer +message MsgAuthenticate { + repeated bytes signers = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; } message MsgPropose { diff --git a/incubator/group/types.go b/incubator/group/types.go index 53aff54..c576f34 100644 --- a/incubator/group/types.go +++ b/incubator/group/types.go @@ -57,7 +57,7 @@ func (p ThresholdDecisionPolicy) Allow(tally Tally, totalPower sdk.Dec, votingDu if err != nil { return DecisionPolicyResult{}, err } - if timeout < votingDuration { + if timeout <= votingDuration { return DecisionPolicyResult{Allow: false, Final: true}, nil } if tally.YesCount.GTE(p.Threshold) { @@ -254,7 +254,6 @@ func (p ProposalBase) ValidateBasic() error { if err := AccAddresses(p.Proposers).ValidateBasic(); err != nil { return sdkerrors.Wrap(err, "proposers") } - if p.SubmittedAt.Seconds == 0 && p.SubmittedAt.Nanos == 0 { return sdkerrors.Wrap(ErrEmpty, "submitted at") } @@ -276,7 +275,12 @@ func (p ProposalBase) ValidateBasic() error { if _, ok := ProposalBase_Result_name[int32(p.Result)]; !ok { return sdkerrors.Wrap(ErrInvalid, "result") } - + if p.ExecutorResult == ProposalExecutorResultInvalid { + return sdkerrors.Wrap(ErrEmpty, "executor result") + } + if _, ok := ProposalBase_ExecutorResult_name[int32(p.ExecutorResult)]; !ok { + return sdkerrors.Wrap(ErrInvalid, "executor result") + } if err := p.VoteState.ValidateBasic(); err != nil { return errors.Wrap(err, "vote state") } diff --git a/incubator/group/types.pb.go b/incubator/group/types.pb.go index aca2454..8e89c8e 100644 --- a/incubator/group/types.pb.go +++ b/incubator/group/types.pb.go @@ -130,6 +130,41 @@ func (ProposalBase_Result) EnumDescriptor() ([]byte, []int) { return fileDescriptor_d938547f84707355, []int{21, 1} } +type ProposalBase_ExecutorResult int32 + +const ( + // An empty value is not allowed + ProposalExecutorResultInvalid ProposalBase_ExecutorResult = 0 + // We have not yet run the executor + ProposalExecutorResultNotRun ProposalBase_ExecutorResult = 1 + // The executor was successful and proposed action updated state + ProposalExecutorResultSuccess ProposalBase_ExecutorResult = 2 + // The executor returned an error and proposed action didn't update state + ProposalExecutorResultFailure ProposalBase_ExecutorResult = 3 +) + +var ProposalBase_ExecutorResult_name = map[int32]string{ + 0: "PROPOSAL_EXECUTOR_RESULT_INVALID", + 1: "PROPOSAL_EXECUTOR_RESULT_NOT_RUN", + 2: "PROPOSAL_EXECUTOR_RESULT_SUCCESS", + 3: "PROPOSAL_EXECUTOR_RESULT_FAILURE", +} + +var ProposalBase_ExecutorResult_value = map[string]int32{ + "PROPOSAL_EXECUTOR_RESULT_INVALID": 0, + "PROPOSAL_EXECUTOR_RESULT_NOT_RUN": 1, + "PROPOSAL_EXECUTOR_RESULT_SUCCESS": 2, + "PROPOSAL_EXECUTOR_RESULT_FAILURE": 3, +} + +func (x ProposalBase_ExecutorResult) String() string { + return proto.EnumName(ProposalBase_ExecutorResult_name, int32(x)) +} + +func (ProposalBase_ExecutorResult) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_d938547f84707355, []int{21, 2} +} + type Msg struct { // Types that are valid to be assigned to Sum: // *Msg_CreateGroup @@ -1563,6 +1598,8 @@ type ProposalBase struct { // must be before this end time to be included in the election. After the timeout timestamp the proposal can not be // executed anymore and should be considered pending delete. Timeout types.Timestamp `protobuf:"bytes,10,opt,name=timeout,proto3" json:"timeout"` + // Result is the final result based on the votes and election rule. Initial value is NotRun. + ExecutorResult ProposalBase_ExecutorResult `protobuf:"varint,11,opt,name=executor_result,json=executorResult,proto3,enum=cosmos_modules.incubator.group.v1_alpha.ProposalBase_ExecutorResult" json:"executor_result,omitempty"` } func (m *ProposalBase) Reset() { *m = ProposalBase{} } @@ -1668,6 +1705,13 @@ func (m *ProposalBase) GetTimeout() types.Timestamp { return types.Timestamp{} } +func (m *ProposalBase) GetExecutorResult() ProposalBase_ExecutorResult { + if m != nil { + return m.ExecutorResult + } + return ProposalExecutorResultInvalid +} + type Tally struct { YesCount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=yes_count,json=yesCount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"yes_count"` NoCount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=no_count,json=noCount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"no_count"` @@ -1875,6 +1919,7 @@ func init() { proto.RegisterEnum("cosmos_modules.incubator.group.v1_alpha.Choice", Choice_name, Choice_value) proto.RegisterEnum("cosmos_modules.incubator.group.v1_alpha.ProposalBase_Status", ProposalBase_Status_name, ProposalBase_Status_value) proto.RegisterEnum("cosmos_modules.incubator.group.v1_alpha.ProposalBase_Result", ProposalBase_Result_name, ProposalBase_Result_value) + proto.RegisterEnum("cosmos_modules.incubator.group.v1_alpha.ProposalBase_ExecutorResult", ProposalBase_ExecutorResult_name, ProposalBase_ExecutorResult_value) proto.RegisterType((*Msg)(nil), "cosmos_modules.incubator.group.v1_alpha.Msg") proto.RegisterType((*MsgCreateGroup)(nil), "cosmos_modules.incubator.group.v1_alpha.MsgCreateGroup") proto.RegisterType((*MsgUpdateGroupMembers)(nil), "cosmos_modules.incubator.group.v1_alpha.MsgUpdateGroupMembers") @@ -1906,120 +1951,128 @@ func init() { func init() { proto.RegisterFile("types.proto", fileDescriptor_d938547f84707355) } var fileDescriptor_d938547f84707355 = []byte{ - // 1802 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xcb, 0x6f, 0x23, 0x49, - 0x19, 0x77, 0xfb, 0x19, 0x7f, 0x4e, 0xb2, 0xa6, 0x66, 0x66, 0xe3, 0x98, 0x25, 0x0e, 0x0d, 0x5a, - 0x96, 0x41, 0x63, 0xb3, 0x03, 0x62,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 0x15, 0x20, 0xc1, 0x07, 0x68, 0x74, 0x13, 0xd6, 0x18, 0x44, - 0xe9, 0x53, 0x4b, 0xa2, 0xa5, 0xcd, 0x67, 0x17, 0x39, 0x68, 0xf2, 0x77, 0xb5, 0x8a, 0x74, 0xb9, - 0x8e, 0x6a, 0x10, 0xf7, 0x86, 0xed, 0x55, 0xf4, 0xe3, 0x04, 0x68, 0x1f, 0xe2, 0x6a, 0xcf, 0xd2, - 0x55, 0x4c, 0x75, 0xdb, 0x5c, 0x60, 0x16, 0x2c, 0x53, 0x98, 0xc4, 0xe1, 0xa3, 0x56, 0x46, 0x83, - 0x56, 0xfe, 0x98, 0x59, 0xe9, 0x8d, 0xf7, 0x8b, 0x5a, 0xe9, 0xe8, 0x5d, 0x93, 0x4f, 0x21, 0xcb, - 0x59, 0xc9, 0x08, 0xc4, 0x9f, 0x84, 0x61, 0x83, 0x8f, 0xdd, 0x44, 0xd1, 0x14, 0xa2, 0x0c, 0x4b, - 0xaf, 0x30, 0x73, 0x34, 0xb8, 0xac, 0x32, 0xe1, 0x15, 0xab, 0xcc, 0xcc, 0x04, 0xf0, 0x56, 0x4e, - 0xb1, 0xed, 0x7d, 0x6e, 0xd4, 0x69, 0x51, 0xc9, 0x7f, 0x44, 0x4d, 0x48, 0x11, 0x8b, 0x28, 0xfd, - 0xb7, 0xb1, 0xde, 0xed, 0xb1, 0x13, 0xfb, 0xe2, 0x5f, 0xde, 0x28, 0x85, 0xf8, 0x57, 0x01, 0x52, - 0x23, 0x47, 0x8f, 0x79, 0x3c, 0x50, 0x83, 0x38, 0x9b, 0xf1, 0x57, 0x88, 0x00, 0x23, 0x40, 0x77, - 0x20, 0x7e, 0x9f, 0x99, 0x12, 0x59, 0xca, 0x14, 0x8e, 0x7e, 0x4e, 0x9a, 0xfd, 0x2a, 0x0c, 0x99, - 0xd1, 0x66, 0xe1, 0x87, 0xfa, 0x63, 0x2d, 0x16, 0x73, 0x4c, 0x98, 0x97, 0x69, 0x14, 0xb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x09, 0x62, 0x7e, 0xc7, 0x30, 0x98, 0x7f, 0xc4, 0x63, 0x4f, 0x43, 0x41, 0x37, 0xbf, 0x09, - 0x71, 0xe6, 0x3a, 0x94, 0x82, 0xc4, 0x71, 0xfd, 0x6e, 0xbd, 0xf1, 0x76, 0x3d, 0x1d, 0x42, 0x71, - 0x08, 0xd7, 0x1b, 0x69, 0x01, 0x25, 0x20, 0xf2, 0xdd, 0x6a, 0x2b, 0x1d, 0xf6, 0x56, 0x8b, 0xa5, - 0x56, 0xbb, 0x58, 0xab, 0xa7, 0x23, 0x68, 0x0d, 0xa2, 0x27, 0xd5, 0x76, 0x23, 0x1d, 0x2d, 0x95, - 0x3f, 0x78, 0xb2, 0x23, 0x7c, 0xf8, 0x64, 0x47, 0xf8, 0xdb, 0x93, 0x1d, 0xe1, 0x17, 0x4f, 0x77, - 0x42, 0x1f, 0x3e, 0xdd, 0x09, 0xfd, 0xe9, 0xe9, 0x4e, 0xe8, 0x7b, 0x5f, 0x9c, 0x4c, 0x00, 0xae, - 0x6b, 0xe1, 0x52, 0xd7, 0x02, 0xd5, 0xb5, 0x13, 0xa7, 0x4e, 0xff, 0xca, 0xff, 0x03, 0x00, 0x00, - 0xff, 0xff, 0x62, 0x5a, 0x51, 0x45, 0xb9, 0x1d, 0x00, 0x00, + // 1926 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xcd, 0x6f, 0x23, 0x49, + 0x15, 0x77, 0xdb, 0x8e, 0x9d, 0x3c, 0x27, 0x19, 0x53, 0x33, 0xb3, 0x71, 0xcc, 0x6c, 0xec, 0x6d, + 0xd0, 0xb2, 0x0c, 0x1a, 0x87, 0x1d, 0x10, 0x8b, 0x22, 0x40, 0xf8, 0x2b, 0x89, 0x99, 0xc4, 0x8e, + 0xba, 0xed, 0x2c, 0x1f, 0x23, 0x35, 0x9d, 0xee, 0x5a, 0xa7, 0xc1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0x3d, 0x5d, 0x13, 0x7e, 0xfe, 0x6c, 0x2d, 0xf2, 0xe1, 0xb3, 0xb5, + 0xc8, 0x9f, 0x9e, 0xad, 0x45, 0xbe, 0xfb, 0xf9, 0xc1, 0x04, 0xe0, 0xb6, 0xae, 0x5f, 0xd8, 0xba, + 0x4e, 0x6d, 0x3d, 0x48, 0x50, 0xa7, 0x7f, 0xe9, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x09, 0x67, + 0x14, 0x97, 0x64, 0x1f, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -3266,6 +3319,11 @@ func (m *ProposalBase) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ExecutorResult != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ExecutorResult)) + i-- + dAtA[i] = 0x58 + } { size, err := m.Timeout.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -4100,6 +4158,9 @@ func (m *ProposalBase) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) l = m.Timeout.Size() n += 1 + l + sovTypes(uint64(l)) + if m.ExecutorResult != 0 { + n += 1 + sovTypes(uint64(m.ExecutorResult)) + } return n } @@ -7686,6 +7747,25 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutorResult", wireType) + } + m.ExecutorResult = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExecutorResult |= ProposalBase_ExecutorResult(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) diff --git a/incubator/group/types.proto b/incubator/group/types.proto index 2e87801..9451def 100644 --- a/incubator/group/types.proto +++ b/incubator/group/types.proto @@ -272,6 +272,20 @@ message ProposalBase { // must be before this end time to be included in the election. After the timeout timestamp the proposal can not be // executed anymore and should be considered pending delete. google.protobuf.Timestamp timeout = 10 [(gogoproto.nullable) = false]; + + enum ExecutorResult { + option (gogoproto.goproto_enum_prefix) = false; + // An empty value is not allowed + PROPOSAL_EXECUTOR_RESULT_INVALID = 0 [(gogoproto.enumvalue_customname) = "ProposalExecutorResultInvalid"]; + // We have not yet run the executor + PROPOSAL_EXECUTOR_RESULT_NOT_RUN = 1 [(gogoproto.enumvalue_customname) = "ProposalExecutorResultNotRun"]; + // The executor was successful and proposed action updated state + PROPOSAL_EXECUTOR_RESULT_SUCCESS = 2 [(gogoproto.enumvalue_customname) = "ProposalExecutorResultSuccess"]; + // The executor returned an error and proposed action didn't update state + PROPOSAL_EXECUTOR_RESULT_FAILURE = 3 [(gogoproto.enumvalue_customname) = "ProposalExecutorResultFailure"]; + } + // Result is the final result based on the votes and election rule. Initial value is NotRun. + ExecutorResult executor_result = 11; } message Tally { diff --git a/incubator/group/types_test.go b/incubator/group/types_test.go index 976b426..fd4b428 100644 --- a/incubator/group/types_test.go +++ b/incubator/group/types_test.go @@ -26,7 +26,7 @@ func TestThresholdDecisionPolicy(t *testing.T) { }, srcTally: Tally{YesCount: sdk.NewDec(2)}, srcTotalPower: sdk.NewDec(3), - srcVotingDuration: time.Second, + srcVotingDuration: time.Millisecond, expResult: DecisionPolicyResult{Allow: true, Final: true}, }, "accept when yes count equal to threshold": { @@ -36,7 +36,7 @@ func TestThresholdDecisionPolicy(t *testing.T) { }, srcTally: Tally{YesCount: sdk.OneDec(), NoCount: sdk.ZeroDec(), AbstainCount: sdk.ZeroDec(), VetoCount: sdk.ZeroDec()}, srcTotalPower: sdk.NewDec(3), - srcVotingDuration: time.Second, + srcVotingDuration: time.Millisecond, expResult: DecisionPolicyResult{Allow: true, Final: true}, }, "reject when yes count lower to threshold": { @@ -46,7 +46,7 @@ func TestThresholdDecisionPolicy(t *testing.T) { }, srcTally: Tally{YesCount: sdk.ZeroDec(), NoCount: sdk.ZeroDec(), AbstainCount: sdk.ZeroDec(), VetoCount: sdk.ZeroDec()}, srcTotalPower: sdk.NewDec(3), - srcVotingDuration: time.Second, + srcVotingDuration: time.Millisecond, expResult: DecisionPolicyResult{Allow: false, Final: false}, }, "reject as final when remaining votes can't cross threshold": { @@ -56,10 +56,20 @@ func TestThresholdDecisionPolicy(t *testing.T) { }, srcTally: Tally{YesCount: sdk.ZeroDec(), NoCount: sdk.NewDec(2), AbstainCount: sdk.ZeroDec(), VetoCount: sdk.ZeroDec()}, srcTotalPower: sdk.NewDec(3), + srcVotingDuration: time.Millisecond, + expResult: DecisionPolicyResult{Allow: false, Final: true}, + }, + "expired when on timeout": { + srcPolicy: ThresholdDecisionPolicy{ + Threshold: sdk.OneDec(), + Timout: proto.Duration{Seconds: 1}, + }, + srcTally: Tally{YesCount: sdk.NewDec(2)}, + srcTotalPower: sdk.NewDec(3), srcVotingDuration: time.Second, expResult: DecisionPolicyResult{Allow: false, Final: true}, }, - "reject when expired": { + "expired when after timeout": { srcPolicy: ThresholdDecisionPolicy{ Threshold: sdk.OneDec(), Timout: proto.Duration{Seconds: 1}, @@ -76,7 +86,7 @@ func TestThresholdDecisionPolicy(t *testing.T) { }, srcTally: Tally{YesCount: sdk.ZeroDec(), NoCount: sdk.ZeroDec(), AbstainCount: sdk.OneDec(), VetoCount: sdk.ZeroDec()}, srcTotalPower: sdk.NewDec(3), - srcVotingDuration: time.Second, + srcVotingDuration: time.Millisecond, expResult: DecisionPolicyResult{Allow: false, Final: false}, }, "veto same as no": { @@ -86,7 +96,7 @@ func TestThresholdDecisionPolicy(t *testing.T) { }, srcTally: Tally{YesCount: sdk.ZeroDec(), NoCount: sdk.ZeroDec(), AbstainCount: sdk.ZeroDec(), VetoCount: sdk.NewDec(2)}, srcTotalPower: sdk.NewDec(3), - srcVotingDuration: time.Second, + srcVotingDuration: time.Millisecond, expResult: DecisionPolicyResult{Allow: false, Final: false}, }, }