Skip to content

Commit

Permalink
fix: Removal of liquidity module (cosmos#2716)
Browse files Browse the repository at this point in the history
* Remove liquidity module
* Fix issue found by linter
* Update docs
* Correction to coding guidlines
  • Loading branch information
bermuell committed Sep 8, 2023
1 parent c54975c commit 5b54c94
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 41 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/dependencies/2714-remove-liquidity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Remove [Liquidity](https://github.com/Gravity-Devs/liquidity)
([\#2716](https://github.com/cosmos/gaia/pull/2716))
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ func (app *GaiaApp) setupUpgradeStoreLoaders() {
}

for _, upgrade := range Upgrades {
upgrade := upgrade
if upgradeInfo.Name == upgrade.UpgradeName {
storeUpgrades := upgrade.StoreUpgrades
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
Expand Down
24 changes: 6 additions & 18 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package keepers

import (
liquiditykeeper "github.com/gravity-devs/liquidity/x/liquidity/keeper"
liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types"
tmos "github.com/tendermint/tendermint/libs/os"

// unnamed import of statik for swagger UI support
Expand Down Expand Up @@ -86,13 +84,12 @@ type AppKeepers struct {
UpgradeKeeper upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
// IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCKeeper *ibckeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
AuthzKeeper authzkeeper.Keeper
LiquidityKeeper liquiditykeeper.Keeper
IBCKeeper *ibckeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
AuthzKeeper authzkeeper.Keeper

// ICS
ProviderKeeper ibcproviderkeeper.Keeper
Expand Down Expand Up @@ -226,14 +223,6 @@ func NewAppKeeper(
&stakingKeeper,
appKeepers.GetSubspace(slashingtypes.ModuleName),
)
appKeepers.LiquidityKeeper = liquiditykeeper.NewKeeper(
appCodec,
appKeepers.keys[liquiditytypes.StoreKey],
appKeepers.GetSubspace(liquiditytypes.ModuleName),
appKeepers.BankKeeper,
appKeepers.AccountKeeper,
appKeepers.DistrKeeper,
)

// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
Expand Down Expand Up @@ -398,7 +387,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(slashingtypes.ModuleName)
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable())
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(liquiditytypes.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibchost.ModuleName)

Expand Down
4 changes: 1 addition & 3 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package keepers

import (
liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types"

routertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v4/router/types"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
Expand Down Expand Up @@ -33,7 +31,7 @@ func (appKeepers *AppKeepers) GenerateKeys() {
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey,
evidencetypes.StoreKey, liquiditytypes.StoreKey, ibctransfertypes.StoreKey,
evidencetypes.StoreKey, ibctransfertypes.StoreKey,
capabilitytypes.StoreKey, feegrant.StoreKey, authzkeeper.StoreKey, routertypes.StoreKey,
icahosttypes.StoreKey, providertypes.StoreKey,
)
Expand Down
10 changes: 0 additions & 10 deletions app/modules.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package gaia

import (
"github.com/gravity-devs/liquidity/x/liquidity"
liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types"

"github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v4/router"
routertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v4/router/types"
ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts"
Expand Down Expand Up @@ -67,7 +64,6 @@ var maccPerms = map[string][]string{
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
govtypes.ModuleName: {authtypes.Burner},
liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
providertypes.ConsumerRewardsPool: nil,
}
Expand Down Expand Up @@ -104,7 +100,6 @@ var ModuleBasics = module.NewBasicManager(
evidence.AppModuleBasic{},
transfer.AppModuleBasic{},
vesting.AppModuleBasic{},
liquidity.AppModuleBasic{},
router.AppModuleBasic{},
ica.AppModuleBasic{},
globalfee.AppModule{},
Expand Down Expand Up @@ -141,7 +136,6 @@ func appModules(
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
ibc.NewAppModule(app.IBCKeeper),
params.NewAppModule(app.ParamsKeeper),
liquidity.NewAppModule(appCodec, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.DistrKeeper),
globalfee.NewAppModule(app.GetSubspace(globalfee.ModuleName)),
app.TransferModule,
app.ICAModule,
Expand Down Expand Up @@ -172,7 +166,6 @@ func simulationModules(
params.NewAppModule(app.ParamsKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
liquidity.NewAppModule(appCodec, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.DistrKeeper),
ibc.NewAppModule(app.IBCKeeper),
app.TransferModule,
app.ProviderModule,
Expand Down Expand Up @@ -205,7 +198,6 @@ func orderBeginBlockers() []string {
banktypes.ModuleName,
govtypes.ModuleName,
crisistypes.ModuleName,
liquiditytypes.ModuleName,
ibctransfertypes.ModuleName,
ibchost.ModuleName,
icatypes.ModuleName,
Expand Down Expand Up @@ -233,7 +225,6 @@ func orderEndBlockers() []string {
crisistypes.ModuleName,
govtypes.ModuleName,
stakingtypes.ModuleName,
liquiditytypes.ModuleName,
ibctransfertypes.ModuleName,
ibchost.ModuleName,
icatypes.ModuleName,
Expand Down Expand Up @@ -280,7 +271,6 @@ func orderInitBlockers() []string {
ibchost.ModuleName,
icatypes.ModuleName,
evidencetypes.ModuleName,
liquiditytypes.ModuleName,
authz.ModuleName,
feegrant.ModuleName,
routertypes.ModuleName,
Expand Down
2 changes: 1 addition & 1 deletion docs/guidelines/code-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

If you want to contribute to a project and improve it, your help is welcome. We want to make Gaia as good as it can be. Contributing is also a great way to learn more about blockchain technology and improve it. Please read this document and follow our guidelines to make the process as smooth as possible. We are happy to review your code but please ensure that you have a reasonable and clean pull request.

This documents idiomatic conventions in the Go code that we follow at Uber. A lot of these are general guidelines for Go, while others extend upon external resources:
This documents idiomatic conventions in the Go code that we follow for gaia development. A lot of these are general guidelines for Go, while others extend upon external resources:

1. [Effective Go](https://golang.org/doc/effective_go.html)
2. [Go Common Mistakes](https://github.com/golang/go/wiki/CommonMistakes)
Expand Down
5 changes: 0 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ require (
github.com/golang/protobuf v1.5.3
github.com/google/gofuzz v1.2.0
github.com/gorilla/mux v1.8.0
github.com/gravity-devs/liquidity v1.6.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/ory/dockertest/v3 v3.10.0
github.com/rakyll/statik v0.1.7
Expand Down Expand Up @@ -94,7 +93,6 @@ require (
github.com/gorilla/handlers v1.5.1 // 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/v2 v2.10.2 // 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 @@ -190,9 +188,6 @@ replace (
// use cosmos style protobufs
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

// Liquidity force withdrawal: https://www.mintscan.io/cosmos/proposals/801
github.com/gravity-devs/liquidity => github.com/gravity-devs/liquidity v1.6.0-forced-withdrawal

// Comet
github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.29

Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,6 @@ github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc=
github.com/gravity-devs/liquidity v1.6.0-forced-withdrawal h1:XQAMyrO6tovGLwpclVa4Z4DI02u2jW+uCJyBFeRqtxY=
github.com/gravity-devs/liquidity v1.6.0-forced-withdrawal/go.mod h1:0oxsaI8Ukf40W1xDSQ+LKbbXEcS17UkU4RbJ2fPMpl8=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
Expand All @@ -542,8 +540,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.2 h1:ERKrevVTnCw3Wu4I3mtR15QU3gtWy86cBo6De0jEohg=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.2/go.mod h1:chrfS3YoLAlKTRE5cFWvCbt8uGAjshktT4PveTUpsFQ=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
Expand Down

0 comments on commit 5b54c94

Please sign in to comment.