Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[x/group] Add amino JSON signing support and CLI #220

Merged
merged 112 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from 107 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
94b6d0a
Add group module and updated proto
blushi Nov 5, 2020
88219db
Delete unrelevant files
blushi Nov 5, 2020
1ea581c
WIP on upgrade to stargate
blushi Nov 5, 2020
e0983d1
Add TODO
blushi Nov 5, 2020
5d4b17d
Merge branch 'master' into marie/136-x-group
blushi Nov 6, 2020
46302c8
Fix proto-gen
blushi Nov 6, 2020
ac06ce7
Fix group AppModule and AppModuleBasic
blushi Nov 6, 2020
b83faeb
More migration in x/group
blushi Nov 6, 2020
e63f712
Fix lint
blushi Nov 6, 2020
4629fb1
More lint fix
blushi Nov 6, 2020
61558c3
Rename GroupID
blushi Nov 6, 2020
e8578c4
Merge branch 'master' into marie/136-x-group
blushi Nov 6, 2020
179d5a3
Fix TestGroupMetadataValidation and add UnpackInterfaces
blushi Nov 6, 2020
1b1d694
Merge branch 'master' into marie/136-x-group
blushi Nov 12, 2020
7c48dfb
Refacto to use Msg services
blushi Nov 12, 2020
4acfd5a
Move module impl to x/group/module and remove amino
blushi Nov 12, 2020
5f66c4f
Fix build
blushi Nov 12, 2020
55b0df8
Fix lint
blushi Nov 12, 2020
6338a52
Clean up testutil
blushi Nov 12, 2020
63227df
Add Proposal and CreateProposal rpc, use Any for msgs in it
blushi Nov 13, 2020
41612ce
Fix lint
blushi Nov 13, 2020
4aba3fc
Fix initParamsKeeper
blushi Nov 13, 2020
5aae182
Merge branch 'master' into marie/136-x-group
blushi Nov 13, 2020
742d2b9
Comment group ref in app
blushi Nov 18, 2020
a9d5fcf
Add comments in proto
blushi Nov 18, 2020
548340f
Merge branch 'master' into marie/136-x-group
blushi Nov 18, 2020
3bba95a
gen proto
blushi Nov 18, 2020
f777129
wip on tests
blushi Nov 19, 2020
1af002b
Setup test suite
blushi Nov 19, 2020
4718f17
Rm keeper_test
blushi Nov 19, 2020
1212b8d
Rm testsupport.go
blushi Nov 19, 2020
97cf006
Move old hander tests to testsuite and use msgClient in tests
blushi Nov 19, 2020
4887476
Use BinaryMarshaler in ORM to unpack Any's
blushi Nov 20, 2020
dc61a9b
Fix exec proposal tests
blushi Nov 20, 2020
a62bdb0
Fix group tests
blushi Nov 25, 2020
95a81c8
Add proposal executor tests
blushi Nov 25, 2020
070c047
Update ORM tests
blushi Nov 25, 2020
db313ee
Wire up group module to regen app
blushi Nov 25, 2020
24fce14
Merge branch 'master' into marie/136-x-group
blushi Nov 25, 2020
09216b7
Fix lint
blushi Nov 25, 2020
83ad845
Fix proto lint
blushi Nov 25, 2020
8321ff0
Renaming
blushi Nov 25, 2020
f834ea5
Update ORM
blushi Nov 26, 2020
ce52870
Merge branch 'master' into marie/136-x-group
blushi Nov 26, 2020
e80c00c
Remove errors pkg
blushi Nov 26, 2020
67ede52
Merge branch 'marie/136-x-group' of github.com:regen-network/regen-le…
blushi Nov 26, 2020
1e1e4d1
Improve proposal doc
blushi Nov 26, 2020
2693e75
Fix events types
blushi Nov 26, 2020
f523044
Update comment
blushi Nov 26, 2020
75194ac
Clean up
blushi Nov 26, 2020
01fa2a1
Use GroupId
blushi Nov 26, 2020
2058ef0
Use ProposalId
blushi Nov 26, 2020
3c620a0
Update conditions.go
blushi Nov 26, 2020
a2a508f
Rename to GetGroupMembers
blushi Nov 26, 2020
814f33d
Add assertCommentSize
blushi Nov 26, 2020
1563e6d
Update x/group/server/keeper.go
blushi Nov 26, 2020
171c485
Update x/group/server/keeper.go
blushi Nov 26, 2020
b11796a
Rename result enum value
blushi Nov 27, 2020
33040fe
Add doc
blushi Nov 27, 2020
307191c
Add doc
blushi Nov 27, 2020
3fb86a6
Merge branch 'marie/136-x-group' of github.com:regen-network/regen-le…
blushi Nov 27, 2020
d7a94a6
Use apd.Decimal instead of sdk.Dec
blushi Dec 3, 2020
47ee8ae
Rename to GroupInfo and GroupAcountInfo
blushi Dec 3, 2020
47040d8
Move group/types to group
blushi Dec 4, 2020
ecbac2b
Remove tmp query.proto
blushi Dec 4, 2020
29ab424
Move Keeper methods to serverImpl
blushi Dec 4, 2020
cb440a0
Add Query service proto def
blushi Dec 4, 2020
9083119
Add first impl of query service
blushi Dec 8, 2020
ff624f7
Finish up query service and rm keeper
blushi Dec 9, 2020
f9eae0d
Lint
blushi Dec 9, 2020
96824bc
Rename GroupID to ID
blushi Dec 9, 2020
fa85eec
Support Key page request with index.Get
blushi Dec 15, 2020
fd44c16
Merge branch 'master' into marie/136-x-group
blushi Dec 17, 2020
0b04ac2
Lint
blushi Dec 17, 2020
985b4c3
Format
blushi Dec 17, 2020
184d271
Use bech32 addresses
blushi Dec 18, 2020
113af10
Lint
blushi Dec 18, 2020
cb413b7
Update group events
blushi Jan 6, 2021
ea502f8
Merge branch 'master' into marie/136-x-group
blushi Jan 6, 2021
30dd644
Refactor group module to work with new proto codegen
blushi Jan 8, 2021
b9fb3bc
Lint
blushi Jan 8, 2021
75541a5
Update protocgen script
blushi Jan 8, 2021
7534891
Add amino registration and handler
blushi Jan 14, 2021
869bb27
Add CLI wip
blushi Jan 15, 2021
e1458a3
Merge branch 'master' into marie/218-group-amino
blushi Jan 15, 2021
2ec1e52
Add tx cli
blushi Jan 15, 2021
c3249a3
WIP on query cli
blushi Jan 20, 2021
096baae
Add some query cmd
blushi Jan 22, 2021
1b53e0b
Merge branch 'master' into marie/218-group-amino
blushi Feb 3, 2021
c83a9bb
Fix build
blushi Feb 3, 2021
045bca9
Update protobuf.md
blushi Feb 3, 2021
803e328
group client and module cleanup
blushi Feb 4, 2021
adf3dd7
Add remaining CLI queries
blushi Feb 4, 2021
e91f079
rm dead code
blushi Feb 4, 2021
eb20090
Register Msgs
blushi Feb 4, 2021
620e96f
Add LegacyRouteModule
blushi Feb 4, 2021
be1661a
Merge branch 'master' into marie/218-group-amino
blushi Feb 4, 2021
eb8ce4e
CLI test wip
blushi Feb 4, 2021
a009869
Merge branch 'master' into marie/218-group-amino
blushi Feb 5, 2021
9a4bc93
Add more CLI tests
blushi Feb 5, 2021
504540b
Add more query CLI tests
blushi Feb 5, 2021
cb39adb
Add tx group update CLI tests wip
blushi Feb 5, 2021
ab245c1
Merge branch 'master' into marie/218-group-amino
blushi Feb 10, 2021
21e0cf2
Use app.AccountKeeper
blushi Feb 11, 2021
a7e40cd
Add remaining CLI tests
blushi Feb 11, 2021
d186dfe
Revert orm index
blushi Feb 11, 2021
a21f620
Add cli tests for group account actions (#258)
atheeshp Feb 12, 2021
ba33020
Update types/module/server/manager.go
blushi Feb 17, 2021
79bd145
Clean up
blushi Feb 17, 2021
bb6f06b
Remove s.maxMetadataLength
blushi Feb 17, 2021
51bc325
Merge branch 'master' into marie/218-group-amino
blushi Feb 17, 2021
5f206ad
Lint
blushi Feb 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest
newModuleManager := servermodule.NewManager(app.BaseApp, codec.NewProtoCodec(interfaceRegistry))

// BEGIN HACK: this is a total, ugly hack until x/auth supports ADR 033 or we have a suitable alternative
groupModule := group.Module{AccountKeeper: authkeeper.AccountKeeper{}}
groupModule := group.Module{AccountKeeper: app.AccountKeeper}
// use a separate newModules from the global NewModules here because we need to pass state into the group module
newModules := []moduletypes.Module{
ecocredit.Module{},
Expand Down
1 change: 0 additions & 1 deletion docs/modules/data/protobuf.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,4 +571,3 @@ The sender in StoreRawData is not attesting to the veracity of the underlying da
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

43 changes: 43 additions & 0 deletions types/module/configurator.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package module

import (
"github.com/cosmos/cosmos-sdk/codec"
sdkmodule "github.com/cosmos/cosmos-sdk/types/module"
"github.com/gogo/protobuf/grpc"
)

// Configurator extends the cosmos sdk Configurator interface
// with Marshaler()
type Configurator interface {
sdkmodule.Configurator

Marshaler() codec.Marshaler
}

type configurator struct {
msgServer grpc.Server
queryServer grpc.Server
cdc codec.Marshaler
}

// NewConfigurator returns a new Configurator instance
func NewConfigurator(msgServer grpc.Server, queryServer grpc.Server, cdc codec.Marshaler) Configurator {
return configurator{msgServer: msgServer, queryServer: queryServer, cdc: cdc}
}

var _ Configurator = configurator{}

// MsgServer implements the Configurator.MsgServer method
func (c configurator) MsgServer() grpc.Server {
return c.msgServer
}

// QueryServer implements the Configurator.QueryServer method
func (c configurator) QueryServer() grpc.Server {
return c.queryServer
}

// Marshaler implements the Configurator.Marshaler method
func (c configurator) Marshaler() codec.Marshaler {
return c.cdc
}
9 changes: 9 additions & 0 deletions types/module/server/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ func (mm *Manager) RegisterModules(modules []module.Module) error {

serverMod.RegisterServices(cfg)

// If mod implements LegacyRouteModule, registry module route.
blushi marked this conversation as resolved.
Show resolved Hide resolved
// This is currently used for the group module as part of #218.
routeMod, ok := mod.(LegacyRouteModule)
if ok {
if r := routeMod.Route(cfg); !r.Empty() {
mm.baseApp.Router().AddRoute(r)
}
}

for typ := range cfg.requiredServices {
mm.requiredServices[typ] = true
}
Expand Down
7 changes: 7 additions & 0 deletions types/module/server/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ type Configurator interface {
// TODO: remove once #225 addressed
Router() sdk.Router
}

// LegacyRouteModule is the module type that a module must implement
// to support legacy sdk.Msg routing.
// This is currently used for the group module as part of #218.
type LegacyRouteModule interface {
Route(Configurator) sdk.Route
}
Loading