Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update proto annotations #654

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions proto/pstake/liquidstakeibc/v1beta1/msgs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos/base/v1beta1/coin.proto";
import "amino/amino.proto";

import "pstake/liquidstakeibc/v1beta1/liquidstakeibc.proto";
import "pstake/liquidstakeibc/v1beta1/params.proto";
Expand Down Expand Up @@ -39,6 +40,8 @@ service Msg {
message MsgRegisterHostChain {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "pstake/MsgRegisterHostChain";

// authority is the address of the governance account
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
Expand Down Expand Up @@ -81,18 +84,20 @@ message MsgRegisterHostChainResponse {}
message MsgUpdateHostChain {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "pstake/MsgUpdateHostChain";
// authority is the address of the governance account
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

string chain_id = 2;
repeated KVUpdate updates = 3;
repeated KVUpdate updates = 3 [(amino.dont_omitempty) = true];
}

message MsgUpdateHostChainResponse {}

message MsgLiquidStake {
option (cosmos.msg.v1.signer) = "delegator_address";
option (amino.name) = "pstake/MsgLiquidStake";

string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false];
Expand All @@ -102,6 +107,7 @@ message MsgLiquidStakeResponse {}

message MsgLiquidStakeLSM {
option (cosmos.msg.v1.signer) = "delegator_address";
option (amino.name) = "pstake/MsgLiquidStakeLSM";

string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
repeated cosmos.base.v1beta1.Coin delegations = 2 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
Expand All @@ -112,6 +118,7 @@ message MsgLiquidStakeLSMResponse {}

message MsgLiquidUnstake {
option (cosmos.msg.v1.signer) = "delegator_address";
option (amino.name) = "pstake/MsgLiquidUnstake";

string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false];
Expand All @@ -121,6 +128,7 @@ message MsgLiquidUnstakeResponse {}

message MsgRedeem {
option (cosmos.msg.v1.signer) = "delegator_address";
option (amino.name) = "pstake/MsgRedeem";

string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false];
Expand All @@ -133,9 +141,10 @@ message MsgUpdateParams {
option (gogoproto.goproto_getters) = false;

option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "pstake/MsgUpdateParams";

string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
Params params = 2 [(gogoproto.nullable) = false];
Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}

message MsgUpdateParamsResponse {}
3 changes: 3 additions & 0 deletions proto/pstake/liquidstakeibc/v1beta1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ package pstake.liquidstakeibc.v1beta1;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "amino/amino.proto";

option go_package = "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/types";

// Params defines the parameters for the module.
message Params {
option (amino.name) = "pstake/x/liquidstakeibc/Params";

string admin_address = 1 [
(cosmos_proto.scalar) = "cosmos.AddressString"
]; // protocol admin address
Expand Down
15 changes: 8 additions & 7 deletions x/liquidstakeibc/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package types

import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/legacy"
"github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -11,13 +12,13 @@ import (
// RegisterLegacyAminoCodec registers the necessary x/liquidstakeibc interfaces and concrete types
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgRegisterHostChain{}, "pstake/MsgRegisterHostChain", nil)
cdc.RegisterConcrete(&MsgUpdateHostChain{}, "pstake/MsgUpdateHostChain", nil)
cdc.RegisterConcrete(&MsgLiquidStake{}, "pstake/MsgLiquidStake", nil)
cdc.RegisterConcrete(&MsgLiquidStakeLSM{}, "pstake/MsgLiquidStakeLSM", nil)
cdc.RegisterConcrete(&MsgLiquidUnstake{}, "pstake/MsgLiquidUnstake", nil)
cdc.RegisterConcrete(&MsgRedeem{}, "pstake/MsgRedeem", nil)
cdc.RegisterConcrete(&MsgUpdateParams{}, "pstake/MsgUpdateParams", nil)
legacy.RegisterAminoMsg(cdc, &MsgRegisterHostChain{}, "pstake/MsgRegisterHostChain")
legacy.RegisterAminoMsg(cdc, &MsgUpdateHostChain{}, "pstake/MsgUpdateHostChain")
legacy.RegisterAminoMsg(cdc, &MsgLiquidStake{}, "pstake/MsgLiquidStake")
legacy.RegisterAminoMsg(cdc, &MsgLiquidStakeLSM{}, "pstake/MsgLiquidStakeLSM")
legacy.RegisterAminoMsg(cdc, &MsgLiquidUnstake{}, "pstake/MsgLiquidUnstake")
legacy.RegisterAminoMsg(cdc, &MsgRedeem{}, "pstake/MsgRedeem")
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "pstake/MsgUpdateParams")
}

func RegisterInterfaces(registry types.InterfaceRegistry) {
Expand Down
142 changes: 74 additions & 68 deletions x/liquidstakeibc/types/msgs.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading