From cd380478855bf40ed84503aab63dd19d89f4d48c Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 22 Mar 2024 14:29:22 +0100 Subject: [PATCH] feat: reards auction proto --- proto/umee/auction/v1/auction.proto | 15 + proto/umee/auction/v1/genesis.proto | 19 + proto/umee/auction/v1/query.proto | 40 ++ proto/umee/auction/v1/tx.proto | 49 ++ proto/umee/ugov/v1/tx.proto | 2 +- x/auction/auction.pb.go | 327 +++++++++ x/auction/genesis.pb.go | 450 ++++++++++++ x/auction/query.pb.go | 1005 ++++++++++++++++++++++++++ x/auction/query.pb.gw.go | 254 +++++++ x/auction/tx.pb.go | 1007 +++++++++++++++++++++++++++ 10 files changed, 3167 insertions(+), 1 deletion(-) create mode 100644 proto/umee/auction/v1/auction.proto create mode 100644 proto/umee/auction/v1/genesis.proto create mode 100644 proto/umee/auction/v1/query.proto create mode 100644 proto/umee/auction/v1/tx.proto create mode 100644 x/auction/auction.pb.go create mode 100644 x/auction/genesis.pb.go create mode 100644 x/auction/query.pb.go create mode 100644 x/auction/query.pb.gw.go create mode 100644 x/auction/tx.pb.go diff --git a/proto/umee/auction/v1/auction.proto b/proto/umee/auction/v1/auction.proto new file mode 100644 index 0000000000..fd193320fe --- /dev/null +++ b/proto/umee/auction/v1/auction.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package umee.auction.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/umee-network/umee/v6/x/auction"; +option (gogoproto.goproto_getters_all) = false; + +// RewardsParams defines parameters for the rewards auction. +message RewardsParams { + // auction_duration is duration in seconds. + int64 auction_duration = 1; + // min_bid_increment (nominal) in the base denom for each consequitive bid. + int64 min_bid_increment = 2; +} diff --git a/proto/umee/auction/v1/genesis.proto b/proto/umee/auction/v1/genesis.proto new file mode 100644 index 0000000000..2e0eccac60 --- /dev/null +++ b/proto/umee/auction/v1/genesis.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package umee.auction.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "umee/auction/v1/auction.proto"; + +option go_package = "github.com/umee-network/umee/v6/x/auction"; + +option (gogoproto.goproto_getters_all) = false; +// option (gogoproto.equal_all) = false; + +// GenesisState defines the x/auction module's genesis state. +message GenesisState { + RewardsParams rewards_params = 1 [(gogoproto.nullable) = false]; + uint64 reward_round = 2; + string highest_bidder = 3; + repeated cosmos.base.v1beta1.Coin reward_tokens = 4 [(gogoproto.nullable) = false]; +} diff --git a/proto/umee/auction/v1/query.proto b/proto/umee/auction/v1/query.proto new file mode 100644 index 0000000000..76cdded4b6 --- /dev/null +++ b/proto/umee/auction/v1/query.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package umee.auction.v1; + +import "google/api/annotations.proto"; +import "gogoproto/gogo.proto"; +import "umee/auction/v1/auction.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/umee-network/umee/v6/x/auction"; + +// Query defines the gRPC querier service. +service Query { + // RewardParams queries parameters for the reward auciton. + rpc RewardParams(QueryRewardParams) returns (QueryRewardParamsResp) { + option (google.api.http).get = "/umee/auction/v1/rewards/params"; + } + // RewardAuction queries the information of the auction by ID. If ID is ommitted, returns + // current reward auction params. + rpc RewardAuction(QueryRewardAuction) returns (QueryRewardAuctionResp) { + option (google.api.http).get = "/umee/auction/v1/rewards/{id}"; + } +} + +message QueryRewardParams {} + +message QueryRewardParamsResp { + RewardsParams params = 1 [(gogoproto.nullable) = false]; +} + +message QueryRewardAuction { + // If zero or not present, the current auction is returned + uint32 id = 1; +} + +message QueryRewardAuctionResp { + uint32 id = 1; + // highest bidder + string bidder = 2; + repeated cosmos.base.v1beta1.Coin rewards = 3 [(gogoproto.nullable) = false]; +} diff --git a/proto/umee/auction/v1/tx.proto b/proto/umee/auction/v1/tx.proto new file mode 100644 index 0000000000..f5023016fa --- /dev/null +++ b/proto/umee/auction/v1/tx.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; +package umee.auction.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "gogoproto/gogo.proto"; +import "umee/auction/v1/auction.proto"; + +option go_package = "github.com/umee-network/umee/v6/x/auction"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the x/auction module's Msg service. +service Msg { + // + // Rewards auction: bid umee for protocol rewards + // + + rpc GovSetRewardsParams(MsgGovSetRewardsParams) returns (MsgGovSetRewardsParamsResp); + rpc RewardsBid(MsgRewardsBid) returns (MsgRewardsBidResp); +} + +// MsgGovSetRewardsParams updates rewards parameters. +message MsgGovSetRewardsParams { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "authority"; + + // authority must be the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + RewardsParams params = 2 [(gogoproto.nullable) = false]; +} + +// MsgGovSetRewardsParamsResp defines the Msg/GovSetRewardsParams response type. +message MsgGovSetRewardsParamsResp {} + +// MsgRewardsBid places a bid for a reword auction. +message MsgRewardsBid { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + string sender = 1; + // amount of the bid in the base tokens + cosmos.base.v1beta1.Coin bid_amount = 2 [(gogoproto.nullable) = false]; + // the current auction ID being bid on. Fails if the ID is not an ID of the current auction. + uint32 id = 3; +} + +// MsgRewardsBidResp response type for Msg/RewardsBid +message MsgRewardsBidResp {} diff --git a/proto/umee/ugov/v1/tx.proto b/proto/umee/ugov/v1/tx.proto index 519d1e4203..3a669fd7d3 100644 --- a/proto/umee/ugov/v1/tx.proto +++ b/proto/umee/ugov/v1/tx.proto @@ -58,4 +58,4 @@ message MsgGovUpdateInflationParams { } // GovUpdateInflationParamsResponse response type. -message GovUpdateInflationParamsResponse {} \ No newline at end of file +message GovUpdateInflationParamsResponse {} diff --git a/x/auction/auction.pb.go b/x/auction/auction.pb.go new file mode 100644 index 0000000000..e1a635970a --- /dev/null +++ b/x/auction/auction.pb.go @@ -0,0 +1,327 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: umee/auction/v1/auction.proto + +package auction + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// RewardsParams defines parameters for the rewards auction. +type RewardsParams struct { + // auction_duration is duration in seconds. + AuctionDuration int64 `protobuf:"varint,1,opt,name=auction_duration,json=auctionDuration,proto3" json:"auction_duration,omitempty"` + // min_bid_increment (nominal) in the base denom for each consequitive bid. + MinBidIncrement int64 `protobuf:"varint,2,opt,name=min_bid_increment,json=minBidIncrement,proto3" json:"min_bid_increment,omitempty"` +} + +func (m *RewardsParams) Reset() { *m = RewardsParams{} } +func (m *RewardsParams) String() string { return proto.CompactTextString(m) } +func (*RewardsParams) ProtoMessage() {} +func (*RewardsParams) Descriptor() ([]byte, []int) { + return fileDescriptor_7a7eec280427e7e3, []int{0} +} +func (m *RewardsParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RewardsParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RewardsParams.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 *RewardsParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_RewardsParams.Merge(m, src) +} +func (m *RewardsParams) XXX_Size() int { + return m.Size() +} +func (m *RewardsParams) XXX_DiscardUnknown() { + xxx_messageInfo_RewardsParams.DiscardUnknown(m) +} + +var xxx_messageInfo_RewardsParams proto.InternalMessageInfo + +func init() { + proto.RegisterType((*RewardsParams)(nil), "umee.auction.v1.RewardsParams") +} + +func init() { proto.RegisterFile("umee/auction/v1/auction.proto", fileDescriptor_7a7eec280427e7e3) } + +var fileDescriptor_7a7eec280427e7e3 = []byte{ + // 216 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xcd, 0x4d, 0x4d, + 0xd5, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0x33, 0x84, 0x31, 0xf5, 0x0a, 0x8a, + 0xf2, 0x4b, 0xf2, 0x85, 0xf8, 0x41, 0xd2, 0x7a, 0x30, 0xb1, 0x32, 0x43, 0x29, 0x91, 0xf4, 0xfc, + 0xf4, 0x7c, 0xb0, 0x9c, 0x3e, 0x88, 0x05, 0x51, 0xa6, 0x94, 0xc6, 0xc5, 0x1b, 0x94, 0x5a, 0x9e, + 0x58, 0x94, 0x52, 0x1c, 0x90, 0x58, 0x94, 0x98, 0x5b, 0x2c, 0xa4, 0xc9, 0x25, 0x00, 0xd5, 0x14, + 0x9f, 0x52, 0x5a, 0x94, 0x08, 0x62, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0xf1, 0x43, 0xc5, + 0x5d, 0xa0, 0xc2, 0x42, 0x5a, 0x5c, 0x82, 0xb9, 0x99, 0x79, 0xf1, 0x49, 0x99, 0x29, 0xf1, 0x99, + 0x79, 0xc9, 0x45, 0xa9, 0xb9, 0xa9, 0x79, 0x25, 0x12, 0x4c, 0x10, 0xb5, 0xb9, 0x99, 0x79, 0x4e, + 0x99, 0x29, 0x9e, 0x30, 0x61, 0x27, 0xf7, 0x13, 0x0f, 0xe5, 0x18, 0x4e, 0x3c, 0x92, 0x63, 0xbc, + 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, + 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x33, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, + 0x57, 0x1f, 0xe4, 0x6e, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x30, 0x47, 0xbf, 0xcc, + 0x4c, 0xbf, 0x02, 0xe6, 0xbb, 0x24, 0x36, 0xb0, 0xbb, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x26, 0xc1, 0xf4, 0x0e, 0xff, 0x00, 0x00, 0x00, +} + +func (m *RewardsParams) 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 *RewardsParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RewardsParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MinBidIncrement != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.MinBidIncrement)) + i-- + dAtA[i] = 0x10 + } + if m.AuctionDuration != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionDuration)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { + offset -= sovAuction(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RewardsParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionDuration != 0 { + n += 1 + sovAuction(uint64(m.AuctionDuration)) + } + if m.MinBidIncrement != 0 { + n += 1 + sovAuction(uint64(m.MinBidIncrement)) + } + return n +} + +func sovAuction(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAuction(x uint64) (n int) { + return sovAuction(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RewardsParams) 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 ErrIntOverflowAuction + } + 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: RewardsParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RewardsParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionDuration", wireType) + } + m.AuctionDuration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionDuration |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinBidIncrement", wireType) + } + m.MinBidIncrement = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinBidIncrement |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAuction(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAuction + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAuction + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAuction + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAuction + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAuction + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAuction + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAuction = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAuction = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAuction = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/auction/genesis.pb.go b/x/auction/genesis.pb.go new file mode 100644 index 0000000000..f6b51b2d6e --- /dev/null +++ b/x/auction/genesis.pb.go @@ -0,0 +1,450 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: umee/auction/v1/genesis.proto + +package auction + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the x/auction module's genesis state. +type GenesisState struct { + RewardsParams RewardsParams `protobuf:"bytes,1,opt,name=rewards_params,json=rewardsParams,proto3" json:"rewards_params"` + RewardRound uint64 `protobuf:"varint,2,opt,name=reward_round,json=rewardRound,proto3" json:"reward_round,omitempty"` + HighestBidder string `protobuf:"bytes,3,opt,name=highest_bidder,json=highestBidder,proto3" json:"highest_bidder,omitempty"` + RewardTokens []types.Coin `protobuf:"bytes,4,rep,name=reward_tokens,json=rewardTokens,proto3" json:"reward_tokens"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_15e83c50dcf6ac7b, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func init() { + proto.RegisterType((*GenesisState)(nil), "umee.auction.v1.GenesisState") +} + +func init() { proto.RegisterFile("umee/auction/v1/genesis.proto", fileDescriptor_15e83c50dcf6ac7b) } + +var fileDescriptor_15e83c50dcf6ac7b = []byte{ + // 330 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xcf, 0x4a, 0xf4, 0x30, + 0x14, 0xc5, 0x9b, 0x6f, 0x86, 0x0f, 0xec, 0xfc, 0x11, 0x8a, 0x8b, 0x3a, 0x60, 0xac, 0x82, 0x50, + 0x17, 0x26, 0x74, 0x04, 0x1f, 0x60, 0x14, 0x66, 0xe1, 0x46, 0xaa, 0x2b, 0x37, 0x25, 0x6d, 0x43, + 0x27, 0x0c, 0x4d, 0x86, 0x24, 0xed, 0xf8, 0x18, 0x3e, 0xd6, 0x2c, 0x67, 0xe9, 0x4a, 0x74, 0xba, + 0xf4, 0x25, 0xa4, 0x69, 0x06, 0x44, 0x77, 0x37, 0xbf, 0x73, 0xef, 0x3d, 0x37, 0xc7, 0x3d, 0xa9, + 0x4a, 0x4a, 0x31, 0xa9, 0x32, 0xcd, 0x04, 0xc7, 0x75, 0x84, 0x0b, 0xca, 0xa9, 0x62, 0x0a, 0xad, + 0xa4, 0xd0, 0xc2, 0x3b, 0x6c, 0x65, 0x64, 0x65, 0x54, 0x47, 0x13, 0x98, 0x09, 0x55, 0x0a, 0x85, + 0x53, 0xa2, 0x28, 0xae, 0xa3, 0x94, 0x6a, 0x12, 0xe1, 0x4c, 0x30, 0xde, 0x0d, 0x4c, 0x8e, 0x0a, + 0x51, 0x08, 0x53, 0xe2, 0xb6, 0xb2, 0xf4, 0x8f, 0xcb, 0x7e, 0xa3, 0x91, 0xcf, 0xbf, 0x80, 0x3b, + 0x9c, 0x77, 0xbe, 0x8f, 0x9a, 0x68, 0xea, 0xdd, 0xbb, 0x63, 0x49, 0xd7, 0x44, 0xe6, 0x2a, 0x59, + 0x11, 0x49, 0x4a, 0xe5, 0x83, 0x00, 0x84, 0x83, 0x29, 0x44, 0xbf, 0xee, 0x41, 0x71, 0xd7, 0xf6, + 0x60, 0xba, 0x66, 0xfd, 0xcd, 0xfb, 0xa9, 0x13, 0x8f, 0xe4, 0x4f, 0xe8, 0x9d, 0xb9, 0xc3, 0x0e, + 0x24, 0x52, 0x54, 0x3c, 0xf7, 0xff, 0x05, 0x20, 0xec, 0xc7, 0x83, 0x8e, 0xc5, 0x2d, 0xf2, 0x2e, + 0xdc, 0xf1, 0x82, 0x15, 0x0b, 0xaa, 0x74, 0x92, 0xb2, 0x3c, 0xa7, 0xd2, 0xef, 0x05, 0x20, 0x3c, + 0x88, 0x47, 0x96, 0xce, 0x0c, 0xf4, 0xee, 0x5c, 0xbb, 0x3a, 0xd1, 0x62, 0x49, 0xb9, 0xf2, 0xfb, + 0x41, 0x2f, 0x1c, 0x4c, 0x8f, 0x51, 0x17, 0x0a, 0x6a, 0x43, 0x41, 0x36, 0x14, 0x74, 0x2b, 0x18, + 0xb7, 0x07, 0x59, 0xff, 0x27, 0x33, 0x34, 0x9b, 0x6f, 0x3e, 0xa1, 0xb3, 0xd9, 0x41, 0xb0, 0xdd, + 0x41, 0xf0, 0xb1, 0x83, 0xe0, 0xb5, 0x81, 0xce, 0xb6, 0x81, 0xce, 0x5b, 0x03, 0x9d, 0xe7, 0xcb, + 0x82, 0xe9, 0x45, 0x95, 0xa2, 0x4c, 0x94, 0xb8, 0xfd, 0xec, 0x15, 0xa7, 0x7a, 0x2d, 0xe4, 0xd2, + 0x3c, 0x70, 0x7d, 0x83, 0x5f, 0xf6, 0xe1, 0xa5, 0xff, 0x4d, 0x7a, 0xd7, 0xdf, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x4d, 0x7d, 0x55, 0xa3, 0xc4, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RewardTokens) > 0 { + for iNdEx := len(m.RewardTokens) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RewardTokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.HighestBidder) > 0 { + i -= len(m.HighestBidder) + copy(dAtA[i:], m.HighestBidder) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.HighestBidder))) + i-- + dAtA[i] = 0x1a + } + if m.RewardRound != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.RewardRound)) + i-- + dAtA[i] = 0x10 + } + { + size, err := m.RewardsParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.RewardsParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + if m.RewardRound != 0 { + n += 1 + sovGenesis(uint64(m.RewardRound)) + } + l = len(m.HighestBidder) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.RewardTokens) > 0 { + for _, e := range m.RewardTokens { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardsParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardsParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardRound", wireType) + } + m.RewardRound = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RewardRound |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HighestBidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HighestBidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardTokens", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardTokens = append(m.RewardTokens, types.Coin{}) + if err := m.RewardTokens[len(m.RewardTokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/auction/query.pb.go b/x/auction/query.pb.go new file mode 100644 index 0000000000..66a8bdb71f --- /dev/null +++ b/x/auction/query.pb.go @@ -0,0 +1,1005 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: umee/auction/v1/query.proto + +package auction + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type QueryRewardParams struct { +} + +func (m *QueryRewardParams) Reset() { *m = QueryRewardParams{} } +func (m *QueryRewardParams) String() string { return proto.CompactTextString(m) } +func (*QueryRewardParams) ProtoMessage() {} +func (*QueryRewardParams) Descriptor() ([]byte, []int) { + return fileDescriptor_e1df854d377e58e5, []int{0} +} +func (m *QueryRewardParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRewardParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRewardParams.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 *QueryRewardParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRewardParams.Merge(m, src) +} +func (m *QueryRewardParams) XXX_Size() int { + return m.Size() +} +func (m *QueryRewardParams) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRewardParams.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRewardParams proto.InternalMessageInfo + +type QueryRewardParamsResp struct { + Params RewardsParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryRewardParamsResp) Reset() { *m = QueryRewardParamsResp{} } +func (m *QueryRewardParamsResp) String() string { return proto.CompactTextString(m) } +func (*QueryRewardParamsResp) ProtoMessage() {} +func (*QueryRewardParamsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_e1df854d377e58e5, []int{1} +} +func (m *QueryRewardParamsResp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRewardParamsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRewardParamsResp.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 *QueryRewardParamsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRewardParamsResp.Merge(m, src) +} +func (m *QueryRewardParamsResp) XXX_Size() int { + return m.Size() +} +func (m *QueryRewardParamsResp) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRewardParamsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRewardParamsResp proto.InternalMessageInfo + +func (m *QueryRewardParamsResp) GetParams() RewardsParams { + if m != nil { + return m.Params + } + return RewardsParams{} +} + +type QueryRewardAuction struct { + // If zero or not present, the current auction is returned + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryRewardAuction) Reset() { *m = QueryRewardAuction{} } +func (m *QueryRewardAuction) String() string { return proto.CompactTextString(m) } +func (*QueryRewardAuction) ProtoMessage() {} +func (*QueryRewardAuction) Descriptor() ([]byte, []int) { + return fileDescriptor_e1df854d377e58e5, []int{2} +} +func (m *QueryRewardAuction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRewardAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRewardAuction.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 *QueryRewardAuction) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRewardAuction.Merge(m, src) +} +func (m *QueryRewardAuction) XXX_Size() int { + return m.Size() +} +func (m *QueryRewardAuction) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRewardAuction.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRewardAuction proto.InternalMessageInfo + +func (m *QueryRewardAuction) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +type QueryRewardAuctionResp struct { + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // highest bidder + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + Rewards []types.Coin `protobuf:"bytes,3,rep,name=rewards,proto3" json:"rewards"` +} + +func (m *QueryRewardAuctionResp) Reset() { *m = QueryRewardAuctionResp{} } +func (m *QueryRewardAuctionResp) String() string { return proto.CompactTextString(m) } +func (*QueryRewardAuctionResp) ProtoMessage() {} +func (*QueryRewardAuctionResp) Descriptor() ([]byte, []int) { + return fileDescriptor_e1df854d377e58e5, []int{3} +} +func (m *QueryRewardAuctionResp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRewardAuctionResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRewardAuctionResp.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 *QueryRewardAuctionResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRewardAuctionResp.Merge(m, src) +} +func (m *QueryRewardAuctionResp) XXX_Size() int { + return m.Size() +} +func (m *QueryRewardAuctionResp) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRewardAuctionResp.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRewardAuctionResp proto.InternalMessageInfo + +func (m *QueryRewardAuctionResp) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *QueryRewardAuctionResp) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *QueryRewardAuctionResp) GetRewards() []types.Coin { + if m != nil { + return m.Rewards + } + return nil +} + +func init() { + proto.RegisterType((*QueryRewardParams)(nil), "umee.auction.v1.QueryRewardParams") + proto.RegisterType((*QueryRewardParamsResp)(nil), "umee.auction.v1.QueryRewardParamsResp") + proto.RegisterType((*QueryRewardAuction)(nil), "umee.auction.v1.QueryRewardAuction") + proto.RegisterType((*QueryRewardAuctionResp)(nil), "umee.auction.v1.QueryRewardAuctionResp") +} + +func init() { proto.RegisterFile("umee/auction/v1/query.proto", fileDescriptor_e1df854d377e58e5) } + +var fileDescriptor_e1df854d377e58e5 = []byte{ + // 417 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcb, 0xae, 0xd3, 0x30, + 0x14, 0x8c, 0x73, 0xa1, 0x08, 0x5f, 0x2e, 0x08, 0x03, 0x55, 0x09, 0xd4, 0x2d, 0xe1, 0xd1, 0xb2, + 0xc0, 0x56, 0x8a, 0x84, 0x84, 0xc4, 0x86, 0xf6, 0x07, 0x20, 0x12, 0x1b, 0x76, 0x4e, 0x62, 0x05, + 0x0b, 0x12, 0x87, 0xbc, 0x0a, 0xaa, 0xd8, 0x00, 0x1f, 0x80, 0x04, 0x1f, 0xd5, 0x65, 0x25, 0x36, + 0xac, 0x10, 0x6a, 0xf9, 0x10, 0x14, 0xdb, 0x95, 0x4a, 0x22, 0x1e, 0x3b, 0xdb, 0x33, 0x67, 0xce, + 0xcc, 0x24, 0xf0, 0x5a, 0x95, 0x70, 0x4e, 0x59, 0x15, 0x96, 0x42, 0xa6, 0xb4, 0xf6, 0xe8, 0xeb, + 0x8a, 0xe7, 0x6f, 0x49, 0x96, 0xcb, 0x52, 0xa2, 0x0b, 0x0d, 0x48, 0x0c, 0x48, 0x6a, 0xcf, 0xb9, + 0x1e, 0x4b, 0x19, 0xbf, 0xe2, 0x94, 0x65, 0x82, 0xb2, 0x34, 0x95, 0x25, 0x6b, 0x90, 0x42, 0xd3, + 0x9d, 0xcb, 0xb1, 0x8c, 0xa5, 0x3a, 0xd2, 0xe6, 0x64, 0x5e, 0x87, 0xed, 0x0d, 0x7b, 0x3d, 0x0d, + 0xe3, 0x50, 0x16, 0x89, 0x2c, 0x68, 0xc0, 0x0a, 0x4e, 0x6b, 0x2f, 0xe0, 0x25, 0xf3, 0x68, 0x28, + 0x85, 0xc1, 0xdd, 0x4b, 0xf0, 0xe2, 0xd3, 0xc6, 0x92, 0xcf, 0x97, 0x2c, 0x8f, 0x9e, 0xb0, 0x9c, + 0x25, 0x85, 0xfb, 0x0c, 0x5e, 0xe9, 0x3c, 0xfa, 0xbc, 0xc8, 0xd0, 0x23, 0xd8, 0xcb, 0xd4, 0x6d, + 0x00, 0xc6, 0x60, 0x7a, 0x3c, 0xc3, 0xa4, 0x15, 0x81, 0xe8, 0x91, 0x42, 0xcf, 0xcc, 0x4f, 0xad, + 0xbf, 0x8f, 0x2c, 0xdf, 0xcc, 0xb8, 0xb7, 0x20, 0x3a, 0x90, 0x7d, 0xac, 0x87, 0xd0, 0x79, 0x68, + 0x8b, 0x48, 0xe9, 0x9d, 0xf8, 0xb6, 0x88, 0xdc, 0x15, 0xec, 0x77, 0x59, 0x6a, 0x7b, 0x8b, 0x89, + 0xfa, 0xb0, 0x17, 0x88, 0x28, 0xe2, 0xf9, 0xc0, 0x1e, 0x83, 0xe9, 0x59, 0xdf, 0xdc, 0xd0, 0x43, + 0x78, 0x26, 0xd7, 0x36, 0x06, 0x47, 0xe3, 0xa3, 0xe9, 0xf1, 0xec, 0x2a, 0xd1, 0x2d, 0x90, 0xa6, + 0x05, 0x62, 0x5a, 0x20, 0x0b, 0x29, 0x52, 0xe3, 0x70, 0xcf, 0x9f, 0x7d, 0xb1, 0xe1, 0x69, 0xb5, + 0x1d, 0x7d, 0x00, 0xf0, 0xdc, 0x61, 0x7e, 0xe4, 0x76, 0xb2, 0x76, 0x3a, 0x72, 0xee, 0xfc, 0x9b, + 0xd3, 0x24, 0x71, 0x27, 0xef, 0xbf, 0xfe, 0xfc, 0x6c, 0xdf, 0x40, 0x23, 0xda, 0xfe, 0x7a, 0xc6, + 0x08, 0xd5, 0x95, 0xa1, 0x8f, 0x00, 0x9e, 0xfc, 0x5e, 0xd7, 0xcd, 0xbf, 0xad, 0x30, 0x24, 0x67, + 0xf2, 0x1f, 0x24, 0x65, 0xe4, 0xb6, 0x32, 0x32, 0x42, 0xc3, 0x3f, 0x1a, 0x59, 0x89, 0xe8, 0xdd, + 0x7c, 0xb1, 0xde, 0x62, 0xb0, 0xd9, 0x62, 0xf0, 0x63, 0x8b, 0xc1, 0xa7, 0x1d, 0xb6, 0x36, 0x3b, + 0x6c, 0x7d, 0xdb, 0x61, 0xeb, 0xf9, 0xdd, 0x58, 0x94, 0x2f, 0xaa, 0x80, 0x84, 0x32, 0x51, 0x12, + 0xf7, 0x52, 0x5e, 0x2e, 0x65, 0xfe, 0x52, 0xeb, 0xd5, 0x0f, 0xe8, 0x9b, 0xbd, 0x68, 0xd0, 0x53, + 0x7f, 0xdc, 0xfd, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x08, 0xd2, 0x5d, 0x38, 0x14, 0x03, 0x00, + 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // RewardParams queries parameters for the reward auciton. + RewardParams(ctx context.Context, in *QueryRewardParams, opts ...grpc.CallOption) (*QueryRewardParamsResp, error) + // RewardAuction queries the information of the auction by ID. If ID is ommitted, returns + // current reward auction params. + RewardAuction(ctx context.Context, in *QueryRewardAuction, opts ...grpc.CallOption) (*QueryRewardAuctionResp, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) RewardParams(ctx context.Context, in *QueryRewardParams, opts ...grpc.CallOption) (*QueryRewardParamsResp, error) { + out := new(QueryRewardParamsResp) + err := c.cc.Invoke(ctx, "/umee.auction.v1.Query/RewardParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RewardAuction(ctx context.Context, in *QueryRewardAuction, opts ...grpc.CallOption) (*QueryRewardAuctionResp, error) { + out := new(QueryRewardAuctionResp) + err := c.cc.Invoke(ctx, "/umee.auction.v1.Query/RewardAuction", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // RewardParams queries parameters for the reward auciton. + RewardParams(context.Context, *QueryRewardParams) (*QueryRewardParamsResp, error) + // RewardAuction queries the information of the auction by ID. If ID is ommitted, returns + // current reward auction params. + RewardAuction(context.Context, *QueryRewardAuction) (*QueryRewardAuctionResp, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) RewardParams(ctx context.Context, req *QueryRewardParams) (*QueryRewardParamsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method RewardParams not implemented") +} +func (*UnimplementedQueryServer) RewardAuction(ctx context.Context, req *QueryRewardAuction) (*QueryRewardAuctionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method RewardAuction not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_RewardParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRewardParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RewardParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.auction.v1.Query/RewardParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RewardParams(ctx, req.(*QueryRewardParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RewardAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRewardAuction) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RewardAuction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.auction.v1.Query/RewardAuction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RewardAuction(ctx, req.(*QueryRewardAuction)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "umee.auction.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RewardParams", + Handler: _Query_RewardParams_Handler, + }, + { + MethodName: "RewardAuction", + Handler: _Query_RewardAuction_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "umee/auction/v1/query.proto", +} + +func (m *QueryRewardParams) 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 *QueryRewardParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRewardParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryRewardParamsResp) 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 *QueryRewardParamsResp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRewardParamsResp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.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 *QueryRewardAuction) 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 *QueryRewardAuction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRewardAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryRewardAuctionResp) 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 *QueryRewardAuctionResp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRewardAuctionResp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Rewards) > 0 { + for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + 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 *QueryRewardParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryRewardParamsResp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryRewardAuction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryRewardAuctionResp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Rewards) > 0 { + for _, e := range m.Rewards { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryRewardParams) 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: QueryRewardParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRewardParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryRewardParamsResp) 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: QueryRewardParamsResp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRewardParamsResp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params.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 *QueryRewardAuction) 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: QueryRewardAuction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRewardAuction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *QueryRewardAuctionResp) 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: QueryRewardAuctionResp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRewardAuctionResp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", 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.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rewards", 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.Rewards = append(m.Rewards, types.Coin{}) + if err := m.Rewards[len(m.Rewards)-1].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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/auction/query.pb.gw.go b/x/auction/query.pb.gw.go new file mode 100644 index 0000000000..69c75cb489 --- /dev/null +++ b/x/auction/query.pb.gw.go @@ -0,0 +1,254 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: umee/auction/v1/query.proto + +/* +Package auction is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package auction + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_RewardParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRewardParams + var metadata runtime.ServerMetadata + + msg, err := client.RewardParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RewardParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRewardParams + var metadata runtime.ServerMetadata + + msg, err := server.RewardParams(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_RewardAuction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRewardAuction + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint32(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.RewardAuction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RewardAuction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRewardAuction + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint32(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.RewardAuction(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_RewardParams_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_RewardParams_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_RewardParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RewardAuction_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_RewardAuction_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_RewardAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_RewardParams_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_RewardParams_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_RewardParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RewardAuction_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_RewardAuction_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_RewardAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_RewardParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"umee", "auction", "v1", "rewards", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_RewardAuction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"umee", "auction", "v1", "rewards", "id"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_RewardParams_0 = runtime.ForwardResponseMessage + + forward_Query_RewardAuction_0 = runtime.ForwardResponseMessage +) diff --git a/x/auction/tx.pb.go b/x/auction/tx.pb.go new file mode 100644 index 0000000000..cadeab8a55 --- /dev/null +++ b/x/auction/tx.pb.go @@ -0,0 +1,1007 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: umee/auction/v1/tx.proto + +package auction + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgGovSetRewardsParams updates rewards parameters. +type MsgGovSetRewardsParams struct { + // authority must be the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Params RewardsParams `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgGovSetRewardsParams) Reset() { *m = MsgGovSetRewardsParams{} } +func (m *MsgGovSetRewardsParams) String() string { return proto.CompactTextString(m) } +func (*MsgGovSetRewardsParams) ProtoMessage() {} +func (*MsgGovSetRewardsParams) Descriptor() ([]byte, []int) { + return fileDescriptor_44a5dea2889d94ea, []int{0} +} +func (m *MsgGovSetRewardsParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovSetRewardsParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovSetRewardsParams.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 *MsgGovSetRewardsParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovSetRewardsParams.Merge(m, src) +} +func (m *MsgGovSetRewardsParams) XXX_Size() int { + return m.Size() +} +func (m *MsgGovSetRewardsParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovSetRewardsParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovSetRewardsParams proto.InternalMessageInfo + +// MsgGovSetRewardsParamsResp defines the Msg/GovSetRewardsParams response type. +type MsgGovSetRewardsParamsResp struct { +} + +func (m *MsgGovSetRewardsParamsResp) Reset() { *m = MsgGovSetRewardsParamsResp{} } +func (m *MsgGovSetRewardsParamsResp) String() string { return proto.CompactTextString(m) } +func (*MsgGovSetRewardsParamsResp) ProtoMessage() {} +func (*MsgGovSetRewardsParamsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_44a5dea2889d94ea, []int{1} +} +func (m *MsgGovSetRewardsParamsResp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovSetRewardsParamsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovSetRewardsParamsResp.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 *MsgGovSetRewardsParamsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovSetRewardsParamsResp.Merge(m, src) +} +func (m *MsgGovSetRewardsParamsResp) XXX_Size() int { + return m.Size() +} +func (m *MsgGovSetRewardsParamsResp) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovSetRewardsParamsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovSetRewardsParamsResp proto.InternalMessageInfo + +// MsgRewardsBid places a bid for a reword auction. +type MsgRewardsBid struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // amount of the bid in the base tokens + BidAmount types.Coin `protobuf:"bytes,2,opt,name=bid_amount,json=bidAmount,proto3" json:"bid_amount"` + // the current auction ID being bid on. Fails if the ID is not an ID of the current auction. + Id uint32 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *MsgRewardsBid) Reset() { *m = MsgRewardsBid{} } +func (m *MsgRewardsBid) String() string { return proto.CompactTextString(m) } +func (*MsgRewardsBid) ProtoMessage() {} +func (*MsgRewardsBid) Descriptor() ([]byte, []int) { + return fileDescriptor_44a5dea2889d94ea, []int{2} +} +func (m *MsgRewardsBid) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRewardsBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRewardsBid.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 *MsgRewardsBid) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRewardsBid.Merge(m, src) +} +func (m *MsgRewardsBid) XXX_Size() int { + return m.Size() +} +func (m *MsgRewardsBid) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRewardsBid.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRewardsBid proto.InternalMessageInfo + +// MsgRewardsBidResp response type for Msg/RewardsBid +type MsgRewardsBidResp struct { +} + +func (m *MsgRewardsBidResp) Reset() { *m = MsgRewardsBidResp{} } +func (m *MsgRewardsBidResp) String() string { return proto.CompactTextString(m) } +func (*MsgRewardsBidResp) ProtoMessage() {} +func (*MsgRewardsBidResp) Descriptor() ([]byte, []int) { + return fileDescriptor_44a5dea2889d94ea, []int{3} +} +func (m *MsgRewardsBidResp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRewardsBidResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRewardsBidResp.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 *MsgRewardsBidResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRewardsBidResp.Merge(m, src) +} +func (m *MsgRewardsBidResp) XXX_Size() int { + return m.Size() +} +func (m *MsgRewardsBidResp) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRewardsBidResp.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRewardsBidResp proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgGovSetRewardsParams)(nil), "umee.auction.v1.MsgGovSetRewardsParams") + proto.RegisterType((*MsgGovSetRewardsParamsResp)(nil), "umee.auction.v1.MsgGovSetRewardsParamsResp") + proto.RegisterType((*MsgRewardsBid)(nil), "umee.auction.v1.MsgRewardsBid") + proto.RegisterType((*MsgRewardsBidResp)(nil), "umee.auction.v1.MsgRewardsBidResp") +} + +func init() { proto.RegisterFile("umee/auction/v1/tx.proto", fileDescriptor_44a5dea2889d94ea) } + +var fileDescriptor_44a5dea2889d94ea = []byte{ + // 463 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x31, 0x6f, 0x13, 0x31, + 0x14, 0xc7, 0xcf, 0x29, 0x8a, 0x88, 0x51, 0x41, 0x5c, 0xab, 0x70, 0x3d, 0x81, 0x13, 0xdd, 0x42, + 0x00, 0xd5, 0x56, 0x8a, 0xd4, 0xa1, 0x42, 0x48, 0x0d, 0x43, 0xa7, 0x48, 0xd5, 0x75, 0x63, 0xa9, + 0xee, 0x62, 0xcb, 0xb5, 0xaa, 0x3b, 0x47, 0xb6, 0xef, 0x5a, 0x46, 0x98, 0x18, 0xf9, 0x08, 0x9d, + 0x98, 0x19, 0xf8, 0x08, 0x0c, 0x19, 0x2b, 0x26, 0x26, 0x04, 0xc9, 0x00, 0x1f, 0x03, 0xf9, 0xce, + 0x55, 0x68, 0x38, 0xa1, 0x6e, 0xf7, 0xee, 0xef, 0xff, 0xff, 0xfd, 0xde, 0xb3, 0x61, 0x50, 0x64, + 0x8c, 0x91, 0xa4, 0x98, 0x18, 0x21, 0x73, 0x52, 0x0e, 0x89, 0x39, 0xc7, 0x53, 0x25, 0x8d, 0xf4, + 0xef, 0x59, 0x05, 0x3b, 0x05, 0x97, 0xc3, 0x10, 0x4d, 0xa4, 0xce, 0xa4, 0x26, 0x69, 0xa2, 0x19, + 0x29, 0x87, 0x29, 0x33, 0xc9, 0x90, 0x4c, 0xa4, 0xc8, 0x6b, 0x43, 0xb8, 0x55, 0xeb, 0xc7, 0x55, + 0x45, 0xea, 0xc2, 0x49, 0x0f, 0x9c, 0x35, 0xd3, 0xdc, 0xf6, 0xc8, 0x34, 0x77, 0xc2, 0x26, 0x97, + 0x5c, 0xd6, 0x06, 0xfb, 0xe5, 0xfe, 0x3e, 0x5a, 0x85, 0xba, 0xa2, 0xa8, 0xe4, 0xe8, 0x23, 0x80, + 0xdd, 0xb1, 0xe6, 0x07, 0xb2, 0x3c, 0x62, 0x26, 0x66, 0x67, 0x89, 0xa2, 0xfa, 0x30, 0x51, 0x49, + 0xa6, 0xfd, 0x5d, 0xd8, 0x49, 0x0a, 0x73, 0x22, 0x95, 0x30, 0x6f, 0x02, 0xd0, 0x07, 0x83, 0xce, + 0x28, 0xf8, 0xfa, 0x79, 0x7b, 0xd3, 0xd1, 0xec, 0x53, 0xaa, 0x98, 0xd6, 0x47, 0x46, 0x89, 0x9c, + 0xc7, 0xcb, 0xa3, 0xfe, 0x0b, 0xd8, 0x9e, 0x56, 0x09, 0x41, 0xab, 0x0f, 0x06, 0x77, 0x76, 0x10, + 0x5e, 0x99, 0x1e, 0x5f, 0xeb, 0x33, 0xba, 0x35, 0xfb, 0xde, 0xf3, 0x62, 0xe7, 0xd9, 0xeb, 0xbe, + 0xbf, 0xe8, 0x79, 0xbf, 0x2f, 0x7a, 0xe0, 0xdd, 0xaf, 0x4f, 0x4f, 0x97, 0xa9, 0xd1, 0x43, 0x18, + 0x36, 0x73, 0xc6, 0x4c, 0x4f, 0xa3, 0xb7, 0x00, 0xae, 0x8f, 0x35, 0x77, 0xc2, 0x48, 0x50, 0xbf, + 0x0b, 0xdb, 0x9a, 0xe5, 0x94, 0xa9, 0x1a, 0x3d, 0x76, 0x95, 0xff, 0x12, 0xc2, 0x54, 0xd0, 0xe3, + 0x24, 0x93, 0x45, 0x6e, 0x1c, 0xe1, 0x16, 0x76, 0x33, 0xd9, 0xeb, 0xc0, 0xee, 0x3a, 0xf0, 0x2b, + 0x29, 0x72, 0x07, 0xd7, 0x49, 0x05, 0xdd, 0xaf, 0x1c, 0xfe, 0x5d, 0xd8, 0x12, 0x34, 0x58, 0xeb, + 0x83, 0xc1, 0x7a, 0xdc, 0x12, 0x74, 0xef, 0xb6, 0xe3, 0xf5, 0xa2, 0x0d, 0x78, 0xff, 0x1a, 0x82, + 0x05, 0xdb, 0xf9, 0x02, 0xe0, 0xda, 0x58, 0x73, 0xff, 0x14, 0x6e, 0x34, 0xed, 0xf8, 0xf1, 0x3f, + 0xbb, 0x69, 0x1e, 0x32, 0x7c, 0x76, 0xc3, 0x83, 0xb6, 0xa9, 0x7f, 0x08, 0xe1, 0x5f, 0x9b, 0x40, + 0x4d, 0xd6, 0xa5, 0x1e, 0x46, 0xff, 0xd7, 0x6d, 0xe2, 0xe8, 0x60, 0xf6, 0x13, 0x79, 0xb3, 0x39, + 0x02, 0x97, 0x73, 0x04, 0x7e, 0xcc, 0x11, 0xf8, 0xb0, 0x40, 0xde, 0xe5, 0x02, 0x79, 0xdf, 0x16, + 0xc8, 0x7b, 0xfd, 0x84, 0x0b, 0x73, 0x52, 0xa4, 0x78, 0x22, 0x33, 0x62, 0xb3, 0xb6, 0x73, 0x66, + 0xce, 0xa4, 0x3a, 0xad, 0x0a, 0x52, 0xee, 0x92, 0xf3, 0xab, 0x57, 0x97, 0xb6, 0xab, 0x67, 0xf7, + 0xfc, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x45, 0x2f, 0x2a, 0xec, 0x2c, 0x03, 0x00, 0x00, +} + +func (this *MsgGovSetRewardsParams) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgGovSetRewardsParams) + if !ok { + that2, ok := that.(MsgGovSetRewardsParams) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Authority != that1.Authority { + return false + } + if !this.Params.Equal(&that1.Params) { + return false + } + return true +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + GovSetRewardsParams(ctx context.Context, in *MsgGovSetRewardsParams, opts ...grpc.CallOption) (*MsgGovSetRewardsParamsResp, error) + RewardsBid(ctx context.Context, in *MsgRewardsBid, opts ...grpc.CallOption) (*MsgRewardsBidResp, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) GovSetRewardsParams(ctx context.Context, in *MsgGovSetRewardsParams, opts ...grpc.CallOption) (*MsgGovSetRewardsParamsResp, error) { + out := new(MsgGovSetRewardsParamsResp) + err := c.cc.Invoke(ctx, "/umee.auction.v1.Msg/GovSetRewardsParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RewardsBid(ctx context.Context, in *MsgRewardsBid, opts ...grpc.CallOption) (*MsgRewardsBidResp, error) { + out := new(MsgRewardsBidResp) + err := c.cc.Invoke(ctx, "/umee.auction.v1.Msg/RewardsBid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + GovSetRewardsParams(context.Context, *MsgGovSetRewardsParams) (*MsgGovSetRewardsParamsResp, error) + RewardsBid(context.Context, *MsgRewardsBid) (*MsgRewardsBidResp, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) GovSetRewardsParams(ctx context.Context, req *MsgGovSetRewardsParams) (*MsgGovSetRewardsParamsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovSetRewardsParams not implemented") +} +func (*UnimplementedMsgServer) RewardsBid(ctx context.Context, req *MsgRewardsBid) (*MsgRewardsBidResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method RewardsBid not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_GovSetRewardsParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgGovSetRewardsParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GovSetRewardsParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.auction.v1.Msg/GovSetRewardsParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GovSetRewardsParams(ctx, req.(*MsgGovSetRewardsParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RewardsBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRewardsBid) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RewardsBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.auction.v1.Msg/RewardsBid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RewardsBid(ctx, req.(*MsgRewardsBid)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "umee.auction.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GovSetRewardsParams", + Handler: _Msg_GovSetRewardsParams_Handler, + }, + { + MethodName: "RewardsBid", + Handler: _Msg_RewardsBid_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "umee/auction/v1/tx.proto", +} + +func (m *MsgGovSetRewardsParams) 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 *MsgGovSetRewardsParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovSetRewardsParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + 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 *MsgGovSetRewardsParamsResp) 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 *MsgGovSetRewardsParamsResp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovSetRewardsParamsResp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRewardsBid) 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 *MsgRewardsBid) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRewardsBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.BidAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRewardsBidResp) 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 *MsgRewardsBidResp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRewardsBidResp) 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 *MsgGovSetRewardsParams) 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 = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgGovSetRewardsParamsResp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRewardsBid) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.BidAmount.Size() + n += 1 + l + sovTx(uint64(l)) + if m.Id != 0 { + n += 1 + sovTx(uint64(m.Id)) + } + return n +} + +func (m *MsgRewardsBidResp) 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 *MsgGovSetRewardsParams) 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: MsgGovSetRewardsParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovSetRewardsParams: 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 { + 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.Params.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 *MsgGovSetRewardsParamsResp) 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: MsgGovSetRewardsParamsResp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovSetRewardsParamsResp: 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 *MsgRewardsBid) 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: MsgRewardsBid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRewardsBid: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidAmount", 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.BidAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *MsgRewardsBidResp) 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: MsgRewardsBidResp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRewardsBidResp: 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 skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +)