Skip to content

Commit 636b83e

Browse files
committed
chore: resolve comments and set params in update migration
1 parent 2ef802b commit 636b83e

9 files changed

Lines changed: 115 additions & 103 deletions

File tree

app/upgrades/v2_2/upgrade.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import (
44
"context"
55
"fmt"
66

7+
"cosmossdk.io/math"
78
liquidkeeper "github.com/KYVENetwork/chain/x/liquid/keeper"
9+
liquidtypes "github.com/KYVENetwork/chain/x/liquid/types"
810
stakingKeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
911

1012
"cosmossdk.io/log"
@@ -33,9 +35,12 @@ func CreateUpgradeHandler(
3335

3436
// Run cosmos migrations
3537
migratedVersionMap, err := mm.RunMigrations(ctx, configurator, fromVM)
38+
if err != nil {
39+
return nil, err
40+
}
3641

3742
// Run KYVE migrations
38-
validators, _ := stakingKeeper.GetValidators(ctx, 1_000)
43+
validators, _ := stakingKeeper.GetAllValidators(ctx)
3944
for _, v := range validators {
4045
valAddress, _ := sdk.ValAddressFromBech32(v.OperatorAddress)
4146
err := liquidStakingKeeper.Hooks().AfterValidatorCreated(ctx, valAddress)
@@ -44,6 +49,14 @@ func CreateUpgradeHandler(
4449
}
4550
}
4651

52+
err = liquidStakingKeeper.SetParams(ctx, liquidtypes.Params{
53+
GlobalLiquidStakingCap: math.LegacyMustNewDecFromStr("0.25"),
54+
ValidatorLiquidStakingCap: math.LegacyMustNewDecFromStr("0.25"),
55+
})
56+
if err != nil {
57+
return nil, err
58+
}
59+
4760
logger.Info(fmt.Sprintf("finished upgrade %v", UpgradeName))
4861

4962
return migratedVersionMap, err

docs/static/openapi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9831,7 +9831,7 @@ paths:
98319831
title: validator delegated to for tokenize share record creation
98329832
title: TokenizeShareRecord represents a tokenized delegation
98339833
description: |-
9834-
QueryTokenizeShareRecordByIdRequest is response type for the
9834+
QueryTokenizeShareRecordByIdResponse is response type for the
98359835
Query/QueryTokenizeShareRecordById RPC method.
98369836
default:
98379837
description: An unexpected error response.
@@ -10060,7 +10060,7 @@ paths:
1006010060
type: string
1006110061
description: |-
1006210062
QueryTotalLiquidStakedResponse is response type for the
10063-
Query/QueryQueryTotalLiquidStaked RPC method.
10063+
Query/QueryTotalLiquidStaked RPC method.
1006410064
default:
1006510065
description: An unexpected error response.
1006610066
schema:

proto/kyve/liquid/v1beta1/liquid.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ option go_package = "github.com/KYVENetwork/chain/x/liquid/types";
1414

1515
// Params defines the parameters for the x/liquid module.
1616
message Params {
17-
option (amino.name) = "gaia/x/liquid/Params";
17+
option (amino.name) = "kyve/x/liquid/Params";
1818
option (gogoproto.equal) = true;
1919

2020
// global_liquid_staking_cap represents a cap on the portion of stake that

proto/kyve/liquid/v1beta1/query.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ message QueryTokenizeShareRecordByIdRequest {
135135
uint64 id = 1;
136136
}
137137

138-
// QueryTokenizeShareRecordByIdRequest is response type for the
138+
// QueryTokenizeShareRecordByIdResponse is response type for the
139139
// Query/QueryTokenizeShareRecordById RPC method.
140140
message QueryTokenizeShareRecordByIdResponse {
141141
TokenizeShareRecord record = 1 [(gogoproto.nullable) = false];
@@ -205,7 +205,7 @@ message QueryTotalTokenizeSharedAssetsResponse {
205205
message QueryTotalLiquidStaked {}
206206

207207
// QueryTotalLiquidStakedResponse is response type for the
208-
// Query/QueryQueryTotalLiquidStaked RPC method.
208+
// Query/QueryTotalLiquidStaked RPC method.
209209
message QueryTotalLiquidStakedResponse {
210210
string tokens = 1;
211211
}

proto/kyve/liquid/v1beta1/tx.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ service Msg {
5454
// MsgUpdateParams is the Msg/UpdateParams request type.
5555
message MsgUpdateParams {
5656
option (cosmos.msg.v1.signer) = "authority";
57-
option (amino.name) = "gaia/liquid/MsgUpdateParams";
57+
option (amino.name) = "kyve/liquid/MsgUpdateParams";
5858

5959
// authority is the address that controls the module (defaults to x/gov unless
6060
// overwritten).
@@ -75,7 +75,7 @@ message MsgUpdateParamsResponse {}
7575
// MsgTokenizeShares tokenizes a delegation
7676
message MsgTokenizeShares {
7777
option (cosmos.msg.v1.signer) = "delegator_address";
78-
option (amino.name) = "gaia/MsgTokenizeShares";
78+
option (amino.name) = "kyve/MsgTokenizeShares";
7979

8080
option (gogoproto.equal) = false;
8181
option (gogoproto.goproto_getters) = false;

x/liquid/client/cli/tx.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// This file was modified from its original version.
22
// Original source: https://github.com/cosmos/gaia/blob/b3583a755ad2947582f8e9c969806b187668ea23/x/liquid/client/cli/tx.go
33
// Modifications made by KYVE, 2025.
4-
// - Changed import paths
54

65
package cli
76

@@ -274,7 +273,7 @@ func NewWithdrawAllTokenizeShareRecordRewardCmd(ac address.Codec) *cobra.Command
274273
Long: strings.TrimSpace(
275274
fmt.Sprintf(`Withdraw reward for all owned TokenizeShareRecord
276275
Example:
277-
$ %s tx distribution withdraw-all-tokenize-share-rewards --from mykey
276+
$ %s tx liquid withdraw-all-tokenize-share-rewards --from mykey
278277
`,
279278
version.AppName,
280279
),
@@ -310,7 +309,7 @@ func NewWithdrawTokenizeShareRecordRewardCmd(ac address.Codec) *cobra.Command {
310309
Long: strings.TrimSpace(
311310
fmt.Sprintf(`Withdraw reward for an owned TokenizeShareRecord
312311
Example:
313-
$ %s tx distribution withdraw-tokenize-share-rewards 1 --from mykey
312+
$ %s tx liquid withdraw-tokenize-share-rewards 1 --from mykey
314313
`,
315314
version.AppName,
316315
),

x/liquid/types/liquid.pb.go

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x/liquid/types/query.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)