Skip to content

Commit 90c1e81

Browse files
authored
fix: legacy delegation types (#264)
1 parent 7b2d39f commit 90c1e81

3 files changed

Lines changed: 629 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
syntax = "proto3";
2+
3+
package kyve.delegation.v1beta1;
4+
5+
import "cosmos/msg/v1/msg.proto";
6+
import "cosmos_proto/cosmos.proto";
7+
8+
option go_package = "github.com/KYVENetwork/chain/x/stakers/types_delegation_v1beta1";
9+
10+
/*
11+
NOTICE:
12+
This file needs to be kept for backwards compatibility with the governance module.
13+
Otherwise, it is not possible to decode legacy delegation param update proposals.
14+
*/
15+
16+
17+
// Msg defines the Msg service.
18+
service Msg {
19+
option (cosmos.msg.v1.service) = true;
20+
21+
// UpdateParams defines a governance operation for updating the x/delegation module
22+
// parameters. The authority is hard-coded to the x/gov module account.
23+
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
24+
}
25+
26+
// MsgUpdateParams defines a SDK message for updating the module parameters.
27+
message MsgUpdateParams {
28+
option (cosmos.msg.v1.signer) = "authority";
29+
// authority is the address of the governance account.
30+
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
31+
32+
// payload defines the x/delegation parameters to update.
33+
string payload = 2;
34+
}
35+
36+
// MsgUpdateParamsResponse defines the Msg/UpdateParams response type.
37+
message MsgUpdateParamsResponse {}

x/stakers/types/codec.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package types
22

33
import (
4+
"github.com/KYVENetwork/chain/x/stakers/types_delegation_v1beta1"
45
"github.com/KYVENetwork/chain/x/stakers/types_v1beta1"
56
"github.com/cosmos/cosmos-sdk/codec"
67
codecTypes "github.com/cosmos/cosmos-sdk/codec/types"
@@ -23,6 +24,7 @@ func RegisterInterfaces(registry codecTypes.InterfaceRegistry) {
2324
registry.RegisterImplementations((*sdk.Msg)(nil), &MsgLeavePool{})
2425
registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{})
2526
registry.RegisterImplementations((*sdk.Msg)(nil), &types_v1beta1.MsgUpdateParams{})
27+
registry.RegisterImplementations((*sdk.Msg)(nil), &types_delegation_v1beta1.MsgUpdateParams{})
2628
}
2729

2830
var Amino = codec.NewLegacyAmino()

0 commit comments

Comments
 (0)