Skip to content

Commit aff6d20

Browse files
authored
Merge pull request #412 from persistenceOne/puneet/migrate-lsm
feat: wire gaia/liquid
2 parents f9075a2 + 7455c81 commit aff6d20

25 files changed

+669
-263
lines changed

app/encoding.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ package app
88
import (
99
"github.com/cosmos/cosmos-sdk/std"
1010
sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution"
11+
grouptypes "github.com/cosmos/cosmos-sdk/x/group"
1112
sdkslashing "github.com/cosmos/cosmos-sdk/x/slashing"
1213
sdkstaking "github.com/cosmos/cosmos-sdk/x/staking"
13-
interchainquerytypes "github.com/persistenceOne/persistence-sdk/v4/x/interchainquery/types"
14-
oracletypes "github.com/persistenceOne/persistence-sdk/v4/x/oracle/types"
15-
liquidstakeibctypes "github.com/persistenceOne/pstake-native/v4/x/liquidstakeibc/types"
16-
lscosmostypes "github.com/persistenceOne/pstake-native/v4/x/lscosmos/types"
17-
ratesynctypes "github.com/persistenceOne/pstake-native/v4/x/ratesync/types"
14+
interchainquerytypes "github.com/persistenceOne/persistence-sdk/v5/x/interchainquery/types"
15+
oracletypes "github.com/persistenceOne/persistence-sdk/v5/x/oracle/types"
16+
liquidstakeibctypes "github.com/persistenceOne/pstake-native/v5/x/liquidstakeibc/types"
17+
lscosmostypes "github.com/persistenceOne/pstake-native/v5/x/lscosmos/types"
18+
ratesynctypes "github.com/persistenceOne/pstake-native/v5/x/ratesync/types"
1819

1920
"github.com/persistenceOne/persistenceCore/v14/app/params"
2021
)
@@ -48,6 +49,10 @@ func MakeEncodingConfig() params.EncodingConfig {
4849
// oracle, but was never used
4950
oracletypes.RegisterInterfaces(encodingConfig.InterfaceRegistry)
5051
oracletypes.RegisterLegacyAminoCodec(encodingConfig.Amino)
52+
53+
// group module,
54+
grouptypes.RegisterInterfaces(encodingConfig.InterfaceRegistry)
55+
grouptypes.RegisterLegacyAminoCodec(encodingConfig.Amino)
5156
//ibcfee, but was never used ...
5257
return encodingConfig
5358
}

