From 7d1780efe8b8581645ccbc80370baa5e9bc037a4 Mon Sep 17 00:00:00 2001 From: lxgr-linux Date: Tue, 17 Dec 2024 00:33:04 +0100 Subject: [PATCH] feat(#242): Card proto --- api/cardchain/cardchain/card.pulsar.go | 3038 +++++++++++++++++++++++ gen.sh | 32 +- proto/cardchain/cardchain/card.proto | 70 + proto/cardchain/cardchain/council.proto | 43 + x/cardchain/types/card.pb.go | 1610 ++++++++++++ 5 files changed, 4779 insertions(+), 14 deletions(-) create mode 100644 api/cardchain/cardchain/card.pulsar.go create mode 100644 proto/cardchain/cardchain/card.proto create mode 100644 proto/cardchain/cardchain/council.proto create mode 100644 x/cardchain/types/card.pb.go diff --git a/api/cardchain/cardchain/card.pulsar.go b/api/cardchain/cardchain/card.pulsar.go new file mode 100644 index 00000000..193c865e --- /dev/null +++ b/api/cardchain/cardchain/card.pulsar.go @@ -0,0 +1,3038 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package cardchain + +import ( + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_Card_14_list)(nil) + +type _Card_14_list struct { + list *[]string +} + +func (x *_Card_14_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Card_14_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Card_14_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Card_14_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Card_14_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Card at list field Voters as it is not of Message kind")) +} + +func (x *_Card_14_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Card_14_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Card_14_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Card protoreflect.MessageDescriptor + fd_Card_owner protoreflect.FieldDescriptor + fd_Card_artist protoreflect.FieldDescriptor + fd_Card_content protoreflect.FieldDescriptor + fd_Card_image_id protoreflect.FieldDescriptor + fd_Card_fullArt protoreflect.FieldDescriptor + fd_Card_notes protoreflect.FieldDescriptor + fd_Card_status protoreflect.FieldDescriptor + fd_Card_votePool protoreflect.FieldDescriptor + fd_Card_voters protoreflect.FieldDescriptor + fd_Card_fairEnoughVotes protoreflect.FieldDescriptor + fd_Card_overpoweredVotes protoreflect.FieldDescriptor + fd_Card_underpoweredVotes protoreflect.FieldDescriptor + fd_Card_inappropriateVotes protoreflect.FieldDescriptor + fd_Card_nerflevel protoreflect.FieldDescriptor + fd_Card_balanceAnchor protoreflect.FieldDescriptor + fd_Card_starterCard protoreflect.FieldDescriptor + fd_Card_rarity protoreflect.FieldDescriptor +) + +func init() { + file_cardchain_cardchain_card_proto_init() + md_Card = File_cardchain_cardchain_card_proto.Messages().ByName("Card") + fd_Card_owner = md_Card.Fields().ByName("owner") + fd_Card_artist = md_Card.Fields().ByName("artist") + fd_Card_content = md_Card.Fields().ByName("content") + fd_Card_image_id = md_Card.Fields().ByName("image_id") + fd_Card_fullArt = md_Card.Fields().ByName("fullArt") + fd_Card_notes = md_Card.Fields().ByName("notes") + fd_Card_status = md_Card.Fields().ByName("status") + fd_Card_votePool = md_Card.Fields().ByName("votePool") + fd_Card_voters = md_Card.Fields().ByName("voters") + fd_Card_fairEnoughVotes = md_Card.Fields().ByName("fairEnoughVotes") + fd_Card_overpoweredVotes = md_Card.Fields().ByName("overpoweredVotes") + fd_Card_underpoweredVotes = md_Card.Fields().ByName("underpoweredVotes") + fd_Card_inappropriateVotes = md_Card.Fields().ByName("inappropriateVotes") + fd_Card_nerflevel = md_Card.Fields().ByName("nerflevel") + fd_Card_balanceAnchor = md_Card.Fields().ByName("balanceAnchor") + fd_Card_starterCard = md_Card.Fields().ByName("starterCard") + fd_Card_rarity = md_Card.Fields().ByName("rarity") +} + +var _ protoreflect.Message = (*fastReflection_Card)(nil) + +type fastReflection_Card Card + +func (x *Card) ProtoReflect() protoreflect.Message { + return (*fastReflection_Card)(x) +} + +func (x *Card) slowProtoReflect() protoreflect.Message { + mi := &file_cardchain_cardchain_card_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Card_messageType fastReflection_Card_messageType +var _ protoreflect.MessageType = fastReflection_Card_messageType{} + +type fastReflection_Card_messageType struct{} + +func (x fastReflection_Card_messageType) Zero() protoreflect.Message { + return (*fastReflection_Card)(nil) +} +func (x fastReflection_Card_messageType) New() protoreflect.Message { + return new(fastReflection_Card) +} +func (x fastReflection_Card_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Card +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Card) Descriptor() protoreflect.MessageDescriptor { + return md_Card +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Card) Type() protoreflect.MessageType { + return _fastReflection_Card_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Card) New() protoreflect.Message { + return new(fastReflection_Card) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Card) Interface() protoreflect.ProtoMessage { + return (*Card)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Card) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Owner != "" { + value := protoreflect.ValueOfString(x.Owner) + if !f(fd_Card_owner, value) { + return + } + } + if x.Artist != "" { + value := protoreflect.ValueOfString(x.Artist) + if !f(fd_Card_artist, value) { + return + } + } + if len(x.Content) != 0 { + value := protoreflect.ValueOfBytes(x.Content) + if !f(fd_Card_content, value) { + return + } + } + if x.ImageId != uint64(0) { + value := protoreflect.ValueOfUint64(x.ImageId) + if !f(fd_Card_image_id, value) { + return + } + } + if x.FullArt != false { + value := protoreflect.ValueOfBool(x.FullArt) + if !f(fd_Card_fullArt, value) { + return + } + } + if x.Notes != "" { + value := protoreflect.ValueOfString(x.Notes) + if !f(fd_Card_notes, value) { + return + } + } + if x.Status != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Status)) + if !f(fd_Card_status, value) { + return + } + } + if x.VotePool != nil { + value := protoreflect.ValueOfMessage(x.VotePool.ProtoReflect()) + if !f(fd_Card_votePool, value) { + return + } + } + if len(x.Voters) != 0 { + value := protoreflect.ValueOfList(&_Card_14_list{list: &x.Voters}) + if !f(fd_Card_voters, value) { + return + } + } + if x.FairEnoughVotes != uint64(0) { + value := protoreflect.ValueOfUint64(x.FairEnoughVotes) + if !f(fd_Card_fairEnoughVotes, value) { + return + } + } + if x.OverpoweredVotes != uint64(0) { + value := protoreflect.ValueOfUint64(x.OverpoweredVotes) + if !f(fd_Card_overpoweredVotes, value) { + return + } + } + if x.UnderpoweredVotes != uint64(0) { + value := protoreflect.ValueOfUint64(x.UnderpoweredVotes) + if !f(fd_Card_underpoweredVotes, value) { + return + } + } + if x.InappropriateVotes != uint64(0) { + value := protoreflect.ValueOfUint64(x.InappropriateVotes) + if !f(fd_Card_inappropriateVotes, value) { + return + } + } + if x.Nerflevel != int64(0) { + value := protoreflect.ValueOfInt64(x.Nerflevel) + if !f(fd_Card_nerflevel, value) { + return + } + } + if x.BalanceAnchor != false { + value := protoreflect.ValueOfBool(x.BalanceAnchor) + if !f(fd_Card_balanceAnchor, value) { + return + } + } + if x.StarterCard != false { + value := protoreflect.ValueOfBool(x.StarterCard) + if !f(fd_Card_starterCard, value) { + return + } + } + if x.Rarity != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Rarity)) + if !f(fd_Card_rarity, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Card) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cardchain.cardchain.Card.owner": + return x.Owner != "" + case "cardchain.cardchain.Card.artist": + return x.Artist != "" + case "cardchain.cardchain.Card.content": + return len(x.Content) != 0 + case "cardchain.cardchain.Card.image_id": + return x.ImageId != uint64(0) + case "cardchain.cardchain.Card.fullArt": + return x.FullArt != false + case "cardchain.cardchain.Card.notes": + return x.Notes != "" + case "cardchain.cardchain.Card.status": + return x.Status != 0 + case "cardchain.cardchain.Card.votePool": + return x.VotePool != nil + case "cardchain.cardchain.Card.voters": + return len(x.Voters) != 0 + case "cardchain.cardchain.Card.fairEnoughVotes": + return x.FairEnoughVotes != uint64(0) + case "cardchain.cardchain.Card.overpoweredVotes": + return x.OverpoweredVotes != uint64(0) + case "cardchain.cardchain.Card.underpoweredVotes": + return x.UnderpoweredVotes != uint64(0) + case "cardchain.cardchain.Card.inappropriateVotes": + return x.InappropriateVotes != uint64(0) + case "cardchain.cardchain.Card.nerflevel": + return x.Nerflevel != int64(0) + case "cardchain.cardchain.Card.balanceAnchor": + return x.BalanceAnchor != false + case "cardchain.cardchain.Card.starterCard": + return x.StarterCard != false + case "cardchain.cardchain.Card.rarity": + return x.Rarity != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.Card")) + } + panic(fmt.Errorf("message cardchain.cardchain.Card does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Card) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cardchain.cardchain.Card.owner": + x.Owner = "" + case "cardchain.cardchain.Card.artist": + x.Artist = "" + case "cardchain.cardchain.Card.content": + x.Content = nil + case "cardchain.cardchain.Card.image_id": + x.ImageId = uint64(0) + case "cardchain.cardchain.Card.fullArt": + x.FullArt = false + case "cardchain.cardchain.Card.notes": + x.Notes = "" + case "cardchain.cardchain.Card.status": + x.Status = 0 + case "cardchain.cardchain.Card.votePool": + x.VotePool = nil + case "cardchain.cardchain.Card.voters": + x.Voters = nil + case "cardchain.cardchain.Card.fairEnoughVotes": + x.FairEnoughVotes = uint64(0) + case "cardchain.cardchain.Card.overpoweredVotes": + x.OverpoweredVotes = uint64(0) + case "cardchain.cardchain.Card.underpoweredVotes": + x.UnderpoweredVotes = uint64(0) + case "cardchain.cardchain.Card.inappropriateVotes": + x.InappropriateVotes = uint64(0) + case "cardchain.cardchain.Card.nerflevel": + x.Nerflevel = int64(0) + case "cardchain.cardchain.Card.balanceAnchor": + x.BalanceAnchor = false + case "cardchain.cardchain.Card.starterCard": + x.StarterCard = false + case "cardchain.cardchain.Card.rarity": + x.Rarity = 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.Card")) + } + panic(fmt.Errorf("message cardchain.cardchain.Card does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Card) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cardchain.cardchain.Card.owner": + value := x.Owner + return protoreflect.ValueOfString(value) + case "cardchain.cardchain.Card.artist": + value := x.Artist + return protoreflect.ValueOfString(value) + case "cardchain.cardchain.Card.content": + value := x.Content + return protoreflect.ValueOfBytes(value) + case "cardchain.cardchain.Card.image_id": + value := x.ImageId + return protoreflect.ValueOfUint64(value) + case "cardchain.cardchain.Card.fullArt": + value := x.FullArt + return protoreflect.ValueOfBool(value) + case "cardchain.cardchain.Card.notes": + value := x.Notes + return protoreflect.ValueOfString(value) + case "cardchain.cardchain.Card.status": + value := x.Status + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "cardchain.cardchain.Card.votePool": + value := x.VotePool + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cardchain.cardchain.Card.voters": + if len(x.Voters) == 0 { + return protoreflect.ValueOfList(&_Card_14_list{}) + } + listValue := &_Card_14_list{list: &x.Voters} + return protoreflect.ValueOfList(listValue) + case "cardchain.cardchain.Card.fairEnoughVotes": + value := x.FairEnoughVotes + return protoreflect.ValueOfUint64(value) + case "cardchain.cardchain.Card.overpoweredVotes": + value := x.OverpoweredVotes + return protoreflect.ValueOfUint64(value) + case "cardchain.cardchain.Card.underpoweredVotes": + value := x.UnderpoweredVotes + return protoreflect.ValueOfUint64(value) + case "cardchain.cardchain.Card.inappropriateVotes": + value := x.InappropriateVotes + return protoreflect.ValueOfUint64(value) + case "cardchain.cardchain.Card.nerflevel": + value := x.Nerflevel + return protoreflect.ValueOfInt64(value) + case "cardchain.cardchain.Card.balanceAnchor": + value := x.BalanceAnchor + return protoreflect.ValueOfBool(value) + case "cardchain.cardchain.Card.starterCard": + value := x.StarterCard + return protoreflect.ValueOfBool(value) + case "cardchain.cardchain.Card.rarity": + value := x.Rarity + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.Card")) + } + panic(fmt.Errorf("message cardchain.cardchain.Card does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Card) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cardchain.cardchain.Card.owner": + x.Owner = value.Interface().(string) + case "cardchain.cardchain.Card.artist": + x.Artist = value.Interface().(string) + case "cardchain.cardchain.Card.content": + x.Content = value.Bytes() + case "cardchain.cardchain.Card.image_id": + x.ImageId = value.Uint() + case "cardchain.cardchain.Card.fullArt": + x.FullArt = value.Bool() + case "cardchain.cardchain.Card.notes": + x.Notes = value.Interface().(string) + case "cardchain.cardchain.Card.status": + x.Status = (Status)(value.Enum()) + case "cardchain.cardchain.Card.votePool": + x.VotePool = value.Message().Interface().(*v1beta1.Coin) + case "cardchain.cardchain.Card.voters": + lv := value.List() + clv := lv.(*_Card_14_list) + x.Voters = *clv.list + case "cardchain.cardchain.Card.fairEnoughVotes": + x.FairEnoughVotes = value.Uint() + case "cardchain.cardchain.Card.overpoweredVotes": + x.OverpoweredVotes = value.Uint() + case "cardchain.cardchain.Card.underpoweredVotes": + x.UnderpoweredVotes = value.Uint() + case "cardchain.cardchain.Card.inappropriateVotes": + x.InappropriateVotes = value.Uint() + case "cardchain.cardchain.Card.nerflevel": + x.Nerflevel = value.Int() + case "cardchain.cardchain.Card.balanceAnchor": + x.BalanceAnchor = value.Bool() + case "cardchain.cardchain.Card.starterCard": + x.StarterCard = value.Bool() + case "cardchain.cardchain.Card.rarity": + x.Rarity = (CardRarity)(value.Enum()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.Card")) + } + panic(fmt.Errorf("message cardchain.cardchain.Card does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Card) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cardchain.cardchain.Card.votePool": + if x.VotePool == nil { + x.VotePool = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.VotePool.ProtoReflect()) + case "cardchain.cardchain.Card.voters": + if x.Voters == nil { + x.Voters = []string{} + } + value := &_Card_14_list{list: &x.Voters} + return protoreflect.ValueOfList(value) + case "cardchain.cardchain.Card.owner": + panic(fmt.Errorf("field owner of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.artist": + panic(fmt.Errorf("field artist of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.content": + panic(fmt.Errorf("field content of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.image_id": + panic(fmt.Errorf("field image_id of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.fullArt": + panic(fmt.Errorf("field fullArt of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.notes": + panic(fmt.Errorf("field notes of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.status": + panic(fmt.Errorf("field status of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.fairEnoughVotes": + panic(fmt.Errorf("field fairEnoughVotes of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.overpoweredVotes": + panic(fmt.Errorf("field overpoweredVotes of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.underpoweredVotes": + panic(fmt.Errorf("field underpoweredVotes of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.inappropriateVotes": + panic(fmt.Errorf("field inappropriateVotes of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.nerflevel": + panic(fmt.Errorf("field nerflevel of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.balanceAnchor": + panic(fmt.Errorf("field balanceAnchor of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.starterCard": + panic(fmt.Errorf("field starterCard of message cardchain.cardchain.Card is not mutable")) + case "cardchain.cardchain.Card.rarity": + panic(fmt.Errorf("field rarity of message cardchain.cardchain.Card is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.Card")) + } + panic(fmt.Errorf("message cardchain.cardchain.Card does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Card) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cardchain.cardchain.Card.owner": + return protoreflect.ValueOfString("") + case "cardchain.cardchain.Card.artist": + return protoreflect.ValueOfString("") + case "cardchain.cardchain.Card.content": + return protoreflect.ValueOfBytes(nil) + case "cardchain.cardchain.Card.image_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "cardchain.cardchain.Card.fullArt": + return protoreflect.ValueOfBool(false) + case "cardchain.cardchain.Card.notes": + return protoreflect.ValueOfString("") + case "cardchain.cardchain.Card.status": + return protoreflect.ValueOfEnum(0) + case "cardchain.cardchain.Card.votePool": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cardchain.cardchain.Card.voters": + list := []string{} + return protoreflect.ValueOfList(&_Card_14_list{list: &list}) + case "cardchain.cardchain.Card.fairEnoughVotes": + return protoreflect.ValueOfUint64(uint64(0)) + case "cardchain.cardchain.Card.overpoweredVotes": + return protoreflect.ValueOfUint64(uint64(0)) + case "cardchain.cardchain.Card.underpoweredVotes": + return protoreflect.ValueOfUint64(uint64(0)) + case "cardchain.cardchain.Card.inappropriateVotes": + return protoreflect.ValueOfUint64(uint64(0)) + case "cardchain.cardchain.Card.nerflevel": + return protoreflect.ValueOfInt64(int64(0)) + case "cardchain.cardchain.Card.balanceAnchor": + return protoreflect.ValueOfBool(false) + case "cardchain.cardchain.Card.starterCard": + return protoreflect.ValueOfBool(false) + case "cardchain.cardchain.Card.rarity": + return protoreflect.ValueOfEnum(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.Card")) + } + panic(fmt.Errorf("message cardchain.cardchain.Card does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Card) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cardchain.cardchain.Card", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Card) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Card) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Card) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Card) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Card) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Owner) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Artist) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Content) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ImageId != 0 { + n += 1 + runtime.Sov(uint64(x.ImageId)) + } + if x.FullArt { + n += 2 + } + l = len(x.Notes) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Status != 0 { + n += 1 + runtime.Sov(uint64(x.Status)) + } + if x.VotePool != nil { + l = options.Size(x.VotePool) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Voters) > 0 { + for _, s := range x.Voters { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.FairEnoughVotes != 0 { + n += 1 + runtime.Sov(uint64(x.FairEnoughVotes)) + } + if x.OverpoweredVotes != 0 { + n += 1 + runtime.Sov(uint64(x.OverpoweredVotes)) + } + if x.UnderpoweredVotes != 0 { + n += 1 + runtime.Sov(uint64(x.UnderpoweredVotes)) + } + if x.InappropriateVotes != 0 { + n += 1 + runtime.Sov(uint64(x.InappropriateVotes)) + } + if x.Nerflevel != 0 { + n += 1 + runtime.Sov(uint64(x.Nerflevel)) + } + if x.BalanceAnchor { + n += 2 + } + if x.StarterCard { + n += 3 + } + if x.Rarity != 0 { + n += 2 + runtime.Sov(uint64(x.Rarity)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Card) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Rarity != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Rarity)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if x.StarterCard { + i-- + if x.StarterCard { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if x.BalanceAnchor { + i-- + if x.BalanceAnchor { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 + } + if len(x.Voters) > 0 { + for iNdEx := len(x.Voters) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Voters[iNdEx]) + copy(dAtA[i:], x.Voters[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Voters[iNdEx]))) + i-- + dAtA[i] = 0x72 + } + } + if x.Nerflevel != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Nerflevel)) + i-- + dAtA[i] = 0x68 + } + if x.InappropriateVotes != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.InappropriateVotes)) + i-- + dAtA[i] = 0x60 + } + if x.UnderpoweredVotes != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.UnderpoweredVotes)) + i-- + dAtA[i] = 0x58 + } + if x.OverpoweredVotes != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.OverpoweredVotes)) + i-- + dAtA[i] = 0x50 + } + if x.FairEnoughVotes != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.FairEnoughVotes)) + i-- + dAtA[i] = 0x48 + } + if x.VotePool != nil { + encoded, err := options.Marshal(x.VotePool) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x42 + } + if x.Status != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Status)) + i-- + dAtA[i] = 0x38 + } + if len(x.Notes) > 0 { + i -= len(x.Notes) + copy(dAtA[i:], x.Notes) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Notes))) + i-- + dAtA[i] = 0x32 + } + if x.FullArt { + i-- + if x.FullArt { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if x.ImageId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ImageId)) + i-- + dAtA[i] = 0x20 + } + if len(x.Content) > 0 { + i -= len(x.Content) + copy(dAtA[i:], x.Content) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Content))) + i-- + dAtA[i] = 0x1a + } + if len(x.Artist) > 0 { + i -= len(x.Artist) + copy(dAtA[i:], x.Artist) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Artist))) + i-- + dAtA[i] = 0x12 + } + if len(x.Owner) > 0 { + i -= len(x.Owner) + copy(dAtA[i:], x.Owner) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Owner))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Card) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Card: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Card: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Artist", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Artist = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Content = append(x.Content[:0], dAtA[iNdEx:postIndex]...) + if x.Content == nil { + x.Content = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ImageId", wireType) + } + x.ImageId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ImageId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FullArt", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.FullArt = bool(v != 0) + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Notes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Notes = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + x.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Status |= Status(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VotePool", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.VotePool == nil { + x.VotePool = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VotePool); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Voters", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Voters = append(x.Voters, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FairEnoughVotes", wireType) + } + x.FairEnoughVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.FairEnoughVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OverpoweredVotes", wireType) + } + x.OverpoweredVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.OverpoweredVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UnderpoweredVotes", wireType) + } + x.UnderpoweredVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.UnderpoweredVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InappropriateVotes", wireType) + } + x.InappropriateVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.InappropriateVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Nerflevel", wireType) + } + x.Nerflevel = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Nerflevel |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BalanceAnchor", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.BalanceAnchor = bool(v != 0) + case 16: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StarterCard", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.StarterCard = bool(v != 0) + case 17: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Rarity", wireType) + } + x.Rarity = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Rarity |= CardRarity(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_CardWithImage protoreflect.MessageDescriptor + fd_CardWithImage_card protoreflect.FieldDescriptor + fd_CardWithImage_image protoreflect.FieldDescriptor + fd_CardWithImage_hash protoreflect.FieldDescriptor +) + +func init() { + file_cardchain_cardchain_card_proto_init() + md_CardWithImage = File_cardchain_cardchain_card_proto.Messages().ByName("CardWithImage") + fd_CardWithImage_card = md_CardWithImage.Fields().ByName("card") + fd_CardWithImage_image = md_CardWithImage.Fields().ByName("image") + fd_CardWithImage_hash = md_CardWithImage.Fields().ByName("hash") +} + +var _ protoreflect.Message = (*fastReflection_CardWithImage)(nil) + +type fastReflection_CardWithImage CardWithImage + +func (x *CardWithImage) ProtoReflect() protoreflect.Message { + return (*fastReflection_CardWithImage)(x) +} + +func (x *CardWithImage) slowProtoReflect() protoreflect.Message { + mi := &file_cardchain_cardchain_card_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_CardWithImage_messageType fastReflection_CardWithImage_messageType +var _ protoreflect.MessageType = fastReflection_CardWithImage_messageType{} + +type fastReflection_CardWithImage_messageType struct{} + +func (x fastReflection_CardWithImage_messageType) Zero() protoreflect.Message { + return (*fastReflection_CardWithImage)(nil) +} +func (x fastReflection_CardWithImage_messageType) New() protoreflect.Message { + return new(fastReflection_CardWithImage) +} +func (x fastReflection_CardWithImage_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_CardWithImage +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_CardWithImage) Descriptor() protoreflect.MessageDescriptor { + return md_CardWithImage +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_CardWithImage) Type() protoreflect.MessageType { + return _fastReflection_CardWithImage_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_CardWithImage) New() protoreflect.Message { + return new(fastReflection_CardWithImage) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_CardWithImage) Interface() protoreflect.ProtoMessage { + return (*CardWithImage)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_CardWithImage) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Card != nil { + value := protoreflect.ValueOfMessage(x.Card.ProtoReflect()) + if !f(fd_CardWithImage_card, value) { + return + } + } + if x.Image != "" { + value := protoreflect.ValueOfString(x.Image) + if !f(fd_CardWithImage_image, value) { + return + } + } + if x.Hash != "" { + value := protoreflect.ValueOfString(x.Hash) + if !f(fd_CardWithImage_hash, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_CardWithImage) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cardchain.cardchain.CardWithImage.card": + return x.Card != nil + case "cardchain.cardchain.CardWithImage.image": + return x.Image != "" + case "cardchain.cardchain.CardWithImage.hash": + return x.Hash != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.CardWithImage")) + } + panic(fmt.Errorf("message cardchain.cardchain.CardWithImage does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_CardWithImage) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cardchain.cardchain.CardWithImage.card": + x.Card = nil + case "cardchain.cardchain.CardWithImage.image": + x.Image = "" + case "cardchain.cardchain.CardWithImage.hash": + x.Hash = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.CardWithImage")) + } + panic(fmt.Errorf("message cardchain.cardchain.CardWithImage does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_CardWithImage) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cardchain.cardchain.CardWithImage.card": + value := x.Card + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cardchain.cardchain.CardWithImage.image": + value := x.Image + return protoreflect.ValueOfString(value) + case "cardchain.cardchain.CardWithImage.hash": + value := x.Hash + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.CardWithImage")) + } + panic(fmt.Errorf("message cardchain.cardchain.CardWithImage does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_CardWithImage) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cardchain.cardchain.CardWithImage.card": + x.Card = value.Message().Interface().(*Card) + case "cardchain.cardchain.CardWithImage.image": + x.Image = value.Interface().(string) + case "cardchain.cardchain.CardWithImage.hash": + x.Hash = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.CardWithImage")) + } + panic(fmt.Errorf("message cardchain.cardchain.CardWithImage does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_CardWithImage) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cardchain.cardchain.CardWithImage.card": + if x.Card == nil { + x.Card = new(Card) + } + return protoreflect.ValueOfMessage(x.Card.ProtoReflect()) + case "cardchain.cardchain.CardWithImage.image": + panic(fmt.Errorf("field image of message cardchain.cardchain.CardWithImage is not mutable")) + case "cardchain.cardchain.CardWithImage.hash": + panic(fmt.Errorf("field hash of message cardchain.cardchain.CardWithImage is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.CardWithImage")) + } + panic(fmt.Errorf("message cardchain.cardchain.CardWithImage does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_CardWithImage) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cardchain.cardchain.CardWithImage.card": + m := new(Card) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cardchain.cardchain.CardWithImage.image": + return protoreflect.ValueOfString("") + case "cardchain.cardchain.CardWithImage.hash": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.CardWithImage")) + } + panic(fmt.Errorf("message cardchain.cardchain.CardWithImage does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_CardWithImage) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cardchain.cardchain.CardWithImage", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_CardWithImage) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_CardWithImage) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_CardWithImage) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_CardWithImage) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*CardWithImage) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Card != nil { + l = options.Size(x.Card) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Image) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Hash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*CardWithImage) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Hash) > 0 { + i -= len(x.Hash) + copy(dAtA[i:], x.Hash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Hash))) + i-- + dAtA[i] = 0x1a + } + if len(x.Image) > 0 { + i -= len(x.Image) + copy(dAtA[i:], x.Image) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Image))) + i-- + dAtA[i] = 0x12 + } + if x.Card != nil { + encoded, err := options.Marshal(x.Card) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*CardWithImage) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CardWithImage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CardWithImage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Card", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Card == nil { + x.Card = &Card{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Card); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Image = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_TimeStamp protoreflect.MessageDescriptor + fd_TimeStamp_timeStamp protoreflect.FieldDescriptor +) + +func init() { + file_cardchain_cardchain_card_proto_init() + md_TimeStamp = File_cardchain_cardchain_card_proto.Messages().ByName("TimeStamp") + fd_TimeStamp_timeStamp = md_TimeStamp.Fields().ByName("timeStamp") +} + +var _ protoreflect.Message = (*fastReflection_TimeStamp)(nil) + +type fastReflection_TimeStamp TimeStamp + +func (x *TimeStamp) ProtoReflect() protoreflect.Message { + return (*fastReflection_TimeStamp)(x) +} + +func (x *TimeStamp) slowProtoReflect() protoreflect.Message { + mi := &file_cardchain_cardchain_card_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_TimeStamp_messageType fastReflection_TimeStamp_messageType +var _ protoreflect.MessageType = fastReflection_TimeStamp_messageType{} + +type fastReflection_TimeStamp_messageType struct{} + +func (x fastReflection_TimeStamp_messageType) Zero() protoreflect.Message { + return (*fastReflection_TimeStamp)(nil) +} +func (x fastReflection_TimeStamp_messageType) New() protoreflect.Message { + return new(fastReflection_TimeStamp) +} +func (x fastReflection_TimeStamp_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_TimeStamp +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_TimeStamp) Descriptor() protoreflect.MessageDescriptor { + return md_TimeStamp +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_TimeStamp) Type() protoreflect.MessageType { + return _fastReflection_TimeStamp_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_TimeStamp) New() protoreflect.Message { + return new(fastReflection_TimeStamp) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_TimeStamp) Interface() protoreflect.ProtoMessage { + return (*TimeStamp)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_TimeStamp) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.TimeStamp != uint64(0) { + value := protoreflect.ValueOfUint64(x.TimeStamp) + if !f(fd_TimeStamp_timeStamp, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_TimeStamp) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cardchain.cardchain.TimeStamp.timeStamp": + return x.TimeStamp != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.TimeStamp")) + } + panic(fmt.Errorf("message cardchain.cardchain.TimeStamp does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TimeStamp) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cardchain.cardchain.TimeStamp.timeStamp": + x.TimeStamp = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.TimeStamp")) + } + panic(fmt.Errorf("message cardchain.cardchain.TimeStamp does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_TimeStamp) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cardchain.cardchain.TimeStamp.timeStamp": + value := x.TimeStamp + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.TimeStamp")) + } + panic(fmt.Errorf("message cardchain.cardchain.TimeStamp does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TimeStamp) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cardchain.cardchain.TimeStamp.timeStamp": + x.TimeStamp = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.TimeStamp")) + } + panic(fmt.Errorf("message cardchain.cardchain.TimeStamp does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TimeStamp) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cardchain.cardchain.TimeStamp.timeStamp": + panic(fmt.Errorf("field timeStamp of message cardchain.cardchain.TimeStamp is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.TimeStamp")) + } + panic(fmt.Errorf("message cardchain.cardchain.TimeStamp does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_TimeStamp) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cardchain.cardchain.TimeStamp.timeStamp": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cardchain.cardchain.TimeStamp")) + } + panic(fmt.Errorf("message cardchain.cardchain.TimeStamp does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_TimeStamp) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cardchain.cardchain.TimeStamp", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_TimeStamp) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_TimeStamp) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_TimeStamp) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_TimeStamp) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*TimeStamp) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.TimeStamp != 0 { + n += 1 + runtime.Sov(uint64(x.TimeStamp)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*TimeStamp) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.TimeStamp != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TimeStamp)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*TimeStamp) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TimeStamp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TimeStamp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TimeStamp", wireType) + } + x.TimeStamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.TimeStamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cardchain/cardchain/card.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Status int32 + +const ( + Status_scheme Status = 0 + Status_prototype Status = 1 + Status_trial Status = 2 + Status_permanent Status = 3 + Status_suspended Status = 4 + Status_banned Status = 5 + Status_bannedSoon Status = 6 + Status_bannedVerySoon Status = 7 + Status_none Status = 8 + Status_adventureItem Status = 9 +) + +// Enum value maps for Status. +var ( + Status_name = map[int32]string{ + 0: "scheme", + 1: "prototype", + 2: "trial", + 3: "permanent", + 4: "suspended", + 5: "banned", + 6: "bannedSoon", + 7: "bannedVerySoon", + 8: "none", + 9: "adventureItem", + } + Status_value = map[string]int32{ + "scheme": 0, + "prototype": 1, + "trial": 2, + "permanent": 3, + "suspended": 4, + "banned": 5, + "bannedSoon": 6, + "bannedVerySoon": 7, + "none": 8, + "adventureItem": 9, + } +) + +func (x Status) Enum() *Status { + p := new(Status) + *p = x + return p +} + +func (x Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Status) Descriptor() protoreflect.EnumDescriptor { + return file_cardchain_cardchain_card_proto_enumTypes[0].Descriptor() +} + +func (Status) Type() protoreflect.EnumType { + return &file_cardchain_cardchain_card_proto_enumTypes[0] +} + +func (x Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Status.Descriptor instead. +func (Status) EnumDescriptor() ([]byte, []int) { + return file_cardchain_cardchain_card_proto_rawDescGZIP(), []int{0} +} + +type CardRarity int32 + +const ( + CardRarity_common CardRarity = 0 + CardRarity_uncommon CardRarity = 1 + CardRarity_rare CardRarity = 2 + CardRarity_exceptional CardRarity = 3 + CardRarity_unique CardRarity = 4 +) + +// Enum value maps for CardRarity. +var ( + CardRarity_name = map[int32]string{ + 0: "common", + 1: "uncommon", + 2: "rare", + 3: "exceptional", + 4: "unique", + } + CardRarity_value = map[string]int32{ + "common": 0, + "uncommon": 1, + "rare": 2, + "exceptional": 3, + "unique": 4, + } +) + +func (x CardRarity) Enum() *CardRarity { + p := new(CardRarity) + *p = x + return p +} + +func (x CardRarity) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CardRarity) Descriptor() protoreflect.EnumDescriptor { + return file_cardchain_cardchain_card_proto_enumTypes[1].Descriptor() +} + +func (CardRarity) Type() protoreflect.EnumType { + return &file_cardchain_cardchain_card_proto_enumTypes[1] +} + +func (x CardRarity) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CardRarity.Descriptor instead. +func (CardRarity) EnumDescriptor() ([]byte, []int) { + return file_cardchain_cardchain_card_proto_rawDescGZIP(), []int{1} +} + +type CardClass int32 + +const ( + CardClass_nature CardClass = 0 + CardClass_culture CardClass = 1 + CardClass_mysticism CardClass = 2 + CardClass_technology CardClass = 3 +) + +// Enum value maps for CardClass. +var ( + CardClass_name = map[int32]string{ + 0: "nature", + 1: "culture", + 2: "mysticism", + 3: "technology", + } + CardClass_value = map[string]int32{ + "nature": 0, + "culture": 1, + "mysticism": 2, + "technology": 3, + } +) + +func (x CardClass) Enum() *CardClass { + p := new(CardClass) + *p = x + return p +} + +func (x CardClass) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CardClass) Descriptor() protoreflect.EnumDescriptor { + return file_cardchain_cardchain_card_proto_enumTypes[2].Descriptor() +} + +func (CardClass) Type() protoreflect.EnumType { + return &file_cardchain_cardchain_card_proto_enumTypes[2] +} + +func (x CardClass) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CardClass.Descriptor instead. +func (CardClass) EnumDescriptor() ([]byte, []int) { + return file_cardchain_cardchain_card_proto_rawDescGZIP(), []int{2} +} + +type CardType int32 + +const ( + CardType_place CardType = 0 + CardType_action CardType = 1 + CardType_entity CardType = 2 + CardType_headquarter CardType = 3 +) + +// Enum value maps for CardType. +var ( + CardType_name = map[int32]string{ + 0: "place", + 1: "action", + 2: "entity", + 3: "headquarter", + } + CardType_value = map[string]int32{ + "place": 0, + "action": 1, + "entity": 2, + "headquarter": 3, + } +) + +func (x CardType) Enum() *CardType { + p := new(CardType) + *p = x + return p +} + +func (x CardType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CardType) Descriptor() protoreflect.EnumDescriptor { + return file_cardchain_cardchain_card_proto_enumTypes[3].Descriptor() +} + +func (CardType) Type() protoreflect.EnumType { + return &file_cardchain_cardchain_card_proto_enumTypes[3] +} + +func (x CardType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CardType.Descriptor instead. +func (CardType) EnumDescriptor() ([]byte, []int) { + return file_cardchain_cardchain_card_proto_rawDescGZIP(), []int{3} +} + +type Card struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Artist string `protobuf:"bytes,2,opt,name=artist,proto3" json:"artist,omitempty"` + Content []byte `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + ImageId uint64 `protobuf:"varint,4,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` + FullArt bool `protobuf:"varint,5,opt,name=fullArt,proto3" json:"fullArt,omitempty"` + Notes string `protobuf:"bytes,6,opt,name=notes,proto3" json:"notes,omitempty"` + Status Status `protobuf:"varint,7,opt,name=status,proto3,enum=cardchain.cardchain.Status" json:"status,omitempty"` + VotePool *v1beta1.Coin `protobuf:"bytes,8,opt,name=votePool,proto3" json:"votePool,omitempty"` + Voters []string `protobuf:"bytes,14,rep,name=voters,proto3" json:"voters,omitempty"` + FairEnoughVotes uint64 `protobuf:"varint,9,opt,name=fairEnoughVotes,proto3" json:"fairEnoughVotes,omitempty"` + OverpoweredVotes uint64 `protobuf:"varint,10,opt,name=overpoweredVotes,proto3" json:"overpoweredVotes,omitempty"` + UnderpoweredVotes uint64 `protobuf:"varint,11,opt,name=underpoweredVotes,proto3" json:"underpoweredVotes,omitempty"` + InappropriateVotes uint64 `protobuf:"varint,12,opt,name=inappropriateVotes,proto3" json:"inappropriateVotes,omitempty"` + Nerflevel int64 `protobuf:"varint,13,opt,name=nerflevel,proto3" json:"nerflevel,omitempty"` + BalanceAnchor bool `protobuf:"varint,15,opt,name=balanceAnchor,proto3" json:"balanceAnchor,omitempty"` + StarterCard bool `protobuf:"varint,16,opt,name=starterCard,proto3" json:"starterCard,omitempty"` + Rarity CardRarity `protobuf:"varint,17,opt,name=rarity,proto3,enum=cardchain.cardchain.CardRarity" json:"rarity,omitempty"` +} + +func (x *Card) Reset() { + *x = Card{} + if protoimpl.UnsafeEnabled { + mi := &file_cardchain_cardchain_card_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Card) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Card) ProtoMessage() {} + +// Deprecated: Use Card.ProtoReflect.Descriptor instead. +func (*Card) Descriptor() ([]byte, []int) { + return file_cardchain_cardchain_card_proto_rawDescGZIP(), []int{0} +} + +func (x *Card) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *Card) GetArtist() string { + if x != nil { + return x.Artist + } + return "" +} + +func (x *Card) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + +func (x *Card) GetImageId() uint64 { + if x != nil { + return x.ImageId + } + return 0 +} + +func (x *Card) GetFullArt() bool { + if x != nil { + return x.FullArt + } + return false +} + +func (x *Card) GetNotes() string { + if x != nil { + return x.Notes + } + return "" +} + +func (x *Card) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_scheme +} + +func (x *Card) GetVotePool() *v1beta1.Coin { + if x != nil { + return x.VotePool + } + return nil +} + +func (x *Card) GetVoters() []string { + if x != nil { + return x.Voters + } + return nil +} + +func (x *Card) GetFairEnoughVotes() uint64 { + if x != nil { + return x.FairEnoughVotes + } + return 0 +} + +func (x *Card) GetOverpoweredVotes() uint64 { + if x != nil { + return x.OverpoweredVotes + } + return 0 +} + +func (x *Card) GetUnderpoweredVotes() uint64 { + if x != nil { + return x.UnderpoweredVotes + } + return 0 +} + +func (x *Card) GetInappropriateVotes() uint64 { + if x != nil { + return x.InappropriateVotes + } + return 0 +} + +func (x *Card) GetNerflevel() int64 { + if x != nil { + return x.Nerflevel + } + return 0 +} + +func (x *Card) GetBalanceAnchor() bool { + if x != nil { + return x.BalanceAnchor + } + return false +} + +func (x *Card) GetStarterCard() bool { + if x != nil { + return x.StarterCard + } + return false +} + +func (x *Card) GetRarity() CardRarity { + if x != nil { + return x.Rarity + } + return CardRarity_common +} + +type CardWithImage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Card *Card `protobuf:"bytes,1,opt,name=card,proto3" json:"card,omitempty"` + Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (x *CardWithImage) Reset() { + *x = CardWithImage{} + if protoimpl.UnsafeEnabled { + mi := &file_cardchain_cardchain_card_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CardWithImage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CardWithImage) ProtoMessage() {} + +// Deprecated: Use CardWithImage.ProtoReflect.Descriptor instead. +func (*CardWithImage) Descriptor() ([]byte, []int) { + return file_cardchain_cardchain_card_proto_rawDescGZIP(), []int{1} +} + +func (x *CardWithImage) GetCard() *Card { + if x != nil { + return x.Card + } + return nil +} + +func (x *CardWithImage) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +func (x *CardWithImage) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + +type TimeStamp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TimeStamp uint64 `protobuf:"varint,1,opt,name=timeStamp,proto3" json:"timeStamp,omitempty"` +} + +func (x *TimeStamp) Reset() { + *x = TimeStamp{} + if protoimpl.UnsafeEnabled { + mi := &file_cardchain_cardchain_card_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TimeStamp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TimeStamp) ProtoMessage() {} + +// Deprecated: Use TimeStamp.ProtoReflect.Descriptor instead. +func (*TimeStamp) Descriptor() ([]byte, []int) { + return file_cardchain_cardchain_card_proto_rawDescGZIP(), []int{2} +} + +func (x *TimeStamp) GetTimeStamp() uint64 { + if x != nil { + return x.TimeStamp + } + return 0 +} + +var File_cardchain_cardchain_card_proto protoreflect.FileDescriptor + +var file_cardchain_cardchain_card_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x63, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x61, 0x72, 0x64, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x61, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x13, 0x63, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x61, 0x72, 0x64, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x04, 0x0a, 0x04, + 0x43, 0x61, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x72, + 0x74, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x72, 0x74, 0x69, + 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x75, 0x6c, 0x6c, 0x41, + 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x66, 0x75, 0x6c, 0x6c, 0x41, 0x72, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x63, 0x61, 0x72, 0x64, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3b, 0x0a, 0x08, + 0x76, 0x6f, 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x08, 0x76, 0x6f, 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x6f, 0x74, + 0x65, 0x72, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x6f, 0x74, 0x65, 0x72, + 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x66, 0x61, 0x69, 0x72, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x56, + 0x6f, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x66, 0x61, 0x69, 0x72, + 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x6f, + 0x76, 0x65, 0x72, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x6f, 0x76, 0x65, 0x72, 0x70, 0x6f, 0x77, 0x65, 0x72, + 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x75, 0x6e, 0x64, 0x65, 0x72, + 0x70, 0x6f, 0x77, 0x65, 0x72, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x11, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x65, 0x64, + 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x69, 0x6e, 0x61, 0x70, 0x70, 0x72, 0x6f, + 0x70, 0x72, 0x69, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x12, 0x69, 0x6e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x65, + 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x72, 0x66, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x72, 0x66, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x24, 0x0a, 0x0d, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x6e, + 0x63, 0x68, 0x6f, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x62, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x65, 0x72, 0x43, 0x61, 0x72, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x72, 0x43, 0x61, 0x72, 0x64, 0x12, 0x37, 0x0a, 0x06, 0x72, + 0x61, 0x72, 0x69, 0x74, 0x79, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x63, 0x61, + 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x2e, 0x43, 0x61, 0x72, 0x64, 0x52, 0x61, 0x72, 0x69, 0x74, 0x79, 0x52, 0x06, 0x72, 0x61, + 0x72, 0x69, 0x74, 0x79, 0x22, 0x68, 0x0a, 0x0d, 0x43, 0x61, 0x72, 0x64, 0x57, 0x69, 0x74, 0x68, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x63, 0x61, 0x72, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, + 0x63, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x43, 0x61, 0x72, 0x64, 0x52, 0x04, + 0x63, 0x61, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x29, + 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x2a, 0x99, 0x01, 0x0a, 0x06, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x10, 0x00, + 0x12, 0x0d, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x10, 0x01, 0x12, + 0x09, 0x0a, 0x05, 0x74, 0x72, 0x69, 0x61, 0x6c, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x70, 0x65, + 0x72, 0x6d, 0x61, 0x6e, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x73, 0x75, 0x73, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x62, 0x61, 0x6e, 0x6e, + 0x65, 0x64, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x53, 0x6f, + 0x6f, 0x6e, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x56, 0x65, + 0x72, 0x79, 0x53, 0x6f, 0x6f, 0x6e, 0x10, 0x07, 0x12, 0x08, 0x0a, 0x04, 0x6e, 0x6f, 0x6e, 0x65, + 0x10, 0x08, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x64, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x49, + 0x74, 0x65, 0x6d, 0x10, 0x09, 0x2a, 0x4d, 0x0a, 0x0a, 0x43, 0x61, 0x72, 0x64, 0x52, 0x61, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x0a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x10, 0x00, 0x12, + 0x0c, 0x0a, 0x08, 0x75, 0x6e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x10, 0x01, 0x12, 0x08, 0x0a, + 0x04, 0x72, 0x61, 0x72, 0x65, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x65, 0x78, 0x63, 0x65, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, + 0x75, 0x65, 0x10, 0x04, 0x2a, 0x43, 0x0a, 0x09, 0x43, 0x61, 0x72, 0x64, 0x43, 0x6c, 0x61, 0x73, + 0x73, 0x12, 0x0a, 0x0a, 0x06, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x10, 0x00, 0x12, 0x0b, 0x0a, + 0x07, 0x63, 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x6d, 0x79, + 0x73, 0x74, 0x69, 0x63, 0x69, 0x73, 0x6d, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x74, 0x65, 0x63, + 0x68, 0x6e, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x10, 0x03, 0x2a, 0x3e, 0x0a, 0x08, 0x43, 0x61, 0x72, + 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x10, 0x00, + 0x12, 0x0a, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x68, 0x65, 0x61, 0x64, + 0x71, 0x75, 0x61, 0x72, 0x74, 0x65, 0x72, 0x10, 0x03, 0x42, 0xd1, 0x01, 0x0a, 0x17, 0x63, 0x6f, + 0x6d, 0x2e, 0x63, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x63, 0x61, 0x72, 0x64, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x42, 0x09, 0x43, 0x61, 0x72, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, + 0x65, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x43, 0x61, 0x72, 0x64, 0x47, 0x61, 0x6d, 0x65, + 0x2f, 0x63, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x61, 0x72, 0x64, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x43, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0xca, 0x02, + 0x13, 0x43, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x43, 0x61, 0x72, 0x64, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0xe2, 0x02, 0x1f, 0x43, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x5c, 0x43, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x3a, 0x3a, 0x43, 0x61, 0x72, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cardchain_cardchain_card_proto_rawDescOnce sync.Once + file_cardchain_cardchain_card_proto_rawDescData = file_cardchain_cardchain_card_proto_rawDesc +) + +func file_cardchain_cardchain_card_proto_rawDescGZIP() []byte { + file_cardchain_cardchain_card_proto_rawDescOnce.Do(func() { + file_cardchain_cardchain_card_proto_rawDescData = protoimpl.X.CompressGZIP(file_cardchain_cardchain_card_proto_rawDescData) + }) + return file_cardchain_cardchain_card_proto_rawDescData +} + +var file_cardchain_cardchain_card_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_cardchain_cardchain_card_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_cardchain_cardchain_card_proto_goTypes = []interface{}{ + (Status)(0), // 0: cardchain.cardchain.Status + (CardRarity)(0), // 1: cardchain.cardchain.CardRarity + (CardClass)(0), // 2: cardchain.cardchain.CardClass + (CardType)(0), // 3: cardchain.cardchain.CardType + (*Card)(nil), // 4: cardchain.cardchain.Card + (*CardWithImage)(nil), // 5: cardchain.cardchain.CardWithImage + (*TimeStamp)(nil), // 6: cardchain.cardchain.TimeStamp + (*v1beta1.Coin)(nil), // 7: cosmos.base.v1beta1.Coin +} +var file_cardchain_cardchain_card_proto_depIdxs = []int32{ + 0, // 0: cardchain.cardchain.Card.status:type_name -> cardchain.cardchain.Status + 7, // 1: cardchain.cardchain.Card.votePool:type_name -> cosmos.base.v1beta1.Coin + 1, // 2: cardchain.cardchain.Card.rarity:type_name -> cardchain.cardchain.CardRarity + 4, // 3: cardchain.cardchain.CardWithImage.card:type_name -> cardchain.cardchain.Card + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_cardchain_cardchain_card_proto_init() } +func file_cardchain_cardchain_card_proto_init() { + if File_cardchain_cardchain_card_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cardchain_cardchain_card_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Card); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cardchain_cardchain_card_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CardWithImage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cardchain_cardchain_card_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TimeStamp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cardchain_cardchain_card_proto_rawDesc, + NumEnums: 4, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cardchain_cardchain_card_proto_goTypes, + DependencyIndexes: file_cardchain_cardchain_card_proto_depIdxs, + EnumInfos: file_cardchain_cardchain_card_proto_enumTypes, + MessageInfos: file_cardchain_cardchain_card_proto_msgTypes, + }.Build() + File_cardchain_cardchain_card_proto = out.File + file_cardchain_cardchain_card_proto_rawDesc = nil + file_cardchain_cardchain_card_proto_goTypes = nil + file_cardchain_cardchain_card_proto_depIdxs = nil +} diff --git a/gen.sh b/gen.sh index 555087bf..a5c968d4 100755 --- a/gen.sh +++ b/gen.sh @@ -12,17 +12,21 @@ #ignite scaffold message CouncilDeregister #ignite scaffold message MatchReport matchId:uint playedCardsA:uints \ # playedCardsB:uints outcome:int -ignite scaffold message CouncilCreate cardId:uint -ignite scaffold message MatchReporterAppoint reporter:string -ignite scaffold message SetCreate name artist storyWriter contributors:strings -ignite scaffold message SetCardAdd setId:uint cardId:uint -ignite scaffold message SetCardRemove setId:uint cardId:uint -ignite scaffold message SetContributorAdd setId:uint user -ignite scaffold message SetContributorRemove setId:uint user -ignite scaffold message SetFinalize setId:uint -ignite scaffold message SetArtworkAdd setId:uint image -ignite scaffold message SetStoryAdd setId:uint story -ignite scaffold message BoosterPackBuy setId:uint --response airdropClaimed:bool -ignite scaffold message SellOfferCreate cardId:uint price:coin -ignite scaffold message SellOfferBuy sellOfferId:uint -ignite scaffold message SellOfferRemove sellOfferId:uint +#ignite scaffold message CouncilCreate cardId:uint +#ignite scaffold message MatchReporterAppoint reporter:string +#ignite scaffold message SetCreate name artist storyWriter contributors:strings +#ignite scaffold message SetCardAdd setId:uint cardId:uint +#ignite scaffold message SetCardRemove setId:uint cardId:uint +#ignite scaffold message SetContributorAdd setId:uint user +#ignite scaffold message SetContributorRemove setId:uint user +#ignite scaffold message SetFinalize setId:uint +#ignite scaffold message SetArtworkAdd setId:uint image +#ignite scaffold message SetStoryAdd setId:uint story +#ignite scaffold message BoosterPackBuy setId:uint --response airdropClaimed:bool +#ignite scaffold message SellOfferCreate cardId:uint price:coin +#ignite scaffold message SellOfferBuy sellOfferId:uint +#ignite scaffold message SellOfferRemove sellOfferId:uint +ignite scaffold message CardRaritySet cardId:uint setId:uint rarity:int +ignite scaffold message CouncilResponseCommit councilId:uint reponse \ + suggestion +ignite scaffold message CouncilResponseReveal councilId:uint reponse:int secret diff --git a/proto/cardchain/cardchain/card.proto b/proto/cardchain/cardchain/card.proto new file mode 100644 index 00000000..2688e4a3 --- /dev/null +++ b/proto/cardchain/cardchain/card.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; +package cardchain.cardchain; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/DecentralCardGame/cardchain/x/cardchain/types"; + +message Card { + string owner = 1; + string artist = 2; + bytes content = 3; + uint64 image_id = 4; + bool fullArt = 5; + string notes = 6; + Status status = 7; + cosmos.base.v1beta1.Coin votePool = 8 [ (gogoproto.nullable) = false ]; + repeated string voters = 14; + uint64 fairEnoughVotes = 9; + uint64 overpoweredVotes = 10; + uint64 underpoweredVotes = 11; + uint64 inappropriateVotes = 12; + int64 nerflevel = 13; + bool balanceAnchor = 15; + bool starterCard = 16; + CardRarity rarity = 17; +} + +message CardWithImage { + Card card = 1; + string image = 2; + string hash = 3; +} + +enum Status { + scheme = 0; + prototype = 1; + trial = 2; + permanent = 3; + suspended = 4; + banned = 5; + bannedSoon = 6; + bannedVerySoon = 7; + none = 8; + adventureItem = 9; +} + +enum CardRarity { + common = 0; + uncommon = 1; + rare = 2; + exceptional = 3; + unique = 4; +} + +enum CardClass { + nature = 0; + culture = 1; + mysticism = 2; + technology = 3; +} + +enum CardType { + place = 0; + action = 1; + entity = 2; + headquarter = 3; +} + +message TimeStamp { uint64 timeStamp = 1; } diff --git a/proto/cardchain/cardchain/council.proto b/proto/cardchain/cardchain/council.proto new file mode 100644 index 00000000..3cb19ea6 --- /dev/null +++ b/proto/cardchain/cardchain/council.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cardchain.cardchain; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/DecentralCardGame/cardchain/x/cardchain/types"; + +message Council { + uint64 cardId = 1; + repeated string voters = 2; + repeated WrapHashResponse hashResponses = 3; + repeated WrapClearResponse clearResponses = 4; + cosmos.base.v1beta1.Coin treasury = 8 [ (gogoproto.nullable) = false ]; + CouncelingStatus status = 6; + uint64 trialStart = 7; +} + +message WrapClearResponse { + string user = 1; + Response response = 2; + string suggestion = 3; +} + +message WrapHashResponse { + string user = 1; + string hash = 2; +} + +enum Response { + Yes = 0; + No = 1; + Suggestion = 2; +} + +enum CouncelingStatus { + councilOpen = 0; + councilCreated = 1; + councilClosed = 2; + commited = 3; + revealed = 4; + suggestionsMade = 5; +} diff --git a/x/cardchain/types/card.pb.go b/x/cardchain/types/card.pb.go new file mode 100644 index 00000000..7f1e6d76 --- /dev/null +++ b/x/cardchain/types/card.pb.go @@ -0,0 +1,1610 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cardchain/cardchain/card.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Status int32 + +const ( + Status_scheme Status = 0 + Status_prototype Status = 1 + Status_trial Status = 2 + Status_permanent Status = 3 + Status_suspended Status = 4 + Status_banned Status = 5 + Status_bannedSoon Status = 6 + Status_bannedVerySoon Status = 7 + Status_none Status = 8 + Status_adventureItem Status = 9 +) + +var Status_name = map[int32]string{ + 0: "scheme", + 1: "prototype", + 2: "trial", + 3: "permanent", + 4: "suspended", + 5: "banned", + 6: "bannedSoon", + 7: "bannedVerySoon", + 8: "none", + 9: "adventureItem", +} + +var Status_value = map[string]int32{ + "scheme": 0, + "prototype": 1, + "trial": 2, + "permanent": 3, + "suspended": 4, + "banned": 5, + "bannedSoon": 6, + "bannedVerySoon": 7, + "none": 8, + "adventureItem": 9, +} + +func (x Status) String() string { + return proto.EnumName(Status_name, int32(x)) +} + +func (Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_a360ffd2377ddc30, []int{0} +} + +type CardRarity int32 + +const ( + CardRarity_common CardRarity = 0 + CardRarity_uncommon CardRarity = 1 + CardRarity_rare CardRarity = 2 + CardRarity_exceptional CardRarity = 3 + CardRarity_unique CardRarity = 4 +) + +var CardRarity_name = map[int32]string{ + 0: "common", + 1: "uncommon", + 2: "rare", + 3: "exceptional", + 4: "unique", +} + +var CardRarity_value = map[string]int32{ + "common": 0, + "uncommon": 1, + "rare": 2, + "exceptional": 3, + "unique": 4, +} + +func (x CardRarity) String() string { + return proto.EnumName(CardRarity_name, int32(x)) +} + +func (CardRarity) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_a360ffd2377ddc30, []int{1} +} + +type CardClass int32 + +const ( + CardClass_nature CardClass = 0 + CardClass_culture CardClass = 1 + CardClass_mysticism CardClass = 2 + CardClass_technology CardClass = 3 +) + +var CardClass_name = map[int32]string{ + 0: "nature", + 1: "culture", + 2: "mysticism", + 3: "technology", +} + +var CardClass_value = map[string]int32{ + "nature": 0, + "culture": 1, + "mysticism": 2, + "technology": 3, +} + +func (x CardClass) String() string { + return proto.EnumName(CardClass_name, int32(x)) +} + +func (CardClass) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_a360ffd2377ddc30, []int{2} +} + +type CardType int32 + +const ( + CardType_place CardType = 0 + CardType_action CardType = 1 + CardType_entity CardType = 2 + CardType_headquarter CardType = 3 +) + +var CardType_name = map[int32]string{ + 0: "place", + 1: "action", + 2: "entity", + 3: "headquarter", +} + +var CardType_value = map[string]int32{ + "place": 0, + "action": 1, + "entity": 2, + "headquarter": 3, +} + +func (x CardType) String() string { + return proto.EnumName(CardType_name, int32(x)) +} + +func (CardType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_a360ffd2377ddc30, []int{3} +} + +type Card struct { + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Artist string `protobuf:"bytes,2,opt,name=artist,proto3" json:"artist,omitempty"` + Content []byte `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + ImageId uint64 `protobuf:"varint,4,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` + FullArt bool `protobuf:"varint,5,opt,name=fullArt,proto3" json:"fullArt,omitempty"` + Notes string `protobuf:"bytes,6,opt,name=notes,proto3" json:"notes,omitempty"` + Status Status `protobuf:"varint,7,opt,name=status,proto3,enum=cardchain.cardchain.Status" json:"status,omitempty"` + VotePool types.Coin `protobuf:"bytes,8,opt,name=votePool,proto3" json:"votePool"` + Voters []string `protobuf:"bytes,14,rep,name=voters,proto3" json:"voters,omitempty"` + FairEnoughVotes uint64 `protobuf:"varint,9,opt,name=fairEnoughVotes,proto3" json:"fairEnoughVotes,omitempty"` + OverpoweredVotes uint64 `protobuf:"varint,10,opt,name=overpoweredVotes,proto3" json:"overpoweredVotes,omitempty"` + UnderpoweredVotes uint64 `protobuf:"varint,11,opt,name=underpoweredVotes,proto3" json:"underpoweredVotes,omitempty"` + InappropriateVotes uint64 `protobuf:"varint,12,opt,name=inappropriateVotes,proto3" json:"inappropriateVotes,omitempty"` + Nerflevel int64 `protobuf:"varint,13,opt,name=nerflevel,proto3" json:"nerflevel,omitempty"` + BalanceAnchor bool `protobuf:"varint,15,opt,name=balanceAnchor,proto3" json:"balanceAnchor,omitempty"` + StarterCard bool `protobuf:"varint,16,opt,name=starterCard,proto3" json:"starterCard,omitempty"` + Rarity CardRarity `protobuf:"varint,17,opt,name=rarity,proto3,enum=cardchain.cardchain.CardRarity" json:"rarity,omitempty"` +} + +func (m *Card) Reset() { *m = Card{} } +func (m *Card) String() string { return proto.CompactTextString(m) } +func (*Card) ProtoMessage() {} +func (*Card) Descriptor() ([]byte, []int) { + return fileDescriptor_a360ffd2377ddc30, []int{0} +} +func (m *Card) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Card) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Card.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 *Card) XXX_Merge(src proto.Message) { + xxx_messageInfo_Card.Merge(m, src) +} +func (m *Card) XXX_Size() int { + return m.Size() +} +func (m *Card) XXX_DiscardUnknown() { + xxx_messageInfo_Card.DiscardUnknown(m) +} + +var xxx_messageInfo_Card proto.InternalMessageInfo + +func (m *Card) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *Card) GetArtist() string { + if m != nil { + return m.Artist + } + return "" +} + +func (m *Card) GetContent() []byte { + if m != nil { + return m.Content + } + return nil +} + +func (m *Card) GetImageId() uint64 { + if m != nil { + return m.ImageId + } + return 0 +} + +func (m *Card) GetFullArt() bool { + if m != nil { + return m.FullArt + } + return false +} + +func (m *Card) GetNotes() string { + if m != nil { + return m.Notes + } + return "" +} + +func (m *Card) GetStatus() Status { + if m != nil { + return m.Status + } + return Status_scheme +} + +func (m *Card) GetVotePool() types.Coin { + if m != nil { + return m.VotePool + } + return types.Coin{} +} + +func (m *Card) GetVoters() []string { + if m != nil { + return m.Voters + } + return nil +} + +func (m *Card) GetFairEnoughVotes() uint64 { + if m != nil { + return m.FairEnoughVotes + } + return 0 +} + +func (m *Card) GetOverpoweredVotes() uint64 { + if m != nil { + return m.OverpoweredVotes + } + return 0 +} + +func (m *Card) GetUnderpoweredVotes() uint64 { + if m != nil { + return m.UnderpoweredVotes + } + return 0 +} + +func (m *Card) GetInappropriateVotes() uint64 { + if m != nil { + return m.InappropriateVotes + } + return 0 +} + +func (m *Card) GetNerflevel() int64 { + if m != nil { + return m.Nerflevel + } + return 0 +} + +func (m *Card) GetBalanceAnchor() bool { + if m != nil { + return m.BalanceAnchor + } + return false +} + +func (m *Card) GetStarterCard() bool { + if m != nil { + return m.StarterCard + } + return false +} + +func (m *Card) GetRarity() CardRarity { + if m != nil { + return m.Rarity + } + return CardRarity_common +} + +type CardWithImage struct { + Card *Card `protobuf:"bytes,1,opt,name=card,proto3" json:"card,omitempty"` + Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *CardWithImage) Reset() { *m = CardWithImage{} } +func (m *CardWithImage) String() string { return proto.CompactTextString(m) } +func (*CardWithImage) ProtoMessage() {} +func (*CardWithImage) Descriptor() ([]byte, []int) { + return fileDescriptor_a360ffd2377ddc30, []int{1} +} +func (m *CardWithImage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CardWithImage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CardWithImage.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 *CardWithImage) XXX_Merge(src proto.Message) { + xxx_messageInfo_CardWithImage.Merge(m, src) +} +func (m *CardWithImage) XXX_Size() int { + return m.Size() +} +func (m *CardWithImage) XXX_DiscardUnknown() { + xxx_messageInfo_CardWithImage.DiscardUnknown(m) +} + +var xxx_messageInfo_CardWithImage proto.InternalMessageInfo + +func (m *CardWithImage) GetCard() *Card { + if m != nil { + return m.Card + } + return nil +} + +func (m *CardWithImage) GetImage() string { + if m != nil { + return m.Image + } + return "" +} + +func (m *CardWithImage) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +type TimeStamp struct { + TimeStamp uint64 `protobuf:"varint,1,opt,name=timeStamp,proto3" json:"timeStamp,omitempty"` +} + +func (m *TimeStamp) Reset() { *m = TimeStamp{} } +func (m *TimeStamp) String() string { return proto.CompactTextString(m) } +func (*TimeStamp) ProtoMessage() {} +func (*TimeStamp) Descriptor() ([]byte, []int) { + return fileDescriptor_a360ffd2377ddc30, []int{2} +} +func (m *TimeStamp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TimeStamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TimeStamp.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 *TimeStamp) XXX_Merge(src proto.Message) { + xxx_messageInfo_TimeStamp.Merge(m, src) +} +func (m *TimeStamp) XXX_Size() int { + return m.Size() +} +func (m *TimeStamp) XXX_DiscardUnknown() { + xxx_messageInfo_TimeStamp.DiscardUnknown(m) +} + +var xxx_messageInfo_TimeStamp proto.InternalMessageInfo + +func (m *TimeStamp) GetTimeStamp() uint64 { + if m != nil { + return m.TimeStamp + } + return 0 +} + +func init() { + proto.RegisterEnum("cardchain.cardchain.Status", Status_name, Status_value) + proto.RegisterEnum("cardchain.cardchain.CardRarity", CardRarity_name, CardRarity_value) + proto.RegisterEnum("cardchain.cardchain.CardClass", CardClass_name, CardClass_value) + proto.RegisterEnum("cardchain.cardchain.CardType", CardType_name, CardType_value) + proto.RegisterType((*Card)(nil), "cardchain.cardchain.Card") + proto.RegisterType((*CardWithImage)(nil), "cardchain.cardchain.CardWithImage") + proto.RegisterType((*TimeStamp)(nil), "cardchain.cardchain.TimeStamp") +} + +func init() { proto.RegisterFile("cardchain/cardchain/card.proto", fileDescriptor_a360ffd2377ddc30) } + +var fileDescriptor_a360ffd2377ddc30 = []byte{ + // 785 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0x4d, 0x6f, 0xdb, 0x46, + 0x10, 0x15, 0x2d, 0x9a, 0x12, 0x47, 0x96, 0xbd, 0xde, 0x06, 0x05, 0x93, 0x16, 0x0a, 0x61, 0xf4, + 0xc0, 0x0a, 0x2d, 0x85, 0x24, 0x87, 0x16, 0x28, 0x50, 0x20, 0x51, 0x8b, 0xc2, 0x87, 0x02, 0x05, + 0x1d, 0xa4, 0x40, 0x2f, 0xc5, 0x6a, 0x39, 0x16, 0x17, 0x20, 0x77, 0x99, 0xdd, 0xa5, 0x12, 0xfd, + 0x8b, 0x5e, 0xfb, 0x8f, 0x72, 0xcc, 0xb1, 0xa7, 0xa2, 0xb0, 0xff, 0x43, 0xcf, 0xc5, 0x2e, 0xe5, + 0x8f, 0xc4, 0xee, 0x6d, 0xde, 0x9b, 0xb7, 0x33, 0x9c, 0x99, 0x27, 0xc1, 0x8c, 0x33, 0x5d, 0xf2, + 0x8a, 0x09, 0xb9, 0xf8, 0x30, 0xca, 0x5b, 0xad, 0xac, 0xa2, 0x9f, 0x5c, 0xb3, 0xf9, 0x75, 0xf4, + 0xe8, 0xc1, 0x5a, 0xad, 0x95, 0xcf, 0x2f, 0x5c, 0xd4, 0x4b, 0x1f, 0xcd, 0xb8, 0x32, 0x8d, 0x32, + 0x8b, 0x15, 0x33, 0xb8, 0xd8, 0x3c, 0x59, 0xa1, 0x65, 0x4f, 0x16, 0x5c, 0x09, 0xd9, 0xe7, 0x4f, + 0xfe, 0x0d, 0x21, 0x5c, 0x32, 0x5d, 0xd2, 0x07, 0xb0, 0xaf, 0xde, 0x48, 0xd4, 0x49, 0x90, 0x06, + 0x59, 0x5c, 0xf4, 0x80, 0x7e, 0x0a, 0x11, 0xd3, 0x56, 0x18, 0x9b, 0xec, 0x79, 0x7a, 0x87, 0x68, + 0x02, 0x23, 0xae, 0xa4, 0x45, 0x69, 0x93, 0x61, 0x1a, 0x64, 0x07, 0xc5, 0x15, 0xa4, 0x0f, 0x61, + 0x2c, 0x1a, 0xb6, 0xc6, 0xdf, 0x45, 0x99, 0x84, 0x69, 0x90, 0x85, 0xc5, 0xc8, 0xe3, 0xd3, 0xd2, + 0x3d, 0x3a, 0xef, 0xea, 0xfa, 0xb9, 0xb6, 0xc9, 0x7e, 0x1a, 0x64, 0xe3, 0xe2, 0x0a, 0xba, 0xe6, + 0x52, 0x59, 0x34, 0x49, 0xd4, 0x37, 0xf7, 0x80, 0x3e, 0x83, 0xc8, 0x58, 0x66, 0x3b, 0x93, 0x8c, + 0xd2, 0x20, 0x3b, 0x7c, 0xfa, 0x59, 0x7e, 0xcf, 0xdc, 0xf9, 0x99, 0x97, 0x14, 0x3b, 0x29, 0xfd, + 0x0e, 0xc6, 0x1b, 0x65, 0xf1, 0x17, 0xa5, 0xea, 0x64, 0x9c, 0x06, 0xd9, 0xe4, 0xe9, 0xc3, 0xbc, + 0xdf, 0x41, 0xee, 0x76, 0x90, 0xef, 0x76, 0x90, 0x2f, 0x95, 0x90, 0x2f, 0xc2, 0x77, 0x7f, 0x3f, + 0x1e, 0x14, 0xd7, 0x0f, 0xdc, 0xb8, 0x2e, 0xd6, 0x26, 0x39, 0x4c, 0x87, 0x6e, 0xdc, 0x1e, 0xd1, + 0x0c, 0x8e, 0xce, 0x99, 0xd0, 0x3f, 0x4a, 0xd5, 0xad, 0xab, 0x57, 0xfe, 0x4b, 0x63, 0x3f, 0xdb, + 0xc7, 0x34, 0x9d, 0x03, 0x51, 0x1b, 0xd4, 0xad, 0x7a, 0x83, 0x1a, 0xcb, 0x5e, 0x0a, 0x5e, 0x7a, + 0x87, 0xa7, 0x5f, 0xc1, 0x71, 0x27, 0xcb, 0x8f, 0xc4, 0x13, 0x2f, 0xbe, 0x9b, 0xa0, 0x39, 0x50, + 0x21, 0x59, 0xdb, 0x6a, 0xd5, 0x6a, 0xc1, 0x2c, 0xf6, 0xf2, 0x03, 0x2f, 0xbf, 0x27, 0x43, 0x3f, + 0x87, 0x58, 0xa2, 0x3e, 0xaf, 0x71, 0x83, 0x75, 0x32, 0x4d, 0x83, 0x6c, 0x58, 0xdc, 0x10, 0xf4, + 0x0b, 0x98, 0xae, 0x58, 0xcd, 0x24, 0xc7, 0xe7, 0x92, 0x57, 0x4a, 0x27, 0x47, 0xfe, 0x22, 0x1f, + 0x92, 0x34, 0x85, 0x89, 0xb1, 0x4c, 0x5b, 0xd4, 0xce, 0x23, 0x09, 0xf1, 0x9a, 0xdb, 0x14, 0xfd, + 0x06, 0x22, 0xcd, 0xb4, 0xb0, 0xdb, 0xe4, 0xd8, 0xdf, 0xe8, 0xf1, 0xbd, 0x37, 0x72, 0xd2, 0xc2, + 0xcb, 0x8a, 0x9d, 0xfc, 0xa4, 0x82, 0xa9, 0x63, 0x7f, 0x15, 0xb6, 0x3a, 0x75, 0xfe, 0xa0, 0x5f, + 0x43, 0xe8, 0x1e, 0x78, 0xff, 0xf9, 0xa3, 0xfd, 0x5f, 0x1d, 0x2f, 0x73, 0x96, 0xf1, 0xbe, 0xda, + 0x19, 0xb3, 0x07, 0x94, 0x42, 0x58, 0x31, 0x53, 0x79, 0x53, 0xc6, 0x85, 0x8f, 0x4f, 0xbe, 0x84, + 0xf8, 0xa5, 0x68, 0xf0, 0xcc, 0xb2, 0xa6, 0x75, 0x5b, 0xb1, 0x57, 0xc0, 0xb7, 0x0a, 0x8b, 0x1b, + 0x62, 0xfe, 0x67, 0x00, 0x51, 0xef, 0x27, 0x0a, 0x10, 0x19, 0x5e, 0x61, 0x83, 0x64, 0x40, 0xa7, + 0x10, 0xfb, 0x5f, 0x8b, 0xdd, 0xb6, 0x48, 0x02, 0x1a, 0xc3, 0xbe, 0xd5, 0x82, 0xd5, 0x64, 0xcf, + 0x67, 0x50, 0x37, 0x4c, 0xa2, 0xb4, 0x64, 0xe8, 0xa0, 0xe9, 0x4c, 0x8b, 0xb2, 0xc4, 0x92, 0x84, + 0xae, 0xc6, 0x8a, 0x49, 0x89, 0x25, 0xd9, 0xa7, 0x87, 0x00, 0x7d, 0x7c, 0xa6, 0x94, 0x24, 0x11, + 0xa5, 0x70, 0xd8, 0xe3, 0x57, 0xa8, 0xb7, 0x9e, 0x1b, 0xd1, 0x31, 0x84, 0x52, 0x49, 0x24, 0x63, + 0x7a, 0x0c, 0x53, 0x56, 0x6e, 0x50, 0xda, 0x4e, 0xe3, 0xa9, 0xc5, 0x86, 0xc4, 0xf3, 0x9f, 0x01, + 0x6e, 0xd6, 0xe8, 0x4a, 0x73, 0xd5, 0x34, 0x4a, 0x92, 0x01, 0x3d, 0x80, 0x71, 0x27, 0x77, 0x28, + 0x70, 0x45, 0x34, 0xd3, 0x48, 0xf6, 0xe8, 0x11, 0x4c, 0xf0, 0x2d, 0xc7, 0xd6, 0x0a, 0x25, 0x59, + 0x4d, 0x86, 0xee, 0x51, 0x27, 0xc5, 0xeb, 0x0e, 0x49, 0x38, 0x5f, 0x42, 0xec, 0xca, 0x2d, 0x6b, + 0x66, 0xfc, 0xb0, 0x92, 0xb9, 0x5e, 0x64, 0x40, 0x27, 0x30, 0xe2, 0x5d, 0xed, 0x41, 0xe0, 0x06, + 0x6a, 0xb6, 0xc6, 0x0a, 0x2e, 0x4c, 0x43, 0xf6, 0xdc, 0x10, 0x16, 0x79, 0x25, 0x55, 0xad, 0xd6, + 0x5b, 0x32, 0x9c, 0x7f, 0x0f, 0x63, 0x57, 0xe4, 0xe5, 0xb6, 0x45, 0xb7, 0x95, 0xb6, 0x66, 0xdc, + 0x95, 0x00, 0x88, 0x18, 0x77, 0x5d, 0x49, 0xe0, 0x62, 0x94, 0x56, 0xd8, 0x6d, 0xff, 0x41, 0x15, + 0xb2, 0xf2, 0x75, 0xe7, 0xfd, 0x43, 0x86, 0x2f, 0x8a, 0x77, 0x17, 0xb3, 0xe0, 0xfd, 0xc5, 0x2c, + 0xf8, 0xe7, 0x62, 0x16, 0xfc, 0x71, 0x39, 0x1b, 0xbc, 0xbf, 0x9c, 0x0d, 0xfe, 0xba, 0x9c, 0x0d, + 0x7e, 0xfb, 0x76, 0x2d, 0x6c, 0xd5, 0xad, 0x72, 0xae, 0x9a, 0xc5, 0x0f, 0xc8, 0x51, 0x5a, 0xcd, + 0x6a, 0xd7, 0xeb, 0x27, 0xd6, 0xe0, 0xad, 0x7f, 0xc5, 0xb7, 0xb7, 0x62, 0x77, 0x1e, 0xb3, 0x8a, + 0xfc, 0xa9, 0x9e, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x01, 0xfd, 0x47, 0x47, 0x45, 0x05, 0x00, + 0x00, +} + +func (m *Card) 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 *Card) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Card) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Rarity != 0 { + i = encodeVarintCard(dAtA, i, uint64(m.Rarity)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if m.StarterCard { + i-- + if m.StarterCard { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.BalanceAnchor { + i-- + if m.BalanceAnchor { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 + } + if len(m.Voters) > 0 { + for iNdEx := len(m.Voters) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Voters[iNdEx]) + copy(dAtA[i:], m.Voters[iNdEx]) + i = encodeVarintCard(dAtA, i, uint64(len(m.Voters[iNdEx]))) + i-- + dAtA[i] = 0x72 + } + } + if m.Nerflevel != 0 { + i = encodeVarintCard(dAtA, i, uint64(m.Nerflevel)) + i-- + dAtA[i] = 0x68 + } + if m.InappropriateVotes != 0 { + i = encodeVarintCard(dAtA, i, uint64(m.InappropriateVotes)) + i-- + dAtA[i] = 0x60 + } + if m.UnderpoweredVotes != 0 { + i = encodeVarintCard(dAtA, i, uint64(m.UnderpoweredVotes)) + i-- + dAtA[i] = 0x58 + } + if m.OverpoweredVotes != 0 { + i = encodeVarintCard(dAtA, i, uint64(m.OverpoweredVotes)) + i-- + dAtA[i] = 0x50 + } + if m.FairEnoughVotes != 0 { + i = encodeVarintCard(dAtA, i, uint64(m.FairEnoughVotes)) + i-- + dAtA[i] = 0x48 + } + { + size, err := m.VotePool.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCard(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if m.Status != 0 { + i = encodeVarintCard(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x38 + } + if len(m.Notes) > 0 { + i -= len(m.Notes) + copy(dAtA[i:], m.Notes) + i = encodeVarintCard(dAtA, i, uint64(len(m.Notes))) + i-- + dAtA[i] = 0x32 + } + if m.FullArt { + i-- + if m.FullArt { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.ImageId != 0 { + i = encodeVarintCard(dAtA, i, uint64(m.ImageId)) + i-- + dAtA[i] = 0x20 + } + if len(m.Content) > 0 { + i -= len(m.Content) + copy(dAtA[i:], m.Content) + i = encodeVarintCard(dAtA, i, uint64(len(m.Content))) + i-- + dAtA[i] = 0x1a + } + if len(m.Artist) > 0 { + i -= len(m.Artist) + copy(dAtA[i:], m.Artist) + i = encodeVarintCard(dAtA, i, uint64(len(m.Artist))) + i-- + dAtA[i] = 0x12 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintCard(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CardWithImage) 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 *CardWithImage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CardWithImage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintCard(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x1a + } + if len(m.Image) > 0 { + i -= len(m.Image) + copy(dAtA[i:], m.Image) + i = encodeVarintCard(dAtA, i, uint64(len(m.Image))) + i-- + dAtA[i] = 0x12 + } + if m.Card != nil { + { + size, err := m.Card.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCard(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TimeStamp) 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 *TimeStamp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TimeStamp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TimeStamp != 0 { + i = encodeVarintCard(dAtA, i, uint64(m.TimeStamp)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintCard(dAtA []byte, offset int, v uint64) int { + offset -= sovCard(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Card) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovCard(uint64(l)) + } + l = len(m.Artist) + if l > 0 { + n += 1 + l + sovCard(uint64(l)) + } + l = len(m.Content) + if l > 0 { + n += 1 + l + sovCard(uint64(l)) + } + if m.ImageId != 0 { + n += 1 + sovCard(uint64(m.ImageId)) + } + if m.FullArt { + n += 2 + } + l = len(m.Notes) + if l > 0 { + n += 1 + l + sovCard(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovCard(uint64(m.Status)) + } + l = m.VotePool.Size() + n += 1 + l + sovCard(uint64(l)) + if m.FairEnoughVotes != 0 { + n += 1 + sovCard(uint64(m.FairEnoughVotes)) + } + if m.OverpoweredVotes != 0 { + n += 1 + sovCard(uint64(m.OverpoweredVotes)) + } + if m.UnderpoweredVotes != 0 { + n += 1 + sovCard(uint64(m.UnderpoweredVotes)) + } + if m.InappropriateVotes != 0 { + n += 1 + sovCard(uint64(m.InappropriateVotes)) + } + if m.Nerflevel != 0 { + n += 1 + sovCard(uint64(m.Nerflevel)) + } + if len(m.Voters) > 0 { + for _, s := range m.Voters { + l = len(s) + n += 1 + l + sovCard(uint64(l)) + } + } + if m.BalanceAnchor { + n += 2 + } + if m.StarterCard { + n += 3 + } + if m.Rarity != 0 { + n += 2 + sovCard(uint64(m.Rarity)) + } + return n +} + +func (m *CardWithImage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Card != nil { + l = m.Card.Size() + n += 1 + l + sovCard(uint64(l)) + } + l = len(m.Image) + if l > 0 { + n += 1 + l + sovCard(uint64(l)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovCard(uint64(l)) + } + return n +} + +func (m *TimeStamp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TimeStamp != 0 { + n += 1 + sovCard(uint64(m.TimeStamp)) + } + return n +} + +func sovCard(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCard(x uint64) (n int) { + return sovCard(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Card) 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 ErrIntOverflowCard + } + 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: Card: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Card: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + 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 ErrInvalidLengthCard + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCard + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Artist", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + 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 ErrInvalidLengthCard + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCard + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Artist = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCard + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCard + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Content = append(m.Content[:0], dAtA[iNdEx:postIndex]...) + if m.Content == nil { + m.Content = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ImageId", wireType) + } + m.ImageId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ImageId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FullArt", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FullArt = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Notes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + 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 ErrInvalidLengthCard + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCard + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Notes = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= Status(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotePool", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCard + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCard + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VotePool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FairEnoughVotes", wireType) + } + m.FairEnoughVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FairEnoughVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OverpoweredVotes", wireType) + } + m.OverpoweredVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OverpoweredVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnderpoweredVotes", wireType) + } + m.UnderpoweredVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnderpoweredVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InappropriateVotes", wireType) + } + m.InappropriateVotes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InappropriateVotes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nerflevel", wireType) + } + m.Nerflevel = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Nerflevel |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voters", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + 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 ErrInvalidLengthCard + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCard + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Voters = append(m.Voters, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BalanceAnchor", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BalanceAnchor = bool(v != 0) + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StarterCard", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.StarterCard = bool(v != 0) + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Rarity", wireType) + } + m.Rarity = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Rarity |= CardRarity(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCard(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCard + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CardWithImage) 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 ErrIntOverflowCard + } + 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: CardWithImage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CardWithImage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Card", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCard + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCard + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Card == nil { + m.Card = &Card{} + } + if err := m.Card.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + 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 ErrInvalidLengthCard + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCard + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Image = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + 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 ErrInvalidLengthCard + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCard + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCard(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCard + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TimeStamp) 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 ErrIntOverflowCard + } + 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: TimeStamp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TimeStamp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeStamp", wireType) + } + m.TimeStamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeStamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCard(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCard + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCard(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, ErrIntOverflowCard + } + 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, ErrIntOverflowCard + } + 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, ErrIntOverflowCard + } + 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, ErrInvalidLengthCard + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCard + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCard + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCard = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCard = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCard = fmt.Errorf("proto: unexpected end of group") +)