Skip to content

Commit

Permalink
replace x/gov/types with legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
tbruyelle committed Feb 9, 2024
1 parent f45e56c commit 3f1e1b6
Show file tree
Hide file tree
Showing 81 changed files with 63 additions and 12,164 deletions.
2 changes: 1 addition & 1 deletion ante/gov_ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/authz"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

"github.com/atomone-hub/govgen/v1/types/errors"
govkeeper "github.com/atomone-hub/govgen/v1/x/gov/keeper"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

// initial deposit must be greater than or equal to 1% of the minimum deposit
Expand Down
2 changes: 1 addition & 1 deletion ante/gov_ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

"github.com/atomone-hub/govgen/v1/ante"
govgenapp "github.com/atomone-hub/govgen/v1/app"
govgenhelpers "github.com/atomone-hub/govgen/v1/app/helpers"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

Expand All @@ -45,7 +46,6 @@ import (
govgenappparams "github.com/atomone-hub/govgen/v1/app/params"
"github.com/atomone-hub/govgen/v1/app/upgrades"
"github.com/atomone-hub/govgen/v1/simapp"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
db "github.com/tendermint/tm-db"

authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

govgen "github.com/atomone-hub/govgen/v1/app"
govgenhelpers "github.com/atomone-hub/govgen/v1/app/helpers"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

type EmptyAppOptions struct{}
Expand Down
9 changes: 3 additions & 6 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"

govkeeper "github.com/atomone-hub/govgen/v1/x/gov/keeper"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
Expand All @@ -30,7 +29,7 @@ import (
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
"github.com/cosmos/cosmos-sdk/x/feegrant"
feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper"
legacygovtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/cosmos/cosmos-sdk/x/params"
Expand Down Expand Up @@ -206,11 +205,9 @@ func NewAppKeeper(
appKeepers.SlashingKeeper,
)

// NOTE(tb): use legacy gov router because params, distribution and upgrade
// modules returns legacy gov Handlers.
govRouter := legacygovtypes.NewRouter()
govRouter := govtypes.NewRouter()
govRouter.
AddRoute(govtypes.RouterKey, legacygovtypes.ProposalHandler).
AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(appKeepers.ParamsKeeper)).
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(appKeepers.DistrKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(appKeepers.UpgradeKeeper))
Expand Down
3 changes: 1 addition & 2 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ import (
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
"github.com/cosmos/cosmos-sdk/x/feegrant"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

func (appKeepers *AppKeepers) GenerateKeys() {
Expand Down
2 changes: 1 addition & 1 deletion app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/cosmos/cosmos-sdk/x/mint"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/cosmos/cosmos-sdk/x/params"
Expand All @@ -39,7 +40,6 @@ import (

govgenappparams "github.com/atomone-hub/govgen/v1/app/params"
"github.com/atomone-hub/govgen/v1/x/gov"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"
)

var maccPerms = map[string][]string{
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@ require (
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/rakyll/statik v0.1.7
github.com/regen-network/cosmos-proto v0.3.1
github.com/spf13/cast v1.5.1
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.17.0
github.com/stretchr/testify v1.8.4
github.com/tendermint/tendermint v0.34.27
github.com/tendermint/tm-db v0.6.7
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb
google.golang.org/grpc v1.58.2
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v2 v2.4.0
)

require (
Expand Down Expand Up @@ -119,6 +115,7 @@ require (
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/regen-network/cosmos-proto v0.3.1 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/rs/zerolog v1.27.0 // indirect
Expand All @@ -144,8 +141,11 @@ require (
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
nhooyr.io/websocket v1.8.6 // indirect
)
Expand Down
2 changes: 1 addition & 1 deletion simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import (
feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
legacygovtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/cosmos/cosmos-sdk/x/mint"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
Expand All @@ -87,7 +88,6 @@ import (

"github.com/atomone-hub/govgen/v1/x/gov"
govkeeper "github.com/atomone-hub/govgen/v1/x/gov/keeper"
govtypes "github.com/atomone-hub/govgen/v1/x/gov/types"

// unnamed import of statik for swagger UI support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"
Expand Down
2 changes: 1 addition & 1 deletion third_party/proto/cosmos/gov/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package cosmos.gov.v1beta1;
import "gogoproto/gogo.proto";
import "cosmos/gov/v1beta1/gov.proto";

option go_package = "github.com/atomone-hub/govgen/v1/x/gov/types";
option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types";

// GenesisState defines the gov module's genesis state.
message GenesisState {
Expand Down
2 changes: 1 addition & 1 deletion third_party/proto/cosmos/gov/v1beta1/gov.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";

option go_package = "github.com/atomone-hub/govgen/v1/x/gov/types";
option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types";
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = false;
option (gogoproto.goproto_getters_all) = false;
Expand Down
2 changes: 1 addition & 1 deletion third_party/proto/cosmos/gov/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/gov/v1beta1/gov.proto";

option go_package = "github.com/atomone-hub/govgen/v1/x/gov/types";
option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types";

// Query defines the gRPC querier service for gov module
service Query {
Expand Down
2 changes: 1 addition & 1 deletion third_party/proto/cosmos/gov/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";

option go_package = "github.com/atomone-hub/govgen/v1/x/gov/types";
option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types";

// Msg defines the bank Msg service.
service Msg {
Expand Down
2 changes: 1 addition & 1 deletion x/gov/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"time"

"github.com/atomone-hub/govgen/v1/x/gov/keeper"
"github.com/atomone-hub/govgen/v1/x/gov/types"

"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)

// EndBlocker called every block, process inflation, update validator set.
Expand Down
2 changes: 1 addition & 1 deletion x/gov/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

"github.com/atomone-hub/govgen/v1/simapp"
"github.com/atomone-hub/govgen/v1/x/gov"
"github.com/atomone-hub/govgen/v1/x/gov/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/cosmos/cosmos-sdk/x/staking"
)

Expand Down
2 changes: 1 addition & 1 deletion x/gov/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"github.com/spf13/cobra"

gcutils "github.com/atomone-hub/govgen/v1/x/gov/client/utils"
"github.com/atomone-hub/govgen/v1/x/gov/types"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)

// GetQueryCmd returns the cli query commands for this module
Expand Down
2 changes: 1 addition & 1 deletion x/gov/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
"github.com/spf13/cobra"

govutils "github.com/atomone-hub/govgen/v1/x/gov/client/utils"
"github.com/atomone-hub/govgen/v1/x/gov/types"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)

// Proposal flags
Expand Down
4 changes: 1 addition & 3 deletions x/gov/client/testutil/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import (

"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/atomone-hub/govgen/v1/x/gov/types"

"github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
)
Expand Down
2 changes: 1 addition & 1 deletion x/gov/client/testutil/deposits.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
tmcli "github.com/tendermint/tendermint/libs/cli"

"github.com/atomone-hub/govgen/v1/x/gov/client/cli"
"github.com/atomone-hub/govgen/v1/x/gov/types"

clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)

type DepositTestSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion x/gov/client/testutil/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
tmcli "github.com/tendermint/tendermint/libs/cli"

"github.com/atomone-hub/govgen/v1/x/gov/client/cli"
"github.com/atomone-hub/govgen/v1/x/gov/types"

"github.com/cosmos/cosmos-sdk/client/flags"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)

type IntegrationTestSuite struct {
Expand Down
3 changes: 1 addition & 2 deletions x/gov/client/utils/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ package utils
import (
"fmt"

"github.com/atomone-hub/govgen/v1/x/gov/types"

"github.com/cosmos/cosmos-sdk/client"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion x/gov/client/utils/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (

"github.com/atomone-hub/govgen/v1/simapp"
"github.com/atomone-hub/govgen/v1/x/gov/client/utils"
"github.com/atomone-hub/govgen/v1/x/gov/types"

"github.com/cosmos/cosmos-sdk/client"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)

type TxSearchMock struct {
Expand Down
2 changes: 1 addition & 1 deletion x/gov/client/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package utils
import (
"strings"

"github.com/atomone-hub/govgen/v1/x/gov/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)

// NormalizeVoteOption - normalize user specified vote option
Expand Down
3 changes: 1 addition & 2 deletions x/gov/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import (

"github.com/stretchr/testify/require"

"github.com/atomone-hub/govgen/v1/x/gov/types"

"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)

Expand Down
2 changes: 1 addition & 1 deletion x/gov/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"

"github.com/atomone-hub/govgen/v1/x/gov/keeper"
"github.com/atomone-hub/govgen/v1/x/gov/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)

// InitGenesis - store genesis parameters
Expand Down
2 changes: 1 addition & 1 deletion x/gov/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (

"github.com/atomone-hub/govgen/v1/simapp"
"github.com/atomone-hub/govgen/v1/x/gov"
"github.com/atomone-hub/govgen/v1/x/gov/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)

func TestImportExportQueues(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion x/gov/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package gov

import (
"github.com/atomone-hub/govgen/v1/x/gov/keeper"
"github.com/atomone-hub/govgen/v1/x/gov/types"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)

// NewHandler creates an sdk.Handler for all the gov type messages
Expand Down
2 changes: 1 addition & 1 deletion x/gov/keeper/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"github.com/stretchr/testify/require"

"github.com/atomone-hub/govgen/v1/simapp"
"github.com/atomone-hub/govgen/v1/x/gov/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
Expand Down
Loading

0 comments on commit 3f1e1b6

Please sign in to comment.