diff --git a/proto/umee/auction/v1/auction.proto b/proto/umee/auction/v1/auction.proto new file mode 100644 index 0000000000..95b1d858bc --- /dev/null +++ b/proto/umee/auction/v1/auction.proto @@ -0,0 +1,16 @@ +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 { + // bid_duration is duration of the bid phase in seconds. + int64 bid_duration = 1; + // Duration (in seconds) at the end of each auction, when we start collecting revenues for + // the next auction. + int64 revenu_collection_shift = 2; +} diff --git a/proto/umee/auction/v1/events.proto b/proto/umee/auction/v1/events.proto new file mode 100644 index 0000000000..89c4ecdef2 --- /dev/null +++ b/proto/umee/auction/v1/events.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package umee.auction.v1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/umee-network/umee/v6/x/auction"; + +option (gogoproto.goproto_getters_all) = false; + +// EventRewardsAuctionResult is emitted at the end of each auction that has at least one bidder. +message EventRewardsAuctionResult { + uint32 id = 1; + string bidder = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Auctioned tokens. + repeated cosmos.base.v1beta1.Coin rewards = 4 [(gogoproto.nullable) = false]; +} diff --git a/proto/umee/auction/v1/genesis.proto b/proto/umee/auction/v1/genesis.proto new file mode 100644 index 0000000000..a266765d19 --- /dev/null +++ b/proto/umee/auction/v1/genesis.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package umee.auction.v1; + +import "google/protobuf/timestamp.proto"; +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]; + // Latest active (in bid phase) reward auction. + uint32 reward_auction_id = 2; + // Latest highest bid. + string highest_bidder = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Tokens collected for the current auction. + repeated cosmos.base.v1beta1.Coin current_rewards = 4 [(gogoproto.nullable) = false]; + // Tokens collected for the next auction, while the current reward auction is still in the + // bid phase. + repeated cosmos.base.v1beta1.Coin next_rewards = 5 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp current_rewards_auction_end = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/proto/umee/auction/v1/query.proto b/proto/umee/auction/v1/query.proto new file mode 100644 index 0000000000..38f33abffa --- /dev/null +++ b/proto/umee/auction/v1/query.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package umee.auction.v1; + +import "google/protobuf/timestamp.proto"; +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 { + // QueryRewardParams queries parameters for the reward auciton. + rpc RewardParams(QueryRewardParams) returns (QueryRewardParamsResponse) { + 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 (QueryRewardAuctionResponse) { + option (google.api.http).get = "/umee/auction/v1/rewards"; + } +} + +// Query type for Query/RewardParams +message QueryRewardParams {} + +// Response type for Query/RewardParams +message QueryRewardParamsResponse { + RewardsParams params = 1 [(gogoproto.nullable) = false]; +} + +// Query type for QueryRewardAuction +message QueryRewardAuction { + // If zero or not present, the current auction is returned + uint32 id = 1; +} + +// Response type for Query/RewardAuctionResponse +message QueryRewardAuctionResponse { + uint32 id = 1; + // highest bidder + string bidder = 2; + repeated cosmos.base.v1beta1.Coin rewards = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin usd_rewards = 4 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp ends_at = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/proto/umee/auction/v1/tx.proto b/proto/umee/auction/v1/tx.proto new file mode 100644 index 0000000000..e09ce6aa08 --- /dev/null +++ b/proto/umee/auction/v1/tx.proto @@ -0,0 +1,50 @@ +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 + // + + // Allows x/gov to update rewards auction parameters. + rpc GovSetRewardsParams(MsgGovSetRewardsParams) returns (MsgGovSetRewardsParamsResponse); + // Places a bid for a reword auction. Must be higher than the previous bid by at least + // RewardParams.RewardsParams. + rpc RewardsBid(MsgRewardsBid) returns (MsgRewardsBidResponse); +} + +// MsgGovSetRewardsParams updates rewards auction parameters. +message MsgGovSetRewardsParams { + 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]; +} + +// MsgGovSetRewardsParamsResponse defines the Msg/GovSetRewardsParams response type. +message MsgGovSetRewardsParamsResponse {} + +// MsgRewardsBid places a bid for a reword auction. +message MsgRewardsBid { + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + // the current auction ID being bid on. Fails if the ID is not an ID of the current auction. + uint32 id = 2; + // amount of the bid in the base tokens + cosmos.base.v1beta1.Coin bid_amount = 3 [(gogoproto.nullable) = false]; +} + +// MsgRewardsBidResponse response type for Msg/RewardsBid +message MsgRewardsBidResponse {} 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..fd51a40ee5 --- /dev/null +++ b/x/auction/auction.pb.go @@ -0,0 +1,328 @@ +// 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 { + // bid_duration is duration of the bid phase in seconds. + BidDuration int64 `protobuf:"varint,1,opt,name=bid_duration,json=bidDuration,proto3" json:"bid_duration,omitempty"` + // Duration (in seconds) at the end of each auction, when we start collecting revenues for + // the next auction. + RevenuCollectionShift int64 `protobuf:"varint,2,opt,name=revenu_collection_shift,json=revenuCollectionShift,proto3" json:"revenu_collection_shift,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{ + // 221 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, 0xc5, 0xc5, 0x1b, 0x94, 0x5a, 0x9e, + 0x58, 0x94, 0x52, 0x1c, 0x90, 0x58, 0x94, 0x98, 0x5b, 0x2c, 0xa4, 0xc8, 0xc5, 0x93, 0x94, 0x99, + 0x12, 0x9f, 0x52, 0x5a, 0x94, 0x08, 0xd2, 0x29, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x1c, 0xc4, 0x9d, + 0x94, 0x99, 0xe2, 0x02, 0x15, 0x12, 0x32, 0xe3, 0x12, 0x2f, 0x4a, 0x2d, 0x4b, 0xcd, 0x2b, 0x8d, + 0x4f, 0xce, 0xcf, 0xc9, 0x49, 0x05, 0xdb, 0x10, 0x5f, 0x9c, 0x91, 0x99, 0x56, 0x22, 0xc1, 0x04, + 0x56, 0x2d, 0x0a, 0x91, 0x76, 0x86, 0xcb, 0x06, 0x83, 0x24, 0x9d, 0xdc, 0x4f, 0x3c, 0x94, 0x63, + 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, + 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xcd, 0xf4, 0xcc, 0x92, 0x8c, + 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x90, 0xdb, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, + 0xb2, 0xc1, 0x1c, 0xfd, 0x32, 0x33, 0xfd, 0x0a, 0x98, 0x0f, 0x93, 0xd8, 0xc0, 0x6e, 0x37, 0x06, + 0x04, 0x00, 0x00, 0xff, 0xff, 0x54, 0x46, 0x9a, 0x8f, 0x03, 0x01, 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.RevenuCollectionShift != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.RevenuCollectionShift)) + i-- + dAtA[i] = 0x10 + } + if m.BidDuration != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.BidDuration)) + 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.BidDuration != 0 { + n += 1 + sovAuction(uint64(m.BidDuration)) + } + if m.RevenuCollectionShift != 0 { + n += 1 + sovAuction(uint64(m.RevenuCollectionShift)) + } + 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 BidDuration", wireType) + } + m.BidDuration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BidDuration |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RevenuCollectionShift", wireType) + } + m.RevenuCollectionShift = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RevenuCollectionShift |= 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/events.pb.go b/x/auction/events.pb.go new file mode 100644 index 0000000000..b05b729fe1 --- /dev/null +++ b/x/auction/events.pb.go @@ -0,0 +1,404 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: umee/auction/v1/events.proto + +package auction + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + 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 + +// EventRewardsAuctionResult is emitted at the end of each auction that has at least one bidder. +type EventRewardsAuctionResult struct { + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + // Auctioned tokens. + Rewards []types.Coin `protobuf:"bytes,4,rep,name=rewards,proto3" json:"rewards"` +} + +func (m *EventRewardsAuctionResult) Reset() { *m = EventRewardsAuctionResult{} } +func (m *EventRewardsAuctionResult) String() string { return proto.CompactTextString(m) } +func (*EventRewardsAuctionResult) ProtoMessage() {} +func (*EventRewardsAuctionResult) Descriptor() ([]byte, []int) { + return fileDescriptor_b5998c755af8caa1, []int{0} +} +func (m *EventRewardsAuctionResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRewardsAuctionResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventRewardsAuctionResult.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 *EventRewardsAuctionResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRewardsAuctionResult.Merge(m, src) +} +func (m *EventRewardsAuctionResult) XXX_Size() int { + return m.Size() +} +func (m *EventRewardsAuctionResult) XXX_DiscardUnknown() { + xxx_messageInfo_EventRewardsAuctionResult.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRewardsAuctionResult proto.InternalMessageInfo + +func init() { + proto.RegisterType((*EventRewardsAuctionResult)(nil), "umee.auction.v1.EventRewardsAuctionResult") +} + +func init() { proto.RegisterFile("umee/auction/v1/events.proto", fileDescriptor_b5998c755af8caa1) } + +var fileDescriptor_b5998c755af8caa1 = []byte{ + // 294 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x90, 0xb1, 0x4a, 0xc4, 0x30, + 0x18, 0xc7, 0x9b, 0xf3, 0x38, 0xb1, 0xa2, 0x42, 0xb9, 0xa1, 0x3d, 0x24, 0x16, 0xa7, 0x3a, 0x5c, + 0x62, 0x15, 0x04, 0xc7, 0xab, 0x88, 0x7b, 0xdd, 0x5c, 0xa4, 0x6d, 0x42, 0x0d, 0xda, 0x44, 0x92, + 0xb4, 0xe7, 0x63, 0x38, 0xfa, 0x20, 0x3e, 0x44, 0xc7, 0xc3, 0xc9, 0x49, 0xb4, 0x7d, 0x11, 0x69, + 0x93, 0xdb, 0xf2, 0xe7, 0xf7, 0x23, 0xff, 0xef, 0xfb, 0xdc, 0xe3, 0xba, 0xa2, 0x14, 0x67, 0x75, + 0xa1, 0x99, 0xe0, 0xb8, 0x89, 0x31, 0x6d, 0x28, 0xd7, 0x0a, 0xbd, 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xab, 0xe6, 0xb3, 0x71, 0xd5, 0xcb, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x05, 0x11, + 0xf0, 0x01, 0x6c, 0x01, 0x00, 0x00, +} + +func (m *EventRewardsAuctionResult) 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 *EventRewardsAuctionResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRewardsAuctionResult) 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 = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventRewardsAuctionResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovEvents(uint64(m.Id)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if len(m.Rewards) > 0 { + for _, e := range m.Rewards { + l = e.Size() + n += 1 + l + sovEvents(uint64(l)) + } + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventRewardsAuctionResult) 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 ErrIntOverflowEvents + } + 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: EventRewardsAuctionResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRewardsAuctionResult: 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 ErrIntOverflowEvents + } + 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 ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + 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 := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = 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..81307cb3ef --- /dev/null +++ b/x/auction/genesis.pb.go @@ -0,0 +1,563 @@ +// 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" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/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. +// 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"` + // Latest active (in bid phase) reward auction. + RewardAuctionId uint32 `protobuf:"varint,2,opt,name=reward_auction_id,json=rewardAuctionId,proto3" json:"reward_auction_id,omitempty"` + // Latest highest bid. + HighestBidder string `protobuf:"bytes,3,opt,name=highest_bidder,json=highestBidder,proto3" json:"highest_bidder,omitempty"` + // Tokens collected for the current auction. + CurrentRewards []types.Coin `protobuf:"bytes,4,rep,name=current_rewards,json=currentRewards,proto3" json:"current_rewards"` + // Tokens collected for the next auction, while the current reward auction is still in the + // bid phase. + NextRewards []types.Coin `protobuf:"bytes,5,rep,name=next_rewards,json=nextRewards,proto3" json:"next_rewards"` + CurrentRewardsAuctionEnd time.Time `protobuf:"bytes,6,opt,name=current_rewards_auction_end,json=currentRewardsAuctionEnd,proto3,stdtime" json:"current_rewards_auction_end"` +} + +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{ + // 413 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0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 0x7b, 0x12, + 0xbd, 0x7f, 0x58, 0x0b, 0xbb, 0x6a, 0x0b, 0x5a, 0xaa, 0x86, 0x75, 0x15, 0x3d, 0x96, 0x60, 0xcf, + 0x95, 0xfe, 0xe8, 0x3e, 0xd8, 0xe6, 0x29, 0xbb, 0xe8, 0x2b, 0x2f, 0x8e, 0x1d, 0xc0, 0x93, 0x9f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x19, 0x33, 0xd7, 0xc2, 0x9b, 0x02, 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 + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CurrentRewardsAuctionEnd, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CurrentRewardsAuctionEnd):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintGenesis(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x32 + if len(m.NextRewards) > 0 { + for iNdEx := len(m.NextRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NextRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.CurrentRewards) > 0 { + for iNdEx := len(m.CurrentRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CurrentRewards[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.RewardAuctionId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.RewardAuctionId)) + 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.RewardAuctionId != 0 { + n += 1 + sovGenesis(uint64(m.RewardAuctionId)) + } + l = len(m.HighestBidder) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.CurrentRewards) > 0 { + for _, e := range m.CurrentRewards { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.NextRewards) > 0 { + for _, e := range m.NextRewards { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CurrentRewardsAuctionEnd) + 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 RewardAuctionId", wireType) + } + m.RewardAuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RewardAuctionId |= uint32(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 CurrentRewards", 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.CurrentRewards = append(m.CurrentRewards, types.Coin{}) + if err := m.CurrentRewards[len(m.CurrentRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextRewards", 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.NextRewards = append(m.NextRewards, types.Coin{}) + if err := m.NextRewards[len(m.NextRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentRewardsAuctionEnd", 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 := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.CurrentRewardsAuctionEnd, 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..dc4e1367f1 --- /dev/null +++ b/x/auction/query.pb.go @@ -0,0 +1,1121 @@ +// 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" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + _ "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. +// 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 + +// Query type for Query/RewardParams +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 + +// Response type for Query/RewardParams +type QueryRewardParamsResponse struct { + Params RewardsParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryRewardParamsResponse) Reset() { *m = QueryRewardParamsResponse{} } +func (m *QueryRewardParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRewardParamsResponse) ProtoMessage() {} +func (*QueryRewardParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e1df854d377e58e5, []int{1} +} +func (m *QueryRewardParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRewardParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRewardParamsResponse.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 *QueryRewardParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRewardParamsResponse.Merge(m, src) +} +func (m *QueryRewardParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryRewardParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRewardParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRewardParamsResponse proto.InternalMessageInfo + +func (m *QueryRewardParamsResponse) GetParams() RewardsParams { + if m != nil { + return m.Params + } + return RewardsParams{} +} + +// Query type for QueryRewardAuction +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 +} + +// Response type for Query/RewardAuctionResponse +type QueryRewardAuctionResponse 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"` + UsdRewards types.Coin `protobuf:"bytes,4,opt,name=usd_rewards,json=usdRewards,proto3" json:"usd_rewards"` + EndsAt time.Time `protobuf:"bytes,5,opt,name=ends_at,json=endsAt,proto3,stdtime" json:"ends_at"` +} + +func (m *QueryRewardAuctionResponse) Reset() { *m = QueryRewardAuctionResponse{} } +func (m *QueryRewardAuctionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRewardAuctionResponse) ProtoMessage() {} +func (*QueryRewardAuctionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e1df854d377e58e5, []int{3} +} +func (m *QueryRewardAuctionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRewardAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRewardAuctionResponse.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 *QueryRewardAuctionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRewardAuctionResponse.Merge(m, src) +} +func (m *QueryRewardAuctionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryRewardAuctionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRewardAuctionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRewardAuctionResponse proto.InternalMessageInfo + +func (m *QueryRewardAuctionResponse) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *QueryRewardAuctionResponse) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *QueryRewardAuctionResponse) GetRewards() []types.Coin { + if m != nil { + return m.Rewards + } + return nil +} + +func (m *QueryRewardAuctionResponse) GetUsdRewards() types.Coin { + if m != nil { + return m.UsdRewards + } + return types.Coin{} +} + +func (m *QueryRewardAuctionResponse) GetEndsAt() time.Time { + if m != nil { + return m.EndsAt + } + return time.Time{} +} + +func init() { + proto.RegisterType((*QueryRewardParams)(nil), "umee.auction.v1.QueryRewardParams") + proto.RegisterType((*QueryRewardParamsResponse)(nil), "umee.auction.v1.QueryRewardParamsResponse") + proto.RegisterType((*QueryRewardAuction)(nil), "umee.auction.v1.QueryRewardAuction") + proto.RegisterType((*QueryRewardAuctionResponse)(nil), "umee.auction.v1.QueryRewardAuctionResponse") +} + +func init() { proto.RegisterFile("umee/auction/v1/query.proto", fileDescriptor_e1df854d377e58e5) } + +var fileDescriptor_e1df854d377e58e5 = []byte{ + // 493 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x6f, 0xd3, 0x30, + 0x18, 0xad, 0xb3, 0xad, 0x03, 0x97, 0x81, 0x30, 0x08, 0x75, 0x81, 0x25, 0x25, 0x80, 0x28, 0x20, + 0x6c, 0xb5, 0x48, 0x48, 0x48, 0x20, 0xb1, 0xee, 0x0f, 0x40, 0xc4, 0x05, 0x2e, 0x93, 0x53, 0x9b, + 0x60, 0x41, 0xe2, 0x10, 0x3b, 0x1d, 0x08, 0x21, 0x21, 0x2e, 0x70, 0x9c, 0xc4, 0x95, 0x1f, 0xb4, + 0xe3, 0x24, 0x2e, 0x9c, 0x00, 0xb5, 0xfc, 0x10, 0x14, 0xdb, 0x99, 0x46, 0x2b, 0xd8, 0x6e, 0x8e, + 0xdf, 0x7b, 0x9f, 0xdf, 0xf7, 0x5e, 0xe0, 0xc5, 0x2a, 0xe3, 0x9c, 0xd0, 0x6a, 0xac, 0x85, 0xcc, + 0xc9, 0x64, 0x40, 0x5e, 0x57, 0xbc, 0x7c, 0x8b, 0x8b, 0x52, 0x6a, 0x89, 0xce, 0xd4, 0x20, 0x76, + 0x20, 0x9e, 0x0c, 0xfc, 0x30, 0x95, 0x32, 0x7d, 0xc5, 0x89, 0x81, 0x93, 0xea, 0x39, 0xd1, 0x22, + 0xe3, 0x4a, 0xd3, 0xac, 0xb0, 0x0a, 0xff, 0x92, 0x23, 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x29, + 0xe6, 0xb6, 0x47, 0x0f, 0xe0, 0x2a, 0xcf, 0x99, 0xda, 0xa6, 0xba, 0xbb, 0x62, 0xd4, 0x3e, 0xb6, + 0xf5, 0xe2, 0xa6, 0x7f, 0xfc, 0xa4, 0xe9, 0x7f, 0x74, 0xa2, 0x96, 0xef, 0xfe, 0x0c, 0x41, 0xdc, + 0xae, 0x45, 0x9b, 0x7a, 0xf8, 0xd5, 0x83, 0x2b, 0x26, 0x02, 0xf4, 0x09, 0xc0, 0x53, 0x87, 0x9b, + 0x40, 0xd1, 0x42, 0xe2, 0x0b, 0x6d, 0xf9, 0x37, 0x8f, 0xe6, 0x34, 0x71, 0x46, 0xd7, 0x3f, 0x7e, + 0xfb, 0xfd, 0xc5, 0xbb, 0x8c, 0x42, 0x32, 0xff, 0x2f, 0xb9, 0xf5, 0x89, 0x2d, 0x0f, 0x7d, 0x06, + 0x70, 0xed, 0xef, 0xe2, 0xae, 0xfc, 0xef, 0x19, 0x47, 0xf2, 0x6f, 0x1d, 0x83, 0x74, 0x60, 0xe6, + 0x9a, 0x31, 0x13, 0xa2, 0x8d, 0x7f, 0x9a, 0x79, 0x27, 0xd8, 0xfb, 0xd1, 0xd6, 0xde, 0x34, 0x00, + 0xfb, 0xd3, 0x00, 0xfc, 0x9a, 0x06, 0x60, 0x77, 0x16, 0xb4, 0xf6, 0x67, 0x41, 0xeb, 0xfb, 0x2c, + 0x68, 0x3d, 0xbb, 0x91, 0x0a, 0xfd, 0xa2, 0x4a, 0xf0, 0x58, 0x66, 0x66, 0xc4, 0xed, 0x9c, 0xeb, + 0x1d, 0x59, 0xbe, 0xb4, 0xf3, 0x26, 0x77, 0xc9, 0x9b, 0x66, 0x68, 0xd2, 0x36, 0x4d, 0xdc, 0xf9, + 0x13, 0x00, 0x00, 0xff, 0xff, 0x1a, 0xdb, 0xd8, 0xe9, 0xc7, 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 { + // QueryRewardParams queries parameters for the reward auciton. + RewardParams(ctx context.Context, in *QueryRewardParams, opts ...grpc.CallOption) (*QueryRewardParamsResponse, 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) (*QueryRewardAuctionResponse, 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) (*QueryRewardParamsResponse, error) { + out := new(QueryRewardParamsResponse) + 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) (*QueryRewardAuctionResponse, error) { + out := new(QueryRewardAuctionResponse) + 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 { + // QueryRewardParams queries parameters for the reward auciton. + RewardParams(context.Context, *QueryRewardParams) (*QueryRewardParamsResponse, error) + // RewardAuction queries the information of the auction by ID. If ID is ommitted, returns + // current reward auction params. + RewardAuction(context.Context, *QueryRewardAuction) (*QueryRewardAuctionResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) RewardParams(ctx context.Context, req *QueryRewardParams) (*QueryRewardParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RewardParams not implemented") +} +func (*UnimplementedQueryServer) RewardAuction(ctx context.Context, req *QueryRewardAuction) (*QueryRewardAuctionResponse, 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 *QueryRewardParamsResponse) 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 *QueryRewardParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRewardParamsResponse) 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 *QueryRewardAuctionResponse) 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 *QueryRewardAuctionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRewardAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndsAt, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndsAt):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintQuery(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x2a + { + size, err := m.UsdRewards.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + 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 *QueryRewardParamsResponse) 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 *QueryRewardAuctionResponse) 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)) + } + } + l = m.UsdRewards.Size() + n += 1 + l + sovQuery(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndsAt) + 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 *QueryRewardParamsResponse) 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: QueryRewardParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRewardParamsResponse: 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 *QueryRewardAuctionResponse) 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: QueryRewardAuctionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRewardAuctionResponse: 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 + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UsdRewards", 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.UsdRewards.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndsAt", 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 := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.EndsAt, 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..d7cb4e0c46 --- /dev/null +++ b/x/auction/tx.pb.go @@ -0,0 +1,985 @@ +// 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 auction 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 + +// MsgGovSetRewardsParamsResponse defines the Msg/GovSetRewardsParams response type. +type MsgGovSetRewardsParamsResponse struct { +} + +func (m *MsgGovSetRewardsParamsResponse) Reset() { *m = MsgGovSetRewardsParamsResponse{} } +func (m *MsgGovSetRewardsParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgGovSetRewardsParamsResponse) ProtoMessage() {} +func (*MsgGovSetRewardsParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_44a5dea2889d94ea, []int{1} +} +func (m *MsgGovSetRewardsParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovSetRewardsParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovSetRewardsParamsResponse.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 *MsgGovSetRewardsParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovSetRewardsParamsResponse.Merge(m, src) +} +func (m *MsgGovSetRewardsParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgGovSetRewardsParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovSetRewardsParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovSetRewardsParamsResponse 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"` + // the current auction ID being bid on. Fails if the ID is not an ID of the current auction. + Id uint32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + // amount of the bid in the base tokens + BidAmount types.Coin `protobuf:"bytes,3,opt,name=bid_amount,json=bidAmount,proto3" json:"bid_amount"` +} + +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 + +// MsgRewardsBidResponse response type for Msg/RewardsBid +type MsgRewardsBidResponse struct { +} + +func (m *MsgRewardsBidResponse) Reset() { *m = MsgRewardsBidResponse{} } +func (m *MsgRewardsBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRewardsBidResponse) ProtoMessage() {} +func (*MsgRewardsBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_44a5dea2889d94ea, []int{3} +} +func (m *MsgRewardsBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRewardsBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRewardsBidResponse.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 *MsgRewardsBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRewardsBidResponse.Merge(m, src) +} +func (m *MsgRewardsBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRewardsBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRewardsBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRewardsBidResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgGovSetRewardsParams)(nil), "umee.auction.v1.MsgGovSetRewardsParams") + proto.RegisterType((*MsgGovSetRewardsParamsResponse)(nil), "umee.auction.v1.MsgGovSetRewardsParamsResponse") + proto.RegisterType((*MsgRewardsBid)(nil), "umee.auction.v1.MsgRewardsBid") + proto.RegisterType((*MsgRewardsBidResponse)(nil), "umee.auction.v1.MsgRewardsBidResponse") +} + +func init() { proto.RegisterFile("umee/auction/v1/tx.proto", fileDescriptor_44a5dea2889d94ea) } + +var fileDescriptor_44a5dea2889d94ea = []byte{ + // 457 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6a, 0x14, 0x31, + 0x18, 0xc7, 0x27, 0x5b, 0x59, 0xd8, 0x94, 0x56, 0x18, 0x6b, 0x3b, 0x5d, 0x30, 0x2e, 0x7b, 0xd0, + 0x2a, 0x34, 0x61, 0x2b, 0xf4, 0x50, 0x44, 0xe8, 0x7a, 0xe8, 0x69, 0x41, 0xa6, 0x9e, 0xbc, 0x94, + 0x99, 0x4d, 0x48, 0x83, 0xcc, 0x7c, 0x4b, 0x92, 0x99, 0xd6, 0xab, 0xf8, 0x00, 0x3e, 0x81, 0xcf, + 0xe0, 0xc1, 0x87, 0xd8, 0x83, 0x87, 0xe2, 0xc9, 0x93, 0xe8, 0xee, 0xc1, 0xd7, 0x90, 0xc9, 0x64, + 0x58, 0x5b, 0x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09, 0x00, 0x00, 0xff, + 0xff, 0x13, 0xf5, 0x07, 0xef, 0x37, 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 + +// 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 { + // Allows x/gov to update rewards auction parameters. + GovSetRewardsParams(ctx context.Context, in *MsgGovSetRewardsParams, opts ...grpc.CallOption) (*MsgGovSetRewardsParamsResponse, error) + // Places a bid for a reword auction. Must be higher than the previous bid by at least + // RewardParams.RewardsParams. + RewardsBid(ctx context.Context, in *MsgRewardsBid, opts ...grpc.CallOption) (*MsgRewardsBidResponse, 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) (*MsgGovSetRewardsParamsResponse, error) { + out := new(MsgGovSetRewardsParamsResponse) + 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) (*MsgRewardsBidResponse, error) { + out := new(MsgRewardsBidResponse) + 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 { + // Allows x/gov to update rewards auction parameters. + GovSetRewardsParams(context.Context, *MsgGovSetRewardsParams) (*MsgGovSetRewardsParamsResponse, error) + // Places a bid for a reword auction. Must be higher than the previous bid by at least + // RewardParams.RewardsParams. + RewardsBid(context.Context, *MsgRewardsBid) (*MsgRewardsBidResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) GovSetRewardsParams(ctx context.Context, req *MsgGovSetRewardsParams) (*MsgGovSetRewardsParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovSetRewardsParams not implemented") +} +func (*UnimplementedMsgServer) RewardsBid(ctx context.Context, req *MsgRewardsBid) (*MsgRewardsBidResponse, 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 *MsgGovSetRewardsParamsResponse) 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 *MsgGovSetRewardsParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovSetRewardsParamsResponse) 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 + { + size, err := m.BidAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Id != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 + } + 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 *MsgRewardsBidResponse) 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 *MsgRewardsBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRewardsBidResponse) 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 *MsgGovSetRewardsParamsResponse) 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)) + } + if m.Id != 0 { + n += 1 + sovTx(uint64(m.Id)) + } + l = m.BidAmount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgRewardsBidResponse) 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 *MsgGovSetRewardsParamsResponse) 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: MsgGovSetRewardsParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovSetRewardsParamsResponse: 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 != 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 + } + } + case 3: + 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 + 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 *MsgRewardsBidResponse) 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: MsgRewardsBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRewardsBidResponse: 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") +)