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 7, 2023
1 parent c325cbf commit 184da08
Show file tree
Hide file tree
Showing 81 changed files with 1,550 additions and 454 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/crypto/hd"
Expand All @@ -19,8 +21,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 @@ -202,6 +202,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/params => ../x/params
cosmossdk.io/x/protocolpool => ../x/protocolpool
Expand Down
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
3 changes: 1 addition & 2 deletions tests/integration/tx/aminojson/aminojson_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"cosmossdk.io/math"
"cosmossdk.io/x/evidence"
feegrantmodule "cosmossdk.io/x/feegrant/module"
"cosmossdk.io/x/params"
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 @@ -68,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/slashing"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
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
7 changes: 4 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,10 @@ 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"
groupcli "github.com/cosmos/cosmos-sdk/x/group/client/cli"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand All @@ -26,9 +30,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"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 184da08

Please sign in to comment.