app/keepers/keepers.go

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ import (
4646
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
4747
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
4848
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
49+
liquidkeeper "github.com/cosmos/gaia/v24/x/liquid/keeper"
50+
liquidtypes "github.com/cosmos/gaia/v24/x/liquid/types"
4951
"github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v10/packetforward"
5052
packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v10/packetforward/keeper"
5153
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v10/packetforward/types"
@@ -67,12 +69,12 @@ import (
6769
ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported"
6870
ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper"
6971
ibctm "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint"
70-
epochskeeper "github.com/persistenceOne/persistence-sdk/v4/x/epochs/keeper"
71-
epochstypes "github.com/persistenceOne/persistence-sdk/v4/x/epochs/types"
72-
"github.com/persistenceOne/persistence-sdk/v4/x/halving"
73-
halvingtypes "github.com/persistenceOne/persistence-sdk/v4/x/halving/types"
74-
liquidstakekeeper "github.com/persistenceOne/pstake-native/v4/x/liquidstake/keeper"
75-
liquidstaketypes "github.com/persistenceOne/pstake-native/v4/x/liquidstake/types"
72+
epochskeeper "github.com/persistenceOne/persistence-sdk/v5/x/epochs/keeper"
73+
epochstypes "github.com/persistenceOne/persistence-sdk/v5/x/epochs/types"
74+
"github.com/persistenceOne/persistence-sdk/v5/x/halving"
75+
halvingtypes "github.com/persistenceOne/persistence-sdk/v5/x/halving/types"
76+
liquidstakekeeper "github.com/persistenceOne/pstake-native/v5/x/liquidstake/keeper"
77+
liquidstaketypes "github.com/persistenceOne/pstake-native/v5/x/liquidstake/types"
7678
"github.com/spf13/cast"
7779

7880
"github.com/persistenceOne/persistenceCore/v14/app/constants"
@@ -104,6 +106,7 @@ type AppKeepers struct {
104106
WasmKeeper *wasmkeeper.Keeper
105107
EpochsKeeper *epochskeeper.Keeper
106108
ICAControllerKeeper *icacontrollerkeeper.Keeper
109+
LiquidKeeper *liquidkeeper.Keeper
107110
LiquidStakeKeeper *liquidstakekeeper.Keeper
108111
ConsensusParamsKeeper *consensusparamskeeper.Keeper
109112
PacketForwardKeeper *packetforwardkeeper.Keeper
@@ -270,8 +273,21 @@ func NewAppKeeper(
270273
)
271274
appKeepers.HalvingKeeper = &halvingKeeper
272275

276+
appKeepers.LiquidKeeper = liquidkeeper.NewKeeper(
277+
appCodec,
278+
runtime.NewKVStoreService(appKeepers.keys[liquidtypes.StoreKey]),
279+
appKeepers.AccountKeeper,
280+
appKeepers.BankKeeper,
281+
appKeepers.StakingKeeper,
282+
appKeepers.DistributionKeeper,
283+
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
284+
)
285+
273286
appKeepers.StakingKeeper.SetHooks(
274-
stakingtypes.NewMultiStakingHooks(appKeepers.DistributionKeeper.Hooks(), appKeepers.SlashingKeeper.Hooks()),
287+
stakingtypes.NewMultiStakingHooks(
288+
appKeepers.DistributionKeeper.Hooks(),
289+
appKeepers.SlashingKeeper.Hooks(),
290+
appKeepers.LiquidKeeper.Hooks()),
275291
)
276292

277293
appKeepers.EpochsKeeper = epochskeeper.NewKeeper(appKeepers.keys[epochstypes.StoreKey])
@@ -356,6 +372,7 @@ func NewAppKeeper(
356372
*appKeepers.MintKeeper,
357373
appKeepers.DistributionKeeper,
358374
appKeepers.SlashingKeeper,
375+
*appKeepers.LiquidKeeper,
359376
bApp.MsgServiceRouter(),
360377
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
361378
)

app/keepers/keys.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ import (
1717
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
1818
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
1919
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
20+
liquidtypes "github.com/cosmos/gaia/v24/x/liquid/types"
2021
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v10/packetforward/types"
2122
ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v10/types"
2223
icacontrollertypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/controller/types"
2324
icahosttypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/host/types"
2425
ibctransfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types"
2526
ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported"
26-
epochstypes "github.com/persistenceOne/persistence-sdk/v4/x/epochs/types"
27-
"github.com/persistenceOne/persistence-sdk/v4/x/halving"
28-
liquidstaketypes "github.com/persistenceOne/pstake-native/v4/x/liquidstake/types"
27+
epochstypes "github.com/persistenceOne/persistence-sdk/v5/x/epochs/types"
28+
"github.com/persistenceOne/persistence-sdk/v5/x/halving"
29+
liquidstaketypes "github.com/persistenceOne/pstake-native/v5/x/liquidstake/types"
2930
)
3031

3132
func (appKeepers *AppKeepers) GenerateKeys() {
@@ -48,6 +49,7 @@ func (appKeepers *AppKeepers) GenerateKeys() {
4849
ibctransfertypes.StoreKey,
4950
icacontrollertypes.StoreKey,
5051
icahosttypes.StoreKey,
52+
liquidtypes.StoreKey,
5153
liquidstaketypes.StoreKey,
5254
minttypes.StoreKey,
5355
paramstypes.StoreKey,

app/keepers/modules.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,23 @@ import (
1717
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
1818
"github.com/cosmos/cosmos-sdk/x/gov"
1919
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
20-
groupmodule "github.com/cosmos/cosmos-sdk/x/group/module"
2120
"github.com/cosmos/cosmos-sdk/x/mint"
2221
"github.com/cosmos/cosmos-sdk/x/params"
2322
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
2423
"github.com/cosmos/cosmos-sdk/x/slashing"
2524
"github.com/cosmos/cosmos-sdk/x/staking"
25+
"github.com/cosmos/gaia/v24/x/liquid"
2626
"github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v10/packetforward"
2727
ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v10"
2828
ica "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts"
2929
"github.com/cosmos/ibc-go/v10/modules/apps/transfer"
3030
ibc "github.com/cosmos/ibc-go/v10/modules/core"
3131
ibctm "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint"
32-
"github.com/persistenceOne/persistence-sdk/v4/x/epochs"
33-
"github.com/persistenceOne/persistence-sdk/v4/x/halving"
34-
"github.com/persistenceOne/pstake-native/v4/x/liquidstake"
32+
"github.com/persistenceOne/persistence-sdk/v5/x/epochs"
33+
"github.com/persistenceOne/persistence-sdk/v5/x/halving"
34+
"github.com/persistenceOne/pstake-native/v5/x/liquidstake"
3535
)
3636

37-
var DeprecatedAppModuleBasics = []module.AppModuleBasic{
38-
groupmodule.AppModuleBasic{},
39-
}
40-
4137
// AppModuleBasics defines the module BasicManager is in charge of setting up basic,
4238
// non-dependant module elements, such as codec registration
4339
// and genesis verification.
@@ -68,8 +64,9 @@ var AppModuleBasics = append([]module.AppModuleBasic{
6864
halving.AppModuleBasic{},
6965
ica.AppModuleBasic{},
7066
epochs.AppModuleBasic{},
67+
liquid.AppModuleBasic{},
7168
liquidstake.AppModuleBasic{},
7269
consensus.AppModuleBasic{},
7370
ibchooks.AppModuleBasic{},
7471
packetforward.AppModuleBasic{},
75-
}, DeprecatedAppModuleBasics...)
72+
})

app/modules.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ import (
3636
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
3737
"github.com/cosmos/cosmos-sdk/x/staking"
3838
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
39+
"github.com/cosmos/gaia/v24/x/liquid"
40+
liquidtypes "github.com/cosmos/gaia/v24/x/liquid/types"
3941
packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v10/packetforward"
4042
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v10/packetforward/types"
4143
ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v10"
@@ -46,12 +48,12 @@ import (
4648
ibc "github.com/cosmos/ibc-go/v10/modules/core"
4749
ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported"
4850
ibctm "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint"
49-
"github.com/persistenceOne/persistence-sdk/v4/x/epochs"
50-
epochstypes "github.com/persistenceOne/persistence-sdk/v4/x/epochs/types"
51-
"github.com/persistenceOne/persistence-sdk/v4/x/halving"
51+
"github.com/persistenceOne/persistence-sdk/v5/x/epochs"
52+
epochstypes "github.com/persistenceOne/persistence-sdk/v5/x/epochs/types"
53+
"github.com/persistenceOne/persistence-sdk/v5/x/halving"
5254
appparams "github.com/persistenceOne/persistenceCore/v14/app/params"
53-
"github.com/persistenceOne/pstake-native/v4/x/liquidstake"
54-
liquidstaketypes "github.com/persistenceOne/pstake-native/v4/x/liquidstake/types"
55+
"github.com/persistenceOne/pstake-native/v5/x/liquidstake"
56+
liquidstaketypes "github.com/persistenceOne/pstake-native/v5/x/liquidstake/types"
5557
)
5658

5759
var ModuleAccountPermissions = map[string][]string{
@@ -104,6 +106,7 @@ func appModules(
104106
ica.NewAppModule(app.ICAControllerKeeper, app.ICAHostKeeper),
105107
wasm.NewAppModule(appCodec, app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasm.ModuleName)),
106108
epochs.NewAppModule(*app.EpochsKeeper),
109+
liquid.NewAppModule(appCodec, app.LiquidKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
107110
liquidstake.NewAppModule(*app.LiquidStakeKeeper),
108111
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them
109112
ibctm.NewAppModule(app.TMLightClientModule),
@@ -148,6 +151,7 @@ func orderBeginBlockers() []string {
148151
ibchookstypes.ModuleName,
149152
packetforwardtypes.ModuleName,
150153
wasmtypes.ModuleName,
154+
liquidtypes.ModuleName,
151155
liquidstaketypes.ModuleName,
152156
}
153157
}
@@ -178,6 +182,7 @@ func orderEndBlockers() []string {
178182
packetforwardtypes.ModuleName,
179183
wasmtypes.ModuleName,
180184
epochstypes.ModuleName,
185+
liquidtypes.ModuleName,
181186
liquidstaketypes.ModuleName,
182187
}
183188
}
@@ -213,6 +218,7 @@ func orderInitGenesis() []string {
213218
packetforwardtypes.ModuleName,
214219
wasmtypes.ModuleName,
215220
epochstypes.ModuleName,
221+
liquidtypes.ModuleName,
216222
liquidstaketypes.ModuleName,
217223
}
218224
}

app/upgrades/testnet/v14.0.0-rc0/constants.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package v14_0_0_rc0
22

33
import (
44
store "cosmossdk.io/store/types"
5+
liquidtypes "github.com/cosmos/gaia/v24/x/liquid/types"
56
"github.com/persistenceOne/persistenceCore/v14/app/upgrades"
67
)
78

@@ -14,7 +15,7 @@ var Upgrade = upgrades.Upgrade{
1415
UpgradeName: UpgradeName,
1516
CreateUpgradeHandler: CreateUpgradeHandler,
1617
StoreUpgrades: store.StoreUpgrades{
17-
Added: []string{},
18+
Added: []string{liquidtypes.ModuleName},
1819
Deleted: []string{},
1920
},
2021
}

0 commit comments

Comments
 (0)