Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Update group to use Any #71

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft

Update group to use Any #71

wants to merge 11 commits into from

Conversation

blushi
Copy link
Member

@blushi blushi commented Jun 1, 2020

closes: #69

@blushi blushi linked an issue Jun 1, 2020 that may be closed by this pull request
Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good!

Left a few minor comments, some of them related to stuff that wasn't even affected by this PR but that I did notice in reviewing the code.

The main functional thing is to keep the DecisionPolicy interface as generic as possible and not add things that are just specific to ThresholdDecisionPolicy.

incubator/group/codec.go Outdated Show resolved Hide resolved
//
// The actual codec used for serialization should be provided to x/transfer and
// defined at the application level.
ModuleCdc = codec.NewHybridCodec(amino, cdctypes.NewInterfaceRegistry())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it work to make this private?

}
return data.Validate()
}

func (a AppModule) RegisterRESTRoutes(ctx context.CLIContext, r *mux.Router) {
func (a AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, r *mux.Router) {
//rest.RegisterRoutes(ctx, r, ModuleCdc, RouterKey)
// todo: what client functions do we want to support?
panic("implement me")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to panic here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's existing code from @alpe I believe

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I know, just noting it as something to cleanup

incubator/group/group.go Outdated Show resolved Hide resolved
incubator/group/group.go Outdated Show resolved Hide resolved
incubator/group/msg.go Outdated Show resolved Hide resolved
incubator/group/msg.go Outdated Show resolved Hide resolved
@@ -2,50 +2,64 @@ package testdata

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish there were a way we could just extend simapp from the sdk rather than just having everything copied here. Not relevant for this PR, but something to think about in the future.

incubator/group/types.proto Outdated Show resolved Hide resolved
incubator/group/types.go Outdated Show resolved Hide resolved
incubator/group/group.go Outdated Show resolved Hide resolved
}

func (a AppModuleBasic) GetQueryCmd(*codec.Codec) *cobra.Command {
//return cli.GetQueryCmd(StoreKey, cdc)
panic("implement me")
return &cobra.Command{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Allow(tally Tally, totalPower sdk.Dec, votingDuration time.Duration) (DecisionPolicyResult, error)
Validate(g GroupMetadata) error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a godoc here explaining why GroupMetadata is passed in?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update groups module to use Any in proto encoding
2 participants