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

refactor(x/group): spin out Go module #17937

Merged
merged 8 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -945,3 +945,33 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: x/upgrade/
test-x-group:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.21"
check-latest: true
cache: true
cache-dependency-path: x/group/go.sum
- uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
x/group/**/*.go
x/group/go.mod
x/group/go.sum
- name: tests
if: env.GIT_DIFF
run: |
cd x/group
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: x/group/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (types) [#17885](https://github.com/cosmos/cosmos-sdk/pull/17885) `InitGenesis` & `ExportGenesis` now take `context.Context` instead of `sdk.Context`
* (x/auth) [#17985](https://github.com/cosmos/cosmos-sdk/pull/17985) Remove `StdTxConfig`
* Remove depreacted `MakeTestingEncodingParams` from `simapp/params`
* (x/group) [#17937](https://github.com/cosmos/cosmos-sdk/pull/17937) Groups module was moved to its own go.mod `cosmossdk.io/x/group`
Copy link
Member

Choose a reason for hiding this comment

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

We should add an upgrading.md as well

* (x/consensus) [#18041](https://github.com/cosmos/cosmos-sdk/pull/18041) `ToProtoConsensusParams()` returns an error
* (x/slashing) [#18115](https://github.com/cosmos/cosmos-sdk/pull/18115) `NewValidatorSigningInfo` takes strings instead of `sdk.AccAddress`

Expand Down
7 changes: 3 additions & 4 deletions api/cosmos/group/module/v1/module.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
go 1.21

toolchain go1.21.0

module github.com/cosmos/cosmos-sdk

require (
Expand All @@ -19,7 +17,6 @@ require (
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816
github.com/bits-and-blooms/bitset v1.10.0
github.com/chzyer/readline v1.5.1
github.com/cockroachdb/apd/v2 v2.0.2
github.com/cockroachdb/errors v1.11.1
github.com/cometbft/cometbft v0.38.0
github.com/cosmos/btcutil v1.0.5
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E=
github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4=
github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU=
Expand Down
1 change: 1 addition & 0 deletions go.work.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use (
./tools/confix
./tools/hubl
./x/accounts
./x/group
./x/tx
./x/nft
./x/circuit
Expand Down
2 changes: 1 addition & 1 deletion proto/cosmos/group/module/v1/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "amino/amino.proto";
// Module is the config object of the group module.
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import: "github.com/cosmos/cosmos-sdk/x/group"
go_import: "cosmossdk.io/x/group"
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved
};

// max_execution_period defines the max duration after a proposal's voting period ends that members can send a MsgExec
Expand Down
2 changes: 1 addition & 1 deletion proto/cosmos/group/v1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import "cosmos_proto/cosmos.proto";
import "cosmos/group/v1/types.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/group";
option go_package = "cosmossdk.io/x/group";

Check failure on line 9 in proto/cosmos/group/v1/events.proto

View workflow job for this annotation

GitHub Actions / break-check

File option "go_package" changed from "github.com/cosmos/cosmos-sdk/x/group" to "cosmossdk.io/x/group".

// EventCreateGroup is an event emitted when a group is created.
message EventCreateGroup {
Expand Down
4 changes: 2 additions & 2 deletions proto/cosmos/group/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package cosmos.group.v1;

option go_package = "github.com/cosmos/cosmos-sdk/x/group";
option go_package = "cosmossdk.io/x/group";

Check failure on line 6 in proto/cosmos/group/v1/genesis.proto

View workflow job for this annotation

GitHub Actions / break-check

File option "go_package" changed from "github.com/cosmos/cosmos-sdk/x/group" to "cosmossdk.io/x/group".

import "cosmos/group/v1/types.proto";

Expand Down Expand Up @@ -36,4 +36,4 @@

// votes is the list of votes.
repeated Vote votes = 8;
}
}
2 changes: 1 addition & 1 deletion proto/cosmos/group/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import "cosmos_proto/cosmos.proto";
import "amino/amino.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/group";
option go_package = "cosmossdk.io/x/group";

Check failure on line 13 in proto/cosmos/group/v1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

File option "go_package" changed from "github.com/cosmos/cosmos-sdk/x/group" to "cosmossdk.io/x/group".

// Query is the cosmos.group.v1 Query service.
service Query {
Expand Down
2 changes: 1 addition & 1 deletion proto/cosmos/group/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package cosmos.group.v1;

option go_package = "github.com/cosmos/cosmos-sdk/x/group";
option go_package = "cosmossdk.io/x/group";

Check failure on line 6 in proto/cosmos/group/v1/tx.proto

View workflow job for this annotation

GitHub Actions / break-check

File option "go_package" changed from "github.com/cosmos/cosmos-sdk/x/group" to "cosmossdk.io/x/group".

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
Expand Down
2 changes: 1 addition & 1 deletion proto/cosmos/group/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package cosmos.group.v1;

option go_package = "github.com/cosmos/cosmos-sdk/x/group";
option go_package = "cosmossdk.io/x/group";

Check failure on line 6 in proto/cosmos/group/v1/types.proto

View workflow job for this annotation

GitHub Actions / break-check

File option "go_package" changed from "github.com/cosmos/cosmos-sdk/x/group" to "cosmossdk.io/x/group".

import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
Expand Down
6 changes: 3 additions & 3 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import (
"cosmossdk.io/x/feegrant"
feegrantkeeper "cosmossdk.io/x/feegrant/keeper"
feegrantmodule "cosmossdk.io/x/feegrant/module"
"cosmossdk.io/x/group"
groupkeeper "cosmossdk.io/x/group/keeper"
groupmodule "cosmossdk.io/x/group/module"
"cosmossdk.io/x/nft"
nftkeeper "cosmossdk.io/x/nft/keeper"
nftmodule "cosmossdk.io/x/nft/module"
Expand Down Expand Up @@ -92,9 +95,6 @@ import (
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/cosmos/cosmos-sdk/x/group"
groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper"
groupmodule "github.com/cosmos/cosmos-sdk/x/group/module"
"github.com/cosmos/cosmos-sdk/x/mint"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
Expand Down
6 changes: 3 additions & 3 deletions simapp/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import (
evidencetypes "cosmossdk.io/x/evidence/types"
"cosmossdk.io/x/feegrant"
_ "cosmossdk.io/x/feegrant/module" // import for side-effects
"cosmossdk.io/x/group"
_ "cosmossdk.io/x/group/module" // import for side-effects
"cosmossdk.io/x/nft"
_ "cosmossdk.io/x/nft/module" // import for side-effects
_ "cosmossdk.io/x/protocolpool" // import for side-effects
Expand Down Expand Up @@ -63,9 +65,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/gov"
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/cosmos/cosmos-sdk/x/group"
_ "github.com/cosmos/cosmos-sdk/x/group/module" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
_ "github.com/cosmos/cosmos-sdk/x/slashing" // import for side-effects
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
Expand Down
2 changes: 1 addition & 1 deletion simapp/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"cosmossdk.io/log"
"cosmossdk.io/x/evidence"
feegrantmodule "cosmossdk.io/x/feegrant/module"
group "cosmossdk.io/x/group/module"
"cosmossdk.io/x/upgrade"

"github.com/cosmos/cosmos-sdk/baseapp"
Expand All @@ -37,7 +38,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/distribution"
"github.com/cosmos/cosmos-sdk/x/genutil"
"github.com/cosmos/cosmos-sdk/x/gov"
group "github.com/cosmos/cosmos-sdk/x/group/module"
"github.com/cosmos/cosmos-sdk/x/mint"
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
Expand Down
2 changes: 1 addition & 1 deletion simapp/app_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
circuitkeeper "cosmossdk.io/x/circuit/keeper"
evidencekeeper "cosmossdk.io/x/evidence/keeper"
feegrantkeeper "cosmossdk.io/x/feegrant/keeper"
groupkeeper "cosmossdk.io/x/group/keeper"
nftkeeper "cosmossdk.io/x/nft/keeper"
_ "cosmossdk.io/x/protocolpool"
poolkeeper "cosmossdk.io/x/protocolpool/keeper"
Expand All @@ -41,7 +42,6 @@ import (
crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
Expand Down
21 changes: 12 additions & 9 deletions simapp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ require (
google.golang.org/protobuf v1.31.0
)

require cosmossdk.io/x/group v0.0.0-00010101000000-000000000000

require (
cloud.google.com/go v0.110.8 // indirect
cloud.google.com/go/compute v1.23.1 // indirect
Expand All @@ -42,7 +44,7 @@ require (
cosmossdk.io/errors v1.0.0 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/99designs/keyring v1.2.2 // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/aws/aws-sdk-go v1.45.25 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand All @@ -57,7 +59,7 @@ require (
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20230824192853-9bb0864bdb98 // indirect
github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft-db v0.8.0 // indirect
Expand All @@ -70,7 +72,7 @@ require (
github.com/cosmos/ledger-cosmos-go v0.13.2 // indirect
github.com/creachadair/atomicfile v0.3.2 // indirect
github.com/creachadair/tomledit v0.0.25 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/danieljoos/wincred v1.2.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
Expand All @@ -81,10 +83,10 @@ require (
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/emicklei/dot v1.6.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/getsentry/sentry-go v0.23.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/getsentry/sentry-go v0.24.1 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
Expand Down Expand Up @@ -141,16 +143,16 @@ require (
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/petermattis/goid v0.0.0-20230808133559-b036b712a89b // indirect
github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/cors v1.8.3 // indirect
Expand Down Expand Up @@ -207,6 +209,7 @@ replace (
cosmossdk.io/x/circuit => ../x/circuit
cosmossdk.io/x/evidence => ../x/evidence
cosmossdk.io/x/feegrant => ../x/feegrant
cosmossdk.io/x/group => ../x/group
cosmossdk.io/x/nft => ../x/nft
cosmossdk.io/x/protocolpool => ../x/protocolpool
cosmossdk.io/x/upgrade => ../x/upgrade
Expand Down
Loading
Loading