Skip to content

Commit

Permalink
Remove DAO module and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Dusek committed May 6, 2024
1 parent 5379e12 commit 433b61b
Show file tree
Hide file tree
Showing 47 changed files with 8 additions and 7,329 deletions.
38 changes: 0 additions & 38 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ import (
v1_1_2 "github.com/onomyprotocol/onomy/app/upgrades/v1.1.2"
v1_1_4 "github.com/onomyprotocol/onomy/app/upgrades/v1.1.4"
"github.com/onomyprotocol/onomy/docs"
"github.com/onomyprotocol/onomy/x/dao"
daoclient "github.com/onomyprotocol/onomy/x/dao/client"
daokeeper "github.com/onomyprotocol/onomy/x/dao/keeper"
daotypes "github.com/onomyprotocol/onomy/x/dao/types"
)

const (
Expand All @@ -131,8 +127,6 @@ func getGovProposalHandlers() []govclient.ProposalHandler {
upgradeclient.CancelProposalHandler,
ibcclientclient.UpdateClientProposalHandler,
ibcclientclient.UpgradeProposalHandler,
daoclient.FundTreasuryProposalHandler,
daoclient.ExchangeWithTreasuryProposalProposalHandler,
ibcproviderclient.ConsumerAdditionProposalHandler,
ibcproviderclient.ConsumerRemovalProposalHandler,
ibcproviderclient.EquivocationProposalHandler,
Expand Down Expand Up @@ -167,14 +161,12 @@ var (
evidence.AppModuleBasic{},
transfer.AppModuleBasic{},
vesting.AppModuleBasic{},
dao.AppModuleBasic{},
ibcprovider.AppModuleBasic{},
)

// module account permissions.
maccPerms = map[string][]string{ // nolint:gochecknoglobals // cosmos-sdk application style
authtypes.FeeCollectorName: nil,
daotypes.ModuleName: {authtypes.Minter},
distrtypes.ModuleName: nil,
minttypes.ModuleName: {authtypes.Minter},
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
Expand All @@ -187,7 +179,6 @@ var (
// module accounts that are allowed to receive tokens.
allowedReceivingModAcc = map[string]bool{ // nolint:gochecknoglobals // cosmos-sdk application style
distrtypes.ModuleName: true,
daotypes.ModuleName: true,
// provider chain note: the fee-pool is allowed to receive tokens
authtypes.FeeCollectorName: true,
}
Expand Down Expand Up @@ -254,8 +245,6 @@ type OnomyApp struct {
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedIBCProviderKeeper capabilitykeeper.ScopedKeeper

DaoKeeper daokeeper.Keeper

// mm is the module manager
mm *module.Manager
configurator module.Configurator
Expand Down Expand Up @@ -382,19 +371,6 @@ func New( // nolint:funlen // app new cosmos func
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper

app.DaoKeeper = *daokeeper.NewKeeper(
appCodec,
keys[daotypes.StoreKey],
keys[daotypes.MemStoreKey],
app.GetSubspace(daotypes.ModuleName),
&app.BankKeeper,
&app.AccountKeeper,
&app.DistrKeeper,
&app.GovKeeper,
&app.MintKeeper,
&app.StakingKeeper,
)

// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
app.StakingKeeper = *stakingKeeper.SetHooks(
Expand All @@ -405,13 +381,6 @@ func New( // nolint:funlen // app new cosmos func
),
)

// protect the dao module form the slashing
app.StakingKeeper = *stakingKeeper.SetSlashingProtestedModules(func() map[string]struct{} {
return map[string]struct{}{
daotypes.ModuleName: {},
}
})

app.ProviderKeeper = ibcproviderkeeper.NewKeeper(
appCodec,
keys[providertypes.StoreKey],
Expand Down Expand Up @@ -444,7 +413,6 @@ func New( // nolint:funlen // app new cosmos func
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
AddRoute(daotypes.RouterKey, dao.NewProposalHandler(app.DaoKeeper)).
AddRoute(providertypes.RouterKey, ibcprovider.NewProviderProposalHandler(app.ProviderKeeper))

app.GovKeeper = govkeeper.NewKeeper(
Expand Down Expand Up @@ -483,7 +451,6 @@ func New( // nolint:funlen // app new cosmos func
params.NewAppModule(app.ParamsKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
transferModule,
dao.NewAppModule(appCodec, app.DaoKeeper),
providerModule,
)

Expand All @@ -510,7 +477,6 @@ func New( // nolint:funlen // app new cosmos func
paramstypes.ModuleName,
vestingtypes.ModuleName,
feegrant.ModuleName,
daotypes.ModuleName,
providertypes.ModuleName,
)
app.mm.SetOrderEndBlockers(
Expand All @@ -532,7 +498,6 @@ func New( // nolint:funlen // app new cosmos func
paramstypes.ModuleName,
vestingtypes.ModuleName,
feegrant.ModuleName,
daotypes.ModuleName,
providertypes.ModuleName,
)

Expand Down Expand Up @@ -560,7 +525,6 @@ func New( // nolint:funlen // app new cosmos func
paramstypes.ModuleName,
vestingtypes.ModuleName,
feegrant.ModuleName,
daotypes.ModuleName,
providertypes.ModuleName,
)

Expand Down Expand Up @@ -588,7 +552,6 @@ func New( // nolint:funlen // app new cosmos func
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
ibc.NewAppModule(app.IBCKeeper),
transferModule,
dao.NewAppModule(appCodec, app.DaoKeeper),
)
app.sm.RegisterStoreDecoders()

Expand Down Expand Up @@ -787,7 +750,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibchost.ModuleName)
paramsKeeper.Subspace(daotypes.ModuleName)
paramsKeeper.Subspace(providertypes.ModuleName)

return paramsKeeper
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,12 @@ require (
github.com/cosmos/cosmos-sdk v0.45.16-ics
github.com/cosmos/ibc-go/v4 v4.4.2
github.com/cosmos/interchain-security v1.1.0-multiden
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/spf13/cast v1.5.1
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.3
github.com/tendermint/starport v0.19.3
github.com/tendermint/tendermint v0.34.27
github.com/tendermint/tm-db v0.6.7
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17
google.golang.org/grpc v1.59.0
gopkg.in/yaml.v2 v2.4.0
)

require (
Expand Down Expand Up @@ -72,14 +64,18 @@ require (
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/gateway v1.1.0 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
Expand Down Expand Up @@ -122,6 +118,7 @@ require (
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.14.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
Expand All @@ -138,9 +135,12 @@ require (
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/grpc v1.59.0 // 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
43 changes: 0 additions & 43 deletions x/dao/abci.go

This file was deleted.

Loading

0 comments on commit 433b61b

Please sign in to comment.