From cc98486e0763e3d47be0d76f10b25e0e4b2ad652 Mon Sep 17 00:00:00 2001 From: javiersuweijie Date: Thu, 7 Sep 2023 17:20:17 +0800 Subject: [PATCH] feat: migrate gov proposal away from legacy --- docs/proto/proto-docs.md | 96 ++ proto/alliance/tx.proto | 86 +- x/alliance/keeper/msg_server.go | 73 +- x/alliance/keeper/proposal.go | 80 +- x/alliance/types/errors.go | 10 +- x/alliance/types/msg.go | 135 +++ x/alliance/types/tx.pb.go | 1858 ++++++++++++++++++++++++++++--- 7 files changed, 2141 insertions(+), 197 deletions(-) diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index 663f4d57..4fb976a5 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -81,12 +81,18 @@ - [alliance/tx.proto](#alliance/tx.proto) - [MsgClaimDelegationRewards](#alliance.MsgClaimDelegationRewards) - [MsgClaimDelegationRewardsResponse](#alliance.MsgClaimDelegationRewardsResponse) + - [MsgCreateAlliance](#alliance.MsgCreateAlliance) + - [MsgCreateAllianceResponse](#alliance.MsgCreateAllianceResponse) - [MsgDelegate](#alliance.MsgDelegate) - [MsgDelegateResponse](#alliance.MsgDelegateResponse) + - [MsgDeleteAlliance](#alliance.MsgDeleteAlliance) + - [MsgDeleteAllianceResponse](#alliance.MsgDeleteAllianceResponse) - [MsgRedelegate](#alliance.MsgRedelegate) - [MsgRedelegateResponse](#alliance.MsgRedelegateResponse) - [MsgUndelegate](#alliance.MsgUndelegate) - [MsgUndelegateResponse](#alliance.MsgUndelegateResponse) + - [MsgUpdateAlliance](#alliance.MsgUpdateAlliance) + - [MsgUpdateAllianceResponse](#alliance.MsgUpdateAllianceResponse) - [MsgUpdateParams](#alliance.MsgUpdateParams) - [MsgUpdateParamsResponse](#alliance.MsgUpdateParamsResponse) @@ -1209,6 +1215,37 @@ Params + + +### MsgCreateAlliance + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `authority` | [string](#string) | | | +| `denom` | [string](#string) | | Denom of the asset. It could either be a native token or an IBC token | +| `reward_weight` | [string](#string) | | The reward weight specifies the ratio of rewards that will be given to each alliance asset It does not need to sum to 1. rate = weight / total_weight Native asset is always assumed to have a weight of 1. | +| `take_rate` | [string](#string) | | A positive take rate is used for liquid staking derivatives. It defines an annualized reward rate that will be redirected to the distribution rewards pool | +| `reward_change_rate` | [string](#string) | | | +| `reward_change_interval` | [google.protobuf.Duration](#google.protobuf.Duration) | | | +| `reward_weight_range` | [RewardWeightRange](#alliance.RewardWeightRange) | | set a bound of weight range to limit how much reward weights can scale. | + + + + + + + + +### MsgCreateAllianceResponse + + + + + + + ### MsgDelegate @@ -1236,6 +1273,32 @@ Params + + +### MsgDeleteAlliance + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `authority` | [string](#string) | | | +| `denom` | [string](#string) | | | + + + + + + + + +### MsgDeleteAllianceResponse + + + + + + + ### MsgRedelegate @@ -1291,6 +1354,36 @@ Params + + +### MsgUpdateAlliance + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `authority` | [string](#string) | | | +| `denom` | [string](#string) | | Denom of the asset. It could either be a native token or an IBC token | +| `reward_weight` | [string](#string) | | The reward weight specifies the ratio of rewards that will be given to each alliance asset It does not need to sum to 1. rate = weight / total_weight Native asset is always assumed to have a weight of 1. | +| `take_rate` | [string](#string) | | | +| `reward_change_rate` | [string](#string) | | | +| `reward_change_interval` | [google.protobuf.Duration](#google.protobuf.Duration) | | | + + + + + + + + +### MsgUpdateAllianceResponse + + + + + + + ### MsgUpdateParams @@ -1335,6 +1428,9 @@ Params | `Undelegate` | [MsgUndelegate](#alliance.MsgUndelegate) | [MsgUndelegateResponse](#alliance.MsgUndelegateResponse) | | | | `ClaimDelegationRewards` | [MsgClaimDelegationRewards](#alliance.MsgClaimDelegationRewards) | [MsgClaimDelegationRewardsResponse](#alliance.MsgClaimDelegationRewardsResponse) | | | | `UpdateParams` | [MsgUpdateParams](#alliance.MsgUpdateParams) | [MsgUpdateParamsResponse](#alliance.MsgUpdateParamsResponse) | | | +| `CreateAlliance` | [MsgCreateAlliance](#alliance.MsgCreateAlliance) | [MsgCreateAllianceResponse](#alliance.MsgCreateAllianceResponse) | | | +| `UpdateAlliance` | [MsgUpdateAlliance](#alliance.MsgUpdateAlliance) | [MsgUpdateAllianceResponse](#alliance.MsgUpdateAllianceResponse) | | | +| `DeleteAlliance` | [MsgDeleteAlliance](#alliance.MsgDeleteAlliance) | [MsgDeleteAllianceResponse](#alliance.MsgDeleteAllianceResponse) | | | diff --git a/proto/alliance/tx.proto b/proto/alliance/tx.proto index dfbde217..74d40fee 100644 --- a/proto/alliance/tx.proto +++ b/proto/alliance/tx.proto @@ -6,6 +6,8 @@ import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos/base/v1beta1/coin.proto"; import "alliance/params.proto"; +import "alliance/alliance.proto"; +import "google/protobuf/duration.proto"; option go_package = "github.com/terra-money/alliance/x/alliance/types"; @@ -15,6 +17,9 @@ service Msg { rpc Undelegate(MsgUndelegate) returns(MsgUndelegateResponse); rpc ClaimDelegationRewards(MsgClaimDelegationRewards) returns(MsgClaimDelegationRewardsResponse); rpc UpdateParams(MsgUpdateParams) returns(MsgUpdateParamsResponse); + rpc CreateAlliance(MsgCreateAlliance) returns(MsgCreateAllianceResponse); + rpc UpdateAlliance(MsgUpdateAlliance) returns(MsgUpdateAllianceResponse); + rpc DeleteAlliance(MsgDeleteAlliance) returns(MsgDeleteAllianceResponse); } message MsgDelegate { @@ -84,4 +89,83 @@ message MsgUpdateParams { Params params = 2 [(gogoproto.nullable) = false]; } -message MsgUpdateParamsResponse {} \ No newline at end of file +message MsgUpdateParamsResponse {} + +message MsgCreateAlliance { + option (cosmos.msg.v1.signer) = "authority"; + + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Denom of the asset. It could either be a native token or an IBC token + string denom = 2 [(gogoproto.moretags) = "yaml:\"denom\""]; + // The reward weight specifies the ratio of rewards that will be given to each alliance asset + // It does not need to sum to 1. rate = weight / total_weight + // Native asset is always assumed to have a weight of 1. + string reward_weight = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // A positive take rate is used for liquid staking derivatives. It defines an annualized reward rate that + // will be redirected to the distribution rewards pool + string take_rate = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + string reward_change_rate = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + google.protobuf.Duration reward_change_interval = 6 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; + + // set a bound of weight range to limit how much reward weights can scale. + RewardWeightRange reward_weight_range = 7 [ + (gogoproto.nullable) = false + ]; +} + +message MsgCreateAllianceResponse {} + +message MsgUpdateAlliance { + option (cosmos.msg.v1.signer) = "authority"; + + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Denom of the asset. It could either be a native token or an IBC token + string denom = 2 [(gogoproto.moretags) = "yaml:\"denom\""]; + // The reward weight specifies the ratio of rewards that will be given to each alliance asset + // It does not need to sum to 1. rate = weight / total_weight + // Native asset is always assumed to have a weight of 1. + string reward_weight = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + string take_rate = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + string reward_change_rate = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + google.protobuf.Duration reward_change_interval = 6 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; +} + +message MsgUpdateAllianceResponse {} + +message MsgDeleteAlliance { + option (cosmos.msg.v1.signer) = "authority"; + + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string denom = 2 [(gogoproto.moretags) = "yaml:\"denom\""]; +} + +message MsgDeleteAllianceResponse {} diff --git a/x/alliance/keeper/msg_server.go b/x/alliance/keeper/msg_server.go index 2be0fb3c..86762ce8 100644 --- a/x/alliance/keeper/msg_server.go +++ b/x/alliance/keeper/msg_server.go @@ -2,13 +2,11 @@ package keeper import ( "context" - sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/terra-money/alliance/x/alliance/types" - - sdk "github.com/cosmos/cosmos-sdk/types" ) type MsgServer struct { @@ -152,6 +150,73 @@ func (m MsgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) return &types.MsgUpdateParamsResponse{}, nil } +func (m MsgServer) CreateAlliance(ctx context.Context, req *types.MsgCreateAlliance) (*types.MsgCreateAllianceResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + _, found := m.GetAssetByDenom(sdkCtx, req.Denom) + + if found { + return nil, types.ErrAlreadyExists + } + rewardStartTime := sdkCtx.BlockTime().Add(m.RewardDelayTime(sdkCtx)) + asset := types.AllianceAsset{ + Denom: req.Denom, + RewardWeight: req.RewardWeight, + RewardWeightRange: req.RewardWeightRange, + TakeRate: req.TakeRate, + TotalTokens: sdk.ZeroInt(), + TotalValidatorShares: sdk.ZeroDec(), + RewardStartTime: rewardStartTime, + RewardChangeRate: req.RewardChangeRate, + RewardChangeInterval: req.RewardChangeInterval, + LastRewardChangeTime: rewardStartTime, + } + m.SetAsset(sdkCtx, asset) + return &types.MsgCreateAllianceResponse{}, nil +} + +func (m MsgServer) UpdateAlliance(ctx context.Context, req *types.MsgUpdateAlliance) (*types.MsgUpdateAllianceResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + asset, found := m.GetAssetByDenom(sdkCtx, req.Denom) + + if !found { + return nil, types.ErrUnknownAsset + } + if asset.RewardWeightRange.Min.GT(req.RewardWeight) || asset.RewardWeightRange.Max.LT(req.RewardWeight) { + return nil, types.ErrRewardWeightOutOfBound + } + asset.RewardWeight = req.RewardWeight + asset.TakeRate = req.TakeRate + asset.RewardChangeRate = req.RewardChangeRate + asset.RewardChangeInterval = req.RewardChangeInterval + + err := m.UpdateAllianceAsset(sdkCtx, asset) + if err != nil { + return nil, err + } + + return &types.MsgUpdateAllianceResponse{}, nil +} + +func (m MsgServer) DeleteAlliance(ctx context.Context, req *types.MsgDeleteAlliance) (*types.MsgDeleteAllianceResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + asset, found := m.GetAssetByDenom(sdkCtx, req.Denom) + + if !found { + return nil, types.ErrUnknownAsset + } + + if asset.TotalTokens.GT(math.ZeroInt()) { + return nil, types.ErrActiveDelegationsExists + } + + err := m.DeleteAsset(sdkCtx, asset) + if err != nil { + return nil, err + } + + return &types.MsgDeleteAllianceResponse{}, nil +} + // NewMsgServerImpl returns an implementation of the MsgServer interface // for the provided Keeper. func NewMsgServerImpl(keeper Keeper) types.MsgServer { diff --git a/x/alliance/keeper/proposal.go b/x/alliance/keeper/proposal.go index 9c35bf7c..25f0cdf2 100644 --- a/x/alliance/keeper/proposal.go +++ b/x/alliance/keeper/proposal.go @@ -3,77 +3,41 @@ package keeper import ( "context" - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "github.com/terra-money/alliance/x/alliance/types" ) func (k Keeper) CreateAlliance(ctx context.Context, req *types.MsgCreateAllianceProposal) error { - sdkCtx := sdk.UnwrapSDKContext(ctx) - _, found := k.GetAssetByDenom(sdkCtx, req.Denom) - - if found { - return status.Errorf(codes.AlreadyExists, "Asset with denom: %s already exists", req.Denom) - } - rewardStartTime := sdkCtx.BlockTime().Add(k.RewardDelayTime(sdkCtx)) - asset := types.AllianceAsset{ + ms := MsgServer{k} + _, err := ms.CreateAlliance(ctx, &types.MsgCreateAlliance{ + Authority: k.GetAuthority(), Denom: req.Denom, RewardWeight: req.RewardWeight, - RewardWeightRange: req.RewardWeightRange, TakeRate: req.TakeRate, - TotalTokens: sdk.ZeroInt(), - TotalValidatorShares: sdk.ZeroDec(), - RewardStartTime: rewardStartTime, RewardChangeRate: req.RewardChangeRate, RewardChangeInterval: req.RewardChangeInterval, - LastRewardChangeTime: rewardStartTime, - } - k.SetAsset(sdkCtx, asset) - return nil + RewardWeightRange: req.RewardWeightRange, + }) + return err } func (k Keeper) UpdateAlliance(ctx context.Context, req *types.MsgUpdateAllianceProposal) error { - sdkCtx := sdk.UnwrapSDKContext(ctx) - asset, found := k.GetAssetByDenom(sdkCtx, req.Denom) - - if !found { - return status.Errorf(codes.NotFound, "Asset with denom: %s does not exist", req.Denom) - } - if asset.RewardWeightRange.Min.GT(req.RewardWeight) || asset.RewardWeightRange.Max.LT(req.RewardWeight) { - return types.ErrRewardWeightOutOfBound - } - asset.RewardWeight = req.RewardWeight - asset.TakeRate = req.TakeRate - asset.RewardChangeRate = req.RewardChangeRate - asset.RewardChangeInterval = req.RewardChangeInterval - - err := k.UpdateAllianceAsset(sdkCtx, asset) - if err != nil { - return err - } - - return nil + ms := MsgServer{k} + _, err := ms.UpdateAlliance(ctx, &types.MsgUpdateAlliance{ + Authority: k.GetAuthority(), + Denom: req.Denom, + RewardWeight: req.RewardWeight, + TakeRate: req.TakeRate, + RewardChangeRate: req.RewardChangeRate, + RewardChangeInterval: req.RewardChangeInterval, + }) + return err } func (k Keeper) DeleteAlliance(ctx context.Context, req *types.MsgDeleteAllianceProposal) error { - sdkCtx := sdk.UnwrapSDKContext(ctx) - asset, found := k.GetAssetByDenom(sdkCtx, req.Denom) - - if !found { - return status.Errorf(codes.NotFound, "Asset with denom: %s does not exist", req.Denom) - } - - if asset.TotalTokens.GT(math.ZeroInt()) { - return status.Errorf(codes.Internal, "Asset cannot be deleted because there are still %s delegations associated with it", asset.TotalTokens) - } - - err := k.DeleteAsset(sdkCtx, asset) - if err != nil { - return err - } - - return nil + ms := MsgServer{k} + _, err := ms.DeleteAlliance(ctx, &types.MsgDeleteAlliance{ + Authority: k.GetAuthority(), + Denom: req.Denom, + }) + return err } diff --git a/x/alliance/types/errors.go b/x/alliance/types/errors.go index 5419b675..757dacf8 100644 --- a/x/alliance/types/errors.go +++ b/x/alliance/types/errors.go @@ -7,14 +7,16 @@ import ( var ( ErrInvalidGenesisState = sdkerrors.Register(ModuleName, 0, "invalid genesis state") - ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 10, "empty validator address") - ErrValidatorNotFound = sdkerrors.Register(ModuleName, 11, "validator not found") - ErrDelegationNotFound = sdkerrors.Register(ModuleName, 12, "delegation not found") + ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 10, "empty validator address") + ErrValidatorNotFound = sdkerrors.Register(ModuleName, 11, "validator not found") + ErrDelegationNotFound = sdkerrors.Register(ModuleName, 12, "delegation not found") + ErrActiveDelegationsExists = sdkerrors.Register(ModuleName, 13, "active delegations exists") ErrZeroDelegations = sdkerrors.Register(ModuleName, 20, "there are no delegations yet") ErrInsufficientTokens = sdkerrors.Register(ModuleName, 21, "insufficient tokens") - ErrUnknownAsset = sdkerrors.Register(ModuleName, 30, "alliance asset is not whitelisted") + ErrUnknownAsset = sdkerrors.Register(ModuleName, 30, "alliance asset is not whitelisted") + ErrAlreadyExists = sdkerrors.Register(ModuleName, 31, "alliance asset already exists") ErrRewardWeightOutOfBound = sdkerrors.Register(ModuleName, 40, "alliance asset must be between reward_weight_range") ) diff --git a/x/alliance/types/msg.go b/x/alliance/types/msg.go index fbfa8e8e..3fa1c9c0 100644 --- a/x/alliance/types/msg.go +++ b/x/alliance/types/msg.go @@ -14,12 +14,18 @@ var ( _ sdk.Msg = &MsgUndelegate{} _ sdk.Msg = &MsgClaimDelegationRewards{} _ sdk.Msg = &MsgUpdateParams{} + _ sdk.Msg = &MsgCreateAlliance{} + _ sdk.Msg = &MsgUpdateAlliance{} + _ sdk.Msg = &MsgDeleteAlliance{} _ legacytx.LegacyMsg = &MsgDelegate{} _ legacytx.LegacyMsg = &MsgRedelegate{} _ legacytx.LegacyMsg = &MsgUndelegate{} _ legacytx.LegacyMsg = &MsgClaimDelegationRewards{} _ legacytx.LegacyMsg = &MsgUpdateParams{} + _ legacytx.LegacyMsg = &MsgCreateAlliance{} + _ legacytx.LegacyMsg = &MsgUpdateAlliance{} + _ legacytx.LegacyMsg = &MsgDeleteAlliance{} ) var ( @@ -28,6 +34,9 @@ var ( MsgRedelegateType = "msg_redelegate" MsgClaimDelegationRewardsType = "claim_delegation_rewards" MsgUpdateParamsType = "update_params" + MsgCreateAllianceType = "create_alliance" + MsgUpdateAllianceType = "update_alliance" + MsgDeleteAllianceType = "delete_alliance" ) func NewMsgDelegate(delegatorAddress, validatorAddress string, amount sdk.Coin) *MsgDelegate { @@ -197,3 +206,129 @@ func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { } func (msg MsgUpdateParams) Type() string { return MsgUpdateParamsType } + +func (msg *MsgCreateAlliance) ValidateBasic() error { + if msg.Denom == "" { + return status.Errorf(codes.InvalidArgument, "Alliance denom must have a value") + } + + if err := sdk.ValidateDenom(msg.Denom); err != nil { + return err + } + + if msg.RewardWeight.IsNil() || msg.RewardWeight.LT(sdk.ZeroDec()) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight must be zero or a positive number") + } + + if msg.RewardWeightRange.Min.IsNil() || msg.RewardWeightRange.Min.LT(sdk.ZeroDec()) || + msg.RewardWeightRange.Max.IsNil() || msg.RewardWeightRange.Max.LT(sdk.ZeroDec()) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight min and max must be zero or a positive number") + } + + if msg.RewardWeightRange.Min.GT(msg.RewardWeightRange.Max) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight min must be less or equal to rewardWeight max") + } + + if msg.RewardWeight.LT(msg.RewardWeightRange.Min) || msg.RewardWeight.GT(msg.RewardWeightRange.Max) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight must be bounded in RewardWeightRange") + } + + if msg.TakeRate.IsNil() || msg.TakeRate.IsNegative() || msg.TakeRate.GTE(sdk.OneDec()) { + return status.Errorf(codes.InvalidArgument, "Alliance takeRate must be more or equals to 0 but strictly less than 1") + } + + if msg.RewardChangeRate.IsZero() || msg.RewardChangeRate.IsNegative() { + return status.Errorf(codes.InvalidArgument, "Alliance rewardChangeRate must be strictly a positive number") + } + + if msg.RewardChangeInterval < 0 { + return status.Errorf(codes.InvalidArgument, "Alliance rewardChangeInterval must be strictly a positive number") + } + + return nil +} + +func (msg MsgCreateAlliance) Route() string { + return sdk.MsgTypeURL(&msg) +} + +func (msg MsgCreateAlliance) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +} + +func (msg *MsgCreateAlliance) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + panic("Authority is not valid") + } + return []sdk.AccAddress{signer} +} + +func (msg MsgCreateAlliance) Type() string { return MsgCreateAllianceType } + +func (msg *MsgUpdateAlliance) ValidateBasic() error { + if msg.Denom == "" { + return status.Errorf(codes.InvalidArgument, "Alliance denom must have a value") + } + + if msg.RewardWeight.IsNil() || msg.RewardWeight.LT(sdk.ZeroDec()) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight must be zero or a positive number") + } + + if msg.TakeRate.IsNil() || msg.TakeRate.IsNegative() || msg.TakeRate.GTE(sdk.OneDec()) { + return status.Errorf(codes.InvalidArgument, "Alliance takeRate must be more or equals to 0 but strictly less than 1") + } + + if msg.RewardChangeRate.IsZero() || msg.RewardChangeRate.IsNegative() { + return status.Errorf(codes.InvalidArgument, "Alliance rewardChangeRate must be strictly a positive number") + } + + if msg.RewardChangeInterval < 0 { + return status.Errorf(codes.InvalidArgument, "Alliance rewardChangeInterval must be strictly a positive number") + } + + return nil +} + +func (msg MsgUpdateAlliance) Route() string { + return sdk.MsgTypeURL(&msg) +} + +func (msg MsgUpdateAlliance) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +} + +func (msg *MsgUpdateAlliance) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + panic("Authority is not valid") + } + return []sdk.AccAddress{signer} +} + +func (msg MsgUpdateAlliance) Type() string { return MsgUpdateAllianceType } + +func (msg *MsgDeleteAlliance) ValidateBasic() error { + if msg.Denom == "" { + return status.Errorf(codes.InvalidArgument, "Alliance denom must have a value") + } + return nil +} + +func (msg MsgDeleteAlliance) Route() string { + return sdk.MsgTypeURL(&msg) +} + +func (msg MsgDeleteAlliance) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +} + +func (msg *MsgDeleteAlliance) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + panic("Authority is not valid") + } + return []sdk.AccAddress{signer} +} + +func (msg MsgDeleteAlliance) Type() string { return MsgDeleteAllianceType } diff --git a/x/alliance/types/tx.pb.go b/x/alliance/types/tx.pb.go index 1c07ac6d..1cf00f11 100644 --- a/x/alliance/types/tx.pb.go +++ b/x/alliance/types/tx.pb.go @@ -13,18 +13,22 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -421,6 +425,311 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +type MsgCreateAlliance struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // Denom of the asset. It could either be a native token or an IBC token + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + // The reward weight specifies the ratio of rewards that will be given to each alliance asset + // It does not need to sum to 1. rate = weight / total_weight + // Native asset is always assumed to have a weight of 1. + RewardWeight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=reward_weight,json=rewardWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reward_weight"` + // A positive take rate is used for liquid staking derivatives. It defines an annualized reward rate that + // will be redirected to the distribution rewards pool + TakeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=take_rate,json=takeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"take_rate"` + RewardChangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=reward_change_rate,json=rewardChangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reward_change_rate"` + RewardChangeInterval time.Duration `protobuf:"bytes,6,opt,name=reward_change_interval,json=rewardChangeInterval,proto3,stdduration" json:"reward_change_interval"` + // set a bound of weight range to limit how much reward weights can scale. + RewardWeightRange RewardWeightRange `protobuf:"bytes,7,opt,name=reward_weight_range,json=rewardWeightRange,proto3" json:"reward_weight_range"` +} + +func (m *MsgCreateAlliance) Reset() { *m = MsgCreateAlliance{} } +func (m *MsgCreateAlliance) String() string { return proto.CompactTextString(m) } +func (*MsgCreateAlliance) ProtoMessage() {} +func (*MsgCreateAlliance) Descriptor() ([]byte, []int) { + return fileDescriptor_ddcb3ed838213b4a, []int{10} +} +func (m *MsgCreateAlliance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateAlliance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateAlliance.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateAlliance) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateAlliance.Merge(m, src) +} +func (m *MsgCreateAlliance) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateAlliance) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateAlliance.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateAlliance proto.InternalMessageInfo + +func (m *MsgCreateAlliance) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgCreateAlliance) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *MsgCreateAlliance) GetRewardChangeInterval() time.Duration { + if m != nil { + return m.RewardChangeInterval + } + return 0 +} + +func (m *MsgCreateAlliance) GetRewardWeightRange() RewardWeightRange { + if m != nil { + return m.RewardWeightRange + } + return RewardWeightRange{} +} + +type MsgCreateAllianceResponse struct { +} + +func (m *MsgCreateAllianceResponse) Reset() { *m = MsgCreateAllianceResponse{} } +func (m *MsgCreateAllianceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateAllianceResponse) ProtoMessage() {} +func (*MsgCreateAllianceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ddcb3ed838213b4a, []int{11} +} +func (m *MsgCreateAllianceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateAllianceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateAllianceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateAllianceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateAllianceResponse.Merge(m, src) +} +func (m *MsgCreateAllianceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateAllianceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateAllianceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateAllianceResponse proto.InternalMessageInfo + +type MsgUpdateAlliance struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // Denom of the asset. It could either be a native token or an IBC token + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + // The reward weight specifies the ratio of rewards that will be given to each alliance asset + // It does not need to sum to 1. rate = weight / total_weight + // Native asset is always assumed to have a weight of 1. + RewardWeight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=reward_weight,json=rewardWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reward_weight"` + TakeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=take_rate,json=takeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"take_rate"` + RewardChangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=reward_change_rate,json=rewardChangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reward_change_rate"` + RewardChangeInterval time.Duration `protobuf:"bytes,6,opt,name=reward_change_interval,json=rewardChangeInterval,proto3,stdduration" json:"reward_change_interval"` +} + +func (m *MsgUpdateAlliance) Reset() { *m = MsgUpdateAlliance{} } +func (m *MsgUpdateAlliance) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateAlliance) ProtoMessage() {} +func (*MsgUpdateAlliance) Descriptor() ([]byte, []int) { + return fileDescriptor_ddcb3ed838213b4a, []int{12} +} +func (m *MsgUpdateAlliance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateAlliance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateAlliance.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateAlliance) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateAlliance.Merge(m, src) +} +func (m *MsgUpdateAlliance) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateAlliance) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateAlliance.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateAlliance proto.InternalMessageInfo + +func (m *MsgUpdateAlliance) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateAlliance) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *MsgUpdateAlliance) GetRewardChangeInterval() time.Duration { + if m != nil { + return m.RewardChangeInterval + } + return 0 +} + +type MsgUpdateAllianceResponse struct { +} + +func (m *MsgUpdateAllianceResponse) Reset() { *m = MsgUpdateAllianceResponse{} } +func (m *MsgUpdateAllianceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateAllianceResponse) ProtoMessage() {} +func (*MsgUpdateAllianceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ddcb3ed838213b4a, []int{13} +} +func (m *MsgUpdateAllianceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateAllianceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateAllianceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateAllianceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateAllianceResponse.Merge(m, src) +} +func (m *MsgUpdateAllianceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateAllianceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateAllianceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateAllianceResponse proto.InternalMessageInfo + +type MsgDeleteAlliance struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` +} + +func (m *MsgDeleteAlliance) Reset() { *m = MsgDeleteAlliance{} } +func (m *MsgDeleteAlliance) String() string { return proto.CompactTextString(m) } +func (*MsgDeleteAlliance) ProtoMessage() {} +func (*MsgDeleteAlliance) Descriptor() ([]byte, []int) { + return fileDescriptor_ddcb3ed838213b4a, []int{14} +} +func (m *MsgDeleteAlliance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeleteAlliance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeleteAlliance.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgDeleteAlliance) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeleteAlliance.Merge(m, src) +} +func (m *MsgDeleteAlliance) XXX_Size() int { + return m.Size() +} +func (m *MsgDeleteAlliance) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeleteAlliance.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeleteAlliance proto.InternalMessageInfo + +func (m *MsgDeleteAlliance) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgDeleteAlliance) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +type MsgDeleteAllianceResponse struct { +} + +func (m *MsgDeleteAllianceResponse) Reset() { *m = MsgDeleteAllianceResponse{} } +func (m *MsgDeleteAllianceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDeleteAllianceResponse) ProtoMessage() {} +func (*MsgDeleteAllianceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ddcb3ed838213b4a, []int{15} +} +func (m *MsgDeleteAllianceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeleteAllianceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeleteAllianceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgDeleteAllianceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeleteAllianceResponse.Merge(m, src) +} +func (m *MsgDeleteAllianceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDeleteAllianceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeleteAllianceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeleteAllianceResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgDelegate)(nil), "alliance.MsgDelegate") proto.RegisterType((*MsgDelegateResponse)(nil), "alliance.MsgDelegateResponse") @@ -432,52 +741,76 @@ func init() { proto.RegisterType((*MsgClaimDelegationRewardsResponse)(nil), "alliance.MsgClaimDelegationRewardsResponse") proto.RegisterType((*MsgUpdateParams)(nil), "alliance.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "alliance.MsgUpdateParamsResponse") + proto.RegisterType((*MsgCreateAlliance)(nil), "alliance.MsgCreateAlliance") + proto.RegisterType((*MsgCreateAllianceResponse)(nil), "alliance.MsgCreateAllianceResponse") + proto.RegisterType((*MsgUpdateAlliance)(nil), "alliance.MsgUpdateAlliance") + proto.RegisterType((*MsgUpdateAllianceResponse)(nil), "alliance.MsgUpdateAllianceResponse") + proto.RegisterType((*MsgDeleteAlliance)(nil), "alliance.MsgDeleteAlliance") + proto.RegisterType((*MsgDeleteAllianceResponse)(nil), "alliance.MsgDeleteAllianceResponse") } func init() { proto.RegisterFile("alliance/tx.proto", fileDescriptor_ddcb3ed838213b4a) } var fileDescriptor_ddcb3ed838213b4a = []byte{ - // 635 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0x3f, 0x6f, 0xd3, 0x40, - 0x14, 0xb7, 0x93, 0x12, 0xb5, 0x17, 0xfe, 0xb4, 0x6e, 0x42, 0x12, 0x4b, 0x38, 0x6d, 0x3a, 0x50, - 0x81, 0x62, 0x93, 0x20, 0x31, 0x74, 0x82, 0xb4, 0x30, 0xa0, 0x46, 0x42, 0xae, 0x58, 0x58, 0xaa, - 0x8b, 0x7d, 0x72, 0x0d, 0xb1, 0x2f, 0xf2, 0x5d, 0x42, 0xb3, 0x32, 0xc1, 0x06, 0x9f, 0x80, 0xf2, - 0x0d, 0x18, 0xf8, 0x10, 0x1d, 0x2b, 0x26, 0xc4, 0x50, 0x50, 0x32, 0xc0, 0x27, 0x60, 0x46, 0xb6, - 0xcf, 0x67, 0xbb, 0x49, 0x94, 0x0c, 0x48, 0x30, 0x30, 0xf9, 0xee, 0x7e, 0xef, 0xfd, 0xfc, 0xde, - 0xef, 0xbd, 0x7b, 0x07, 0xd6, 0x60, 0xb7, 0x6b, 0x43, 0xd7, 0x40, 0x1a, 0x3d, 0x56, 0x7b, 0x1e, - 0xa6, 0x58, 0x5a, 0x8e, 0x8e, 0xe4, 0x82, 0x85, 0x2d, 0x1c, 0x1c, 0x6a, 0xfe, 0x2a, 0xc4, 0xe5, - 0x8a, 0x81, 0x89, 0x83, 0xc9, 0x61, 0x08, 0x84, 0x1b, 0x06, 0x95, 0xc2, 0x9d, 0xe6, 0x10, 0x4b, - 0x1b, 0x34, 0xfc, 0x0f, 0x03, 0x14, 0x06, 0x74, 0x20, 0x41, 0xda, 0xa0, 0xd1, 0x41, 0x14, 0x36, - 0x34, 0x03, 0xdb, 0x2e, 0xc3, 0x8b, 0x3c, 0x8c, 0x1e, 0xf4, 0xa0, 0xc3, 0xf8, 0x6a, 0xef, 0x33, - 0x20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 0xcf, - 0xe8, 0xc1, 0xad, 0x94, 0xeb, 0x74, 0x23, 0xf9, 0xf6, 0x02, 0x46, 0xfc, 0x5f, 0xfb, 0xe0, 0x72, - 0xaa, 0xd0, 0x95, 0x74, 0x70, 0x09, 0x48, 0xde, 0x9c, 0x09, 0x45, 0x6c, 0xad, 0xc7, 0xa7, 0x23, - 0x45, 0x3c, 0x1b, 0x29, 0xe2, 0xf7, 0x91, 0x22, 0xbe, 0x1d, 0x2b, 0xc2, 0xd9, 0x58, 0x11, 0xbe, - 0x8c, 0x15, 0xe1, 0xd9, 0x9d, 0xc4, 0x2d, 0xa6, 0xc8, 0xf3, 0x60, 0xdd, 0xc1, 0x2e, 0x1a, 0x6a, - 0xfc, 0x45, 0x3e, 0x8e, 0x97, 0xc1, 0x9d, 0xee, 0xe4, 0x82, 0xc7, 0xf9, 0xee, 0xef, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x8a, 0x38, 0xd8, 0x94, 0x3c, 0x08, 0x00, 0x00, + // 926 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x97, 0x4d, 0x6f, 0xe3, 0x44, + 0x18, 0xc7, 0xe3, 0xbe, 0xd1, 0x4e, 0xbb, 0x4b, 0xeb, 0x36, 0xdb, 0xbc, 0x08, 0x67, 0x37, 0x95, + 0x96, 0x15, 0xa8, 0x36, 0x2d, 0x12, 0x87, 0x9e, 0xd8, 0x34, 0x20, 0x01, 0x1b, 0x09, 0x5c, 0x21, + 0x04, 0x42, 0x8a, 0x26, 0xf6, 0xe0, 0x98, 0xb5, 0x3d, 0xd1, 0xcc, 0x24, 0xbb, 0xb9, 0xc2, 0x05, + 0x0e, 0x48, 0x1c, 0xb9, 0xb1, 0x7c, 0x03, 0x90, 0xf8, 0x10, 0x7b, 0x5c, 0x71, 0x42, 0x1c, 0xb2, + 0xa8, 0x3d, 0xc0, 0x99, 0x03, 0x67, 0xe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, 0xf9, 0xe4, 0x32, + 0xa1, 0xda, 0x8d, 0xc2, 0x90, 0xa2, 0xd9, 0xe0, 0xea, 0xd4, 0x09, 0x54, 0xcf, 0x27, 0x93, 0x0b, + 0xd6, 0x0e, 0xfe, 0x24, 0x98, 0x65, 0x4e, 0x6d, 0x42, 0xf5, 0x39, 0x89, 0x14, 0x30, 0xe7, 0xdb, + 0x3b, 0x66, 0x4e, 0x59, 0xbb, 0x3e, 0x63, 0x91, 0x42, 0xe6, 0x7c, 0x3f, 0xb6, 0xde, 0x7c, 0x78, + 0x6e, 0x68, 0x8f, 0xce, 0x0d, 0xed, 0xe7, 0x73, 0x43, 0xfb, 0xf2, 0xc2, 0x28, 0x3d, 0xba, 0x30, + 0x4a, 0x3f, 0x5e, 0x18, 0xa5, 0x0f, 0x5e, 0xca, 0x6c, 0x07, 0x0c, 0x11, 0x02, 0x0f, 0x43, 0x1c, + 0xa1, 0xb1, 0xfa, 0x63, 0x66, 0xdd, 0x4f, 0x1f, 0xf9, 0xe6, 0xd0, 0x5b, 0xe3, 0xcb, 0xfb, 0xe5, + 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x0e, 0xc7, 0x55, 0x6c, 0x63, 0x0e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -497,6 +830,9 @@ type MsgClient interface { Undelegate(ctx context.Context, in *MsgUndelegate, opts ...grpc.CallOption) (*MsgUndelegateResponse, error) ClaimDelegationRewards(ctx context.Context, in *MsgClaimDelegationRewards, opts ...grpc.CallOption) (*MsgClaimDelegationRewardsResponse, error) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + CreateAlliance(ctx context.Context, in *MsgCreateAlliance, opts ...grpc.CallOption) (*MsgCreateAllianceResponse, error) + UpdateAlliance(ctx context.Context, in *MsgUpdateAlliance, opts ...grpc.CallOption) (*MsgUpdateAllianceResponse, error) + DeleteAlliance(ctx context.Context, in *MsgDeleteAlliance, opts ...grpc.CallOption) (*MsgDeleteAllianceResponse, error) } type msgClient struct { @@ -552,6 +888,33 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) CreateAlliance(ctx context.Context, in *MsgCreateAlliance, opts ...grpc.CallOption) (*MsgCreateAllianceResponse, error) { + out := new(MsgCreateAllianceResponse) + err := c.cc.Invoke(ctx, "/alliance.Msg/CreateAlliance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateAlliance(ctx context.Context, in *MsgUpdateAlliance, opts ...grpc.CallOption) (*MsgUpdateAllianceResponse, error) { + out := new(MsgUpdateAllianceResponse) + err := c.cc.Invoke(ctx, "/alliance.Msg/UpdateAlliance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DeleteAlliance(ctx context.Context, in *MsgDeleteAlliance, opts ...grpc.CallOption) (*MsgDeleteAllianceResponse, error) { + out := new(MsgDeleteAllianceResponse) + err := c.cc.Invoke(ctx, "/alliance.Msg/DeleteAlliance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { Delegate(context.Context, *MsgDelegate) (*MsgDelegateResponse, error) @@ -559,6 +922,9 @@ type MsgServer interface { Undelegate(context.Context, *MsgUndelegate) (*MsgUndelegateResponse, error) ClaimDelegationRewards(context.Context, *MsgClaimDelegationRewards) (*MsgClaimDelegationRewardsResponse, error) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + CreateAlliance(context.Context, *MsgCreateAlliance) (*MsgCreateAllianceResponse, error) + UpdateAlliance(context.Context, *MsgUpdateAlliance) (*MsgUpdateAllianceResponse, error) + DeleteAlliance(context.Context, *MsgDeleteAlliance) (*MsgDeleteAllianceResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -580,6 +946,15 @@ func (*UnimplementedMsgServer) ClaimDelegationRewards(ctx context.Context, req * func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (*UnimplementedMsgServer) CreateAlliance(ctx context.Context, req *MsgCreateAlliance) (*MsgCreateAllianceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateAlliance not implemented") +} +func (*UnimplementedMsgServer) UpdateAlliance(ctx context.Context, req *MsgUpdateAlliance) (*MsgUpdateAllianceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateAlliance not implemented") +} +func (*UnimplementedMsgServer) DeleteAlliance(ctx context.Context, req *MsgDeleteAlliance) (*MsgDeleteAllianceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAlliance not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -675,6 +1050,60 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_CreateAlliance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateAlliance) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateAlliance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/alliance.Msg/CreateAlliance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateAlliance(ctx, req.(*MsgCreateAlliance)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateAlliance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateAlliance) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateAlliance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/alliance.Msg/UpdateAlliance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateAlliance(ctx, req.(*MsgUpdateAlliance)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DeleteAlliance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDeleteAlliance) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DeleteAlliance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/alliance.Msg/DeleteAlliance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DeleteAlliance(ctx, req.(*MsgDeleteAlliance)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "alliance.Msg", HandlerType: (*MsgServer)(nil), @@ -699,6 +1128,18 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "CreateAlliance", + Handler: _Msg_CreateAlliance_Handler, + }, + { + MethodName: "UpdateAlliance", + Handler: _Msg_UpdateAlliance_Handler, + }, + { + MethodName: "DeleteAlliance", + Handler: _Msg_DeleteAlliance_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "alliance/tx.proto", @@ -1051,24 +1492,290 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgCreateAlliance) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgDelegate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DelegatorAddress) + +func (m *MsgCreateAlliance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateAlliance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.RewardWeightRange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + n6, err6 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RewardChangeInterval, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintTx(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x32 + { + size := m.RewardChangeRate.Size() + i -= size + if _, err := m.RewardChangeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.TakeRate.Size() + i -= size + if _, err := m.TakeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.RewardWeight.Size() + i -= size + if _, err := m.RewardWeight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateAllianceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateAllianceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateAllianceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateAlliance) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateAlliance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateAlliance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n7, err7 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RewardChangeInterval, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintTx(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x32 + { + size := m.RewardChangeRate.Size() + i -= size + if _, err := m.RewardChangeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.TakeRate.Size() + i -= size + if _, err := m.TakeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.RewardWeight.Size() + i -= size + if _, err := m.RewardWeight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateAllianceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateAllianceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateAllianceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgDeleteAlliance) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgDeleteAlliance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeleteAlliance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDeleteAllianceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgDeleteAllianceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeleteAllianceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgDelegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -1190,27 +1897,517 @@ func (m *MsgUpdateParams) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateAlliance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.RewardWeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.TakeRate.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.RewardChangeRate.Size() + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval) + n += 1 + l + sovTx(uint64(l)) + l = m.RewardWeightRange.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgCreateAllianceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateAlliance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.RewardWeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.TakeRate.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.RewardChangeRate.Size() + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval) + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateAllianceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgDeleteAlliance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgDeleteAllianceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgDelegate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDelegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDelegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDelegateResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDelegateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUndelegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUndelegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUndelegateResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUndelegateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUndelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 + if iNdEx > l { + return io.ErrUnexpectedEOF } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return nil } -func (m *MsgDelegate) Unmarshal(dAtA []byte) error { +func (m *MsgRedelegate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1233,10 +2430,10 @@ func (m *MsgDelegate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgDelegate: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRedelegate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDelegate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRedelegate: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1273,7 +2470,7 @@ func (m *MsgDelegate) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSrcAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1301,9 +2498,41 @@ func (m *MsgDelegate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + m.ValidatorSrcAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorDstAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorDstAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } @@ -1357,7 +2586,7 @@ func (m *MsgDelegate) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgDelegateResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRedelegateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1380,10 +2609,10 @@ func (m *MsgDelegateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgDelegateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRedelegateResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRedelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1407,7 +2636,7 @@ func (m *MsgDelegateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { +func (m *MsgClaimDelegationRewards) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1430,10 +2659,10 @@ func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUndelegate: wiretype end group for non-group") + return fmt.Errorf("proto: MsgClaimDelegationRewards: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUndelegate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgClaimDelegationRewards: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1502,7 +2731,171 @@ func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgClaimDelegationRewardsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgClaimDelegationRewardsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimDelegationRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1529,7 +2922,7 @@ func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1554,7 +2947,7 @@ func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUndelegateResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1577,10 +2970,10 @@ func (m *MsgUndelegateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUndelegateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUndelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1604,7 +2997,7 @@ func (m *MsgUndelegateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRedelegate) Unmarshal(dAtA []byte) error { +func (m *MsgCreateAlliance) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1627,15 +3020,15 @@ func (m *MsgRedelegate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRedelegate: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateAlliance: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRedelegate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateAlliance: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1663,11 +3056,11 @@ func (m *MsgRedelegate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSrcAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1695,11 +3088,11 @@ func (m *MsgRedelegate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorSrcAddress = string(dAtA[iNdEx:postIndex]) + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorDstAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardWeight", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1727,11 +3120,81 @@ func (m *MsgRedelegate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorDstAddress = string(dAtA[iNdEx:postIndex]) + if err := m.RewardWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TakeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TakeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardChangeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardChangeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardChangeInterval", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1758,7 +3221,40 @@ func (m *MsgRedelegate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.RewardChangeInterval, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardWeightRange", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardWeightRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1783,7 +3279,7 @@ func (m *MsgRedelegate) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRedelegateResponse) Unmarshal(dAtA []byte) error { +func (m *MsgCreateAllianceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1806,10 +3302,10 @@ func (m *MsgRedelegateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRedelegateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateAllianceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRedelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateAllianceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1833,7 +3329,7 @@ func (m *MsgRedelegateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgClaimDelegationRewards) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateAlliance) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1856,15 +3352,15 @@ func (m *MsgClaimDelegationRewards) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgClaimDelegationRewards: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateAlliance: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgClaimDelegationRewards: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateAlliance: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1892,11 +3388,11 @@ func (m *MsgClaimDelegationRewards) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1924,11 +3420,11 @@ func (m *MsgClaimDelegationRewards) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardWeight", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1956,7 +3452,110 @@ func (m *MsgClaimDelegationRewards) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denom = string(dAtA[iNdEx:postIndex]) + if err := m.RewardWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TakeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardChangeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardChangeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardChangeInterval", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.RewardChangeInterval, dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -1979,7 +3578,7 @@ func (m *MsgClaimDelegationRewards) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgClaimDelegationRewardsResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateAllianceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2002,10 +3601,10 @@ func (m *MsgClaimDelegationRewardsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgClaimDelegationRewardsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateAllianceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgClaimDelegationRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateAllianceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2029,7 +3628,7 @@ func (m *MsgClaimDelegationRewardsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { +func (m *MsgDeleteAlliance) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2052,10 +3651,10 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + return fmt.Errorf("proto: MsgDeleteAlliance: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgDeleteAlliance: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2092,9 +3691,9 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2104,24 +3703,23 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2144,7 +3742,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { +func (m *MsgDeleteAllianceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2167,10 +3765,10 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgDeleteAllianceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgDeleteAllianceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: