Skip to content

Commit ece875c

Browse files
committed
Liquid staking bootstrap
1 parent 09e4d09 commit ece875c

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

app/app.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ func New(
483483

484484
app.LiquidKeeper = liquidkeeper.NewKeeper(
485485
appCodec,
486-
runtime.NewKVStoreService(app.keys[liquidtypes.StoreKey]),
486+
runtime.NewKVStoreService(keys[liquidtypes.StoreKey]),
487487
app.AccountKeeper,
488488
app.BankKeeper,
489489
app.StakingKeeper,
@@ -583,7 +583,7 @@ func New(
583583

584584
app.GovKeeper = *govKeeper.SetHooks(
585585
govtypes.NewMultiGovHooks(
586-
// register the governance hooks
586+
// register the governance hooks
587587
),
588588
)
589589

@@ -613,7 +613,7 @@ func New(
613613

614614
app.EpochsKeeper.SetHooks(
615615
epochstypes.NewMultiEpochHooks(
616-
// insert epoch hooks receivers here
616+
// insert epoch hooks receivers here
617617
),
618618
)
619619

app/upgrades.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"strings"
99
"time"
1010

11+
"cosmossdk.io/math"
1112
storetypes "cosmossdk.io/store/types"
1213
circuittypes "cosmossdk.io/x/circuit/types"
1314
"cosmossdk.io/x/nft"
@@ -24,6 +25,8 @@ import (
2425
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
2526
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
2627
protocolpooltypes "github.com/cosmos/cosmos-sdk/x/protocolpool/types"
28+
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
29+
liquidtypes "github.com/cosmos/gaia/v25/x/liquid/types"
2730
icacontrollertypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/controller/types"
2831
icatypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/types"
2932
ibctransfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types"
@@ -45,6 +48,7 @@ var v053StoreUpgrades = storetypes.StoreUpgrades{
4548
group.StoreKey,
4649
icacontrollertypes.StoreKey,
4750
nft.StoreKey,
51+
liquidtypes.StoreKey,
4852
},
4953
Renamed: []storetypes.StoreRename{
5054
// {OldKey: "oldkey", NewKey: "newkey"},
@@ -115,6 +119,22 @@ func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) {
115119
return nil, err
116120
}
117121

122+
// Bootstrap liquid staking
123+
err = app.StakingKeeper.IterateValidators(ctx, func(_ int64, v stakingtypes.ValidatorI) (stop bool) {
124+
lv := liquidtypes.LiquidValidator{
125+
OperatorAddress: v.GetOperator(),
126+
LiquidShares: math.LegacyZeroDec(),
127+
}
128+
err := app.LiquidKeeper.SetLiquidValidator(ctx, lv)
129+
if err != nil {
130+
return false
131+
}
132+
return false
133+
})
134+
if err != nil {
135+
return nil, err
136+
}
137+
118138
// If you must pin any module "from" versions, adjust fromVM here.
119139
return app.mm.RunMigrations(ctx, cfg, fromVM)
120140
},

0 commit comments

Comments
 (0)