From 23d9125287fe74a15cdd4fcebce5ec7ea70af94b Mon Sep 17 00:00:00 2001 From: Olimdzhon Date: Fri, 26 Jul 2024 02:59:44 +0500 Subject: [PATCH] created storedGame with properties board turn black red index; --- api/checkers/checkers/genesis.pulsar.go | 220 +- api/checkers/checkers/query.pulsar.go | 2248 ++++++++++++++++++- api/checkers/checkers/query_grpc.pb.go | 80 +- api/checkers/checkers/stored_game.pulsar.go | 862 +++++++ docs/static/openapi.yml | 2 +- proto/checkers/checkers/genesis.proto | 6 +- proto/checkers/checkers/query.proto | 28 + proto/checkers/checkers/stored_game.proto | 14 + x/checkers/keeper/query_stored_game.go | 55 + x/checkers/keeper/query_stored_game_test.go | 124 + x/checkers/keeper/stored_game.go | 70 + x/checkers/keeper/stored_game_test.go | 63 + x/checkers/module/autocli.go | 11 + x/checkers/module/genesis.go | 5 + x/checkers/module/genesis_test.go | 9 + x/checkers/types/genesis.go | 17 +- x/checkers/types/genesis.pb.go | 92 +- x/checkers/types/genesis_test.go | 22 + x/checkers/types/key_stored_game.go | 23 + x/checkers/types/query.pb.go | 905 +++++++- x/checkers/types/query.pb.gw.go | 184 ++ x/checkers/types/stored_game.pb.go | 524 +++++ 22 files changed, 5420 insertions(+), 144 deletions(-) create mode 100644 api/checkers/checkers/stored_game.pulsar.go create mode 100644 proto/checkers/checkers/stored_game.proto create mode 100644 x/checkers/keeper/query_stored_game.go create mode 100644 x/checkers/keeper/query_stored_game_test.go create mode 100644 x/checkers/keeper/stored_game.go create mode 100644 x/checkers/keeper/stored_game_test.go create mode 100644 x/checkers/types/key_stored_game.go create mode 100644 x/checkers/types/stored_game.pb.go diff --git a/api/checkers/checkers/genesis.pulsar.go b/api/checkers/checkers/genesis.pulsar.go index f456bfc..c9c151f 100644 --- a/api/checkers/checkers/genesis.pulsar.go +++ b/api/checkers/checkers/genesis.pulsar.go @@ -15,10 +15,62 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) +var _ protoreflect.List = (*_GenesisState_3_list)(nil) + +type _GenesisState_3_list struct { + list *[]*StoredGame +} + +func (x *_GenesisState_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*StoredGame) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*StoredGame) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_3_list) AppendMutable() protoreflect.Value { + v := new(StoredGame) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_3_list) NewElement() protoreflect.Value { + v := new(StoredGame) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) IsValid() bool { + return x.list != nil +} + var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_params protoreflect.FieldDescriptor - fd_GenesisState_systemInfo protoreflect.FieldDescriptor + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_systemInfo protoreflect.FieldDescriptor + fd_GenesisState_storedGameList protoreflect.FieldDescriptor ) func init() { @@ -26,6 +78,7 @@ func init() { md_GenesisState = File_checkers_checkers_genesis_proto.Messages().ByName("GenesisState") fd_GenesisState_params = md_GenesisState.Fields().ByName("params") fd_GenesisState_systemInfo = md_GenesisState.Fields().ByName("systemInfo") + fd_GenesisState_storedGameList = md_GenesisState.Fields().ByName("storedGameList") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -105,6 +158,12 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } + if len(x.StoredGameList) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_3_list{list: &x.StoredGameList}) + if !f(fd_GenesisState_storedGameList, value) { + return + } + } } // Has reports whether a field is populated. @@ -124,6 +183,8 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool return x.Params != nil case "checkers.checkers.GenesisState.systemInfo": return x.SystemInfo != nil + case "checkers.checkers.GenesisState.storedGameList": + return len(x.StoredGameList) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.GenesisState")) @@ -144,6 +205,8 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { x.Params = nil case "checkers.checkers.GenesisState.systemInfo": x.SystemInfo = nil + case "checkers.checkers.GenesisState.storedGameList": + x.StoredGameList = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.GenesisState")) @@ -166,6 +229,12 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto case "checkers.checkers.GenesisState.systemInfo": value := x.SystemInfo return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "checkers.checkers.GenesisState.storedGameList": + if len(x.StoredGameList) == 0 { + return protoreflect.ValueOfList(&_GenesisState_3_list{}) + } + listValue := &_GenesisState_3_list{list: &x.StoredGameList} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.GenesisState")) @@ -190,6 +259,10 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value x.Params = value.Message().Interface().(*Params) case "checkers.checkers.GenesisState.systemInfo": x.SystemInfo = value.Message().Interface().(*SystemInfo) + case "checkers.checkers.GenesisState.storedGameList": + lv := value.List() + clv := lv.(*_GenesisState_3_list) + x.StoredGameList = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.GenesisState")) @@ -220,6 +293,12 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p x.SystemInfo = new(SystemInfo) } return protoreflect.ValueOfMessage(x.SystemInfo.ProtoReflect()) + case "checkers.checkers.GenesisState.storedGameList": + if x.StoredGameList == nil { + x.StoredGameList = []*StoredGame{} + } + value := &_GenesisState_3_list{list: &x.StoredGameList} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.GenesisState")) @@ -239,6 +318,9 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "checkers.checkers.GenesisState.systemInfo": m := new(SystemInfo) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "checkers.checkers.GenesisState.storedGameList": + list := []*StoredGame{} + return protoreflect.ValueOfList(&_GenesisState_3_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.GenesisState")) @@ -316,6 +398,12 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { l = options.Size(x.SystemInfo) n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.StoredGameList) > 0 { + for _, e := range x.StoredGameList { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -345,6 +433,22 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.StoredGameList) > 0 { + for iNdEx := len(x.StoredGameList) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.StoredGameList[iNdEx]) + 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] = 0x1a + } + } if x.SystemInfo != nil { encoded, err := options.Marshal(x.SystemInfo) if err != nil { @@ -494,6 +598,40 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StoredGameList", 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 + } + x.StoredGameList = append(x.StoredGameList, &StoredGame{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.StoredGameList[len(x.StoredGameList)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -549,8 +687,9 @@ type GenesisState struct { unknownFields protoimpl.UnknownFields // params defines all the parameters of the module. - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` - SystemInfo *SystemInfo `protobuf:"bytes,2,opt,name=systemInfo,proto3" json:"systemInfo,omitempty"` + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + SystemInfo *SystemInfo `protobuf:"bytes,2,opt,name=systemInfo,proto3" json:"systemInfo,omitempty"` + StoredGameList []*StoredGame `protobuf:"bytes,3,rep,name=storedGameList,proto3" json:"storedGameList,omitempty"` } func (x *GenesisState) Reset() { @@ -587,6 +726,13 @@ func (x *GenesisState) GetSystemInfo() *SystemInfo { return nil } +func (x *GenesisState) GetStoredGameList() []*StoredGame { + if x != nil { + return x.StoredGameList + } + return nil +} + var File_checkers_checkers_genesis_proto protoreflect.FileDescriptor var file_checkers_checkers_genesis_proto_rawDesc = []byte{ @@ -600,28 +746,35 @@ var file_checkers_checkers_genesis_proto_rawDesc = []byte{ 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x8b, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, - 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x3d, 0x0a, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, - 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, - 0x42, 0xbf, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, - 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6c, 0x69, 0x6d, 0x64, 0x7a, 0x68, 0x6f, 0x6e, - 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0xa2, - 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, - 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0xca, 0x02, 0x11, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x65, 0x72, 0x73, 0x5c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0xe2, 0x02, 0x1d, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x5c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, - 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x3a, 0x3a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, - 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x1a, 0x23, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x67, 0x61, 0x6d, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd8, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3d, 0x0a, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x53, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4b, 0x0a, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, + 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, + 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x42, 0xbf, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x42, 0x0c, 0x47, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6c, 0x69, 0x6d, 0x64, 0x7a, 0x68, + 0x6f, 0x6e, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, + 0x73, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, + 0x72, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0xca, 0x02, 0x11, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x5c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0xe2, + 0x02, 0x1d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x5c, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x65, 0x72, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x3a, 0x3a, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x65, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -641,15 +794,17 @@ var file_checkers_checkers_genesis_proto_goTypes = []interface{}{ (*GenesisState)(nil), // 0: checkers.checkers.GenesisState (*Params)(nil), // 1: checkers.checkers.Params (*SystemInfo)(nil), // 2: checkers.checkers.SystemInfo + (*StoredGame)(nil), // 3: checkers.checkers.StoredGame } var file_checkers_checkers_genesis_proto_depIdxs = []int32{ 1, // 0: checkers.checkers.GenesisState.params:type_name -> checkers.checkers.Params 2, // 1: checkers.checkers.GenesisState.systemInfo:type_name -> checkers.checkers.SystemInfo - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 3, // 2: checkers.checkers.GenesisState.storedGameList:type_name -> checkers.checkers.StoredGame + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_checkers_checkers_genesis_proto_init() } @@ -659,6 +814,7 @@ func file_checkers_checkers_genesis_proto_init() { } file_checkers_checkers_params_proto_init() file_checkers_checkers_system_info_proto_init() + file_checkers_checkers_stored_game_proto_init() if !protoimpl.UnsafeEnabled { file_checkers_checkers_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenesisState); i { diff --git a/api/checkers/checkers/query.pulsar.go b/api/checkers/checkers/query.pulsar.go index ed9e71c..ed4d6fd 100644 --- a/api/checkers/checkers/query.pulsar.go +++ b/api/checkers/checkers/query.pulsar.go @@ -8,7 +8,7 @@ import ( sync "sync" _ "cosmossdk.io/api/amino" - _ "cosmossdk.io/api/cosmos/base/query/v1beta1" + v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -1599,6 +1599,1869 @@ func (x *fastReflection_QueryGetSystemInfoResponse) ProtoMethods() *protoiface.M } } +var ( + md_QueryGetStoredGameRequest protoreflect.MessageDescriptor + fd_QueryGetStoredGameRequest_index protoreflect.FieldDescriptor +) + +func init() { + file_checkers_checkers_query_proto_init() + md_QueryGetStoredGameRequest = File_checkers_checkers_query_proto.Messages().ByName("QueryGetStoredGameRequest") + fd_QueryGetStoredGameRequest_index = md_QueryGetStoredGameRequest.Fields().ByName("index") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetStoredGameRequest)(nil) + +type fastReflection_QueryGetStoredGameRequest QueryGetStoredGameRequest + +func (x *QueryGetStoredGameRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetStoredGameRequest)(x) +} + +func (x *QueryGetStoredGameRequest) slowProtoReflect() protoreflect.Message { + mi := &file_checkers_checkers_query_proto_msgTypes[4] + 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_QueryGetStoredGameRequest_messageType fastReflection_QueryGetStoredGameRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetStoredGameRequest_messageType{} + +type fastReflection_QueryGetStoredGameRequest_messageType struct{} + +func (x fastReflection_QueryGetStoredGameRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetStoredGameRequest)(nil) +} +func (x fastReflection_QueryGetStoredGameRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetStoredGameRequest) +} +func (x fastReflection_QueryGetStoredGameRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetStoredGameRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetStoredGameRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetStoredGameRequest +} + +// 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_QueryGetStoredGameRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGetStoredGameRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetStoredGameRequest) New() protoreflect.Message { + return new(fastReflection_QueryGetStoredGameRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetStoredGameRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGetStoredGameRequest)(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_QueryGetStoredGameRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Index != "" { + value := protoreflect.ValueOfString(x.Index) + if !f(fd_QueryGetStoredGameRequest_index, 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_QueryGetStoredGameRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "checkers.checkers.QueryGetStoredGameRequest.index": + return x.Index != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryGetStoredGameRequest")) + } + panic(fmt.Errorf("message checkers.checkers.QueryGetStoredGameRequest 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_QueryGetStoredGameRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "checkers.checkers.QueryGetStoredGameRequest.index": + x.Index = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryGetStoredGameRequest")) + } + panic(fmt.Errorf("message checkers.checkers.QueryGetStoredGameRequest 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_QueryGetStoredGameRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "checkers.checkers.QueryGetStoredGameRequest.index": + value := x.Index + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryGetStoredGameRequest")) + } + panic(fmt.Errorf("message checkers.checkers.QueryGetStoredGameRequest 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_QueryGetStoredGameRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "checkers.checkers.QueryGetStoredGameRequest.index": + x.Index = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryGetStoredGameRequest")) + } + panic(fmt.Errorf("message checkers.checkers.QueryGetStoredGameRequest 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_QueryGetStoredGameRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "checkers.checkers.QueryGetStoredGameRequest.index": + panic(fmt.Errorf("field index of message checkers.checkers.QueryGetStoredGameRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryGetStoredGameRequest")) + } + panic(fmt.Errorf("message checkers.checkers.QueryGetStoredGameRequest 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_QueryGetStoredGameRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "checkers.checkers.QueryGetStoredGameRequest.index": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryGetStoredGameRequest")) + } + panic(fmt.Errorf("message checkers.checkers.QueryGetStoredGameRequest 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_QueryGetStoredGameRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in checkers.checkers.QueryGetStoredGameRequest", 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_QueryGetStoredGameRequest) 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_QueryGetStoredGameRequest) 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_QueryGetStoredGameRequest) 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_QueryGetStoredGameRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetStoredGameRequest) + 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.Index) + 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().(*QueryGetStoredGameRequest) + 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.Index) > 0 { + i -= len(x.Index) + copy(dAtA[i:], x.Index) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Index))) + 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().(*QueryGetStoredGameRequest) + 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: QueryGetStoredGameRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetStoredGameRequest: 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 Index", 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.Index = 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_QueryGetStoredGameResponse protoreflect.MessageDescriptor + fd_QueryGetStoredGameResponse_storedGame protoreflect.FieldDescriptor +) + +func init() { + file_checkers_checkers_query_proto_init() + md_QueryGetStoredGameResponse = File_checkers_checkers_query_proto.Messages().ByName("QueryGetStoredGameResponse") + fd_QueryGetStoredGameResponse_storedGame = md_QueryGetStoredGameResponse.Fields().ByName("storedGame") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetStoredGameResponse)(nil) + +type fastReflection_QueryGetStoredGameResponse QueryGetStoredGameResponse + +func (x *QueryGetStoredGameResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetStoredGameResponse)(x) +} + +func (x *QueryGetStoredGameResponse) slowProtoReflect() protoreflect.Message { + mi := &file_checkers_checkers_query_proto_msgTypes[5] + 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_QueryGetStoredGameResponse_messageType fastReflection_QueryGetStoredGameResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetStoredGameResponse_messageType{} + +type fastReflection_QueryGetStoredGameResponse_messageType struct{} + +func (x fastReflection_QueryGetStoredGameResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetStoredGameResponse)(nil) +} +func (x fastReflection_QueryGetStoredGameResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetStoredGameResponse) +} +func (x fastReflection_QueryGetStoredGameResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetStoredGameResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetStoredGameResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetStoredGameResponse +} + +// 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_QueryGetStoredGameResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGetStoredGameResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetStoredGameResponse) New() protoreflect.Message { + return new(fastReflection_QueryGetStoredGameResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetStoredGameResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGetStoredGameResponse)(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_QueryGetStoredGameResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.StoredGame != nil { + value := protoreflect.ValueOfMessage(x.StoredGame.ProtoReflect()) + if !f(fd_QueryGetStoredGameResponse_storedGame, 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_QueryGetStoredGameResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "checkers.checkers.QueryGetStoredGameResponse.storedGame": + return x.StoredGame != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryGetStoredGameResponse")) + } + panic(fmt.Errorf("message checkers.checkers.QueryGetStoredGameResponse 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_QueryGetStoredGameResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "checkers.checkers.QueryGetStoredGameResponse.storedGame": + x.StoredGame = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryGetStoredGameResponse")) + } + panic(fmt.Errorf("message checkers.checkers.QueryGetStoredGameResponse 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_QueryGetStoredGameResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "checkers.checkers.QueryGetStoredGameResponse.storedGame": + value := x.StoredGame + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryGetStoredGameResponse")) + } + panic(fmt.Errorf("message checkers.checkers.QueryGetStoredGameResponse 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_QueryGetStoredGameResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "checkers.checkers.QueryGetStoredGameResponse.storedGame": + x.StoredGame = value.Message().Interface().(*StoredGame) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryGetStoredGameResponse")) + } + panic(fmt.Errorf("message checkers.checkers.QueryGetStoredGameResponse 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_QueryGetStoredGameResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "checkers.checkers.QueryGetStoredGameResponse.storedGame": + if x.StoredGame == nil { + x.StoredGame = new(StoredGame) + } + return protoreflect.ValueOfMessage(x.StoredGame.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryGetStoredGameResponse")) + } + panic(fmt.Errorf("message checkers.checkers.QueryGetStoredGameResponse 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_QueryGetStoredGameResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "checkers.checkers.QueryGetStoredGameResponse.storedGame": + m := new(StoredGame) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryGetStoredGameResponse")) + } + panic(fmt.Errorf("message checkers.checkers.QueryGetStoredGameResponse 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_QueryGetStoredGameResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in checkers.checkers.QueryGetStoredGameResponse", 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_QueryGetStoredGameResponse) 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_QueryGetStoredGameResponse) 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_QueryGetStoredGameResponse) 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_QueryGetStoredGameResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetStoredGameResponse) + 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.StoredGame != nil { + l = options.Size(x.StoredGame) + 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().(*QueryGetStoredGameResponse) + 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.StoredGame != nil { + encoded, err := options.Marshal(x.StoredGame) + 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().(*QueryGetStoredGameResponse) + 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: QueryGetStoredGameResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetStoredGameResponse: 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 StoredGame", 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.StoredGame == nil { + x.StoredGame = &StoredGame{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.StoredGame); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + 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_QueryAllStoredGameRequest protoreflect.MessageDescriptor + fd_QueryAllStoredGameRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_checkers_checkers_query_proto_init() + md_QueryAllStoredGameRequest = File_checkers_checkers_query_proto.Messages().ByName("QueryAllStoredGameRequest") + fd_QueryAllStoredGameRequest_pagination = md_QueryAllStoredGameRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllStoredGameRequest)(nil) + +type fastReflection_QueryAllStoredGameRequest QueryAllStoredGameRequest + +func (x *QueryAllStoredGameRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllStoredGameRequest)(x) +} + +func (x *QueryAllStoredGameRequest) slowProtoReflect() protoreflect.Message { + mi := &file_checkers_checkers_query_proto_msgTypes[6] + 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_QueryAllStoredGameRequest_messageType fastReflection_QueryAllStoredGameRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllStoredGameRequest_messageType{} + +type fastReflection_QueryAllStoredGameRequest_messageType struct{} + +func (x fastReflection_QueryAllStoredGameRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllStoredGameRequest)(nil) +} +func (x fastReflection_QueryAllStoredGameRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllStoredGameRequest) +} +func (x fastReflection_QueryAllStoredGameRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllStoredGameRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllStoredGameRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllStoredGameRequest +} + +// 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_QueryAllStoredGameRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAllStoredGameRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllStoredGameRequest) New() protoreflect.Message { + return new(fastReflection_QueryAllStoredGameRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllStoredGameRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAllStoredGameRequest)(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_QueryAllStoredGameRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllStoredGameRequest_pagination, 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_QueryAllStoredGameRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "checkers.checkers.QueryAllStoredGameRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryAllStoredGameRequest")) + } + panic(fmt.Errorf("message checkers.checkers.QueryAllStoredGameRequest 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_QueryAllStoredGameRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "checkers.checkers.QueryAllStoredGameRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryAllStoredGameRequest")) + } + panic(fmt.Errorf("message checkers.checkers.QueryAllStoredGameRequest 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_QueryAllStoredGameRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "checkers.checkers.QueryAllStoredGameRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryAllStoredGameRequest")) + } + panic(fmt.Errorf("message checkers.checkers.QueryAllStoredGameRequest 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_QueryAllStoredGameRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "checkers.checkers.QueryAllStoredGameRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryAllStoredGameRequest")) + } + panic(fmt.Errorf("message checkers.checkers.QueryAllStoredGameRequest 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_QueryAllStoredGameRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "checkers.checkers.QueryAllStoredGameRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryAllStoredGameRequest")) + } + panic(fmt.Errorf("message checkers.checkers.QueryAllStoredGameRequest 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_QueryAllStoredGameRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "checkers.checkers.QueryAllStoredGameRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryAllStoredGameRequest")) + } + panic(fmt.Errorf("message checkers.checkers.QueryAllStoredGameRequest 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_QueryAllStoredGameRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in checkers.checkers.QueryAllStoredGameRequest", 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_QueryAllStoredGameRequest) 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_QueryAllStoredGameRequest) 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_QueryAllStoredGameRequest) 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_QueryAllStoredGameRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllStoredGameRequest) + 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.Pagination != nil { + l = options.Size(x.Pagination) + 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().(*QueryAllStoredGameRequest) + 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.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + 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().(*QueryAllStoredGameRequest) + 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: QueryAllStoredGameRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllStoredGameRequest: 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 Pagination", 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.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + 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 _ protoreflect.List = (*_QueryAllStoredGameResponse_1_list)(nil) + +type _QueryAllStoredGameResponse_1_list struct { + list *[]*StoredGame +} + +func (x *_QueryAllStoredGameResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryAllStoredGameResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryAllStoredGameResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*StoredGame) + (*x.list)[i] = concreteValue +} + +func (x *_QueryAllStoredGameResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*StoredGame) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryAllStoredGameResponse_1_list) AppendMutable() protoreflect.Value { + v := new(StoredGame) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllStoredGameResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryAllStoredGameResponse_1_list) NewElement() protoreflect.Value { + v := new(StoredGame) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllStoredGameResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryAllStoredGameResponse protoreflect.MessageDescriptor + fd_QueryAllStoredGameResponse_storedGame protoreflect.FieldDescriptor + fd_QueryAllStoredGameResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_checkers_checkers_query_proto_init() + md_QueryAllStoredGameResponse = File_checkers_checkers_query_proto.Messages().ByName("QueryAllStoredGameResponse") + fd_QueryAllStoredGameResponse_storedGame = md_QueryAllStoredGameResponse.Fields().ByName("storedGame") + fd_QueryAllStoredGameResponse_pagination = md_QueryAllStoredGameResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllStoredGameResponse)(nil) + +type fastReflection_QueryAllStoredGameResponse QueryAllStoredGameResponse + +func (x *QueryAllStoredGameResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllStoredGameResponse)(x) +} + +func (x *QueryAllStoredGameResponse) slowProtoReflect() protoreflect.Message { + mi := &file_checkers_checkers_query_proto_msgTypes[7] + 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_QueryAllStoredGameResponse_messageType fastReflection_QueryAllStoredGameResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllStoredGameResponse_messageType{} + +type fastReflection_QueryAllStoredGameResponse_messageType struct{} + +func (x fastReflection_QueryAllStoredGameResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllStoredGameResponse)(nil) +} +func (x fastReflection_QueryAllStoredGameResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllStoredGameResponse) +} +func (x fastReflection_QueryAllStoredGameResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllStoredGameResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllStoredGameResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllStoredGameResponse +} + +// 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_QueryAllStoredGameResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAllStoredGameResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllStoredGameResponse) New() protoreflect.Message { + return new(fastReflection_QueryAllStoredGameResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllStoredGameResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAllStoredGameResponse)(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_QueryAllStoredGameResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.StoredGame) != 0 { + value := protoreflect.ValueOfList(&_QueryAllStoredGameResponse_1_list{list: &x.StoredGame}) + if !f(fd_QueryAllStoredGameResponse_storedGame, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllStoredGameResponse_pagination, 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_QueryAllStoredGameResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "checkers.checkers.QueryAllStoredGameResponse.storedGame": + return len(x.StoredGame) != 0 + case "checkers.checkers.QueryAllStoredGameResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryAllStoredGameResponse")) + } + panic(fmt.Errorf("message checkers.checkers.QueryAllStoredGameResponse 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_QueryAllStoredGameResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "checkers.checkers.QueryAllStoredGameResponse.storedGame": + x.StoredGame = nil + case "checkers.checkers.QueryAllStoredGameResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryAllStoredGameResponse")) + } + panic(fmt.Errorf("message checkers.checkers.QueryAllStoredGameResponse 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_QueryAllStoredGameResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "checkers.checkers.QueryAllStoredGameResponse.storedGame": + if len(x.StoredGame) == 0 { + return protoreflect.ValueOfList(&_QueryAllStoredGameResponse_1_list{}) + } + listValue := &_QueryAllStoredGameResponse_1_list{list: &x.StoredGame} + return protoreflect.ValueOfList(listValue) + case "checkers.checkers.QueryAllStoredGameResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryAllStoredGameResponse")) + } + panic(fmt.Errorf("message checkers.checkers.QueryAllStoredGameResponse 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_QueryAllStoredGameResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "checkers.checkers.QueryAllStoredGameResponse.storedGame": + lv := value.List() + clv := lv.(*_QueryAllStoredGameResponse_1_list) + x.StoredGame = *clv.list + case "checkers.checkers.QueryAllStoredGameResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryAllStoredGameResponse")) + } + panic(fmt.Errorf("message checkers.checkers.QueryAllStoredGameResponse 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_QueryAllStoredGameResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "checkers.checkers.QueryAllStoredGameResponse.storedGame": + if x.StoredGame == nil { + x.StoredGame = []*StoredGame{} + } + value := &_QueryAllStoredGameResponse_1_list{list: &x.StoredGame} + return protoreflect.ValueOfList(value) + case "checkers.checkers.QueryAllStoredGameResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryAllStoredGameResponse")) + } + panic(fmt.Errorf("message checkers.checkers.QueryAllStoredGameResponse 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_QueryAllStoredGameResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "checkers.checkers.QueryAllStoredGameResponse.storedGame": + list := []*StoredGame{} + return protoreflect.ValueOfList(&_QueryAllStoredGameResponse_1_list{list: &list}) + case "checkers.checkers.QueryAllStoredGameResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.QueryAllStoredGameResponse")) + } + panic(fmt.Errorf("message checkers.checkers.QueryAllStoredGameResponse 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_QueryAllStoredGameResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in checkers.checkers.QueryAllStoredGameResponse", 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_QueryAllStoredGameResponse) 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_QueryAllStoredGameResponse) 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_QueryAllStoredGameResponse) 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_QueryAllStoredGameResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllStoredGameResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.StoredGame) > 0 { + for _, e := range x.StoredGame { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + 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().(*QueryAllStoredGameResponse) + 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.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + 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] = 0x12 + } + if len(x.StoredGame) > 0 { + for iNdEx := len(x.StoredGame) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.StoredGame[iNdEx]) + 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().(*QueryAllStoredGameResponse) + 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: QueryAllStoredGameResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllStoredGameResponse: 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 StoredGame", 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 + } + x.StoredGame = append(x.StoredGame, &StoredGame{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.StoredGame[len(x.StoredGame)-1]); 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 Pagination", 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.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + 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, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -1737,6 +3600,154 @@ func (x *QueryGetSystemInfoResponse) GetSystemInfo() *SystemInfo { return nil } +type QueryGetStoredGameRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` +} + +func (x *QueryGetStoredGameRequest) Reset() { + *x = QueryGetStoredGameRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_checkers_checkers_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetStoredGameRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetStoredGameRequest) ProtoMessage() {} + +// Deprecated: Use QueryGetStoredGameRequest.ProtoReflect.Descriptor instead. +func (*QueryGetStoredGameRequest) Descriptor() ([]byte, []int) { + return file_checkers_checkers_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryGetStoredGameRequest) GetIndex() string { + if x != nil { + return x.Index + } + return "" +} + +type QueryGetStoredGameResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoredGame *StoredGame `protobuf:"bytes,1,opt,name=storedGame,proto3" json:"storedGame,omitempty"` +} + +func (x *QueryGetStoredGameResponse) Reset() { + *x = QueryGetStoredGameResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_checkers_checkers_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetStoredGameResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetStoredGameResponse) ProtoMessage() {} + +// Deprecated: Use QueryGetStoredGameResponse.ProtoReflect.Descriptor instead. +func (*QueryGetStoredGameResponse) Descriptor() ([]byte, []int) { + return file_checkers_checkers_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryGetStoredGameResponse) GetStoredGame() *StoredGame { + if x != nil { + return x.StoredGame + } + return nil +} + +type QueryAllStoredGameRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllStoredGameRequest) Reset() { + *x = QueryAllStoredGameRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_checkers_checkers_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllStoredGameRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllStoredGameRequest) ProtoMessage() {} + +// Deprecated: Use QueryAllStoredGameRequest.ProtoReflect.Descriptor instead. +func (*QueryAllStoredGameRequest) Descriptor() ([]byte, []int) { + return file_checkers_checkers_query_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryAllStoredGameRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryAllStoredGameResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoredGame []*StoredGame `protobuf:"bytes,1,rep,name=storedGame,proto3" json:"storedGame,omitempty"` + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllStoredGameResponse) Reset() { + *x = QueryAllStoredGameResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_checkers_checkers_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllStoredGameResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllStoredGameResponse) ProtoMessage() {} + +// Deprecated: Use QueryAllStoredGameResponse.ProtoReflect.Descriptor instead. +func (*QueryAllStoredGameResponse) Descriptor() ([]byte, []int) { + return file_checkers_checkers_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryAllStoredGameResponse) GetStoredGame() []*StoredGame { + if x != nil { + return x.StoredGame + } + return nil +} + +func (x *QueryAllStoredGameResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + var File_checkers_checkers_query_proto protoreflect.FileDescriptor var file_checkers_checkers_query_proto_rawDesc = []byte{ @@ -1754,53 +3765,102 @@ var file_checkers_checkers_query_proto_rawDesc = []byte{ 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, - 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0x53, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, - 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, - 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x61, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x79, - 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x43, 0x0a, 0x0a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, - 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x53, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x32, 0xac, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, - 0x84, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x25, 0x12, 0x23, 0x2f, 0x6f, 0x6c, 0x69, 0x6d, 0x64, 0x7a, 0x68, 0x6f, 0x6e, 0x2f, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x9b, 0x01, 0x0a, 0x0a, 0x53, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2c, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, - 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, - 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, - 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x6f, 0x6c, 0x69, + 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x53, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x61, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, + 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x31, 0x0a, 0x19, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x61, 0x0a, + 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, + 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x65, 0x72, 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, + 0x22, 0x63, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xaa, 0x01, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, + 0x6c, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x32, 0xf3, 0x04, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x84, 0x01, 0x0a, + 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, + 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, + 0x72, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, + 0x2f, 0x6f, 0x6c, 0x69, 0x6d, 0x64, 0x7a, 0x68, 0x6f, 0x6e, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x9b, 0x01, 0x0a, 0x0a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x2c, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2d, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x6f, 0x6c, 0x69, 0x6d, 0x64, 0x7a, + 0x68, 0x6f, 0x6e, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x6e, 0x66, + 0x6f, 0x12, 0xa3, 0x01, 0x0a, 0x0a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, + 0x12, 0x2c, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, + 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, + 0x72, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x64, 0x47, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x6f, 0x6c, 0x69, 0x6d, 0x64, 0x7a, 0x68, 0x6f, + 0x6e, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x65, 0x72, 0x73, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x2f, + 0x7b, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x7d, 0x12, 0x9e, 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, 0x41, 0x6c, 0x6c, 0x12, 0x2c, 0x2e, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, + 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, + 0x2f, 0x6f, 0x6c, 0x69, 0x6d, 0x64, 0x7a, 0x68, 0x6f, 0x6e, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x64, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x42, 0xbd, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, + 0x72, 0x73, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6c, 0x69, 0x6d, 0x64, 0x7a, 0x68, 0x6f, 0x6e, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, - 0x69, 0x6e, 0x66, 0x6f, 0x42, 0xbd, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x42, 0x0a, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6c, 0x69, 0x6d, 0x64, 0x7a, 0x68, - 0x6f, 0x6e, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, - 0x73, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, - 0x72, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0xca, 0x02, 0x11, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x5c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0xe2, - 0x02, 0x1d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x5c, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x65, 0x72, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x3a, 0x3a, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x65, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x65, 0x72, 0x73, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0xca, + 0x02, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x5c, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x65, 0x72, 0x73, 0xe2, 0x02, 0x1d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x5c, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x3a, 0x3a, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1815,27 +3875,42 @@ func file_checkers_checkers_query_proto_rawDescGZIP() []byte { return file_checkers_checkers_query_proto_rawDescData } -var file_checkers_checkers_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_checkers_checkers_query_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_checkers_checkers_query_proto_goTypes = []interface{}{ (*QueryParamsRequest)(nil), // 0: checkers.checkers.QueryParamsRequest (*QueryParamsResponse)(nil), // 1: checkers.checkers.QueryParamsResponse (*QueryGetSystemInfoRequest)(nil), // 2: checkers.checkers.QueryGetSystemInfoRequest (*QueryGetSystemInfoResponse)(nil), // 3: checkers.checkers.QueryGetSystemInfoResponse - (*Params)(nil), // 4: checkers.checkers.Params - (*SystemInfo)(nil), // 5: checkers.checkers.SystemInfo + (*QueryGetStoredGameRequest)(nil), // 4: checkers.checkers.QueryGetStoredGameRequest + (*QueryGetStoredGameResponse)(nil), // 5: checkers.checkers.QueryGetStoredGameResponse + (*QueryAllStoredGameRequest)(nil), // 6: checkers.checkers.QueryAllStoredGameRequest + (*QueryAllStoredGameResponse)(nil), // 7: checkers.checkers.QueryAllStoredGameResponse + (*Params)(nil), // 8: checkers.checkers.Params + (*SystemInfo)(nil), // 9: checkers.checkers.SystemInfo + (*StoredGame)(nil), // 10: checkers.checkers.StoredGame + (*v1beta1.PageRequest)(nil), // 11: cosmos.base.query.v1beta1.PageRequest + (*v1beta1.PageResponse)(nil), // 12: cosmos.base.query.v1beta1.PageResponse } var file_checkers_checkers_query_proto_depIdxs = []int32{ - 4, // 0: checkers.checkers.QueryParamsResponse.params:type_name -> checkers.checkers.Params - 5, // 1: checkers.checkers.QueryGetSystemInfoResponse.SystemInfo:type_name -> checkers.checkers.SystemInfo - 0, // 2: checkers.checkers.Query.Params:input_type -> checkers.checkers.QueryParamsRequest - 2, // 3: checkers.checkers.Query.SystemInfo:input_type -> checkers.checkers.QueryGetSystemInfoRequest - 1, // 4: checkers.checkers.Query.Params:output_type -> checkers.checkers.QueryParamsResponse - 3, // 5: checkers.checkers.Query.SystemInfo:output_type -> checkers.checkers.QueryGetSystemInfoResponse - 4, // [4:6] is the sub-list for method output_type - 2, // [2:4] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 8, // 0: checkers.checkers.QueryParamsResponse.params:type_name -> checkers.checkers.Params + 9, // 1: checkers.checkers.QueryGetSystemInfoResponse.SystemInfo:type_name -> checkers.checkers.SystemInfo + 10, // 2: checkers.checkers.QueryGetStoredGameResponse.storedGame:type_name -> checkers.checkers.StoredGame + 11, // 3: checkers.checkers.QueryAllStoredGameRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 10, // 4: checkers.checkers.QueryAllStoredGameResponse.storedGame:type_name -> checkers.checkers.StoredGame + 12, // 5: checkers.checkers.QueryAllStoredGameResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 0, // 6: checkers.checkers.Query.Params:input_type -> checkers.checkers.QueryParamsRequest + 2, // 7: checkers.checkers.Query.SystemInfo:input_type -> checkers.checkers.QueryGetSystemInfoRequest + 4, // 8: checkers.checkers.Query.StoredGame:input_type -> checkers.checkers.QueryGetStoredGameRequest + 6, // 9: checkers.checkers.Query.StoredGameAll:input_type -> checkers.checkers.QueryAllStoredGameRequest + 1, // 10: checkers.checkers.Query.Params:output_type -> checkers.checkers.QueryParamsResponse + 3, // 11: checkers.checkers.Query.SystemInfo:output_type -> checkers.checkers.QueryGetSystemInfoResponse + 5, // 12: checkers.checkers.Query.StoredGame:output_type -> checkers.checkers.QueryGetStoredGameResponse + 7, // 13: checkers.checkers.Query.StoredGameAll:output_type -> checkers.checkers.QueryAllStoredGameResponse + 10, // [10:14] is the sub-list for method output_type + 6, // [6:10] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_checkers_checkers_query_proto_init() } @@ -1845,6 +3920,7 @@ func file_checkers_checkers_query_proto_init() { } file_checkers_checkers_params_proto_init() file_checkers_checkers_system_info_proto_init() + file_checkers_checkers_stored_game_proto_init() if !protoimpl.UnsafeEnabled { file_checkers_checkers_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParamsRequest); i { @@ -1894,6 +3970,54 @@ func file_checkers_checkers_query_proto_init() { return nil } } + file_checkers_checkers_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetStoredGameRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_checkers_checkers_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetStoredGameResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_checkers_checkers_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllStoredGameRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_checkers_checkers_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllStoredGameResponse); 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{ @@ -1901,7 +4025,7 @@ func file_checkers_checkers_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_checkers_checkers_query_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/api/checkers/checkers/query_grpc.pb.go b/api/checkers/checkers/query_grpc.pb.go index 705dec9..f570ea9 100644 --- a/api/checkers/checkers/query_grpc.pb.go +++ b/api/checkers/checkers/query_grpc.pb.go @@ -20,8 +20,10 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Query_Params_FullMethodName = "/checkers.checkers.Query/Params" - Query_SystemInfo_FullMethodName = "/checkers.checkers.Query/SystemInfo" + Query_Params_FullMethodName = "/checkers.checkers.Query/Params" + Query_SystemInfo_FullMethodName = "/checkers.checkers.Query/SystemInfo" + Query_StoredGame_FullMethodName = "/checkers.checkers.Query/StoredGame" + Query_StoredGameAll_FullMethodName = "/checkers.checkers.Query/StoredGameAll" ) // QueryClient is the client API for Query service. @@ -32,6 +34,9 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Queries a SystemInfo by index. SystemInfo(ctx context.Context, in *QueryGetSystemInfoRequest, opts ...grpc.CallOption) (*QueryGetSystemInfoResponse, error) + // Queries a list of StoredGame items. + StoredGame(ctx context.Context, in *QueryGetStoredGameRequest, opts ...grpc.CallOption) (*QueryGetStoredGameResponse, error) + StoredGameAll(ctx context.Context, in *QueryAllStoredGameRequest, opts ...grpc.CallOption) (*QueryAllStoredGameResponse, error) } type queryClient struct { @@ -60,6 +65,24 @@ func (c *queryClient) SystemInfo(ctx context.Context, in *QueryGetSystemInfoRequ return out, nil } +func (c *queryClient) StoredGame(ctx context.Context, in *QueryGetStoredGameRequest, opts ...grpc.CallOption) (*QueryGetStoredGameResponse, error) { + out := new(QueryGetStoredGameResponse) + err := c.cc.Invoke(ctx, Query_StoredGame_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) StoredGameAll(ctx context.Context, in *QueryAllStoredGameRequest, opts ...grpc.CallOption) (*QueryAllStoredGameResponse, error) { + out := new(QueryAllStoredGameResponse) + err := c.cc.Invoke(ctx, Query_StoredGameAll_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility @@ -68,6 +91,9 @@ type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Queries a SystemInfo by index. SystemInfo(context.Context, *QueryGetSystemInfoRequest) (*QueryGetSystemInfoResponse, error) + // Queries a list of StoredGame items. + StoredGame(context.Context, *QueryGetStoredGameRequest) (*QueryGetStoredGameResponse, error) + StoredGameAll(context.Context, *QueryAllStoredGameRequest) (*QueryAllStoredGameResponse, error) mustEmbedUnimplementedQueryServer() } @@ -81,6 +107,12 @@ func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*Q func (UnimplementedQueryServer) SystemInfo(context.Context, *QueryGetSystemInfoRequest) (*QueryGetSystemInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SystemInfo not implemented") } +func (UnimplementedQueryServer) StoredGame(context.Context, *QueryGetStoredGameRequest) (*QueryGetStoredGameResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StoredGame not implemented") +} +func (UnimplementedQueryServer) StoredGameAll(context.Context, *QueryAllStoredGameRequest) (*QueryAllStoredGameResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StoredGameAll not implemented") +} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. @@ -130,6 +162,42 @@ func _Query_SystemInfo_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Query_StoredGame_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetStoredGameRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).StoredGame(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_StoredGame_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).StoredGame(ctx, req.(*QueryGetStoredGameRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_StoredGameAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllStoredGameRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).StoredGameAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_StoredGameAll_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).StoredGameAll(ctx, req.(*QueryAllStoredGameRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -145,6 +213,14 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "SystemInfo", Handler: _Query_SystemInfo_Handler, }, + { + MethodName: "StoredGame", + Handler: _Query_StoredGame_Handler, + }, + { + MethodName: "StoredGameAll", + Handler: _Query_StoredGameAll_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "checkers/checkers/query.proto", diff --git a/api/checkers/checkers/stored_game.pulsar.go b/api/checkers/checkers/stored_game.pulsar.go new file mode 100644 index 0000000..b3106ad --- /dev/null +++ b/api/checkers/checkers/stored_game.pulsar.go @@ -0,0 +1,862 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package checkers + +import ( + fmt "fmt" + io "io" + reflect "reflect" + sync "sync" + + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +var ( + md_StoredGame protoreflect.MessageDescriptor + fd_StoredGame_index protoreflect.FieldDescriptor + fd_StoredGame_board protoreflect.FieldDescriptor + fd_StoredGame_turn protoreflect.FieldDescriptor + fd_StoredGame_black protoreflect.FieldDescriptor + fd_StoredGame_red protoreflect.FieldDescriptor +) + +func init() { + file_checkers_checkers_stored_game_proto_init() + md_StoredGame = File_checkers_checkers_stored_game_proto.Messages().ByName("StoredGame") + fd_StoredGame_index = md_StoredGame.Fields().ByName("index") + fd_StoredGame_board = md_StoredGame.Fields().ByName("board") + fd_StoredGame_turn = md_StoredGame.Fields().ByName("turn") + fd_StoredGame_black = md_StoredGame.Fields().ByName("black") + fd_StoredGame_red = md_StoredGame.Fields().ByName("red") +} + +var _ protoreflect.Message = (*fastReflection_StoredGame)(nil) + +type fastReflection_StoredGame StoredGame + +func (x *StoredGame) ProtoReflect() protoreflect.Message { + return (*fastReflection_StoredGame)(x) +} + +func (x *StoredGame) slowProtoReflect() protoreflect.Message { + mi := &file_checkers_checkers_stored_game_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_StoredGame_messageType fastReflection_StoredGame_messageType +var _ protoreflect.MessageType = fastReflection_StoredGame_messageType{} + +type fastReflection_StoredGame_messageType struct{} + +func (x fastReflection_StoredGame_messageType) Zero() protoreflect.Message { + return (*fastReflection_StoredGame)(nil) +} +func (x fastReflection_StoredGame_messageType) New() protoreflect.Message { + return new(fastReflection_StoredGame) +} +func (x fastReflection_StoredGame_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_StoredGame +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_StoredGame) Descriptor() protoreflect.MessageDescriptor { + return md_StoredGame +} + +// 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_StoredGame) Type() protoreflect.MessageType { + return _fastReflection_StoredGame_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_StoredGame) New() protoreflect.Message { + return new(fastReflection_StoredGame) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_StoredGame) Interface() protoreflect.ProtoMessage { + return (*StoredGame)(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_StoredGame) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Index != "" { + value := protoreflect.ValueOfString(x.Index) + if !f(fd_StoredGame_index, value) { + return + } + } + if x.Board != "" { + value := protoreflect.ValueOfString(x.Board) + if !f(fd_StoredGame_board, value) { + return + } + } + if x.Turn != "" { + value := protoreflect.ValueOfString(x.Turn) + if !f(fd_StoredGame_turn, value) { + return + } + } + if x.Black != "" { + value := protoreflect.ValueOfString(x.Black) + if !f(fd_StoredGame_black, value) { + return + } + } + if x.Red != "" { + value := protoreflect.ValueOfString(x.Red) + if !f(fd_StoredGame_red, 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_StoredGame) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "checkers.checkers.StoredGame.index": + return x.Index != "" + case "checkers.checkers.StoredGame.board": + return x.Board != "" + case "checkers.checkers.StoredGame.turn": + return x.Turn != "" + case "checkers.checkers.StoredGame.black": + return x.Black != "" + case "checkers.checkers.StoredGame.red": + return x.Red != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.StoredGame")) + } + panic(fmt.Errorf("message checkers.checkers.StoredGame 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_StoredGame) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "checkers.checkers.StoredGame.index": + x.Index = "" + case "checkers.checkers.StoredGame.board": + x.Board = "" + case "checkers.checkers.StoredGame.turn": + x.Turn = "" + case "checkers.checkers.StoredGame.black": + x.Black = "" + case "checkers.checkers.StoredGame.red": + x.Red = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.StoredGame")) + } + panic(fmt.Errorf("message checkers.checkers.StoredGame 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_StoredGame) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "checkers.checkers.StoredGame.index": + value := x.Index + return protoreflect.ValueOfString(value) + case "checkers.checkers.StoredGame.board": + value := x.Board + return protoreflect.ValueOfString(value) + case "checkers.checkers.StoredGame.turn": + value := x.Turn + return protoreflect.ValueOfString(value) + case "checkers.checkers.StoredGame.black": + value := x.Black + return protoreflect.ValueOfString(value) + case "checkers.checkers.StoredGame.red": + value := x.Red + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.StoredGame")) + } + panic(fmt.Errorf("message checkers.checkers.StoredGame 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_StoredGame) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "checkers.checkers.StoredGame.index": + x.Index = value.Interface().(string) + case "checkers.checkers.StoredGame.board": + x.Board = value.Interface().(string) + case "checkers.checkers.StoredGame.turn": + x.Turn = value.Interface().(string) + case "checkers.checkers.StoredGame.black": + x.Black = value.Interface().(string) + case "checkers.checkers.StoredGame.red": + x.Red = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.StoredGame")) + } + panic(fmt.Errorf("message checkers.checkers.StoredGame 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_StoredGame) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "checkers.checkers.StoredGame.index": + panic(fmt.Errorf("field index of message checkers.checkers.StoredGame is not mutable")) + case "checkers.checkers.StoredGame.board": + panic(fmt.Errorf("field board of message checkers.checkers.StoredGame is not mutable")) + case "checkers.checkers.StoredGame.turn": + panic(fmt.Errorf("field turn of message checkers.checkers.StoredGame is not mutable")) + case "checkers.checkers.StoredGame.black": + panic(fmt.Errorf("field black of message checkers.checkers.StoredGame is not mutable")) + case "checkers.checkers.StoredGame.red": + panic(fmt.Errorf("field red of message checkers.checkers.StoredGame is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.StoredGame")) + } + panic(fmt.Errorf("message checkers.checkers.StoredGame 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_StoredGame) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "checkers.checkers.StoredGame.index": + return protoreflect.ValueOfString("") + case "checkers.checkers.StoredGame.board": + return protoreflect.ValueOfString("") + case "checkers.checkers.StoredGame.turn": + return protoreflect.ValueOfString("") + case "checkers.checkers.StoredGame.black": + return protoreflect.ValueOfString("") + case "checkers.checkers.StoredGame.red": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: checkers.checkers.StoredGame")) + } + panic(fmt.Errorf("message checkers.checkers.StoredGame 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_StoredGame) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in checkers.checkers.StoredGame", 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_StoredGame) 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_StoredGame) 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_StoredGame) 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_StoredGame) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*StoredGame) + 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.Index) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Board) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Turn) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Black) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Red) + 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().(*StoredGame) + 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.Red) > 0 { + i -= len(x.Red) + copy(dAtA[i:], x.Red) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Red))) + i-- + dAtA[i] = 0x2a + } + if len(x.Black) > 0 { + i -= len(x.Black) + copy(dAtA[i:], x.Black) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Black))) + i-- + dAtA[i] = 0x22 + } + if len(x.Turn) > 0 { + i -= len(x.Turn) + copy(dAtA[i:], x.Turn) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Turn))) + i-- + dAtA[i] = 0x1a + } + if len(x.Board) > 0 { + i -= len(x.Board) + copy(dAtA[i:], x.Board) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Board))) + i-- + dAtA[i] = 0x12 + } + if len(x.Index) > 0 { + i -= len(x.Index) + copy(dAtA[i:], x.Index) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Index))) + 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().(*StoredGame) + 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: StoredGame: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StoredGame: 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 Index", 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.Index = 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 Board", 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.Board = 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 Turn", 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.Turn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Black", 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.Black = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Red", 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.Red = 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: checkers/checkers/stored_game.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 StoredGame struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` + Board string `protobuf:"bytes,2,opt,name=board,proto3" json:"board,omitempty"` + Turn string `protobuf:"bytes,3,opt,name=turn,proto3" json:"turn,omitempty"` + Black string `protobuf:"bytes,4,opt,name=black,proto3" json:"black,omitempty"` + Red string `protobuf:"bytes,5,opt,name=red,proto3" json:"red,omitempty"` +} + +func (x *StoredGame) Reset() { + *x = StoredGame{} + if protoimpl.UnsafeEnabled { + mi := &file_checkers_checkers_stored_game_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoredGame) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoredGame) ProtoMessage() {} + +// Deprecated: Use StoredGame.ProtoReflect.Descriptor instead. +func (*StoredGame) Descriptor() ([]byte, []int) { + return file_checkers_checkers_stored_game_proto_rawDescGZIP(), []int{0} +} + +func (x *StoredGame) GetIndex() string { + if x != nil { + return x.Index + } + return "" +} + +func (x *StoredGame) GetBoard() string { + if x != nil { + return x.Board + } + return "" +} + +func (x *StoredGame) GetTurn() string { + if x != nil { + return x.Turn + } + return "" +} + +func (x *StoredGame) GetBlack() string { + if x != nil { + return x.Black + } + return "" +} + +func (x *StoredGame) GetRed() string { + if x != nil { + return x.Red + } + return "" +} + +var File_checkers_checkers_stored_game_proto protoreflect.FileDescriptor + +var file_checkers_checkers_stored_game_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x65, 0x72, 0x73, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x22, 0x74, 0x0a, 0x0a, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x64, 0x47, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, + 0x62, 0x6f, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x6f, 0x61, + 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x75, 0x72, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x12, 0x10, 0x0a, 0x03, + 0x72, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x64, 0x42, 0xc2, + 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2e, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x42, 0x0f, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, + 0x47, 0x61, 0x6d, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6c, 0x69, 0x6d, 0x64, 0x7a, 0x68, 0x6f, + 0x6e, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, + 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, + 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0xca, 0x02, 0x11, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x65, 0x72, 0x73, 0x5c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0xe2, 0x02, + 0x1d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x5c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, + 0x72, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x3a, 0x3a, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x65, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_checkers_checkers_stored_game_proto_rawDescOnce sync.Once + file_checkers_checkers_stored_game_proto_rawDescData = file_checkers_checkers_stored_game_proto_rawDesc +) + +func file_checkers_checkers_stored_game_proto_rawDescGZIP() []byte { + file_checkers_checkers_stored_game_proto_rawDescOnce.Do(func() { + file_checkers_checkers_stored_game_proto_rawDescData = protoimpl.X.CompressGZIP(file_checkers_checkers_stored_game_proto_rawDescData) + }) + return file_checkers_checkers_stored_game_proto_rawDescData +} + +var file_checkers_checkers_stored_game_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_checkers_checkers_stored_game_proto_goTypes = []interface{}{ + (*StoredGame)(nil), // 0: checkers.checkers.StoredGame +} +var file_checkers_checkers_stored_game_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_checkers_checkers_stored_game_proto_init() } +func file_checkers_checkers_stored_game_proto_init() { + if File_checkers_checkers_stored_game_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_checkers_checkers_stored_game_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoredGame); 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_checkers_checkers_stored_game_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_checkers_checkers_stored_game_proto_goTypes, + DependencyIndexes: file_checkers_checkers_stored_game_proto_depIdxs, + MessageInfos: file_checkers_checkers_stored_game_proto_msgTypes, + }.Build() + File_checkers_checkers_stored_game_proto = out.File + file_checkers_checkers_stored_game_proto_rawDesc = nil + file_checkers_checkers_stored_game_proto_goTypes = nil + file_checkers_checkers_stored_game_proto_depIdxs = nil +} diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 8616739..53c8d11 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -1 +1 @@ -{"id":"github.com/olimdzhon/checkers","consumes":["application/json"],"produces":["application/json"],"swagger":"2.0","info":{"description":"Chain github.com/olimdzhon/checkers REST API","title":"HTTP API Console","contact":{"name":"github.com/olimdzhon/checkers"},"version":"version not set"},"paths":{"/checkers.checkers.Msg/UpdateParams":{"post":{"tags":["Msg"],"summary":"UpdateParams defines a (governance) operation for updating the module\nparameters. The authority defaults to the x/gov module account.","operationId":"GithubComolimdzhoncheckersMsg_UpdateParams","parameters":[{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/checkers.checkers.MsgUpdateParams"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/checkers.checkers.MsgUpdateParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/olimdzhon/checkers/checkers/params":{"get":{"tags":["Query"],"summary":"Parameters queries the parameters of the module.","operationId":"GithubComolimdzhoncheckersQuery_Params","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/checkers.checkers.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/olimdzhon/checkers/checkers/system_info":{"get":{"tags":["Query"],"summary":"Queries a SystemInfo by index.","operationId":"GithubComolimdzhoncheckersQuery_SystemInfo","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/checkers.checkers.QueryGetSystemInfoResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}}},"definitions":{"checkers.checkers.MsgUpdateParams":{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","type":"object","properties":{"authority":{"description":"authority is the address that controls the module (defaults to x/gov unless overwritten).","type":"string"},"params":{"description":"params defines the module parameters to update.\n\nNOTE: All parameters must be supplied.","$ref":"#/definitions/checkers.checkers.Params"}}},"checkers.checkers.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"checkers.checkers.Params":{"description":"Params defines the parameters for the module.","type":"object"},"checkers.checkers.QueryGetSystemInfoResponse":{"type":"object","properties":{"SystemInfo":{"$ref":"#/definitions/checkers.checkers.SystemInfo"}}},"checkers.checkers.QueryParamsResponse":{"description":"QueryParamsResponse is response type for the Query/Params RPC method.","type":"object","properties":{"params":{"description":"params holds all the parameters of this module.","$ref":"#/definitions/checkers.checkers.Params"}}},"checkers.checkers.SystemInfo":{"type":"object","properties":{"nextId":{"type":"string","format":"uint64"}}},"google.protobuf.Any":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{}},"google.rpc.Status":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"details":{"type":"array","items":{"type":"object","$ref":"#/definitions/google.protobuf.Any"}},"message":{"type":"string"}}}},"tags":[{"name":"Query"},{"name":"Msg"}]} \ No newline at end of file +{"id":"github.com/olimdzhon/checkers","consumes":["application/json"],"produces":["application/json"],"swagger":"2.0","info":{"description":"Chain github.com/olimdzhon/checkers REST API","title":"HTTP API Console","contact":{"name":"github.com/olimdzhon/checkers"},"version":"version not set"},"paths":{"/checkers.checkers.Msg/UpdateParams":{"post":{"tags":["Msg"],"summary":"UpdateParams defines a (governance) operation for updating the module\nparameters. The authority defaults to the x/gov module account.","operationId":"GithubComolimdzhoncheckersMsg_UpdateParams","parameters":[{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/checkers.checkers.MsgUpdateParams"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/checkers.checkers.MsgUpdateParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/olimdzhon/checkers/checkers/params":{"get":{"tags":["Query"],"summary":"Parameters queries the parameters of the module.","operationId":"GithubComolimdzhoncheckersQuery_Params","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/checkers.checkers.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/olimdzhon/checkers/checkers/stored_game":{"get":{"tags":["Query"],"operationId":"GithubComolimdzhoncheckersQuery_StoredGameAll","parameters":[{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/checkers.checkers.QueryAllStoredGameResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/olimdzhon/checkers/checkers/stored_game/{index}":{"get":{"tags":["Query"],"summary":"Queries a list of StoredGame items.","operationId":"GithubComolimdzhoncheckersQuery_StoredGame","parameters":[{"type":"string","name":"index","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/checkers.checkers.QueryGetStoredGameResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/olimdzhon/checkers/checkers/system_info":{"get":{"tags":["Query"],"summary":"Queries a SystemInfo by index.","operationId":"GithubComolimdzhoncheckersQuery_SystemInfo","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/checkers.checkers.QueryGetSystemInfoResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}}},"definitions":{"checkers.checkers.MsgUpdateParams":{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","type":"object","properties":{"authority":{"description":"authority is the address that controls the module (defaults to x/gov unless overwritten).","type":"string"},"params":{"description":"params defines the module parameters to update.\n\nNOTE: All parameters must be supplied.","$ref":"#/definitions/checkers.checkers.Params"}}},"checkers.checkers.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"checkers.checkers.Params":{"description":"Params defines the parameters for the module.","type":"object"},"checkers.checkers.QueryAllStoredGameResponse":{"type":"object","properties":{"pagination":{"$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"},"storedGame":{"type":"array","items":{"type":"object","$ref":"#/definitions/checkers.checkers.StoredGame"}}}},"checkers.checkers.QueryGetStoredGameResponse":{"type":"object","properties":{"storedGame":{"$ref":"#/definitions/checkers.checkers.StoredGame"}}},"checkers.checkers.QueryGetSystemInfoResponse":{"type":"object","properties":{"SystemInfo":{"$ref":"#/definitions/checkers.checkers.SystemInfo"}}},"checkers.checkers.QueryParamsResponse":{"description":"QueryParamsResponse is response type for the Query/Params RPC method.","type":"object","properties":{"params":{"description":"params holds all the parameters of this module.","$ref":"#/definitions/checkers.checkers.Params"}}},"checkers.checkers.StoredGame":{"type":"object","properties":{"black":{"type":"string"},"board":{"type":"string"},"index":{"type":"string"},"red":{"type":"string"},"turn":{"type":"string"}}},"checkers.checkers.SystemInfo":{"type":"object","properties":{"nextId":{"type":"string","format":"uint64"}}},"cosmos.base.query.v1beta1.PageRequest":{"description":"message SomeRequest {\n Foo some_parameter = 1;\n PageRequest pagination = 2;\n }","type":"object","title":"PageRequest is to be embedded in gRPC request messages for efficient\npagination. Ex:","properties":{"count_total":{"description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","type":"boolean"},"key":{"description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","type":"string","format":"byte"},"limit":{"description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","type":"string","format":"uint64"},"offset":{"description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","type":"string","format":"uint64"},"reverse":{"description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","type":"boolean"}}},"cosmos.base.query.v1beta1.PageResponse":{"description":"PageResponse is to be embedded in gRPC response messages where the\ncorresponding request message has used PageRequest.\n\n message SomeResponse {\n repeated Bar results = 1;\n PageResponse page = 2;\n }","type":"object","properties":{"next_key":{"description":"next_key is the key to be passed to PageRequest.key to\nquery the next page most efficiently. It will be empty if\nthere are no more results.","type":"string","format":"byte"},"total":{"type":"string","format":"uint64","title":"total is total number of results available if PageRequest.count_total\nwas set, its value is undefined otherwise"}}},"google.protobuf.Any":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{}},"google.rpc.Status":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"details":{"type":"array","items":{"type":"object","$ref":"#/definitions/google.protobuf.Any"}},"message":{"type":"string"}}}},"tags":[{"name":"Query"},{"name":"Msg"}]} \ No newline at end of file diff --git a/proto/checkers/checkers/genesis.proto b/proto/checkers/checkers/genesis.proto index c773e1b..1257df8 100644 --- a/proto/checkers/checkers/genesis.proto +++ b/proto/checkers/checkers/genesis.proto @@ -6,6 +6,7 @@ import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "checkers/checkers/params.proto"; import "checkers/checkers/system_info.proto"; +import "checkers/checkers/stored_game.proto"; option go_package = "github.com/olimdzhon/checkers/x/checkers/types"; @@ -13,7 +14,8 @@ option go_package = "github.com/olimdzhon/checkers/x/checkers/types"; message GenesisState { // params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - SystemInfo systemInfo = 2; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + SystemInfo systemInfo = 2 [(gogoproto.nullable) = false] ; + repeated StoredGame storedGameList = 3 [(gogoproto.nullable) = false] ; } diff --git a/proto/checkers/checkers/query.proto b/proto/checkers/checkers/query.proto index c22fe56..36e300a 100644 --- a/proto/checkers/checkers/query.proto +++ b/proto/checkers/checkers/query.proto @@ -8,6 +8,7 @@ import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "checkers/checkers/params.proto"; import "checkers/checkers/system_info.proto"; +import "checkers/checkers/stored_game.proto"; option go_package = "github.com/olimdzhon/checkers/x/checkers/types"; @@ -25,6 +26,16 @@ service Query { option (google.api.http).get = "/olimdzhon/checkers/checkers/system_info"; } + + // Queries a list of StoredGame items. + rpc StoredGame (QueryGetStoredGameRequest) returns (QueryGetStoredGameResponse) { + option (google.api.http).get = "/olimdzhon/checkers/checkers/stored_game/{index}"; + + } + rpc StoredGameAll (QueryAllStoredGameRequest) returns (QueryAllStoredGameResponse) { + option (google.api.http).get = "/olimdzhon/checkers/checkers/stored_game"; + + } } // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} @@ -42,3 +53,20 @@ message QueryGetSystemInfoResponse { SystemInfo SystemInfo = 1 [(gogoproto.nullable) = false]; } +message QueryGetStoredGameRequest { + string index = 1; +} + +message QueryGetStoredGameResponse { + StoredGame storedGame = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllStoredGameRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllStoredGameResponse { + repeated StoredGame storedGame = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + diff --git a/proto/checkers/checkers/stored_game.proto b/proto/checkers/checkers/stored_game.proto new file mode 100644 index 0000000..5842ada --- /dev/null +++ b/proto/checkers/checkers/stored_game.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package checkers.checkers; + +option go_package = "github.com/olimdzhon/checkers/x/checkers/types"; + +message StoredGame { + string index = 1; + string board = 2; + string turn = 3; + string black = 4; + string red = 5; + +} + diff --git a/x/checkers/keeper/query_stored_game.go b/x/checkers/keeper/query_stored_game.go new file mode 100644 index 0000000..e97204b --- /dev/null +++ b/x/checkers/keeper/query_stored_game.go @@ -0,0 +1,55 @@ +package keeper + +import ( + "context" + + "cosmossdk.io/store/prefix" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/olimdzhon/checkers/x/checkers/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) StoredGameAll(ctx context.Context, req *types.QueryAllStoredGameRequest) (*types.QueryAllStoredGameResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var storedGames []types.StoredGame + + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + storedGameStore := prefix.NewStore(store, types.KeyPrefix(types.StoredGameKeyPrefix)) + + pageRes, err := query.Paginate(storedGameStore, req.Pagination, func(key []byte, value []byte) error { + var storedGame types.StoredGame + if err := k.cdc.Unmarshal(value, &storedGame); err != nil { + return err + } + + storedGames = append(storedGames, storedGame) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllStoredGameResponse{StoredGame: storedGames, Pagination: pageRes}, nil +} + +func (k Keeper) StoredGame(ctx context.Context, req *types.QueryGetStoredGameRequest) (*types.QueryGetStoredGameResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + val, found := k.GetStoredGame( + ctx, + req.Index, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetStoredGameResponse{StoredGame: val}, nil +} diff --git a/x/checkers/keeper/query_stored_game_test.go b/x/checkers/keeper/query_stored_game_test.go new file mode 100644 index 0000000..5371826 --- /dev/null +++ b/x/checkers/keeper/query_stored_game_test.go @@ -0,0 +1,124 @@ +package keeper_test + +import ( + "strconv" + "testing" + + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/olimdzhon/checkers/testutil/keeper" + "github.com/olimdzhon/checkers/testutil/nullify" + "github.com/olimdzhon/checkers/x/checkers/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestStoredGameQuerySingle(t *testing.T) { + keeper, ctx := keepertest.CheckersKeeper(t) + msgs := createNStoredGame(keeper, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetStoredGameRequest + response *types.QueryGetStoredGameResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetStoredGameRequest{ + Index: msgs[0].Index, + }, + response: &types.QueryGetStoredGameResponse{StoredGame: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetStoredGameRequest{ + Index: msgs[1].Index, + }, + response: &types.QueryGetStoredGameResponse{StoredGame: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetStoredGameRequest{ + Index: strconv.Itoa(100000), + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.StoredGame(ctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestStoredGameQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.CheckersKeeper(t) + msgs := createNStoredGame(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllStoredGameRequest { + return &types.QueryAllStoredGameRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.StoredGameAll(ctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.StoredGame), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.StoredGame), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.StoredGameAll(ctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.StoredGame), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.StoredGame), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.StoredGameAll(ctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.StoredGame), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.StoredGameAll(ctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/checkers/keeper/stored_game.go b/x/checkers/keeper/stored_game.go new file mode 100644 index 0000000..239ef17 --- /dev/null +++ b/x/checkers/keeper/stored_game.go @@ -0,0 +1,70 @@ +package keeper + +import ( + "context" + + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/olimdzhon/checkers/x/checkers/types" +) + +// SetStoredGame set a specific storedGame in the store from its index +func (k Keeper) SetStoredGame(ctx context.Context, storedGame types.StoredGame) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.StoredGameKeyPrefix)) + b := k.cdc.MustMarshal(&storedGame) + store.Set(types.StoredGameKey( + storedGame.Index, + ), b) +} + +// GetStoredGame returns a storedGame from its index +func (k Keeper) GetStoredGame( + ctx context.Context, + index string, + +) (val types.StoredGame, found bool) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.StoredGameKeyPrefix)) + + b := store.Get(types.StoredGameKey( + index, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveStoredGame removes a storedGame from the store +func (k Keeper) RemoveStoredGame( + ctx context.Context, + index string, + +) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.StoredGameKeyPrefix)) + store.Delete(types.StoredGameKey( + index, + )) +} + +// GetAllStoredGame returns all storedGame +func (k Keeper) GetAllStoredGame(ctx context.Context) (list []types.StoredGame) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.StoredGameKeyPrefix)) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.StoredGame + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/checkers/keeper/stored_game_test.go b/x/checkers/keeper/stored_game_test.go new file mode 100644 index 0000000..6457e29 --- /dev/null +++ b/x/checkers/keeper/stored_game_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "context" + "strconv" + "testing" + + keepertest "github.com/olimdzhon/checkers/testutil/keeper" + "github.com/olimdzhon/checkers/testutil/nullify" + "github.com/olimdzhon/checkers/x/checkers/keeper" + "github.com/olimdzhon/checkers/x/checkers/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNStoredGame(keeper keeper.Keeper, ctx context.Context, n int) []types.StoredGame { + items := make([]types.StoredGame, n) + for i := range items { + items[i].Index = strconv.Itoa(i) + + keeper.SetStoredGame(ctx, items[i]) + } + return items +} + +func TestStoredGameGet(t *testing.T) { + keeper, ctx := keepertest.CheckersKeeper(t) + items := createNStoredGame(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetStoredGame(ctx, + item.Index, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} +func TestStoredGameRemove(t *testing.T) { + keeper, ctx := keepertest.CheckersKeeper(t) + items := createNStoredGame(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveStoredGame(ctx, + item.Index, + ) + _, found := keeper.GetStoredGame(ctx, + item.Index, + ) + require.False(t, found) + } +} + +func TestStoredGameGetAll(t *testing.T) { + keeper, ctx := keepertest.CheckersKeeper(t) + items := createNStoredGame(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllStoredGame(ctx)), + ) +} diff --git a/x/checkers/module/autocli.go b/x/checkers/module/autocli.go index 9518ef4..ffb6ff1 100644 --- a/x/checkers/module/autocli.go +++ b/x/checkers/module/autocli.go @@ -22,6 +22,17 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Use: "show-system-info", Short: "show systemInfo", }, + { + RpcMethod: "StoredGameAll", + Use: "list-stored-game", + Short: "List all storedGame", + }, + { + RpcMethod: "StoredGame", + Use: "show-stored-game [id]", + Short: "Shows a storedGame", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "index"}}, + }, // this line is used by ignite scaffolding # autocli/query }, }, diff --git a/x/checkers/module/genesis.go b/x/checkers/module/genesis.go index f484d70..d3ecf16 100644 --- a/x/checkers/module/genesis.go +++ b/x/checkers/module/genesis.go @@ -13,6 +13,10 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) if genState.SystemInfo != nil { k.SetSystemInfo(ctx, *genState.SystemInfo) } + // Set all the storedGame + for _, elem := range genState.StoredGameList { + k.SetStoredGame(ctx, elem) + } // this line is used by starport scaffolding # genesis/module/init if err := k.SetParams(ctx, genState.Params); err != nil { panic(err) @@ -29,6 +33,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { if found { genesis.SystemInfo = &systemInfo } + genesis.StoredGameList = k.GetAllStoredGame(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/checkers/module/genesis_test.go b/x/checkers/module/genesis_test.go index b35ccc8..5dda4aa 100644 --- a/x/checkers/module/genesis_test.go +++ b/x/checkers/module/genesis_test.go @@ -17,6 +17,14 @@ func TestGenesis(t *testing.T) { SystemInfo: &types.SystemInfo{ NextId: 67, }, + StoredGameList: []types.StoredGame{ + { + Index: "0", + }, + { + Index: "1", + }, + }, // this line is used by starport scaffolding # genesis/test/state } @@ -29,5 +37,6 @@ func TestGenesis(t *testing.T) { nullify.Fill(got) require.Equal(t, genesisState.SystemInfo, got.SystemInfo) + require.ElementsMatch(t, genesisState.StoredGameList, got.StoredGameList) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/checkers/types/genesis.go b/x/checkers/types/genesis.go index ae7002f..be2aae5 100644 --- a/x/checkers/types/genesis.go +++ b/x/checkers/types/genesis.go @@ -1,6 +1,8 @@ package types -// this line is used by starport scaffolding # genesis/types/import +import ( + "fmt" +) // DefaultIndex is the default global index const DefaultIndex uint64 = 1 @@ -8,7 +10,8 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - SystemInfo: nil, + SystemInfo: nil, + StoredGameList: []StoredGame{}, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } @@ -17,6 +20,16 @@ func DefaultGenesis() *GenesisState { // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { + // Check for duplicated index in storedGame + storedGameIndexMap := make(map[string]struct{}) + + for _, elem := range gs.StoredGameList { + index := string(StoredGameKey(elem.Index)) + if _, ok := storedGameIndexMap[index]; ok { + return fmt.Errorf("duplicated index for storedGame") + } + storedGameIndexMap[index] = struct{}{} + } // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() diff --git a/x/checkers/types/genesis.pb.go b/x/checkers/types/genesis.pb.go index 4f14518..2818ae3 100644 --- a/x/checkers/types/genesis.pb.go +++ b/x/checkers/types/genesis.pb.go @@ -28,8 +28,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the checkers module's genesis state. type GenesisState struct { // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - SystemInfo *SystemInfo `protobuf:"bytes,2,opt,name=systemInfo,proto3" json:"systemInfo,omitempty"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + SystemInfo *SystemInfo `protobuf:"bytes,2,opt,name=systemInfo,proto3" json:"systemInfo,omitempty"` + StoredGameList []StoredGame `protobuf:"bytes,3,rep,name=storedGameList,proto3" json:"storedGameList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -79,6 +80,13 @@ func (m *GenesisState) GetSystemInfo() *SystemInfo { return nil } +func (m *GenesisState) GetStoredGameList() []StoredGame { + if m != nil { + return m.StoredGameList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "checkers.checkers.GenesisState") } @@ -86,23 +94,25 @@ func init() { func init() { proto.RegisterFile("checkers/checkers/genesis.proto", fileDescriptor_e29994b75a5b5b77) } var fileDescriptor_e29994b75a5b5b77 = []byte{ - // 245 bytes of a gzipped FileDescriptorProto + // 288 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0x48, 0x4d, 0xce, 0x4e, 0x2d, 0x2a, 0xd6, 0x87, 0x33, 0xd2, 0x53, 0xf3, 0x52, 0x8b, 0x33, 0x8b, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x04, 0x61, 0xe2, 0x7a, 0x30, 0x86, 0x94, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, 0x3e, 0x98, 0x84, 0xa8, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x33, 0xf5, 0x41, 0x2c, 0xa8, 0xa8, 0x1c, 0xa6, 0xe1, 0x05, 0x89, 0x45, 0x89, 0xb9, 0x50, 0xb3, 0xa5, 0x94, 0x31, - 0xe5, 0x8b, 0x2b, 0x8b, 0x4b, 0x52, 0x73, 0xe3, 0x33, 0xf3, 0xd2, 0xa0, 0x86, 0x28, 0x75, 0x33, - 0x72, 0xf1, 0xb8, 0x43, 0x9c, 0x14, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xc3, 0xc5, 0x06, 0x31, - 0x45, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x52, 0x0f, 0xc3, 0x89, 0x7a, 0x01, 0x60, 0x05, - 0x4e, 0x9c, 0x27, 0xee, 0xc9, 0x33, 0xac, 0x78, 0xbe, 0x41, 0x8b, 0x31, 0x08, 0xaa, 0x47, 0xc8, - 0x96, 0x8b, 0x0b, 0x62, 0x87, 0x67, 0x5e, 0x5a, 0xbe, 0x04, 0x13, 0xd8, 0x04, 0x59, 0x2c, 0x26, - 0x04, 0xc3, 0x15, 0x05, 0x21, 0x69, 0x70, 0xf2, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, - 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, - 0x39, 0x86, 0x28, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xfc, - 0x9c, 0xcc, 0xdc, 0x94, 0xaa, 0x8c, 0xfc, 0x3c, 0x84, 0xc7, 0x2a, 0x10, 0xcc, 0x92, 0xca, 0x82, - 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xf7, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x8a, 0xe1, - 0x4e, 0x82, 0x01, 0x00, 0x00, + 0xe5, 0x8b, 0x2b, 0x8b, 0x4b, 0x52, 0x73, 0xe3, 0x33, 0xf3, 0xd2, 0xf2, 0xf1, 0x28, 0x2a, 0xc9, + 0x2f, 0x4a, 0x4d, 0x89, 0x4f, 0x4f, 0xcc, 0x4d, 0x85, 0x28, 0x52, 0xba, 0xc1, 0xc8, 0xc5, 0xe3, + 0x0e, 0x71, 0x77, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x0d, 0x17, 0x1b, 0xc4, 0x2a, 0x09, 0x46, + 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x49, 0x3d, 0x0c, 0x7f, 0xe8, 0x05, 0x80, 0x15, 0x38, 0x71, 0x9e, + 0xb8, 0x27, 0xcf, 0xb0, 0xe2, 0xf9, 0x06, 0x2d, 0xc6, 0x20, 0xa8, 0x1e, 0x21, 0x5b, 0x2e, 0x2e, + 0x88, 0x43, 0x3c, 0xf3, 0xd2, 0xf2, 0x25, 0x98, 0xc0, 0x26, 0xc8, 0x62, 0x31, 0x21, 0x18, 0xae, + 0x28, 0x08, 0x49, 0x83, 0x90, 0x37, 0x17, 0x1f, 0xc4, 0x89, 0xee, 0x89, 0xb9, 0xa9, 0x3e, 0x99, + 0xc5, 0x25, 0x12, 0xcc, 0x0a, 0xcc, 0xb8, 0x8c, 0x80, 0x2b, 0x74, 0x62, 0x01, 0x39, 0x24, 0x08, + 0x4d, 0xab, 0x93, 0xc7, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, + 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xe9, 0xa5, + 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xe7, 0xe7, 0x64, 0xe6, 0xa6, 0x54, + 0x65, 0xe4, 0xe7, 0x21, 0x42, 0xa9, 0x02, 0xc1, 0x2c, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, + 0x87, 0x95, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x04, 0x63, 0xa2, 0x25, 0xf4, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -125,6 +135,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.StoredGameList) > 0 { + for iNdEx := len(m.StoredGameList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StoredGameList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } if m.SystemInfo != nil { { size, err := m.SystemInfo.MarshalToSizedBuffer(dAtA[:i]) @@ -173,6 +197,12 @@ func (m *GenesisState) Size() (n int) { l = m.SystemInfo.Size() n += 1 + l + sovGenesis(uint64(l)) } + if len(m.StoredGameList) > 0 { + for _, e := range m.StoredGameList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -280,6 +310,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StoredGameList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StoredGameList = append(m.StoredGameList, StoredGame{}) + if err := m.StoredGameList[len(m.StoredGameList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/checkers/types/genesis_test.go b/x/checkers/types/genesis_test.go index 4bc66f0..423e3f4 100644 --- a/x/checkers/types/genesis_test.go +++ b/x/checkers/types/genesis_test.go @@ -25,10 +25,32 @@ func TestGenesisState_Validate(t *testing.T) { SystemInfo: &types.SystemInfo{ NextId: 100, }, + StoredGameList: []types.StoredGame{ + { + Index: "0", + }, + { + Index: "1", + }, + }, // this line is used by starport scaffolding # types/genesis/validField }, valid: true, }, + { + desc: "duplicated storedGame", + genState: &types.GenesisState{ + StoredGameList: []types.StoredGame{ + { + Index: "0", + }, + { + Index: "0", + }, + }, + }, + valid: false, + }, // this line is used by starport scaffolding # types/genesis/testcase } for _, tc := range tests { diff --git a/x/checkers/types/key_stored_game.go b/x/checkers/types/key_stored_game.go new file mode 100644 index 0000000..4854335 --- /dev/null +++ b/x/checkers/types/key_stored_game.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // StoredGameKeyPrefix is the prefix to retrieve all StoredGame + StoredGameKeyPrefix = "StoredGame/value/" +) + +// StoredGameKey returns the store key to retrieve a StoredGame from the index fields +func StoredGameKey( + index string, +) []byte { + var key []byte + + indexBytes := []byte(index) + key = append(key, indexBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/checkers/types/query.pb.go b/x/checkers/types/query.pb.go index da858b5..765e253 100644 --- a/x/checkers/types/query.pb.go +++ b/x/checkers/types/query.pb.go @@ -10,7 +10,7 @@ import ( math "math" math_bits "math/bits" - _ "github.com/cosmos/cosmos-sdk/types/query" + query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -195,43 +195,242 @@ func (m *QueryGetSystemInfoResponse) GetSystemInfo() SystemInfo { return SystemInfo{} } +type QueryGetStoredGameRequest struct { + Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` +} + +func (m *QueryGetStoredGameRequest) Reset() { *m = QueryGetStoredGameRequest{} } +func (m *QueryGetStoredGameRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetStoredGameRequest) ProtoMessage() {} +func (*QueryGetStoredGameRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_19860b8f7e48e009, []int{4} +} +func (m *QueryGetStoredGameRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetStoredGameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetStoredGameRequest.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 *QueryGetStoredGameRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetStoredGameRequest.Merge(m, src) +} +func (m *QueryGetStoredGameRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetStoredGameRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetStoredGameRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetStoredGameRequest proto.InternalMessageInfo + +func (m *QueryGetStoredGameRequest) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +type QueryGetStoredGameResponse struct { + StoredGame StoredGame `protobuf:"bytes,1,opt,name=storedGame,proto3" json:"storedGame"` +} + +func (m *QueryGetStoredGameResponse) Reset() { *m = QueryGetStoredGameResponse{} } +func (m *QueryGetStoredGameResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetStoredGameResponse) ProtoMessage() {} +func (*QueryGetStoredGameResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_19860b8f7e48e009, []int{5} +} +func (m *QueryGetStoredGameResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetStoredGameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetStoredGameResponse.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 *QueryGetStoredGameResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetStoredGameResponse.Merge(m, src) +} +func (m *QueryGetStoredGameResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetStoredGameResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetStoredGameResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetStoredGameResponse proto.InternalMessageInfo + +func (m *QueryGetStoredGameResponse) GetStoredGame() StoredGame { + if m != nil { + return m.StoredGame + } + return StoredGame{} +} + +type QueryAllStoredGameRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllStoredGameRequest) Reset() { *m = QueryAllStoredGameRequest{} } +func (m *QueryAllStoredGameRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllStoredGameRequest) ProtoMessage() {} +func (*QueryAllStoredGameRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_19860b8f7e48e009, []int{6} +} +func (m *QueryAllStoredGameRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllStoredGameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllStoredGameRequest.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 *QueryAllStoredGameRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllStoredGameRequest.Merge(m, src) +} +func (m *QueryAllStoredGameRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllStoredGameRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllStoredGameRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllStoredGameRequest proto.InternalMessageInfo + +func (m *QueryAllStoredGameRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllStoredGameResponse struct { + StoredGame []StoredGame `protobuf:"bytes,1,rep,name=storedGame,proto3" json:"storedGame"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllStoredGameResponse) Reset() { *m = QueryAllStoredGameResponse{} } +func (m *QueryAllStoredGameResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllStoredGameResponse) ProtoMessage() {} +func (*QueryAllStoredGameResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_19860b8f7e48e009, []int{7} +} +func (m *QueryAllStoredGameResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllStoredGameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllStoredGameResponse.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 *QueryAllStoredGameResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllStoredGameResponse.Merge(m, src) +} +func (m *QueryAllStoredGameResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllStoredGameResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllStoredGameResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllStoredGameResponse proto.InternalMessageInfo + +func (m *QueryAllStoredGameResponse) GetStoredGame() []StoredGame { + if m != nil { + return m.StoredGame + } + return nil +} + +func (m *QueryAllStoredGameResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "checkers.checkers.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "checkers.checkers.QueryParamsResponse") proto.RegisterType((*QueryGetSystemInfoRequest)(nil), "checkers.checkers.QueryGetSystemInfoRequest") proto.RegisterType((*QueryGetSystemInfoResponse)(nil), "checkers.checkers.QueryGetSystemInfoResponse") + proto.RegisterType((*QueryGetStoredGameRequest)(nil), "checkers.checkers.QueryGetStoredGameRequest") + proto.RegisterType((*QueryGetStoredGameResponse)(nil), "checkers.checkers.QueryGetStoredGameResponse") + proto.RegisterType((*QueryAllStoredGameRequest)(nil), "checkers.checkers.QueryAllStoredGameRequest") + proto.RegisterType((*QueryAllStoredGameResponse)(nil), "checkers.checkers.QueryAllStoredGameResponse") } func init() { proto.RegisterFile("checkers/checkers/query.proto", fileDescriptor_19860b8f7e48e009) } var fileDescriptor_19860b8f7e48e009 = []byte{ - // 409 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xce, 0x48, 0x4d, - 0xce, 0x4e, 0x2d, 0x2a, 0xd6, 0x87, 0x33, 0x0a, 0x4b, 0x53, 0x8b, 0x2a, 0xf5, 0x0a, 0x8a, 0xf2, - 0x4b, 0xf2, 0x85, 0x04, 0x61, 0xa2, 0x7a, 0x30, 0x86, 0x94, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, - 0x3e, 0x98, 0x84, 0xa8, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x33, 0xf5, 0x41, 0x2c, 0xa8, - 0xa8, 0x4c, 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x7e, 0x62, 0x41, 0xa6, 0x7e, 0x62, 0x5e, 0x5e, - 0x7e, 0x49, 0x62, 0x49, 0x66, 0x7e, 0x5e, 0x31, 0x54, 0x56, 0x2b, 0x39, 0xbf, 0x38, 0x37, 0xbf, - 0x58, 0x3f, 0x29, 0xb1, 0x38, 0x15, 0x62, 0xa5, 0x7e, 0x99, 0x61, 0x52, 0x6a, 0x49, 0xa2, 0xa1, - 0x7e, 0x41, 0x62, 0x7a, 0x66, 0x1e, 0x58, 0x31, 0x54, 0xad, 0x1c, 0xa6, 0x23, 0x0b, 0x12, 0x8b, - 0x12, 0x73, 0x61, 0x66, 0x29, 0x63, 0xca, 0x17, 0x57, 0x16, 0x97, 0xa4, 0xe6, 0xc6, 0x67, 0xe6, - 0xa5, 0x41, 0x9d, 0xa3, 0x24, 0xc2, 0x25, 0x14, 0x08, 0xb2, 0x26, 0x00, 0xac, 0x33, 0x28, 0xb5, - 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0x29, 0x98, 0x4b, 0x18, 0x45, 0xb4, 0xb8, 0x20, 0x3f, 0xaf, 0x38, - 0x55, 0xc8, 0x86, 0x8b, 0x0d, 0x62, 0x83, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0xa4, 0x1e, - 0x46, 0x40, 0xe8, 0x41, 0xb4, 0x38, 0x71, 0x9e, 0xb8, 0x27, 0xcf, 0xb0, 0xe2, 0xf9, 0x06, 0x2d, - 0xc6, 0x20, 0xa8, 0x1e, 0x25, 0x69, 0x2e, 0x49, 0xb0, 0xa1, 0xee, 0xa9, 0x25, 0xc1, 0x60, 0x77, - 0x78, 0xe6, 0xa5, 0xe5, 0xc3, 0x6c, 0x4c, 0xe4, 0x92, 0xc2, 0x26, 0x09, 0xb5, 0xd8, 0x99, 0x8b, - 0x0b, 0x21, 0x0a, 0xb5, 0x5c, 0x16, 0x8b, 0xe5, 0x08, 0x45, 0x4e, 0x2c, 0x20, 0x07, 0x04, 0x21, - 0x69, 0x33, 0x5a, 0xc3, 0xc4, 0xc5, 0x0a, 0xb6, 0x43, 0xa8, 0x85, 0x91, 0x8b, 0x0d, 0xe2, 0x4e, - 0x21, 0x55, 0x2c, 0xa6, 0x60, 0x06, 0x88, 0x94, 0x1a, 0x21, 0x65, 0x10, 0x87, 0x2a, 0x69, 0x37, - 0x5d, 0x7e, 0x32, 0x99, 0x49, 0x55, 0x48, 0x59, 0x3f, 0x3f, 0x27, 0x33, 0x37, 0xa5, 0x2a, 0x23, - 0x3f, 0x4f, 0x1f, 0x57, 0x34, 0x09, 0xcd, 0x66, 0x44, 0xf6, 0x96, 0x90, 0x0e, 0x2e, 0x3b, 0xb0, - 0x05, 0x98, 0x94, 0x2e, 0x91, 0xaa, 0xa1, 0x0e, 0x33, 0x00, 0x3b, 0x4c, 0x4b, 0x48, 0x03, 0xaf, - 0xc3, 0x90, 0xd2, 0x87, 0x93, 0xc7, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, - 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, - 0xe9, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0x62, 0x33, 0xad, 0x02, 0xc1, - 0x2c, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x27, 0x35, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x52, 0xa2, 0x5a, 0x50, 0x56, 0x03, 0x00, 0x00, + // 583 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x31, 0x6f, 0x13, 0x31, + 0x14, 0xc7, 0x73, 0xa5, 0xad, 0x54, 0x23, 0x86, 0x9a, 0x0c, 0x34, 0xd0, 0x03, 0x5d, 0xd5, 0x52, + 0x05, 0xb0, 0x9b, 0xb0, 0x30, 0xb0, 0x34, 0x48, 0x04, 0xb6, 0x92, 0x6e, 0x2c, 0x95, 0x93, 0xb8, + 0x97, 0x13, 0x77, 0xf6, 0x35, 0x76, 0x50, 0x03, 0x62, 0x41, 0x7c, 0x00, 0x24, 0x46, 0x24, 0x16, + 0x16, 0xc4, 0xc4, 0xc7, 0xe8, 0x58, 0x89, 0x85, 0x09, 0xa1, 0x04, 0x89, 0x0f, 0xc0, 0x17, 0x40, + 0xb1, 0x7d, 0xf1, 0xa5, 0x77, 0xb9, 0x56, 0x2c, 0xd1, 0xcb, 0xf3, 0x7b, 0xef, 0xff, 0xb3, 0xef, + 0x6f, 0x83, 0xf5, 0x4e, 0x8f, 0x76, 0x5e, 0xd0, 0xbe, 0xc0, 0xd3, 0xe0, 0x68, 0x40, 0xfb, 0x43, + 0x14, 0xf7, 0xb9, 0xe4, 0x70, 0x35, 0xc9, 0xa2, 0x24, 0xa8, 0xac, 0x92, 0x28, 0x60, 0x1c, 0xab, + 0x5f, 0x5d, 0x55, 0x29, 0xfb, 0xdc, 0xe7, 0x2a, 0xc4, 0x93, 0xc8, 0x64, 0x6f, 0xf8, 0x9c, 0xfb, + 0x21, 0xc5, 0x24, 0x0e, 0x30, 0x61, 0x8c, 0x4b, 0x22, 0x03, 0xce, 0x84, 0x59, 0xad, 0x76, 0xb8, + 0x88, 0xb8, 0xc0, 0x6d, 0x22, 0xa8, 0x96, 0xc4, 0x2f, 0x6b, 0x6d, 0x2a, 0x49, 0x0d, 0xc7, 0xc4, + 0x0f, 0x98, 0x2a, 0x36, 0xb5, 0x6e, 0x16, 0x32, 0x26, 0x7d, 0x12, 0x25, 0xb3, 0x36, 0xb2, 0xeb, + 0x62, 0x28, 0x24, 0x8d, 0x0e, 0x02, 0x76, 0xc8, 0x0b, 0x8a, 0x24, 0xef, 0xd3, 0xee, 0x81, 0x4f, + 0x22, 0xaa, 0x8b, 0xbc, 0x32, 0x80, 0xcf, 0x26, 0x2c, 0x7b, 0x6a, 0x7c, 0x8b, 0x1e, 0x0d, 0xa8, + 0x90, 0xde, 0x3e, 0xb8, 0x3a, 0x93, 0x15, 0x31, 0x67, 0x82, 0xc2, 0x87, 0x60, 0x59, 0x63, 0x5c, + 0x73, 0x6e, 0x39, 0xdb, 0x97, 0xeb, 0x6b, 0x28, 0x73, 0x5a, 0x48, 0xb7, 0x34, 0x56, 0x4e, 0x7e, + 0xde, 0x2c, 0x7d, 0xf9, 0xf3, 0xad, 0xea, 0xb4, 0x4c, 0x8f, 0x77, 0x1d, 0xac, 0xa9, 0xa1, 0x4d, + 0x2a, 0xf7, 0x15, 0xec, 0x53, 0x76, 0xc8, 0x13, 0x45, 0x02, 0x2a, 0x79, 0x8b, 0x46, 0xf8, 0x11, + 0x00, 0x36, 0x6b, 0xc4, 0xd7, 0x73, 0xc4, 0x6d, 0x51, 0x63, 0x71, 0x02, 0xd0, 0x4a, 0xb5, 0x79, + 0xb5, 0x94, 0xbe, 0x3a, 0x87, 0x26, 0x89, 0xa8, 0xd1, 0x87, 0x65, 0xb0, 0x14, 0xb0, 0x2e, 0x3d, + 0x56, 0xc3, 0x57, 0x5a, 0xfa, 0xcf, 0x0c, 0x55, 0xaa, 0xc5, 0x52, 0x89, 0x69, 0xb6, 0x88, 0x6a, + 0x5a, 0x94, 0x50, 0xd9, 0x36, 0xaf, 0x63, 0xa8, 0x76, 0xc3, 0x30, 0x4b, 0xf5, 0x18, 0x00, 0xeb, + 0x0d, 0xa3, 0xb0, 0x85, 0xb4, 0x91, 0xd0, 0xc4, 0x48, 0x48, 0x7b, 0xd7, 0x18, 0x09, 0xed, 0x11, + 0x3f, 0xe9, 0x6d, 0xa5, 0x3a, 0xbd, 0xaf, 0x8e, 0xd9, 0xc8, 0x19, 0x95, 0x39, 0x1b, 0xb9, 0xf4, + 0x1f, 0x1b, 0x81, 0xcd, 0x19, 0xd6, 0x05, 0xc5, 0x7a, 0xfb, 0x5c, 0x56, 0x4d, 0x90, 0x86, 0xad, + 0xff, 0x5d, 0x04, 0x4b, 0x0a, 0x16, 0xbe, 0x73, 0xc0, 0xb2, 0xf6, 0x13, 0xdc, 0xcc, 0xc1, 0xc9, + 0x1a, 0xb7, 0xb2, 0x75, 0x5e, 0x99, 0xd6, 0xf3, 0xee, 0xbc, 0xfd, 0xfe, 0xfb, 0xc3, 0xc2, 0x26, + 0xdc, 0xc0, 0x3c, 0x0c, 0xa2, 0xee, 0xab, 0x1e, 0x67, 0x78, 0xde, 0x9d, 0x83, 0x1f, 0x9d, 0xb4, + 0xfd, 0xe0, 0xdd, 0x79, 0x1a, 0x79, 0xc6, 0xae, 0xdc, 0xbb, 0x60, 0xb5, 0x01, 0xdb, 0x51, 0x60, + 0x55, 0xb8, 0x5d, 0x08, 0x96, 0xba, 0xec, 0xf0, 0xf3, 0x84, 0xce, 0x7e, 0x86, 0x42, 0xba, 0xb3, + 0x06, 0x2b, 0xa6, 0xcb, 0x18, 0xc5, 0x7b, 0xa0, 0xe8, 0xea, 0x70, 0xa7, 0x98, 0xce, 0xbe, 0x32, + 0xf8, 0xb5, 0xba, 0x48, 0x6f, 0xe0, 0x27, 0x07, 0x5c, 0xb1, 0x03, 0x77, 0xc3, 0x70, 0x3e, 0x68, + 0xde, 0x4d, 0x98, 0x0f, 0x9a, 0xeb, 0xe8, 0x8b, 0x1e, 0xa3, 0x05, 0x6d, 0x3c, 0x39, 0x19, 0xb9, + 0xce, 0xe9, 0xc8, 0x75, 0x7e, 0x8d, 0x5c, 0xe7, 0xfd, 0xd8, 0x2d, 0x9d, 0x8e, 0xdd, 0xd2, 0x8f, + 0xb1, 0x5b, 0x7a, 0x8e, 0xfc, 0x40, 0xf6, 0x06, 0x6d, 0xd4, 0xe1, 0x51, 0xde, 0xb4, 0x63, 0x1b, + 0xca, 0x61, 0x4c, 0x45, 0x7b, 0x59, 0xbd, 0xac, 0xf7, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x88, + 0x43, 0xfc, 0xc7, 0x6a, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -250,6 +449,9 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Queries a SystemInfo by index. SystemInfo(ctx context.Context, in *QueryGetSystemInfoRequest, opts ...grpc.CallOption) (*QueryGetSystemInfoResponse, error) + // Queries a list of StoredGame items. + StoredGame(ctx context.Context, in *QueryGetStoredGameRequest, opts ...grpc.CallOption) (*QueryGetStoredGameResponse, error) + StoredGameAll(ctx context.Context, in *QueryAllStoredGameRequest, opts ...grpc.CallOption) (*QueryAllStoredGameResponse, error) } type queryClient struct { @@ -278,12 +480,33 @@ func (c *queryClient) SystemInfo(ctx context.Context, in *QueryGetSystemInfoRequ return out, nil } +func (c *queryClient) StoredGame(ctx context.Context, in *QueryGetStoredGameRequest, opts ...grpc.CallOption) (*QueryGetStoredGameResponse, error) { + out := new(QueryGetStoredGameResponse) + err := c.cc.Invoke(ctx, "/checkers.checkers.Query/StoredGame", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) StoredGameAll(ctx context.Context, in *QueryAllStoredGameRequest, opts ...grpc.CallOption) (*QueryAllStoredGameResponse, error) { + out := new(QueryAllStoredGameResponse) + err := c.cc.Invoke(ctx, "/checkers.checkers.Query/StoredGameAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Queries a SystemInfo by index. SystemInfo(context.Context, *QueryGetSystemInfoRequest) (*QueryGetSystemInfoResponse, error) + // Queries a list of StoredGame items. + StoredGame(context.Context, *QueryGetStoredGameRequest) (*QueryGetStoredGameResponse, error) + StoredGameAll(context.Context, *QueryAllStoredGameRequest) (*QueryAllStoredGameResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -296,6 +519,12 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsReq func (*UnimplementedQueryServer) SystemInfo(ctx context.Context, req *QueryGetSystemInfoRequest) (*QueryGetSystemInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SystemInfo not implemented") } +func (*UnimplementedQueryServer) StoredGame(ctx context.Context, req *QueryGetStoredGameRequest) (*QueryGetStoredGameResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StoredGame not implemented") +} +func (*UnimplementedQueryServer) StoredGameAll(ctx context.Context, req *QueryAllStoredGameRequest) (*QueryAllStoredGameResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StoredGameAll not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -337,6 +566,42 @@ func _Query_SystemInfo_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Query_StoredGame_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetStoredGameRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).StoredGame(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/checkers.checkers.Query/StoredGame", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).StoredGame(ctx, req.(*QueryGetStoredGameRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_StoredGameAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllStoredGameRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).StoredGameAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/checkers.checkers.Query/StoredGameAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).StoredGameAll(ctx, req.(*QueryAllStoredGameRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "checkers.checkers.Query", HandlerType: (*QueryServer)(nil), @@ -349,6 +614,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "SystemInfo", Handler: _Query_SystemInfo_Handler, }, + { + MethodName: "StoredGame", + Handler: _Query_StoredGame_Handler, + }, + { + MethodName: "StoredGameAll", + Handler: _Query_StoredGameAll_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "checkers/checkers/query.proto", @@ -466,6 +739,153 @@ func (m *QueryGetSystemInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *QueryGetStoredGameRequest) 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 *QueryGetStoredGameRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetStoredGameRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetStoredGameResponse) 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 *QueryGetStoredGameResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetStoredGameResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.StoredGame.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllStoredGameRequest) 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 *QueryAllStoredGameRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllStoredGameRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllStoredGameResponse) 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 *QueryAllStoredGameResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllStoredGameResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.StoredGame) > 0 { + for iNdEx := len(m.StoredGame) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StoredGame[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -517,7 +937,63 @@ func (m *QueryGetSystemInfoResponse) Size() (n int) { return n } -func sovQuery(x uint64) (n int) { +func (m *QueryGetStoredGameRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Index) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetStoredGameResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.StoredGame.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllStoredGameRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllStoredGameResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.StoredGame) > 0 { + for _, e := range m.StoredGame { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozQuery(x uint64) (n int) { @@ -789,6 +1265,377 @@ func (m *QueryGetSystemInfoResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryGetStoredGameRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetStoredGameRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetStoredGameRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetStoredGameResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetStoredGameResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetStoredGameResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StoredGame", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StoredGame.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllStoredGameRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllStoredGameRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllStoredGameRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllStoredGameResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllStoredGameResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllStoredGameResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StoredGame", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StoredGame = append(m.StoredGame, StoredGame{}) + if err := m.StoredGame[len(m.StoredGame)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/checkers/types/query.pb.gw.go b/x/checkers/types/query.pb.gw.go index 4737424..252e9e9 100644 --- a/x/checkers/types/query.pb.gw.go +++ b/x/checkers/types/query.pb.gw.go @@ -69,6 +69,96 @@ func local_request_Query_SystemInfo_0(ctx context.Context, marshaler runtime.Mar } +func request_Query_StoredGame_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetStoredGameRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") + } + + protoReq.Index, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) + } + + msg, err := client.StoredGame(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_StoredGame_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetStoredGameRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") + } + + protoReq.Index, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) + } + + msg, err := server.StoredGame(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_StoredGameAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_StoredGameAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllStoredGameRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_StoredGameAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.StoredGameAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_StoredGameAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllStoredGameRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_StoredGameAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.StoredGameAll(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -121,6 +211,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_StoredGame_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_StoredGame_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_StoredGame_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_StoredGameAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_StoredGameAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_StoredGameAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -202,6 +338,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_StoredGame_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_StoredGame_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_StoredGame_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_StoredGameAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_StoredGameAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_StoredGameAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -209,10 +385,18 @@ var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"olimdzhon", "checkers", "params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_SystemInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"olimdzhon", "checkers", "system_info"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_StoredGame_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"olimdzhon", "checkers", "stored_game", "index"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_StoredGameAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"olimdzhon", "checkers", "stored_game"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage forward_Query_SystemInfo_0 = runtime.ForwardResponseMessage + + forward_Query_StoredGame_0 = runtime.ForwardResponseMessage + + forward_Query_StoredGameAll_0 = runtime.ForwardResponseMessage ) diff --git a/x/checkers/types/stored_game.pb.go b/x/checkers/types/stored_game.pb.go new file mode 100644 index 0000000..dc558b2 --- /dev/null +++ b/x/checkers/types/stored_game.pb.go @@ -0,0 +1,524 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: checkers/checkers/stored_game.proto + +package types + +import ( + fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + + proto "github.com/cosmos/gogoproto/proto" +) + +// 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 StoredGame struct { + Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` + Board string `protobuf:"bytes,2,opt,name=board,proto3" json:"board,omitempty"` + Turn string `protobuf:"bytes,3,opt,name=turn,proto3" json:"turn,omitempty"` + Black string `protobuf:"bytes,4,opt,name=black,proto3" json:"black,omitempty"` + Red string `protobuf:"bytes,5,opt,name=red,proto3" json:"red,omitempty"` +} + +func (m *StoredGame) Reset() { *m = StoredGame{} } +func (m *StoredGame) String() string { return proto.CompactTextString(m) } +func (*StoredGame) ProtoMessage() {} +func (*StoredGame) Descriptor() ([]byte, []int) { + return fileDescriptor_6a777ebb9b26769b, []int{0} +} +func (m *StoredGame) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StoredGame) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StoredGame.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 *StoredGame) XXX_Merge(src proto.Message) { + xxx_messageInfo_StoredGame.Merge(m, src) +} +func (m *StoredGame) XXX_Size() int { + return m.Size() +} +func (m *StoredGame) XXX_DiscardUnknown() { + xxx_messageInfo_StoredGame.DiscardUnknown(m) +} + +var xxx_messageInfo_StoredGame proto.InternalMessageInfo + +func (m *StoredGame) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +func (m *StoredGame) GetBoard() string { + if m != nil { + return m.Board + } + return "" +} + +func (m *StoredGame) GetTurn() string { + if m != nil { + return m.Turn + } + return "" +} + +func (m *StoredGame) GetBlack() string { + if m != nil { + return m.Black + } + return "" +} + +func (m *StoredGame) GetRed() string { + if m != nil { + return m.Red + } + return "" +} + +func init() { + proto.RegisterType((*StoredGame)(nil), "checkers.checkers.StoredGame") +} + +func init() { + proto.RegisterFile("checkers/checkers/stored_game.proto", fileDescriptor_6a777ebb9b26769b) +} + +var fileDescriptor_6a777ebb9b26769b = []byte{ + // 204 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0x48, 0x4d, + 0xce, 0x4e, 0x2d, 0x2a, 0xd6, 0x87, 0x33, 0x8a, 0x4b, 0xf2, 0x8b, 0x52, 0x53, 0xe2, 0xd3, 0x13, + 0x73, 0x53, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x04, 0x61, 0x72, 0x7a, 0x30, 0x86, 0x52, + 0x09, 0x17, 0x57, 0x30, 0x58, 0x9d, 0x7b, 0x62, 0x6e, 0xaa, 0x90, 0x08, 0x17, 0x6b, 0x66, 0x5e, + 0x4a, 0x6a, 0x85, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x84, 0x03, 0x12, 0x4d, 0xca, 0x4f, + 0x2c, 0x4a, 0x91, 0x60, 0x82, 0x88, 0x82, 0x39, 0x42, 0x42, 0x5c, 0x2c, 0x25, 0xa5, 0x45, 0x79, + 0x12, 0xcc, 0x60, 0x41, 0x30, 0x1b, 0xac, 0x32, 0x27, 0x31, 0x39, 0x5b, 0x82, 0x05, 0xaa, 0x12, + 0xc4, 0x11, 0x12, 0xe0, 0x62, 0x2e, 0x4a, 0x4d, 0x91, 0x60, 0x05, 0x8b, 0x81, 0x98, 0x4e, 0x1e, + 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, + 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, + 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x9f, 0x93, 0x99, 0x9b, 0x52, 0x95, 0x91, 0x9f, 0x87, + 0xf0, 0x53, 0x05, 0x82, 0x59, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0x99, 0x31, 0x20, + 0x00, 0x00, 0xff, 0xff, 0xbd, 0x98, 0xb5, 0x46, 0x00, 0x01, 0x00, 0x00, +} + +func (m *StoredGame) 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 *StoredGame) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoredGame) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Red) > 0 { + i -= len(m.Red) + copy(dAtA[i:], m.Red) + i = encodeVarintStoredGame(dAtA, i, uint64(len(m.Red))) + i-- + dAtA[i] = 0x2a + } + if len(m.Black) > 0 { + i -= len(m.Black) + copy(dAtA[i:], m.Black) + i = encodeVarintStoredGame(dAtA, i, uint64(len(m.Black))) + i-- + dAtA[i] = 0x22 + } + if len(m.Turn) > 0 { + i -= len(m.Turn) + copy(dAtA[i:], m.Turn) + i = encodeVarintStoredGame(dAtA, i, uint64(len(m.Turn))) + i-- + dAtA[i] = 0x1a + } + if len(m.Board) > 0 { + i -= len(m.Board) + copy(dAtA[i:], m.Board) + i = encodeVarintStoredGame(dAtA, i, uint64(len(m.Board))) + i-- + dAtA[i] = 0x12 + } + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarintStoredGame(dAtA, i, uint64(len(m.Index))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintStoredGame(dAtA []byte, offset int, v uint64) int { + offset -= sovStoredGame(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *StoredGame) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Index) + if l > 0 { + n += 1 + l + sovStoredGame(uint64(l)) + } + l = len(m.Board) + if l > 0 { + n += 1 + l + sovStoredGame(uint64(l)) + } + l = len(m.Turn) + if l > 0 { + n += 1 + l + sovStoredGame(uint64(l)) + } + l = len(m.Black) + if l > 0 { + n += 1 + l + sovStoredGame(uint64(l)) + } + l = len(m.Red) + if l > 0 { + n += 1 + l + sovStoredGame(uint64(l)) + } + return n +} + +func sovStoredGame(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozStoredGame(x uint64) (n int) { + return sovStoredGame(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *StoredGame) 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 ErrIntOverflowStoredGame + } + 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: StoredGame: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoredGame: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoredGame + } + 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 ErrInvalidLengthStoredGame + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStoredGame + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Board", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoredGame + } + 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 ErrInvalidLengthStoredGame + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStoredGame + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Board = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Turn", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoredGame + } + 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 ErrInvalidLengthStoredGame + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStoredGame + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Turn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Black", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoredGame + } + 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 ErrInvalidLengthStoredGame + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStoredGame + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Black = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Red", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStoredGame + } + 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 ErrInvalidLengthStoredGame + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStoredGame + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Red = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStoredGame(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStoredGame + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStoredGame(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, ErrIntOverflowStoredGame + } + 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, ErrIntOverflowStoredGame + } + 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, ErrIntOverflowStoredGame + } + 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, ErrInvalidLengthStoredGame + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStoredGame + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthStoredGame + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthStoredGame = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStoredGame = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStoredGame = fmt.Errorf("proto: unexpected end of group") +)