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

Remove dao module #164

Open
wants to merge 16 commits into
base: dev-backup2
Choose a base branch
from
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,11 @@ jobs:
- name: Run `cargo clippy`
run: |
cargo clippy --all --all-targets --all-features -- -D clippy::all

markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/[email protected]
with:
folder-path: "docs"
44 changes: 0 additions & 44 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package app
import (
"fmt"
"io"
"net/http"
"os"
"path/filepath"

Expand Down Expand Up @@ -88,7 +87,6 @@ import (
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
"github.com/spf13/cast"
"github.com/tendermint/starport/starport/pkg/cosmoscmd"
"github.com/tendermint/starport/starport/pkg/openapiconsole"
abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
"github.com/tendermint/tendermint/libs/log"
Expand All @@ -107,11 +105,6 @@ import (
v1_1_1 "github.com/onomyprotocol/onomy/app/upgrades/v1.1.1"
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 +124,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 +158,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 +176,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 +242,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 +368,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 +378,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 +410,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 +448,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 +474,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 +495,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 +522,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 +549,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 @@ -753,9 +713,6 @@ func (app *OnomyApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIC
ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router)
ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// register app's OpenAPI routes.
apiSvr.Router.Handle("/openapi/openapi.yml", http.FileServer(http.FS(docs.Docs)))
apiSvr.Router.HandleFunc("/", openapiconsole.Handler(Name, "/openapi/openapi.yml"))
}

// RegisterTxService implements the Application.RegisterTxService method.
Expand Down Expand Up @@ -787,7 +744,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: 16 additions & 0 deletions app/upgrades/v1.1.5dev/upgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Package v1_1_5dev is contains chain upgrade of the corresponding version.
package v1_1_5dev //nolint:revive,stylecheck // app version

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

// Name is migration name.
const Name = "v1.1.5dev"

// UpgradeHandler is an x/upgrade handler.
func UpgradeHandler(_ sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
return vm, nil
}
50 changes: 0 additions & 50 deletions docs/chain/bonding-curve.md

This file was deleted.

4 changes: 1 addition & 3 deletions docs/chain/mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ At [Onomy Protocol](https://onomy.io/), we are excited to launch our public main
blockchain.

## Resources
* [Chain explorer](https://explorer.onomy.io/)
* [Chain explorer](https://mintscan.io/onomy-protocol)

## Documents

- [How to install Onomy](installation.md)
- [How to Run a Full Node](full.md)
- [How to Get bNOMs/NOMs](bonding-curve.md)
- [How to Become a Validator](validator.md)
6 changes: 0 additions & 6 deletions docs/chain/testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
At [Onomy Protocol](https://onomy.io/), we are excited to launch our public testnet for the Onomy Network (ONET)
blockchain.

## Resources
* [Chain explorer](https://explorer-testnet.onomy.io/)
* [Bonding curve (BCO)](https://bonding-curve-testnet.onomy.io/)

## Documents

- [How to install Onomy](installation.md)
- [How to Run a Full Node](full.md)
- [How to Get bNOMs/NOMs](bonding-curve.md)
- [How to Become a Validator](validator.md)
5 changes: 0 additions & 5 deletions docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
package docs

import "embed"

//go:embed openapi
var Docs embed.FS
Loading
Loading