Skip to content

Commit

Permalink
refactor(x/group): spin out Go module
Browse files Browse the repository at this point in the history
This change carves out cosmossdk.io/x/group as
an own Go module.

Updates #11899
Fixes #17936
  • Loading branch information
odeke-em committed Oct 1, 2023
1 parent e0bda6d commit 4a58bff
Show file tree
Hide file tree
Showing 81 changed files with 1,547 additions and 453 deletions.
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.

1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ require (
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816
github.com/bits-and-blooms/bitset v1.9.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"
};

// 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 @@ package cosmos.group.v1;
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 @@ syntax = "proto3";

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 @@ message GenesisState {

// 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/base/query/v1beta1/pagination.proto";
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 @@ syntax = "proto3";

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 @@ syntax = "proto3";

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
1 change: 1 addition & 0 deletions simapp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ replace (
cosmossdk.io/x/nft => ../x/nft
cosmossdk.io/x/protocolpool => ../x/protocolpool
cosmossdk.io/x/upgrade => ../x/upgrade
cosmossdk.io/x/group => ../x/group
)

// Below are the long-lived replace of the SimApp
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/group/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
// without this import amino json encoding will fail when resolving any types
_ "cosmossdk.io/api/cosmos/group/v1"
"cosmossdk.io/math"
"cosmossdk.io/x/group"
client "cosmossdk.io/x/group/client/cli"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec/address"
Expand All @@ -20,8 +22,6 @@ import (
"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/group"
client "github.com/cosmos/cosmos-sdk/x/group/client/cli"
)

type E2ETestSuite struct {
Expand Down
1 change: 1 addition & 0 deletions tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,5 @@ replace (
// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1
cosmossdk.io/x/group => ../x/group
)
2 changes: 1 addition & 1 deletion tests/integration/rapidgen/rapidgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
vestingapi "cosmossdk.io/api/cosmos/vesting/v1beta1"
evidencetypes "cosmossdk.io/x/evidence/types"
feegranttypes "cosmossdk.io/x/feegrant"
grouptypes "cosmossdk.io/x/group"
upgradetypes "cosmossdk.io/x/upgrade/types"

"github.com/cosmos/cosmos-sdk/crypto/keys/multisig"
Expand All @@ -42,7 +43,6 @@ import (
disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
gov_v1_types "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
gov_v1beta1_types "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
grouptypes "github.com/cosmos/cosmos-sdk/x/group"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tx/aminojson/aminojson_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"cosmossdk.io/math"
"cosmossdk.io/x/evidence"
feegrantmodule "cosmossdk.io/x/feegrant/module"
groupmodule "cosmossdk.io/x/group/module"
"cosmossdk.io/x/tx/signing/aminojson"
signing_testutil "cosmossdk.io/x/tx/signing/testutil"
"cosmossdk.io/x/upgrade"
Expand Down Expand Up @@ -67,7 +68,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/gov"
gov_v1_types "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
gov_v1beta1_types "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
groupmodule "github.com/cosmos/cosmos-sdk/x/group/module"
"github.com/cosmos/cosmos-sdk/x/mint"
"github.com/cosmos/cosmos-sdk/x/params"
"github.com/cosmos/cosmos-sdk/x/slashing"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tx/decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"cosmossdk.io/math"
"cosmossdk.io/x/evidence"
feegrantmodule "cosmossdk.io/x/feegrant/module"
groupmodule "cosmossdk.io/x/group/module"
"cosmossdk.io/x/tx/decode"
txsigning "cosmossdk.io/x/tx/signing"
"cosmossdk.io/x/upgrade"
Expand All @@ -33,7 +34,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/consensus"
"github.com/cosmos/cosmos-sdk/x/distribution"
"github.com/cosmos/cosmos-sdk/x/gov"
groupmodule "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
28 changes: 28 additions & 0 deletions x/group/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Guiding Principles:
Changelogs are for humans, not machines.
There should be an entry for every single version.
The same types of changes should be grouped.
Versions and sections should be linkable.
The latest version comes first.
The release date of each version is displayed.
Mention whether you follow Semantic Versioning.
Usage:
Change log entries are to be added to the Unreleased section under the
appropriate stanza (see below). Each entry should ideally include a tag and
the Github issue reference in the following format:
* (<tag>) [#<issue-number>] Changelog message.
Types of changes (Stanzas):
"Features" for new features.
"Improvements" for changes in existing functionality.
"Deprecated" for soon-to-be removed features.
"Bug Fixes" for any bug fixes.
"API Breaking" for breaking exported APIs used by developers building on SDK.
Ref: https://keepachangelog.com/en/1.0.0/
-->

# Changelog

## [Unreleased]
### Features
### API Breaking Changes
4 changes: 2 additions & 2 deletions x/group/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"github.com/spf13/cobra"

"cosmossdk.io/core/address"
"cosmossdk.io/x/group"
"cosmossdk.io/x/group/internal/math"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/group"
"github.com/cosmos/cosmos-sdk/x/group/internal/math"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions x/group/client/cli/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import (
// without this import amino json encoding will fail when resolving any types
_ "cosmossdk.io/api/cosmos/group/v1"
sdkmath "cosmossdk.io/math"
"cosmossdk.io/x/group"
groupcli "cosmossdk.io/x/group/client/cli"
groupmodule "cosmossdk.io/x/group/module"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand All @@ -25,9 +28,6 @@ import (
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
sdk "github.com/cosmos/cosmos-sdk/types"
testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/cosmos/cosmos-sdk/x/group"
groupcli "github.com/cosmos/cosmos-sdk/x/group/client/cli"
groupmodule "github.com/cosmos/cosmos-sdk/x/group/module"
)

var validMetadata = "metadata"
Expand Down
3 changes: 2 additions & 1 deletion x/group/client/cli/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"fmt"
"os"

"cosmossdk.io/x/group"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/group"
)

// parseDecisionPolicy reads and parses the decision policy.
Expand Down
Loading

0 comments on commit 4a58bff

Please sign in to comment.