Skip to content

Commit

Permalink
Add Group module (#154)
Browse files Browse the repository at this point in the history
* Add group module and updated proto

* Delete unrelevant files

* WIP on upgrade to stargate

* Add TODO

* Fix proto-gen

* Fix group AppModule and AppModuleBasic

* More migration in x/group

* Fix lint

* More lint fix

* Rename GroupID

* Fix TestGroupMetadataValidation and add UnpackInterfaces

* Refacto to use Msg services

* Move module impl to x/group/module and remove amino

* Fix build

* Fix lint

* Clean up testutil

* Add Proposal and CreateProposal rpc, use Any for msgs in it

* Fix lint

* Fix initParamsKeeper

* Comment group ref in app

* Add comments in proto

* gen proto

* wip on tests

* Setup test suite

* Rm keeper_test

* Rm testsupport.go

* Move old hander tests to testsuite and use msgClient in tests

* Use BinaryMarshaler in ORM to unpack Any's

* Fix exec proposal tests

* Fix group tests

* Add proposal executor tests

* Update ORM tests

* Wire up group module to regen app

* Fix lint

* Fix proto lint

* Renaming

* Update ORM

* Remove errors pkg

* Improve proposal doc

* Fix events types

* Update comment

* Clean up

* Use GroupId

* Use ProposalId

* Update conditions.go

* Rename to GetGroupMembers

* Add assertCommentSize

* Update x/group/server/keeper.go

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Update x/group/server/keeper.go

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Rename result enum value

* Add doc

* Add doc

* Use apd.Decimal instead of sdk.Dec

* Rename to GroupInfo and GroupAcountInfo

* Move group/types to group

* Remove tmp query.proto

* Move Keeper methods to serverImpl

* Add Query service proto def

* Add first impl of query service

* Finish up query service and rm keeper

* Lint

* Rename GroupID to ID

* Support Key page request with index.Get

* Lint

* Format

* Use bech32 addresses

* Lint

* Update group events

* Refactor group module to work with new proto codegen

* Lint

* Update protocgen script

* Update proto/regen/group/v1alpha1/genesis.proto

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>

* Update proto/regen/group/v1alpha1/query.proto

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>

* Update proto/regen/group/v1alpha1/events.proto

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>

* Update x/group/README.md

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>

* Update testutil/testdata/tx.proto

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>

* Address review comments

* Update README.md

* Reference issues in todos

* Rename member's weight variables

* Update x/group/server/msg_server.go

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>

* Update x/group/README.md

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Update AccAddresses ValidateBasic

* Remove useless address var

* Reference event issue

* Add comment in Vote

* Update x/group/README.md

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Update x/group/README.md

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Add GetPaginated to orm Index

* Rename var in orm/iterator

* Replace comment with metadata

* More renaming

* Support only one voter per Vote request

* Use fixed MaxMetadataLength

* Migrate group module to use ADR 033 and update GroupMember type

* Link

* Reorder members in test to compare

* Rename perm to conditionFormat

* Update x/group/conditions.go

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Add Paginate doc

* Update orm/iterator.go

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Update doc

* Add more docs

* More docs

* Add more tests for GetPaginated

* Add err check in assertion

* Always handle errors in Paginate loop

* Add more comments to Paginate

* Move destRef.Set to end of loop

* Add more tests cases for Paginate

* Update proto/regen/group/v1alpha1/tx.proto

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>

* Update proto/regen/group/v1alpha1/types.proto

* Refactor Fixture (#228)

* Address some of review comments

* Address comments and add more docs

* Update x/group/server/msg_server.go

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Update x/group/server/msg_server.go

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Update comment

* Update proto/regen/group/v1alpha1/query.proto

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
  • Loading branch information
4 people authored Jan 29, 2021
1 parent 4afc5cd commit 71dcb68
Show file tree
Hide file tree
Showing 75 changed files with 24,021 additions and 355 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ tags
.idea

build/

# OS
.DS_Store

/protoc-gen-go-cosmos2/protoc-gen-go-cosmos2
/proto-tools-stamp
/tools-stamp
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,20 @@ proto-check-breaking-docker:
@$(DOCKER_BUF) breaking --against-input $(HTTPS_GIT)#branch=master

GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
REGEN_COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master
COSMOS_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/master/proto/cosmos

GOGO_PROTO_TYPES = third_party/proto/gogoproto
REGEN_COSMOS_PROTO_TYPES = third_party/proto/cosmos_proto
COSMOS_PROTO_TYPES = third_party/proto/cosmos

proto-update-deps:
@mkdir -p $(GOGO_PROTO_TYPES)
@curl -sSL $(GOGO_PROTO_URL)/gogoproto/gogo.proto > $(GOGO_PROTO_TYPES)/gogo.proto

@mkdir -p $(REGEN_COSMOS_PROTO_TYPES)
@curl -sSL $(REGEN_COSMOS_PROTO_URL)/cosmos.proto > $(REGEN_COSMOS_PROTO_TYPES)/cosmos.proto

@mkdir -p $(COSMOS_PROTO_TYPES)/base/query/v1beta1/
@curl -sSL $(COSMOS_PROTO_URL)/base/query/v1beta1/pagination.proto > $(COSMOS_PROTO_TYPES)/base/query/v1beta1/pagination.proto

Expand Down
7 changes: 5 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
wasmclient "github.com/CosmWasm/wasmd/x/wasm/client"

newmodule "github.com/regen-network/regen-ledger/types/module"
moduletypes "github.com/regen-network/regen-ledger/types/module"
servermodule "github.com/regen-network/regen-ledger/types/module/server"
data "github.com/regen-network/regen-ledger/x/data/module"
ecocredit "github.com/regen-network/regen-ledger/x/ecocredit/module"
group "github.com/regen-network/regen-ledger/x/group/module"
)

const (
Expand Down Expand Up @@ -130,11 +131,13 @@ var (
wasm.AppModuleBasic{},
ecocredit.Module{},
data.Module{},
group.Module{},
)

NewModules = []newmodule.Module{
NewModules = []moduletypes.Module{
ecocredit.Module{},
data.Module{},
group.Module{},
}

// module account permissions
Expand Down
2 changes: 2 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ lint:
ignore:
- cosmos
- gogoproto
- cosmos_proto
breaking:
use:
- FILE
ignore:
- cosmos
- gogoproto
- cosmos_proto
Loading

0 comments on commit 71dcb68

Please sign in to comment.