diff --git a/proto/multistaking/v1/multi_staking.proto b/proto/multistaking/v1/multi_staking.proto index 9edc79b1..b0d6c409 100644 --- a/proto/multistaking/v1/multi_staking.proto +++ b/proto/multistaking/v1/multi_staking.proto @@ -4,7 +4,9 @@ package multistaking.v1; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/staking/v1beta1/staking.proto"; import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; option go_package = "github.com/realiotech/multi-staking/x/multi-staking/types"; @@ -71,4 +73,35 @@ message MultiStakingCoinInfo { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; +} + +message ValidatorInfo { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + + string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any consensus_pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + bool jailed = 3; + cosmos.staking.v1beta1.BondStatus status = 4; + string tokens = 5 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string delegator_shares = 6 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + cosmos.staking.v1beta1.Description description = 7 [(gogoproto.nullable) = false]; + int64 unbonding_height = 8; + google.protobuf.Timestamp unbonding_time = 9 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + cosmos.staking.v1beta1.Commission commission = 10 [(gogoproto.nullable) = false]; + string min_self_delegation = 11 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string bond_denom = 12; } \ No newline at end of file diff --git a/proto/multistaking/v1/query.proto b/proto/multistaking/v1/query.proto index 7bd785bb..8f86cc33 100644 --- a/proto/multistaking/v1/query.proto +++ b/proto/multistaking/v1/query.proto @@ -41,6 +41,13 @@ service Query { rpc BondWeight(QueryBondWeightRequest) returns (QueryBondWeightResponse) { option (google.api.http).get = "/realiotech/multistaking/v1/weight/{denom}"; } + rpc Validators(QueryValidatorsRequest) + returns (QueryValidatorsResponse) { + option (google.api.http).get = "/realiotech/multistaking/v1/validators"; + } + rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) { + option (google.api.http).get = "/realiotech/multistaking/v1/validators/{validator_addr}"; + } } message QueryMultiStakingLocksRequest { @@ -116,4 +123,22 @@ message QueryValidatorMultiStakingCoinRequest { string validator_addr = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; } -message QueryValidatorMultiStakingCoinResponse { string denom = 1; } \ No newline at end of file +message QueryValidatorMultiStakingCoinResponse { string denom = 1; } + +message QueryValidatorsRequest { + string status = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryValidatorsResponse { + repeated ValidatorInfo validators = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryValidatorRequest { + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +message QueryValidatorResponse { + ValidatorInfo validator = 1 [(gogoproto.nullable) = false]; +} diff --git a/x/multi-staking/client/cli/query.go b/x/multi-staking/client/cli/query.go index 12177c9e..7b0ddc5e 100644 --- a/x/multi-staking/client/cli/query.go +++ b/x/multi-staking/client/cli/query.go @@ -2,6 +2,7 @@ package cli import ( "fmt" + "strings" "github.com/realio-tech/multi-staking-module/x/multi-staking/types" "github.com/spf13/cobra" @@ -9,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" ) func GetQueryCmd() *cobra.Command { @@ -28,6 +30,8 @@ func GetQueryCmd() *cobra.Command { GetCmdQueryMultiStakingUnlock(), GetCmdQueryMultiStakingUnlocks(), GetCmdQueryValidatorMultiStakingCoin(), + GetCmdQueryValidator(), + GetCmdQueryValidators(), ) return cmd @@ -289,3 +293,91 @@ func GetCmdQueryValidatorMultiStakingCoin() *cobra.Command { return cmd } + +// GetCmdQueryValidator implements the validator query command. +func GetCmdQueryValidator() *cobra.Command { + bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() + + cmd := &cobra.Command{ + Use: "validator [validator-addr]", + Short: "Query a validator", + Long: strings.TrimSpace( + fmt.Sprintf(`Query details about an individual validator. + +Example: +$ %s query multistaking validator %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj +`, + version.AppName, bech32PrefixValAddr, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + addr, err := sdk.ValAddressFromBech32(args[0]) + if err != nil { + return err + } + + params := &types.QueryValidatorRequest{ValidatorAddr: addr.String()} + res, err := queryClient.Validator(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(&res.Validator) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryValidators implements the query all validators command. +func GetCmdQueryValidators() *cobra.Command { + cmd := &cobra.Command{ + Use: "validators", + Short: "Query for all validators", + Args: cobra.NoArgs, + Long: strings.TrimSpace( + fmt.Sprintf(`Query details about all validators on a network. + +Example: +$ %s query multistaking validators +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + result, err := queryClient.Validators(cmd.Context(), &types.QueryValidatorsRequest{ + // Leaving status empty on purpose to query all validators. + Pagination: pageReq, + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(result) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "validators") + + return cmd +} diff --git a/x/multi-staking/keeper/grpc_query.go b/x/multi-staking/keeper/grpc_query.go index 5b20b502..c48233c8 100644 --- a/x/multi-staking/keeper/grpc_query.go +++ b/x/multi-staking/keeper/grpc_query.go @@ -10,10 +10,13 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) type queryServer struct { Keeper + stakingQuerier stakingkeeper.Querier } // NewMsgServerImpl returns an implementation of the bank MsgServer interface @@ -21,6 +24,9 @@ type queryServer struct { func NewQueryServerImpl(keeper Keeper) types.QueryServer { return &queryServer{ Keeper: keeper, + stakingQuerier: stakingkeeper.Querier{ + Keeper: keeper.stakingKeeper, + }, } } @@ -183,3 +189,81 @@ func (k queryServer) ValidatorMultiStakingCoin(c context.Context, req *types.Que Denom: denom, }, nil } + +func (k queryServer) Validators(c context.Context, req *types.QueryValidatorsRequest) (*types.QueryValidatorsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + sdkReq := stakingtypes.QueryValidatorsRequest{ + Status: req.Status, + Pagination: req.Pagination, + } + + resp, err := k.stakingQuerier.Validators(c, &sdkReq) + if err != nil { + return nil, err + } + + vals := []types.ValidatorInfo{} + for _, val := range resp.Validators { + valAcc, err := sdk.ValAddressFromBech32(val.OperatorAddress) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid validator address") + } + + denom := k.Keeper.GetValidatorMultiStakingCoin(ctx, valAcc) + valInfo := types.ValidatorInfo{ + OperatorAddress: val.OperatorAddress, + ConsensusPubkey: val.ConsensusPubkey, + Jailed: val.Jailed, + Status: val.Status, + Tokens: val.Tokens, + DelegatorShares: val.DelegatorShares, + Description: val.Description, + UnbondingHeight: val.UnbondingHeight, + UnbondingTime: val.UnbondingTime, + Commission: val.Commission, + MinSelfDelegation: val.MinSelfDelegation, + BondDenom: denom, + } + vals = append(vals, valInfo) + } + + return &types.QueryValidatorsResponse{Validators: vals, Pagination: resp.Pagination}, nil +} + +func (k queryServer) Validator(c context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + if req.ValidatorAddr == "" { + return nil, status.Error(codes.InvalidArgument, "validator address cannot be empty") + } + + valAddr, err := sdk.ValAddressFromBech32(req.ValidatorAddr) + if err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(c) + validator, found := k.stakingKeeper.GetValidator(ctx, valAddr) + if !found { + return nil, status.Errorf(codes.NotFound, "validator %s not found", req.ValidatorAddr) + } + + denom := k.Keeper.GetValidatorMultiStakingCoin(ctx, valAddr) + valInfo := types.ValidatorInfo{ + OperatorAddress: validator.OperatorAddress, + ConsensusPubkey: validator.ConsensusPubkey, + Jailed: validator.Jailed, + Status: validator.Status, + Tokens: validator.Tokens, + DelegatorShares: validator.DelegatorShares, + Description: validator.Description, + UnbondingHeight: validator.UnbondingHeight, + UnbondingTime: validator.UnbondingTime, + Commission: validator.Commission, + MinSelfDelegation: validator.MinSelfDelegation, + BondDenom: denom, + } + return &types.QueryValidatorResponse{Validator: valInfo}, nil +} diff --git a/x/multi-staking/types/multi_staking.pb.go b/x/multi-staking/types/multi_staking.pb.go index 1dd28bbd..aeb37bde 100644 --- a/x/multi-staking/types/multi_staking.pb.go +++ b/x/multi-staking/types/multi_staking.pb.go @@ -6,20 +6,25 @@ package types import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/x/staking/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "google.golang.org/protobuf/types/known/timestamppb" 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. @@ -401,6 +406,53 @@ func (m *MultiStakingCoinInfo) GetDenom() string { return "" } +type ValidatorInfo struct { + OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` + ConsensusPubkey *types.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` + Status types1.BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"` + Tokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokens"` + DelegatorShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"delegator_shares"` + Description types1.Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` + UnbondingHeight int64 `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty"` + UnbondingTime time.Time `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time"` + Commission types1.Commission `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission"` + MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation"` + BondDenom string `protobuf:"bytes,12,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty"` +} + +func (m *ValidatorInfo) Reset() { *m = ValidatorInfo{} } +func (*ValidatorInfo) ProtoMessage() {} +func (*ValidatorInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_c2c118bafa9b671a, []int{8} +} +func (m *ValidatorInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorInfo.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 *ValidatorInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorInfo.Merge(m, src) +} +func (m *ValidatorInfo) XXX_Size() int { + return m.Size() +} +func (m *ValidatorInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorInfo proto.InternalMessageInfo + func init() { proto.RegisterType((*MultiStakingCoin)(nil), "multistaking.v1.MultiStakingCoin") proto.RegisterType((*LockID)(nil), "multistaking.v1.LockID") @@ -410,6 +462,7 @@ func init() { proto.RegisterType((*MultiStakingUnlock)(nil), "multistaking.v1.MultiStakingUnlock") proto.RegisterType((*UnlockEntry)(nil), "multistaking.v1.UnlockEntry") proto.RegisterType((*MultiStakingCoinInfo)(nil), "multistaking.v1.MultiStakingCoinInfo") + proto.RegisterType((*ValidatorInfo)(nil), "multistaking.v1.ValidatorInfo") } func init() { @@ -417,45 +470,67 @@ func init() { } var fileDescriptor_c2c118bafa9b671a = []byte{ - // 603 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xdd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, 0xaf, 0x40, 0xb6, 0x17, 0xde, 0x7f, 0xad, - 0x97, 0x1a, 0x7b, 0xa0, 0xf6, 0x12, 0xc5, 0x24, 0x44, 0x9c, 0xa5, 0x33, 0xa6, 0xe6, 0x67, 0x32, - 0x4e, 0xcd, 0x04, 0xaf, 0x01, 0x20, 0x04, 0x78, 0xca, 0x74, 0x35, 0xf0, 0x92, 0x40, 0xda, 0x02, - 0x68, 0x3c, 0x07, 0x95, 0x3d, 0x1a, 0x9f, 0xf7, 0x16, 0x61, 0x5e, 0xa1, 0xe2, 0x87, 0xf7, 0x41, - 0x65, 0x48, 0x4f, 0x6d, 0xb2, 0x36, 0xb3, 0x8d, 0xa9, 0x14, 0xbd, 0x85, 0x93, 0x06, 0xb8, 0x03, - 0x16, 0x31, 0xe5, 0x29, 0xc1, 0x59, 0x75, 0x6e, 0x7d, 0x7e, 0xc3, 0xdc, 0xba, 0x7a, 0x46, 0xef, - 0x23, 0xca, 0xd3, 0x03, 0xdd, 0x3e, 0x6d, 0xd9, 0xae, 0x88, 0x0d, 0x7e, 0x16, 0x5b, 0xfc, 0x68, - 0x00, 0x33, 0x57, 0x08, 0x6f, 0x81, 0x95, 0x20, 0xc5, 0x88, 0x13, 0x46, 0xbd, 0x9e, 0xfa, 0x97, - 0x0a, 0x6d, 0xf3, 0xee, 0xf2, 0x14, 0xde, 0x95, 0x28, 0x7c, 0x0a, 0x96, 0x95, 0x18, 0x42, 0xa3, - 0xff, 0x72, 0xf4, 0xe2, 0x49, 0xbb, 0x32, 0x55, 0xca, 0xf9, 0x60, 0x80, 0xd5, 0x62, 0x7d, 0x87, - 0xee, 0xb3, 0x33, 0x6e, 0x69, 0xe1, 0x3e, 0xcd, 0x9d, 0xef, 0x7d, 0x6a, 0x75, 0x0f, 0xc7, 0x96, - 0x71, 0x34, 0xb6, 0x8c, 0xdf, 0x63, 0xcb, 0xf8, 0x34, 0xb1, 0x4a, 0x47, 0x13, 0xab, 0xf4, 0x63, - 0x62, 0x95, 0x5e, 0xdf, 0xcb, 0x71, 0xa7, 0x18, 0xc5, 0x84, 0x71, 0x1c, 0xf4, 0xd4, 0xbb, 0xb7, - 0x39, 0x7d, 0x08, 0xdf, 0x15, 0x62, 0x79, 0xa4, 0x5f, 0x96, 0x6f, 0xd1, 0x9d, 0x3f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x16, 0xe8, 0x24, 0xf0, 0x35, 0x05, 0x00, 0x00, + // 945 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcd, 0x6e, 0x23, 0xc5, + 0x13, 0xf7, 0x24, 0x59, 0xc7, 0x29, 0xef, 0xc6, 0xde, 0xfe, 0x5b, 0x7f, 0x26, 0x11, 0xd8, 0xc1, + 0x8b, 0x20, 0x20, 0x65, 0x46, 0x09, 0xe2, 0x40, 0xd8, 0x4b, 0x1c, 0x23, 0x25, 0x0a, 0x1f, 0xcb, + 0x78, 0x17, 0x04, 0x12, 0x1a, 0x8d, 0x67, 0x3a, 0xe3, 0xc6, 0x33, 0xdd, 0xd6, 0x74, 0x8f, 0xc1, + 0x6f, 0x80, 0x04, 0x87, 0x3d, 0xc2, 0x6d, 0x1f, 0x62, 0x1f, 0x62, 0xc5, 0x69, 0xb5, 0x27, 0x84, + 0xc4, 0x82, 0x92, 0x0b, 0x07, 0x1e, 0x02, 0xf5, 0xc7, 0xd8, 0x8e, 0xa3, 0x1c, 0x40, 0x3e, 0xd9, + 0xf5, 0xf5, 0xeb, 0xaa, 0xfa, 0x55, 0x95, 0x0d, 0xf7, 0xd2, 0x3c, 0x11, 0x84, 0x8b, 0x60, 0x48, + 0x68, 0xec, 0x8e, 0xf7, 0x5d, 0x25, 0xfb, 0x46, 0xe1, 0x8c, 0x32, 0x26, 0x18, 0xaa, 0xcd, 0x3b, + 0x39, 0xe3, 0xfd, 0xed, 0x46, 0xcc, 0x62, 0xa6, 0x6c, 0xae, 0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77, 0x6f, 0xeb, + 0x63, 0x2b, 0x35, 0xea, 0xd8, 0x1e, 0xde, 0x2e, 0xee, 0xd0, 0x5f, 0x4f, 0x5a, 0xa5, 0x4e, 0xef, + 0xd9, 0x45, 0xd3, 0x7a, 0x7e, 0xd1, 0xb4, 0xfe, 0xbc, 0x68, 0x5a, 0x8f, 0x2f, 0x9b, 0xa5, 0xe7, + 0x97, 0xcd, 0xd2, 0xaf, 0x97, 0xcd, 0xd2, 0x57, 0xef, 0xcf, 0xe5, 0x93, 0xe1, 0x20, 0x21, 0x4c, + 0xe0, 0x70, 0xa0, 0xff, 0xa7, 0xec, 0x15, 0xff, 0x17, 0xbe, 0x5b, 0x90, 0x55, 0x9a, 0xfd, 0xb2, + 0x6a, 0xf3, 0xbb, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd1, 0xd6, 0x5f, 0xfa, 0xe5, 0x08, 0x00, + 0x00, } func (m *MultiStakingCoin) Marshal() (dAtA []byte, err error) { @@ -787,6 +862,133 @@ func (m *MultiStakingCoinInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ValidatorInfo) 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 *ValidatorInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BondDenom) > 0 { + i -= len(m.BondDenom) + copy(dAtA[i:], m.BondDenom) + i = encodeVarintMultiStaking(dAtA, i, uint64(len(m.BondDenom))) + i-- + dAtA[i] = 0x62 + } + { + size := m.MinSelfDelegation.Size() + i -= size + if _, err := m.MinSelfDelegation.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMultiStaking(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + { + size, err := m.Commission.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMultiStaking(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UnbondingTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UnbondingTime):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintMultiStaking(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x4a + if m.UnbondingHeight != 0 { + i = encodeVarintMultiStaking(dAtA, i, uint64(m.UnbondingHeight)) + i-- + dAtA[i] = 0x40 + } + { + size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMultiStaking(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.DelegatorShares.Size() + i -= size + if _, err := m.DelegatorShares.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMultiStaking(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.Tokens.Size() + i -= size + if _, err := m.Tokens.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMultiStaking(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.Status != 0 { + i = encodeVarintMultiStaking(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x20 + } + if m.Jailed { + i-- + if m.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.ConsensusPubkey != nil { + { + size, err := m.ConsensusPubkey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMultiStaking(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorAddress) > 0 { + i -= len(m.OperatorAddress) + copy(dAtA[i:], m.OperatorAddress) + i = encodeVarintMultiStaking(dAtA, i, uint64(len(m.OperatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintMultiStaking(dAtA []byte, offset int, v uint64) int { offset -= sovMultiStaking(v) base := offset @@ -925,6 +1127,48 @@ func (m *MultiStakingCoinInfo) Size() (n int) { return n } +func (m *ValidatorInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAddress) + if l > 0 { + n += 1 + l + sovMultiStaking(uint64(l)) + } + if m.ConsensusPubkey != nil { + l = m.ConsensusPubkey.Size() + n += 1 + l + sovMultiStaking(uint64(l)) + } + if m.Jailed { + n += 2 + } + if m.Status != 0 { + n += 1 + sovMultiStaking(uint64(m.Status)) + } + l = m.Tokens.Size() + n += 1 + l + sovMultiStaking(uint64(l)) + l = m.DelegatorShares.Size() + n += 1 + l + sovMultiStaking(uint64(l)) + l = m.Description.Size() + n += 1 + l + sovMultiStaking(uint64(l)) + if m.UnbondingHeight != 0 { + n += 1 + sovMultiStaking(uint64(m.UnbondingHeight)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UnbondingTime) + n += 1 + l + sovMultiStaking(uint64(l)) + l = m.Commission.Size() + n += 1 + l + sovMultiStaking(uint64(l)) + l = m.MinSelfDelegation.Size() + n += 1 + l + sovMultiStaking(uint64(l)) + l = len(m.BondDenom) + if l > 0 { + n += 1 + l + sovMultiStaking(uint64(l)) + } + return n +} + func sovMultiStaking(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1874,6 +2118,415 @@ func (m *MultiStakingCoinInfo) Unmarshal(dAtA []byte) error { } return nil } +func (m *ValidatorInfo) 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 ErrIntOverflowMultiStaking + } + 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: ValidatorInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultiStaking + } + 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 ErrInvalidLengthMultiStaking + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMultiStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OperatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusPubkey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultiStaking + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMultiStaking + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMultiStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsensusPubkey == nil { + m.ConsensusPubkey = &types.Any{} + } + if err := m.ConsensusPubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultiStaking + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Jailed = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultiStaking + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= types1.BondStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultiStaking + } + 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 ErrInvalidLengthMultiStaking + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMultiStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Tokens.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorShares", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultiStaking + } + 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 ErrInvalidLengthMultiStaking + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMultiStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DelegatorShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultiStaking + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMultiStaking + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMultiStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingHeight", wireType) + } + m.UnbondingHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultiStaking + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnbondingHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultiStaking + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMultiStaking + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMultiStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UnbondingTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commission", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultiStaking + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMultiStaking + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMultiStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Commission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinSelfDelegation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultiStaking + } + 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 ErrInvalidLengthMultiStaking + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMultiStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinSelfDelegation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BondDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultiStaking + } + 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 ErrInvalidLengthMultiStaking + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMultiStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BondDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMultiStaking(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMultiStaking + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipMultiStaking(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/multi-staking/types/query.pb.go b/x/multi-staking/types/query.pb.go index 16de7be1..28d7af96 100644 --- a/x/multi-staking/types/query.pb.go +++ b/x/multi-staking/types/query.pb.go @@ -672,6 +672,198 @@ func (m *QueryValidatorMultiStakingCoinResponse) GetDenom() string { return "" } +type QueryValidatorsRequest struct { + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryValidatorsRequest) Reset() { *m = QueryValidatorsRequest{} } +func (m *QueryValidatorsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorsRequest) ProtoMessage() {} +func (*QueryValidatorsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_82d174b604da394d, []int{14} +} +func (m *QueryValidatorsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorsRequest.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 *QueryValidatorsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorsRequest.Merge(m, src) +} +func (m *QueryValidatorsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorsRequest proto.InternalMessageInfo + +func (m *QueryValidatorsRequest) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *QueryValidatorsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryValidatorsResponse struct { + Validators []ValidatorInfo `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryValidatorsResponse) Reset() { *m = QueryValidatorsResponse{} } +func (m *QueryValidatorsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorsResponse) ProtoMessage() {} +func (*QueryValidatorsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_82d174b604da394d, []int{15} +} +func (m *QueryValidatorsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorsResponse.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 *QueryValidatorsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorsResponse.Merge(m, src) +} +func (m *QueryValidatorsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorsResponse proto.InternalMessageInfo + +func (m *QueryValidatorsResponse) GetValidators() []ValidatorInfo { + if m != nil { + return m.Validators + } + return nil +} + +func (m *QueryValidatorsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryValidatorRequest struct { + ValidatorAddr string `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3" json:"validator_addr,omitempty"` +} + +func (m *QueryValidatorRequest) Reset() { *m = QueryValidatorRequest{} } +func (m *QueryValidatorRequest) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorRequest) ProtoMessage() {} +func (*QueryValidatorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_82d174b604da394d, []int{16} +} +func (m *QueryValidatorRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorRequest.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 *QueryValidatorRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorRequest.Merge(m, src) +} +func (m *QueryValidatorRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorRequest proto.InternalMessageInfo + +func (m *QueryValidatorRequest) GetValidatorAddr() string { + if m != nil { + return m.ValidatorAddr + } + return "" +} + +type QueryValidatorResponse struct { + Validator ValidatorInfo `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator"` +} + +func (m *QueryValidatorResponse) Reset() { *m = QueryValidatorResponse{} } +func (m *QueryValidatorResponse) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorResponse) ProtoMessage() {} +func (*QueryValidatorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_82d174b604da394d, []int{17} +} +func (m *QueryValidatorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorResponse.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 *QueryValidatorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorResponse.Merge(m, src) +} +func (m *QueryValidatorResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorResponse proto.InternalMessageInfo + +func (m *QueryValidatorResponse) GetValidator() ValidatorInfo { + if m != nil { + return m.Validator + } + return ValidatorInfo{} +} + func init() { proto.RegisterType((*QueryMultiStakingLocksRequest)(nil), "multistaking.v1.QueryMultiStakingLocksRequest") proto.RegisterType((*QueryMultiStakingLocksResponse)(nil), "multistaking.v1.QueryMultiStakingLocksResponse") @@ -687,70 +879,82 @@ func init() { proto.RegisterType((*QueryBondWeightResponse)(nil), "multistaking.v1.QueryBondWeightResponse") proto.RegisterType((*QueryValidatorMultiStakingCoinRequest)(nil), "multistaking.v1.QueryValidatorMultiStakingCoinRequest") proto.RegisterType((*QueryValidatorMultiStakingCoinResponse)(nil), "multistaking.v1.QueryValidatorMultiStakingCoinResponse") + proto.RegisterType((*QueryValidatorsRequest)(nil), "multistaking.v1.QueryValidatorsRequest") + proto.RegisterType((*QueryValidatorsResponse)(nil), "multistaking.v1.QueryValidatorsResponse") + proto.RegisterType((*QueryValidatorRequest)(nil), "multistaking.v1.QueryValidatorRequest") + proto.RegisterType((*QueryValidatorResponse)(nil), "multistaking.v1.QueryValidatorResponse") } func init() { proto.RegisterFile("multistaking/v1/query.proto", fileDescriptor_82d174b604da394d) } var fileDescriptor_82d174b604da394d = []byte{ - // 927 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0xce, 0x14, 0x52, 0x96, 0xb7, 0x02, 0x76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3, 0xc2, 0x7a, - 0x3c, 0x6f, 0x4d, 0x1f, 0x20, 0x69, 0xae, 0x73, 0x9a, 0x1f, 0xe2, 0xb5, 0x78, 0x9a, 0xb3, 0x94, - 0xfe, 0x0f, 0x04, 0xd7, 0x26, 0x7e, 0x2b, 0xf8, 0xe5, 0x70, 0x9a, 0x71, 0x1f, 0x74, 0xfa, 0xce, - 0xcc, 0x71, 0x52, 0xe5, 0x7d, 0xae, 0xf2, 0x1e, 0xbe, 0x1b, 0xa5, 0x72, 0xa0, 0xae, 0x54, 0x67, - 0x86, 0xe9, 0x57, 0xdb, 0xc7, 0x3f, 0x23, 0x78, 0x2a, 0xb4, 0xaf, 0xe3, 0x4a, 0x7c, 0xd9, 0xfd, - 0x23, 0x27, 0x7d, 0x7b, 0xa6, 0x18, 0xa9, 0x43, 0xe1, 0x3a, 0x8a, 0xb8, 0x10, 0xa5, 0xc3, 0x65, - 0x5f, 0x12, 0xb3, 0x62, 0x0f, 0x01, 0x0c, 0xbb, 0x35, 0xbe, 0x11, 0x8e, 0x19, 0x18, 0x00, 0xe9, - 0x62, 0xfc, 0x45, 0xc9, 0xa8, 0xc2, 0x19, 0xbd, 0x88, 0x6f, 0x46, 0x31, 0x12, 0xed, 0x9c, 0xec, - 0xf2, 0x5e, 0xd8, 0x5f, 0xa9, 0x1e, 0x9e, 0x66, 0xd0, 0xd1, 0x69, 0x06, 0xfd, 0x73, 0x9a, 0x41, - 0xdf, 0x9d, 0x65, 0x12, 0x47, 0x67, 0x99, 0xc4, 0x5f, 0x67, 0x99, 0xc4, 0xe7, 0xaf, 0x8c, 0x8c, - 0x0b, 0x7f, 0xbe, 0x92, 0x97, 0xf0, 0x4b, 0xdf, 0x9a, 0x4f, 0x91, 0xda, 0x3c, 0xff, 0xb7, 0xe3, - 0xf6, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x36, 0x36, 0xc3, 0x46, 0x0d, 0x00, 0x00, + // 1056 bytes of a gzipped FileDescriptorPro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0x4d, 0xf2, 0x58, 0xa4, 0xe5, 0x71, + 0x3c, 0x3c, 0xf4, 0x15, 0x75, 0x11, 0xb8, 0x41, 0x00, 0xfa, 0xa3, 0x98, 0x2e, 0x8c, 0xee, 0x19, + 0x99, 0xee, 0xf9, 0xc5, 0xe4, 0x40, 0x44, 0x54, 0x93, 0x88, 0x9e, 0xa3, 0xa7, 0xc7, 0x21, 0x52, + 0xb3, 0x5a, 0xdf, 0x96, 0x83, 0x6e, 0x87, 0x7e, 0x49, 0x00, 0xfa, 0xa3, 0x26, 0x0e, 0x55, 0x64, + 0x0e, 0xc6, 0xa1, 0x8a, 0x4e, 0xad, 0x74, 0x3a, 0x0d, 0xcc, 0xa7, 0xaf, 0x09, 0x4c, 0x05, 0x65, + 0x68, 0x39, 0xa1, 0x8f, 0x8f, 0x67, 0x21, 0x31, 0x0e, 0xe1, 0x5c, 0x94, 0x70, 0xce, 0xd1, 0xa5, + 0x74, 0x70, 0x22, 0xd6, 0xab, 0xaf, 0xde, 0xde, 0x2d, 0x90, 0x3b, 0xbb, 0x05, 0xf2, 0xf7, 0x6e, + 0x81, 0x7c, 0xb5, 0x57, 0xc8, 0xdc, 0xd9, 0x2b, 0x64, 0xfe, 0xdc, 0x2b, 0x64, 0x3e, 0x3e, 0x37, + 0x70, 0x7b, 0x0a, 0x17, 0xaf, 0xf8, 0xd5, 0xaf, 0x85, 0xd6, 0xf2, 0x52, 0xb5, 0x3e, 0x29, 0x7f, + 0x85, 0x9f, 0xfd, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x95, 0xf3, 0x19, 0xc5, 0x55, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -772,6 +976,8 @@ type QueryClient interface { ValidatorMultiStakingCoin(ctx context.Context, in *QueryValidatorMultiStakingCoinRequest, opts ...grpc.CallOption) (*QueryValidatorMultiStakingCoinResponse, error) MultiStakingCoinInfos(ctx context.Context, in *QueryMultiStakingCoinInfosRequest, opts ...grpc.CallOption) (*QueryMultiStakingCoinInfosResponse, error) BondWeight(ctx context.Context, in *QueryBondWeightRequest, opts ...grpc.CallOption) (*QueryBondWeightResponse, error) + Validators(ctx context.Context, in *QueryValidatorsRequest, opts ...grpc.CallOption) (*QueryValidatorsResponse, error) + Validator(ctx context.Context, in *QueryValidatorRequest, opts ...grpc.CallOption) (*QueryValidatorResponse, error) } type queryClient struct { @@ -845,6 +1051,24 @@ func (c *queryClient) BondWeight(ctx context.Context, in *QueryBondWeightRequest return out, nil } +func (c *queryClient) Validators(ctx context.Context, in *QueryValidatorsRequest, opts ...grpc.CallOption) (*QueryValidatorsResponse, error) { + out := new(QueryValidatorsResponse) + err := c.cc.Invoke(ctx, "/multistaking.v1.Query/Validators", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Validator(ctx context.Context, in *QueryValidatorRequest, opts ...grpc.CallOption) (*QueryValidatorResponse, error) { + out := new(QueryValidatorResponse) + err := c.cc.Invoke(ctx, "/multistaking.v1.Query/Validator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { MultiStakingLocks(context.Context, *QueryMultiStakingLocksRequest) (*QueryMultiStakingLocksResponse, error) @@ -854,6 +1078,8 @@ type QueryServer interface { ValidatorMultiStakingCoin(context.Context, *QueryValidatorMultiStakingCoinRequest) (*QueryValidatorMultiStakingCoinResponse, error) MultiStakingCoinInfos(context.Context, *QueryMultiStakingCoinInfosRequest) (*QueryMultiStakingCoinInfosResponse, error) BondWeight(context.Context, *QueryBondWeightRequest) (*QueryBondWeightResponse, error) + Validators(context.Context, *QueryValidatorsRequest) (*QueryValidatorsResponse, error) + Validator(context.Context, *QueryValidatorRequest) (*QueryValidatorResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -881,6 +1107,12 @@ func (*UnimplementedQueryServer) MultiStakingCoinInfos(ctx context.Context, req func (*UnimplementedQueryServer) BondWeight(ctx context.Context, req *QueryBondWeightRequest) (*QueryBondWeightResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BondWeight not implemented") } +func (*UnimplementedQueryServer) Validators(ctx context.Context, req *QueryValidatorsRequest) (*QueryValidatorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Validators not implemented") +} +func (*UnimplementedQueryServer) Validator(ctx context.Context, req *QueryValidatorRequest) (*QueryValidatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Validator not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1012,6 +1244,42 @@ func _Query_BondWeight_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Query_Validators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Validators(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/multistaking.v1.Query/Validators", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Validators(ctx, req.(*QueryValidatorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Validator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Validator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/multistaking.v1.Query/Validator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Validator(ctx, req.(*QueryValidatorRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "multistaking.v1.Query", HandlerType: (*QueryServer)(nil), @@ -1044,6 +1312,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "BondWeight", Handler: _Query_BondWeight_Handler, }, + { + MethodName: "Validators", + Handler: _Query_Validators_Handler, + }, + { + MethodName: "Validator", + Handler: _Query_Validator_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "multistaking/v1/query.proto", @@ -1598,85 +1874,239 @@ func (m *QueryValidatorMultiStakingCoinResponse) MarshalToSizedBuffer(dAtA []byt return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *QueryValidatorsRequest) 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 *QueryMultiStakingLocksRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + +func (m *QueryValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryMultiStakingLocksResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Locks) > 0 { - for _, e := range m.Locks { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryMultiStakingLockRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MultiStakerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryValidatorsResponse) 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 n + return dAtA[:n], nil } -func (m *QueryMultiStakingLockResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Lock != nil { - l = m.Lock.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.Found { - n += 2 - } - return n +func (m *QueryValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryMultiStakingUnlocksRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorRequest) 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 *QueryValidatorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorAddr) > 0 { + i -= len(m.ValidatorAddr) + copy(dAtA[i:], m.ValidatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorResponse) 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 *QueryValidatorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryMultiStakingLocksRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryMultiStakingLocksResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Locks) > 0 { + for _, e := range m.Locks { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryMultiStakingLockRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MultiStakerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryMultiStakingLockResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Lock != nil { + l = m.Lock.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Found { + n += 2 + } + return n +} + +func (m *QueryMultiStakingUnlocksRequest) Size() (n int) { + if m == nil { + return 0 } var l int _ = l @@ -1824,6 +2254,66 @@ func (m *QueryValidatorMultiStakingCoinResponse) Size() (n int) { return n } +func (m *QueryValidatorsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Status) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryValidatorsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Validators) > 0 { + for _, e := range m.Validators { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryValidatorRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryValidatorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Validator.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3238,6 +3728,409 @@ func (m *QueryValidatorMultiStakingCoinResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryValidatorsRequest) 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 ErrIntOverflowQuery + } + 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: QueryValidatorsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorsResponse) 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 ErrIntOverflowQuery + } + 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: QueryValidatorsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validators = append(m.Validators, ValidatorInfo{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorRequest) 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 ErrIntOverflowQuery + } + 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: QueryValidatorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorResponse) 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 ErrIntOverflowQuery + } + 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: QueryValidatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/multi-staking/types/query.pb.gw.go b/x/multi-staking/types/query.pb.gw.go index 1031051f..526084e3 100644 --- a/x/multi-staking/types/query.pb.gw.go +++ b/x/multi-staking/types/query.pb.gw.go @@ -401,6 +401,96 @@ func local_request_Query_BondWeight_0(ctx context.Context, marshaler runtime.Mar } +var ( + filter_Query_Validators_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Validators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Validators_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Validators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Validators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Validators_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Validators(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Validator_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator_addr"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_addr") + } + + protoReq.ValidatorAddr, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_addr", err) + } + + msg, err := client.Validator(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Validator_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator_addr"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_addr") + } + + protoReq.ValidatorAddr, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_addr", err) + } + + msg, err := server.Validator(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -568,6 +658,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Validators_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Validators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Validator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Validator_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Validator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -749,6 +885,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Validators_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Validators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Validator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Validator_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Validator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -766,6 +942,10 @@ var ( pattern_Query_MultiStakingCoinInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"realiotech", "multistaking", "v1", "coin-infos"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_BondWeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"realiotech", "multistaking", "v1", "weight", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Validators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"realiotech", "multistaking", "v1", "validators"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Validator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"realiotech", "multistaking", "v1", "validators", "validator_addr"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -782,4 +962,8 @@ var ( forward_Query_MultiStakingCoinInfos_0 = runtime.ForwardResponseMessage forward_Query_BondWeight_0 = runtime.ForwardResponseMessage + + forward_Query_Validators_0 = runtime.ForwardResponseMessage + + forward_Query_Validator_0 = runtime.ForwardResponseMessage ) diff --git a/x/multi-staking/types/validator.go b/x/multi-staking/types/validator.go new file mode 100644 index 00000000..f4f1c403 --- /dev/null +++ b/x/multi-staking/types/validator.go @@ -0,0 +1,22 @@ +package types + +import ( + "sigs.k8s.io/yaml" + + "github.com/cosmos/cosmos-sdk/codec" +) + +// String implements the Stringer interface for a Validator object. +func (v ValidatorInfo) String() string { + bz, err := codec.ProtoMarshalJSON(&v, nil) + if err != nil { + panic(err) + } + + out, err := yaml.JSONToYAML(bz) + if err != nil { + panic(err) + } + + return string(out) +}