From 61351acd6e055434a3217181ff9fde0d5f9ead49 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 12:29:35 +0100 Subject: [PATCH 01/29] scaffold: module supplier --dep bank --- api/poktroll/supplier/genesis.pulsar.go | 596 +++++++++ api/poktroll/supplier/module/module.pulsar.go | 579 +++++++++ api/poktroll/supplier/params.pulsar.go | 500 ++++++++ api/poktroll/supplier/query.pulsar.go | 1011 +++++++++++++++ api/poktroll/supplier/tx.pulsar.go | 1090 +++++++++++++++++ app/app.go | 7 +- app/app_config.go | 11 + proto/poktroll/supplier/genesis.proto | 17 + proto/poktroll/supplier/module/module.proto | 14 + proto/poktroll/supplier/params.proto | 15 + proto/poktroll/supplier/query.proto | 30 + proto/poktroll/supplier/tx.proto | 40 + testutil/keeper/supplier.go | 50 + x/supplier/keeper/keeper.go | 58 + x/supplier/keeper/msg_server.go | 17 + x/supplier/keeper/msg_server_test.go | 24 + x/supplier/keeper/msg_update_params.go | 23 + x/supplier/keeper/msg_update_params_test.go | 64 + x/supplier/keeper/params.go | 33 + x/supplier/keeper/params_test.go | 18 + x/supplier/keeper/query.go | 7 + x/supplier/keeper/query_params.go | 20 + x/supplier/keeper/query_params_test.go | 20 + x/supplier/module/autocli.go | 35 + x/supplier/module/genesis.go | 24 + x/supplier/module/genesis_test.go | 29 + x/supplier/module/module.go | 215 ++++ x/supplier/module/simulation.go | 64 + x/supplier/simulation/helpers.go | 15 + x/supplier/types/codec.go | 17 + x/supplier/types/errors.go | 13 + x/supplier/types/expected_keepers.go | 25 + x/supplier/types/genesis.go | 24 + x/supplier/types/genesis_test.go | 41 + x/supplier/types/keys.go | 20 + x/supplier/types/msg_update_params.go | 21 + x/supplier/types/params.go | 32 + x/supplier/types/types.go | 1 + 38 files changed, 4818 insertions(+), 2 deletions(-) create mode 100644 api/poktroll/supplier/genesis.pulsar.go create mode 100644 api/poktroll/supplier/module/module.pulsar.go create mode 100644 api/poktroll/supplier/params.pulsar.go create mode 100644 api/poktroll/supplier/query.pulsar.go create mode 100644 api/poktroll/supplier/tx.pulsar.go create mode 100644 proto/poktroll/supplier/genesis.proto create mode 100644 proto/poktroll/supplier/module/module.proto create mode 100644 proto/poktroll/supplier/params.proto create mode 100644 proto/poktroll/supplier/query.proto create mode 100644 proto/poktroll/supplier/tx.proto create mode 100644 testutil/keeper/supplier.go create mode 100644 x/supplier/keeper/keeper.go create mode 100644 x/supplier/keeper/msg_server.go create mode 100644 x/supplier/keeper/msg_server_test.go create mode 100644 x/supplier/keeper/msg_update_params.go create mode 100644 x/supplier/keeper/msg_update_params_test.go create mode 100644 x/supplier/keeper/params.go create mode 100644 x/supplier/keeper/params_test.go create mode 100644 x/supplier/keeper/query.go create mode 100644 x/supplier/keeper/query_params.go create mode 100644 x/supplier/keeper/query_params_test.go create mode 100644 x/supplier/module/autocli.go create mode 100644 x/supplier/module/genesis.go create mode 100644 x/supplier/module/genesis_test.go create mode 100644 x/supplier/module/module.go create mode 100644 x/supplier/module/simulation.go create mode 100644 x/supplier/simulation/helpers.go create mode 100644 x/supplier/types/codec.go create mode 100644 x/supplier/types/errors.go create mode 100644 x/supplier/types/expected_keepers.go create mode 100644 x/supplier/types/genesis.go create mode 100644 x/supplier/types/genesis_test.go create mode 100644 x/supplier/types/keys.go create mode 100644 x/supplier/types/msg_update_params.go create mode 100644 x/supplier/types/params.go create mode 100644 x/supplier/types/types.go diff --git a/api/poktroll/supplier/genesis.pulsar.go b/api/poktroll/supplier/genesis.pulsar.go new file mode 100644 index 000000000..dc9fea872 --- /dev/null +++ b/api/poktroll/supplier/genesis.pulsar.go @@ -0,0 +1,596 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package supplier + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_genesis_proto_init() + md_GenesisState = File_poktroll_supplier_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_genesis_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_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// 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_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(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_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, 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_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.GenesisState.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.GenesisState")) + } + panic(fmt.Errorf("message poktroll.supplier.GenesisState 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_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.GenesisState.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.GenesisState")) + } + panic(fmt.Errorf("message poktroll.supplier.GenesisState 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_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.GenesisState")) + } + panic(fmt.Errorf("message poktroll.supplier.GenesisState 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_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.GenesisState")) + } + panic(fmt.Errorf("message poktroll.supplier.GenesisState 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_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.GenesisState")) + } + panic(fmt.Errorf("message poktroll.supplier.GenesisState 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_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.GenesisState")) + } + panic(fmt.Errorf("message poktroll.supplier.GenesisState 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_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.GenesisState", 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_GenesisState) 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_GenesisState) 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_GenesisState) 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_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + 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.Params != nil { + l = options.Size(x.Params) + 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().(*GenesisState) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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().(*GenesisState) + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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 +// protoc (unknown) +// source: poktroll/supplier/genesis.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) +) + +// GenesisState defines the supplier module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params defines all the parameters of the module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +var File_poktroll_supplier_genesis_proto protoreflect.FileDescriptor + +var file_poktroll_supplier_genesis_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x11, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4c, 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, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 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, 0x42, 0xae, 0x01, 0x0a, 0x15, + 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, + 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_supplier_genesis_proto_rawDescOnce sync.Once + file_poktroll_supplier_genesis_proto_rawDescData = file_poktroll_supplier_genesis_proto_rawDesc +) + +func file_poktroll_supplier_genesis_proto_rawDescGZIP() []byte { + file_poktroll_supplier_genesis_proto_rawDescOnce.Do(func() { + file_poktroll_supplier_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_supplier_genesis_proto_rawDescData) + }) + return file_poktroll_supplier_genesis_proto_rawDescData +} + +var file_poktroll_supplier_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_supplier_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: poktroll.supplier.GenesisState + (*Params)(nil), // 1: poktroll.supplier.Params +} +var file_poktroll_supplier_genesis_proto_depIdxs = []int32{ + 1, // 0: poktroll.supplier.GenesisState.params:type_name -> poktroll.supplier.Params + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_poktroll_supplier_genesis_proto_init() } +func file_poktroll_supplier_genesis_proto_init() { + if File_poktroll_supplier_genesis_proto != nil { + return + } + file_poktroll_supplier_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_poktroll_supplier_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); 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_poktroll_supplier_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_supplier_genesis_proto_goTypes, + DependencyIndexes: file_poktroll_supplier_genesis_proto_depIdxs, + MessageInfos: file_poktroll_supplier_genesis_proto_msgTypes, + }.Build() + File_poktroll_supplier_genesis_proto = out.File + file_poktroll_supplier_genesis_proto_rawDesc = nil + file_poktroll_supplier_genesis_proto_goTypes = nil + file_poktroll_supplier_genesis_proto_depIdxs = nil +} diff --git a/api/poktroll/supplier/module/module.pulsar.go b/api/poktroll/supplier/module/module.pulsar.go new file mode 100644 index 000000000..4da01a712 --- /dev/null +++ b/api/poktroll/supplier/module/module.pulsar.go @@ -0,0 +1,579 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package module + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" + 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" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_authority protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_module_module_proto_init() + md_Module = File_poktroll_supplier_module_module_proto.Messages().ByName("Module") + fd_Module_authority = md_Module.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_module_module_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_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// 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_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Module_authority, 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.module.Module.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.module.Module")) + } + panic(fmt.Errorf("message poktroll.supplier.module.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.module.Module.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.module.Module")) + } + panic(fmt.Errorf("message poktroll.supplier.module.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.module.Module.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.module.Module")) + } + panic(fmt.Errorf("message poktroll.supplier.module.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.module.Module.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.module.Module")) + } + panic(fmt.Errorf("message poktroll.supplier.module.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.module.Module.authority": + panic(fmt.Errorf("field authority of message poktroll.supplier.module.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.module.Module")) + } + panic(fmt.Errorf("message poktroll.supplier.module.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.module.Module.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.module.Module")) + } + panic(fmt.Errorf("message poktroll.supplier.module.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.module.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + 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.Authority) + 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().(*Module) + 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.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + 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().(*Module) + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: 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 Authority", 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.Authority = 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: poktroll/supplier/module/module.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) +) + +// Module is the config object for the module. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority defines the custom module authority. If not set, defaults to the governance module. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_module_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_module_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +var File_poktroll_supplier_module_module_proto protoreflect.FileDescriptor + +var file_poktroll_supplier_module_module_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x5b, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x33, 0xba, 0xc0, 0x96, + 0xda, 0x01, 0x2d, 0x0a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x42, 0xd8, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x29, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xa2, 0x02, 0x03, 0x50, 0x53, + 0x4d, 0xaa, 0x02, 0x18, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xca, 0x02, 0x18, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xe2, 0x02, 0x24, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x1a, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_supplier_module_module_proto_rawDescOnce sync.Once + file_poktroll_supplier_module_module_proto_rawDescData = file_poktroll_supplier_module_module_proto_rawDesc +) + +func file_poktroll_supplier_module_module_proto_rawDescGZIP() []byte { + file_poktroll_supplier_module_module_proto_rawDescOnce.Do(func() { + file_poktroll_supplier_module_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_supplier_module_module_proto_rawDescData) + }) + return file_poktroll_supplier_module_module_proto_rawDescData +} + +var file_poktroll_supplier_module_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_supplier_module_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: poktroll.supplier.module.Module +} +var file_poktroll_supplier_module_module_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_poktroll_supplier_module_module_proto_init() } +func file_poktroll_supplier_module_module_proto_init() { + if File_poktroll_supplier_module_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_poktroll_supplier_module_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); 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_poktroll_supplier_module_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_supplier_module_module_proto_goTypes, + DependencyIndexes: file_poktroll_supplier_module_module_proto_depIdxs, + MessageInfos: file_poktroll_supplier_module_module_proto_msgTypes, + }.Build() + File_poktroll_supplier_module_module_proto = out.File + file_poktroll_supplier_module_module_proto_rawDesc = nil + file_poktroll_supplier_module_module_proto_goTypes = nil + file_poktroll_supplier_module_module_proto_depIdxs = nil +} diff --git a/api/poktroll/supplier/params.pulsar.go b/api/poktroll/supplier/params.pulsar.go new file mode 100644 index 000000000..7108db140 --- /dev/null +++ b/api/poktroll/supplier/params.pulsar.go @@ -0,0 +1,500 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package supplier + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Params protoreflect.MessageDescriptor +) + +func init() { + file_poktroll_supplier_params_proto_init() + md_Params = File_poktroll_supplier_params_proto.Messages().ByName("Params") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_params_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_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// 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_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(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_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Params")) + } + panic(fmt.Errorf("message poktroll.supplier.Params 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_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Params")) + } + panic(fmt.Errorf("message poktroll.supplier.Params 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_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Params")) + } + panic(fmt.Errorf("message poktroll.supplier.Params 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_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Params")) + } + panic(fmt.Errorf("message poktroll.supplier.Params 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_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Params")) + } + panic(fmt.Errorf("message poktroll.supplier.Params 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_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Params")) + } + panic(fmt.Errorf("message poktroll.supplier.Params 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_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.Params", 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_Params) 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_Params) 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_Params) 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_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + 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.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().(*Params) + 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 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().(*Params) + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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: poktroll/supplier/params.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) +) + +// Params defines the parameters for the module. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_params_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_params_proto_rawDescGZIP(), []int{0} +} + +var File_poktroll_supplier_params_proto protoreflect.FileDescriptor + +var file_poktroll_supplier_params_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x11, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2d, 0x0a, 0x06, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x23, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, + 0x1a, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xad, 0x01, 0x0a, 0x15, + 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, + 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_supplier_params_proto_rawDescOnce sync.Once + file_poktroll_supplier_params_proto_rawDescData = file_poktroll_supplier_params_proto_rawDesc +) + +func file_poktroll_supplier_params_proto_rawDescGZIP() []byte { + file_poktroll_supplier_params_proto_rawDescOnce.Do(func() { + file_poktroll_supplier_params_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_supplier_params_proto_rawDescData) + }) + return file_poktroll_supplier_params_proto_rawDescData +} + +var file_poktroll_supplier_params_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_supplier_params_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: poktroll.supplier.Params +} +var file_poktroll_supplier_params_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_poktroll_supplier_params_proto_init() } +func file_poktroll_supplier_params_proto_init() { + if File_poktroll_supplier_params_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_poktroll_supplier_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); 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_poktroll_supplier_params_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_supplier_params_proto_goTypes, + DependencyIndexes: file_poktroll_supplier_params_proto_depIdxs, + MessageInfos: file_poktroll_supplier_params_proto_msgTypes, + }.Build() + File_poktroll_supplier_params_proto = out.File + file_poktroll_supplier_params_proto_rawDesc = nil + file_poktroll_supplier_params_proto_goTypes = nil + file_poktroll_supplier_params_proto_depIdxs = nil +} diff --git a/api/poktroll/supplier/query.pulsar.go b/api/poktroll/supplier/query.pulsar.go new file mode 100644 index 000000000..16b94d210 --- /dev/null +++ b/api/poktroll/supplier/query.pulsar.go @@ -0,0 +1,1011 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package supplier + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_poktroll_supplier_query_proto_init() + md_QueryParamsRequest = File_poktroll_supplier_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_query_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_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// 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_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(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_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryParamsRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryParamsRequest 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_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryParamsRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryParamsRequest 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_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryParamsRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryParamsRequest 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_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryParamsRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryParamsRequest 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_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryParamsRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryParamsRequest 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_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryParamsRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryParamsRequest 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_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.QueryParamsRequest", 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + 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.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().(*QueryParamsRequest) + 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 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().(*QueryParamsRequest) + 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_query_proto_init() + md_QueryParamsResponse = File_poktroll_supplier_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// 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_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(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_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, 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_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryParamsResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryParamsResponse 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_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryParamsResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryParamsResponse 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_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryParamsResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryParamsResponse 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_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryParamsResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryParamsResponse 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_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryParamsResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryParamsResponse 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_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryParamsResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryParamsResponse 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_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.QueryParamsResponse", 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + 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.Params != nil { + l = options.Size(x.Params) + 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().(*QueryParamsResponse) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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().(*QueryParamsResponse) + 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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 +// protoc (unknown) +// source: poktroll/supplier/query.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) +) + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params holds all the parameters of this module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +var File_poktroll_supplier_query_proto protoreflect.FileDescriptor + +var file_poktroll_supplier_query_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x11, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 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, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, + 0x32, 0x91, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x87, 0x01, 0x0a, 0x06, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x70, + 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0xac, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0a, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, + 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_supplier_query_proto_rawDescOnce sync.Once + file_poktroll_supplier_query_proto_rawDescData = file_poktroll_supplier_query_proto_rawDesc +) + +func file_poktroll_supplier_query_proto_rawDescGZIP() []byte { + file_poktroll_supplier_query_proto_rawDescOnce.Do(func() { + file_poktroll_supplier_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_supplier_query_proto_rawDescData) + }) + return file_poktroll_supplier_query_proto_rawDescData +} + +var file_poktroll_supplier_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_poktroll_supplier_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: poktroll.supplier.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: poktroll.supplier.QueryParamsResponse + (*Params)(nil), // 2: poktroll.supplier.Params +} +var file_poktroll_supplier_query_proto_depIdxs = []int32{ + 2, // 0: poktroll.supplier.QueryParamsResponse.params:type_name -> poktroll.supplier.Params + 0, // 1: poktroll.supplier.Query.Params:input_type -> poktroll.supplier.QueryParamsRequest + 1, // 2: poktroll.supplier.Query.Params:output_type -> poktroll.supplier.QueryParamsResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_poktroll_supplier_query_proto_init() } +func file_poktroll_supplier_query_proto_init() { + if File_poktroll_supplier_query_proto != nil { + return + } + file_poktroll_supplier_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_poktroll_supplier_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_supplier_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); 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_poktroll_supplier_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_poktroll_supplier_query_proto_goTypes, + DependencyIndexes: file_poktroll_supplier_query_proto_depIdxs, + MessageInfos: file_poktroll_supplier_query_proto_msgTypes, + }.Build() + File_poktroll_supplier_query_proto = out.File + file_poktroll_supplier_query_proto_rawDesc = nil + file_poktroll_supplier_query_proto_goTypes = nil + file_poktroll_supplier_query_proto_depIdxs = nil +} diff --git a/api/poktroll/supplier/tx.pulsar.go b/api/poktroll/supplier/tx.pulsar.go new file mode 100644 index 000000000..91020fcfe --- /dev/null +++ b/api/poktroll/supplier/tx.pulsar.go @@ -0,0 +1,1090 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package supplier + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_tx_proto_init() + md_MsgUpdateParams = File_poktroll_supplier_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_tx_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_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// 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_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(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_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, 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_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.MsgUpdateParams.authority": + return x.Authority != "" + case "poktroll.supplier.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUpdateParams")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUpdateParams 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_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.MsgUpdateParams.authority": + x.Authority = "" + case "poktroll.supplier.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUpdateParams")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUpdateParams 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_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "poktroll.supplier.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUpdateParams")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUpdateParams 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_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "poktroll.supplier.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUpdateParams")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUpdateParams 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_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "poktroll.supplier.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message poktroll.supplier.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUpdateParams")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUpdateParams 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_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "poktroll.supplier.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUpdateParams")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUpdateParams 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_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.MsgUpdateParams", 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + 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.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + 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().(*MsgUpdateParams) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + 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().(*MsgUpdateParams) + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: 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 Authority", 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.Authority = 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_poktroll_supplier_tx_proto_init() + md_MsgUpdateParamsResponse = File_poktroll_supplier_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// 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_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(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_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.MsgUpdateParamsResponse", 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + 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.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().(*MsgUpdateParamsResponse) + 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 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().(*MsgUpdateParamsResponse) + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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: poktroll/supplier/tx.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) +) + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the module parameters to update. + // + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_tx_proto_rawDescGZIP(), []int{1} +} + +var File_poktroll_supplier_tx_proto protoreflect.FileDescriptor + +var file_poktroll_supplier_tx_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, + 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, + 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x01, 0x0a, + 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x3a, 0x36, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x23, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, + 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x6c, 0x0a, 0x03, 0x4d, 0x73, 0x67, + 0x12, 0x5e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, + 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_supplier_tx_proto_rawDescOnce sync.Once + file_poktroll_supplier_tx_proto_rawDescData = file_poktroll_supplier_tx_proto_rawDesc +) + +func file_poktroll_supplier_tx_proto_rawDescGZIP() []byte { + file_poktroll_supplier_tx_proto_rawDescOnce.Do(func() { + file_poktroll_supplier_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_supplier_tx_proto_rawDescData) + }) + return file_poktroll_supplier_tx_proto_rawDescData +} + +var file_poktroll_supplier_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_poktroll_supplier_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: poktroll.supplier.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: poktroll.supplier.MsgUpdateParamsResponse + (*Params)(nil), // 2: poktroll.supplier.Params +} +var file_poktroll_supplier_tx_proto_depIdxs = []int32{ + 2, // 0: poktroll.supplier.MsgUpdateParams.params:type_name -> poktroll.supplier.Params + 0, // 1: poktroll.supplier.Msg.UpdateParams:input_type -> poktroll.supplier.MsgUpdateParams + 1, // 2: poktroll.supplier.Msg.UpdateParams:output_type -> poktroll.supplier.MsgUpdateParamsResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_poktroll_supplier_tx_proto_init() } +func file_poktroll_supplier_tx_proto_init() { + if File_poktroll_supplier_tx_proto != nil { + return + } + file_poktroll_supplier_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_poktroll_supplier_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_supplier_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); 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_poktroll_supplier_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_poktroll_supplier_tx_proto_goTypes, + DependencyIndexes: file_poktroll_supplier_tx_proto_depIdxs, + MessageInfos: file_poktroll_supplier_tx_proto_msgTypes, + }.Build() + File_poktroll_supplier_tx_proto = out.File + file_poktroll_supplier_tx_proto_rawDesc = nil + file_poktroll_supplier_tx_proto_goTypes = nil + file_poktroll_supplier_tx_proto_depIdxs = nil +} diff --git a/app/app.go b/app/app.go index 2e3afcd97..283a932b0 100644 --- a/app/app.go +++ b/app/app.go @@ -55,6 +55,7 @@ import ( gatewaymodulekeeper "github.com/pokt-network/poktroll/x/gateway/keeper" servicemodulekeeper "github.com/pokt-network/poktroll/x/service/keeper" + suppliermodulekeeper "github.com/pokt-network/poktroll/x/supplier/keeper" // this line is used by starport scaffolding # stargate/app/moduleImport @@ -120,8 +121,9 @@ type App struct { ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper ScopedICAHostKeeper capabilitykeeper.ScopedKeeper - ServiceKeeper servicemodulekeeper.Keeper - GatewayKeeper gatewaymodulekeeper.Keeper + ServiceKeeper servicemodulekeeper.Keeper + GatewayKeeper gatewaymodulekeeper.Keeper + SupplierKeeper suppliermodulekeeper.Keeper // this line is used by starport scaffolding # stargate/app/keeperDeclaration // simulation manager @@ -262,6 +264,7 @@ func New( &app.CircuitBreakerKeeper, &app.ServiceKeeper, &app.GatewayKeeper, + &app.SupplierKeeper, // this line is used by starport scaffolding # stargate/app/keeperDefinition ); err != nil { panic(err) diff --git a/app/app_config.go b/app/app_config.go index 51e91b5e3..fb38d76e9 100644 --- a/app/app_config.go +++ b/app/app_config.go @@ -71,10 +71,13 @@ import ( ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" gatewaymodulev1 "github.com/pokt-network/poktroll/api/poktroll/gateway/module" servicemodulev1 "github.com/pokt-network/poktroll/api/poktroll/service/module" + suppliermodulev1 "github.com/pokt-network/poktroll/api/poktroll/supplier/module" _ "github.com/pokt-network/poktroll/x/gateway/module" // import for side-effects gatewaymoduletypes "github.com/pokt-network/poktroll/x/gateway/types" _ "github.com/pokt-network/poktroll/x/service/module" // import for side-effects servicemoduletypes "github.com/pokt-network/poktroll/x/service/types" + _ "github.com/pokt-network/poktroll/x/supplier/module" // import for side-effects + suppliermoduletypes "github.com/pokt-network/poktroll/x/supplier/types" "google.golang.org/protobuf/types/known/durationpb" // this line is used by starport scaffolding # stargate/app/moduleImport ) @@ -115,6 +118,7 @@ var ( // chain modules servicemoduletypes.ModuleName, gatewaymoduletypes.ModuleName, + suppliermoduletypes.ModuleName, // this line is used by starport scaffolding # stargate/app/initGenesis } @@ -141,6 +145,7 @@ var ( // chain modules servicemoduletypes.ModuleName, gatewaymoduletypes.ModuleName, + suppliermoduletypes.ModuleName, // this line is used by starport scaffolding # stargate/app/beginBlockers } @@ -161,6 +166,7 @@ var ( // chain modules servicemoduletypes.ModuleName, gatewaymoduletypes.ModuleName, + suppliermoduletypes.ModuleName, // this line is used by starport scaffolding # stargate/app/endBlockers } @@ -182,6 +188,7 @@ var ( {Account: icatypes.ModuleName}, {Account: servicemoduletypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner, authtypes.Staking}}, {Account: gatewaymoduletypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner, authtypes.Staking}}, + {Account: suppliermoduletypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner, authtypes.Staking}}, // this line is used by starport scaffolding # stargate/app/maccPerms } @@ -320,6 +327,10 @@ var ( Name: gatewaymoduletypes.ModuleName, Config: appconfig.WrapAny(&gatewaymodulev1.Module{}), }, + { + Name: suppliermoduletypes.ModuleName, + Config: appconfig.WrapAny(&suppliermodulev1.Module{}), + }, // this line is used by starport scaffolding # stargate/app/moduleConfig }, }) diff --git a/proto/poktroll/supplier/genesis.proto b/proto/poktroll/supplier/genesis.proto new file mode 100644 index 000000000..271750d68 --- /dev/null +++ b/proto/poktroll/supplier/genesis.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package poktroll.supplier; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "poktroll/supplier/params.proto"; + +option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; + +// GenesisState defines the supplier module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/proto/poktroll/supplier/module/module.proto b/proto/poktroll/supplier/module/module.proto new file mode 100644 index 000000000..b0b5704db --- /dev/null +++ b/proto/poktroll/supplier/module/module.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package poktroll.supplier.module; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/pokt-network/poktroll/x/supplier" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} \ No newline at end of file diff --git a/proto/poktroll/supplier/params.proto b/proto/poktroll/supplier/params.proto new file mode 100644 index 000000000..031afe85a --- /dev/null +++ b/proto/poktroll/supplier/params.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package poktroll.supplier; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; + +// Params defines the parameters for the module. +message Params { + option (amino.name) = "poktroll/x/supplier/Params"; + option (gogoproto.equal) = true; + + +} \ No newline at end of file diff --git a/proto/poktroll/supplier/query.proto b/proto/poktroll/supplier/query.proto new file mode 100644 index 000000000..a9f01c722 --- /dev/null +++ b/proto/poktroll/supplier/query.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package poktroll.supplier; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "poktroll/supplier/params.proto"; + +option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/pokt-network/poktroll/supplier/params"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} \ No newline at end of file diff --git a/proto/poktroll/supplier/tx.proto b/proto/poktroll/supplier/tx.proto new file mode 100644 index 000000000..6e3498e66 --- /dev/null +++ b/proto/poktroll/supplier/tx.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package poktroll.supplier; + +import "amino/amino.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "poktroll/supplier/params.proto"; + +option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; + +// Msg defines the Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "poktroll/x/supplier/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the module parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/testutil/keeper/supplier.go b/testutil/keeper/supplier.go new file mode 100644 index 000000000..3b1fcf575 --- /dev/null +++ b/testutil/keeper/supplier.go @@ -0,0 +1,50 @@ +package keeper + +import ( + "testing" + + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/x/supplier/keeper" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func SupplierKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { + storeKey := storetypes.NewKVStoreKey(types.StoreKey) + + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) + stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(registry) + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + + k := keeper.NewKeeper( + cdc, + runtime.NewKVStoreService(storeKey), + log.NewNopLogger(), + authority.String(), + nil, + ) + + ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + k.SetParams(ctx, types.DefaultParams()) + + return k, ctx +} diff --git a/x/supplier/keeper/keeper.go b/x/supplier/keeper/keeper.go new file mode 100644 index 000000000..ef87b8f4d --- /dev/null +++ b/x/supplier/keeper/keeper.go @@ -0,0 +1,58 @@ +package keeper + +import ( + "fmt" + + "cosmossdk.io/core/store" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/pokt-network/poktroll/x/supplier/types" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeService store.KVStoreService + logger log.Logger + + // the address capable of executing a MsgUpdateParams message. Typically, this + // should be the x/gov module account. + authority string + + bankKeeper types.BankKeeper + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeService store.KVStoreService, + logger log.Logger, + authority string, + + bankKeeper types.BankKeeper, +) Keeper { + if _, err := sdk.AccAddressFromBech32(authority); err != nil { + panic(fmt.Sprintf("invalid authority address: %s", authority)) + } + + return Keeper{ + cdc: cdc, + storeService: storeService, + authority: authority, + logger: logger, + + bankKeeper: bankKeeper, + } +} + +// GetAuthority returns the module's authority. +func (k Keeper) GetAuthority() string { + return k.authority +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger() log.Logger { + return k.logger.With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} diff --git a/x/supplier/keeper/msg_server.go b/x/supplier/keeper/msg_server.go new file mode 100644 index 000000000..83879071c --- /dev/null +++ b/x/supplier/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/pokt-network/poktroll/x/supplier/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} diff --git a/x/supplier/keeper/msg_server_test.go b/x/supplier/keeper/msg_server_test.go new file mode 100644 index 000000000..480dd0262 --- /dev/null +++ b/x/supplier/keeper/msg_server_test.go @@ -0,0 +1,24 @@ +package keeper_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/x/supplier/keeper" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func setupMsgServer(t testing.TB) (keeper.Keeper, types.MsgServer, context.Context) { + k, ctx := keepertest.SupplierKeeper(t) + return k, keeper.NewMsgServerImpl(k), ctx +} + +func TestMsgServer(t *testing.T) { + k, ms, ctx := setupMsgServer(t) + require.NotNil(t, ms) + require.NotNil(t, ctx) + require.NotEmpty(t, k) +} diff --git a/x/supplier/keeper/msg_update_params.go b/x/supplier/keeper/msg_update_params.go new file mode 100644 index 000000000..01aaace7c --- /dev/null +++ b/x/supplier/keeper/msg_update_params.go @@ -0,0 +1,23 @@ +package keeper + +import ( + "context" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if k.GetAuthority() != req.Authority { + return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if err := k.SetParams(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/supplier/keeper/msg_update_params_test.go b/x/supplier/keeper/msg_update_params_test.go new file mode 100644 index 000000000..2e179b220 --- /dev/null +++ b/x/supplier/keeper/msg_update_params_test.go @@ -0,0 +1,64 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func TestMsgUpdateParams(t *testing.T) { + k, ms, ctx := setupMsgServer(t) + params := types.DefaultParams() + require.NoError(t, k.SetParams(ctx, params)) + wctx := sdk.UnwrapSDKContext(ctx) + + // default params + testCases := []struct { + name string + input *types.MsgUpdateParams + expErr bool + expErrMsg string + }{ + { + name: "invalid authority", + input: &types.MsgUpdateParams{ + Authority: "invalid", + Params: params, + }, + expErr: true, + expErrMsg: "invalid authority", + }, + { + name: "send enabled param", + input: &types.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: types.Params{}, + }, + expErr: false, + }, + { + name: "all good", + input: &types.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: params, + }, + expErr: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + _, err := ms.UpdateParams(wctx, tc.input) + + if tc.expErr { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expErrMsg) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/supplier/keeper/params.go b/x/supplier/keeper/params.go new file mode 100644 index 000000000..6e3162e05 --- /dev/null +++ b/x/supplier/keeper/params.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/runtime" + + "github.com/pokt-network/poktroll/x/supplier/types" +) + +// GetParams get all parameters as types.Params +func (k Keeper) GetParams(ctx context.Context) (params types.Params) { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + bz := store.Get(types.ParamsKey) + if bz == nil { + return params + } + + k.cdc.MustUnmarshal(bz, ¶ms) + return params +} + +// SetParams set the params +func (k Keeper) SetParams(ctx context.Context, params types.Params) error { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + bz, err := k.cdc.Marshal(¶ms) + if err != nil { + return err + } + store.Set(types.ParamsKey, bz) + + return nil +} diff --git a/x/supplier/keeper/params_test.go b/x/supplier/keeper/params_test.go new file mode 100644 index 000000000..dac4b01a1 --- /dev/null +++ b/x/supplier/keeper/params_test.go @@ -0,0 +1,18 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func TestGetParams(t *testing.T) { + k, ctx := keepertest.SupplierKeeper(t) + params := types.DefaultParams() + + require.NoError(t, k.SetParams(ctx, params)) + require.EqualValues(t, params, k.GetParams(ctx)) +} diff --git a/x/supplier/keeper/query.go b/x/supplier/keeper/query.go new file mode 100644 index 000000000..2d1d5c18e --- /dev/null +++ b/x/supplier/keeper/query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/pokt-network/poktroll/x/supplier/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/supplier/keeper/query_params.go b/x/supplier/keeper/query_params.go new file mode 100644 index 000000000..67e2a17f4 --- /dev/null +++ b/x/supplier/keeper/query_params.go @@ -0,0 +1,20 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/supplier/keeper/query_params_test.go b/x/supplier/keeper/query_params_test.go new file mode 100644 index 000000000..e9014f7b7 --- /dev/null +++ b/x/supplier/keeper/query_params_test.go @@ -0,0 +1,20 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func TestParamsQuery(t *testing.T) { + keeper, ctx := keepertest.SupplierKeeper(t) + params := types.DefaultParams() + require.NoError(t, keeper.SetParams(ctx, params)) + + response, err := keeper.Params(ctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +} diff --git a/x/supplier/module/autocli.go b/x/supplier/module/autocli.go new file mode 100644 index 000000000..737ce98ea --- /dev/null +++ b/x/supplier/module/autocli.go @@ -0,0 +1,35 @@ +package supplier + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + + modulev1 "github.com/pokt-network/poktroll/api/poktroll/supplier" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Shows the parameters of the module", + }, + // this line is used by ignite scaffolding # autocli/query + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Msg_ServiceDesc.ServiceName, + EnhanceCustomCommand: true, // only required if you want to use the custom command + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, + // this line is used by ignite scaffolding # autocli/tx + }, + }, + } +} diff --git a/x/supplier/module/genesis.go b/x/supplier/module/genesis.go new file mode 100644 index 000000000..7c12c8a1d --- /dev/null +++ b/x/supplier/module/genesis.go @@ -0,0 +1,24 @@ +package supplier + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/pokt-network/poktroll/x/supplier/keeper" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +// InitGenesis initializes the module's state from a provided genesis state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // this line is used by starport scaffolding # genesis/module/init + k.SetParams(ctx, genState.Params) +} + +// ExportGenesis returns the module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Params = k.GetParams(ctx) + + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/supplier/module/genesis_test.go b/x/supplier/module/genesis_test.go new file mode 100644 index 000000000..3c1559a34 --- /dev/null +++ b/x/supplier/module/genesis_test.go @@ -0,0 +1,29 @@ +package supplier_test + +import ( + "testing" + + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/testutil/nullify" + "github.com/pokt-network/poktroll/x/supplier/module" + "github.com/pokt-network/poktroll/x/supplier/types" + "github.com/stretchr/testify/require" +) + +func TestGenesis(t *testing.T) { + genesisState := types.GenesisState{ + Params: types.DefaultParams(), + + // this line is used by starport scaffolding # genesis/test/state + } + + k, ctx := keepertest.SupplierKeeper(t) + supplier.InitGenesis(ctx, k, genesisState) + got := supplier.ExportGenesis(ctx, k) + require.NotNil(t, got) + + nullify.Fill(&genesisState) + nullify.Fill(got) + + // this line is used by starport scaffolding # genesis/test/assert +} diff --git a/x/supplier/module/module.go b/x/supplier/module/module.go new file mode 100644 index 000000000..6cb134ae6 --- /dev/null +++ b/x/supplier/module/module.go @@ -0,0 +1,215 @@ +package supplier + +import ( + "context" + "encoding/json" + "fmt" + + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + + // this line is used by starport scaffolding # 1 + + modulev1 "github.com/pokt-network/poktroll/api/poktroll/supplier/module" + "github.com/pokt-network/poktroll/x/supplier/keeper" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +var ( + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.AppModuleSimulation = (*AppModule)(nil) + _ module.HasGenesis = (*AppModule)(nil) + _ module.HasInvariants = (*AppModule)(nil) + _ module.HasConsensusVersion = (*AppModule)(nil) + + _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) + _ appmodule.HasEndBlocker = (*AppModule)(nil) +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface that defines the +// independent methods a Cosmos SDK module needs to implement. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the name of the module as a string. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the amino codec for the module, which is used +// to marshal and unmarshal structs to/from []byte in order to persist them in the module's KVStore. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} + +// RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message. +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns a default GenesisState for the module, marshalled to json.RawMessage. +// The default GenesisState need to be defined by the module developer and is primarily used for testing. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface that defines the inter-dependent methods that modules need to implement +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the module's genesis initialization. It returns no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) +} + +// ExportGenesis returns the module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion is a sequence number for state-breaking change of the module. +// It should be incremented on each consensus-breaking change introduced by the module. +// To avoid wrong/empty versions, the initial version should be set to 1. +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock contains the logic that is automatically triggered at the beginning of each block. +// The begin block implementation is optional. +func (am AppModule) BeginBlock(_ context.Context) error { + return nil +} + +// EndBlock contains the logic that is automatically triggered at the end of each block. +// The end block implementation is optional. +func (am AppModule) EndBlock(_ context.Context) error { + return nil +} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// ---------------------------------------------------------------------------- +// App Wiring Setup +// ---------------------------------------------------------------------------- + +func init() { + appmodule.Register( + &modulev1.Module{}, + appmodule.Provide(ProvideModule), + ) +} + +type ModuleInputs struct { + depinject.In + + StoreService store.KVStoreService + Cdc codec.Codec + Config *modulev1.Module + Logger log.Logger + + AccountKeeper types.AccountKeeper + BankKeeper types.BankKeeper +} + +type ModuleOutputs struct { + depinject.Out + + SupplierKeeper keeper.Keeper + Module appmodule.AppModule +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) + } + k := keeper.NewKeeper( + in.Cdc, + in.StoreService, + in.Logger, + authority.String(), + in.BankKeeper, + ) + m := NewAppModule( + in.Cdc, + k, + in.AccountKeeper, + in.BankKeeper, + ) + + return ModuleOutputs{SupplierKeeper: k, Module: m} +} diff --git a/x/supplier/module/simulation.go b/x/supplier/module/simulation.go new file mode 100644 index 000000000..67a000511 --- /dev/null +++ b/x/supplier/module/simulation.go @@ -0,0 +1,64 @@ +package supplier + +import ( + "math/rand" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + + "github.com/pokt-network/poktroll/testutil/sample" + suppliersimulation "github.com/pokt-network/poktroll/x/supplier/simulation" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +// avoid unused import issue +var ( + _ = suppliersimulation.FindAccount + _ = rand.Rand{} + _ = sample.AccAddress + _ = sdk.AccAddress{} + _ = simulation.MsgEntryKind +) + +const ( +// this line is used by starport scaffolding # simapp/module/const +) + +// GenerateGenesisState creates a randomized GenState of the module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + supplierGenesis := types.GenesisState{ + Params: types.DefaultParams(), + // this line is used by starport scaffolding # simapp/module/genesisState + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&supplierGenesis) +} + +// RegisterStoreDecoder registers a decoder. +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} + +// ProposalContents doesn't return any content functions for governance proposals. +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} + +// ProposalMsgs returns msgs used for governance proposals for simulations. +func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { + return []simtypes.WeightedProposalMsg{ + // this line is used by starport scaffolding # simapp/module/OpMsg + } +} diff --git a/x/supplier/simulation/helpers.go b/x/supplier/simulation/helpers.go new file mode 100644 index 000000000..92c437c0d --- /dev/null +++ b/x/supplier/simulation/helpers.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/supplier/types/codec.go b/x/supplier/types/codec.go new file mode 100644 index 000000000..ac5526374 --- /dev/null +++ b/x/supplier/types/codec.go @@ -0,0 +1,17 @@ +package types + +import ( + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" + // this line is used by starport scaffolding # 1 +) + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + // this line is used by starport scaffolding # 3 + + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateParams{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/x/supplier/types/errors.go b/x/supplier/types/errors.go new file mode 100644 index 000000000..0e998c507 --- /dev/null +++ b/x/supplier/types/errors.go @@ -0,0 +1,13 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "cosmossdk.io/errors" +) + +// x/supplier module sentinel errors +var ( + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") +) diff --git a/x/supplier/types/expected_keepers.go b/x/supplier/types/expected_keepers.go new file mode 100644 index 000000000..4a50d01a9 --- /dev/null +++ b/x/supplier/types/expected_keepers.go @@ -0,0 +1,25 @@ +package types + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// AccountKeeper defines the expected interface for the Account module. +type AccountKeeper interface { + GetAccount(context.Context, sdk.AccAddress) sdk.AccountI // only used for simulation + // Methods imported from account should be defined here +} + +// BankKeeper defines the expected interface for the Bank module. +type BankKeeper interface { + SpendableCoins(context.Context, sdk.AccAddress) sdk.Coins + // Methods imported from bank should be defined here +} + +// ParamSubspace defines the expected Subspace interface for parameters. +type ParamSubspace interface { + Get(context.Context, []byte, interface{}) + Set(context.Context, []byte, interface{}) +} diff --git a/x/supplier/types/genesis.go b/x/supplier/types/genesis.go new file mode 100644 index 000000000..0af9b4416 --- /dev/null +++ b/x/supplier/types/genesis.go @@ -0,0 +1,24 @@ +package types + +import ( +// this line is used by starport scaffolding # genesis/types/import +) + +// DefaultIndex is the default global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // this line is used by starport scaffolding # genesis/types/validate + + return gs.Params.Validate() +} diff --git a/x/supplier/types/genesis_test.go b/x/supplier/types/genesis_test.go new file mode 100644 index 000000000..ee12da6e2 --- /dev/null +++ b/x/supplier/types/genesis_test.go @@ -0,0 +1,41 @@ +package types_test + +import ( + "testing" + + "github.com/pokt-network/poktroll/x/supplier/types" + "github.com/stretchr/testify/require" +) + +func TestGenesisState_Validate(t *testing.T) { + tests := []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/supplier/types/keys.go b/x/supplier/types/keys.go new file mode 100644 index 000000000..fe2ebecc7 --- /dev/null +++ b/x/supplier/types/keys.go @@ -0,0 +1,20 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "supplier" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_supplier" +) + +var ( + ParamsKey = []byte("p_supplier") +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/supplier/types/msg_update_params.go b/x/supplier/types/msg_update_params.go new file mode 100644 index 000000000..e36d023de --- /dev/null +++ b/x/supplier/types/msg_update_params.go @@ -0,0 +1,21 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +// ValidateBasic does a sanity check on the provided data. +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + + if err := m.Params.Validate(); err != nil { + return err + } + + return nil +} diff --git a/x/supplier/types/params.go b/x/supplier/types/params.go new file mode 100644 index 000000000..4f3215e35 --- /dev/null +++ b/x/supplier/types/params.go @@ -0,0 +1,32 @@ +package types + +import ( + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams() Params { + return Params{} +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams() +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{} +} + +// Validate validates the set of params +func (p Params) Validate() error { + return nil +} diff --git a/x/supplier/types/types.go b/x/supplier/types/types.go new file mode 100644 index 000000000..ab1254f4c --- /dev/null +++ b/x/supplier/types/types.go @@ -0,0 +1 @@ +package types From 394e9580986b96ee1fa706c4c81da7202ec81af7 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 12:39:56 +0100 Subject: [PATCH 02/29] scaffold: map supplier --module supplier --no-message address stake:coin services --- api/poktroll/supplier/genesis.pulsar.go | 207 +- api/poktroll/supplier/query.pulsar.go | 2209 +++++++++++++++++++++- api/poktroll/supplier/supplier.pulsar.go | 812 ++++++++ proto/poktroll/supplier/genesis.proto | 10 +- proto/poktroll/supplier/query.proto | 44 +- proto/poktroll/supplier/supplier.proto | 15 + x/supplier/keeper/query_supplier.go | 55 + x/supplier/keeper/query_supplier_test.go | 124 ++ x/supplier/keeper/supplier.go | 70 + x/supplier/keeper/supplier_test.go | 63 + x/supplier/module/autocli.go | 11 + x/supplier/module/debug_container.dot | 502 +++++ x/supplier/module/debug_container.log | 379 ++++ x/supplier/module/genesis.go | 5 + x/supplier/module/genesis_test.go | 9 + x/supplier/types/genesis.go | 13 +- x/supplier/types/genesis_test.go | 24 +- x/supplier/types/key_supplier.go | 23 + 18 files changed, 4494 insertions(+), 81 deletions(-) create mode 100644 api/poktroll/supplier/supplier.pulsar.go create mode 100644 proto/poktroll/supplier/supplier.proto create mode 100644 x/supplier/keeper/query_supplier.go create mode 100644 x/supplier/keeper/query_supplier_test.go create mode 100644 x/supplier/keeper/supplier.go create mode 100644 x/supplier/keeper/supplier_test.go create mode 100644 x/supplier/module/debug_container.dot create mode 100644 x/supplier/module/debug_container.log create mode 100644 x/supplier/types/key_supplier.go diff --git a/api/poktroll/supplier/genesis.pulsar.go b/api/poktroll/supplier/genesis.pulsar.go index dc9fea872..9e9b76ad8 100644 --- a/api/poktroll/supplier/genesis.pulsar.go +++ b/api/poktroll/supplier/genesis.pulsar.go @@ -14,15 +14,68 @@ import ( sync "sync" ) +var _ protoreflect.List = (*_GenesisState_2_list)(nil) + +type _GenesisState_2_list struct { + list *[]*Supplier +} + +func (x *_GenesisState_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Supplier) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Supplier) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { + v := new(Supplier) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_2_list) NewElement() protoreflect.Value { + v := new(Supplier) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) IsValid() bool { + return x.list != nil +} + var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_params protoreflect.FieldDescriptor + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_supplierList protoreflect.FieldDescriptor ) func init() { file_poktroll_supplier_genesis_proto_init() md_GenesisState = File_poktroll_supplier_genesis_proto.Messages().ByName("GenesisState") fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_supplierList = md_GenesisState.Fields().ByName("supplierList") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -96,6 +149,12 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } + if len(x.SupplierList) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.SupplierList}) + if !f(fd_GenesisState_supplierList, value) { + return + } + } } // Has reports whether a field is populated. @@ -113,6 +172,8 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool switch fd.FullName() { case "poktroll.supplier.GenesisState.params": return x.Params != nil + case "poktroll.supplier.GenesisState.supplierList": + return len(x.SupplierList) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.GenesisState")) @@ -131,6 +192,8 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "poktroll.supplier.GenesisState.params": x.Params = nil + case "poktroll.supplier.GenesisState.supplierList": + x.SupplierList = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.GenesisState")) @@ -150,6 +213,12 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto case "poktroll.supplier.GenesisState.params": value := x.Params return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.supplier.GenesisState.supplierList": + if len(x.SupplierList) == 0 { + return protoreflect.ValueOfList(&_GenesisState_2_list{}) + } + listValue := &_GenesisState_2_list{list: &x.SupplierList} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.GenesisState")) @@ -172,6 +241,10 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value switch fd.FullName() { case "poktroll.supplier.GenesisState.params": x.Params = value.Message().Interface().(*Params) + case "poktroll.supplier.GenesisState.supplierList": + lv := value.List() + clv := lv.(*_GenesisState_2_list) + x.SupplierList = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.GenesisState")) @@ -197,6 +270,12 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p x.Params = new(Params) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "poktroll.supplier.GenesisState.supplierList": + if x.SupplierList == nil { + x.SupplierList = []*Supplier{} + } + value := &_GenesisState_2_list{list: &x.SupplierList} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.GenesisState")) @@ -213,6 +292,9 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "poktroll.supplier.GenesisState.params": m := new(Params) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.supplier.GenesisState.supplierList": + list := []*Supplier{} + return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.GenesisState")) @@ -286,6 +368,12 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { l = options.Size(x.Params) n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.SupplierList) > 0 { + for _, e := range x.SupplierList { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -315,6 +403,22 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.SupplierList) > 0 { + for iNdEx := len(x.SupplierList) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.SupplierList[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] = 0x12 + } + } if x.Params != nil { encoded, err := options.Marshal(x.Params) if err != nil { @@ -414,6 +518,40 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { 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 SupplierList", 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.SupplierList = append(x.SupplierList, &Supplier{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SupplierList[len(x.SupplierList)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -469,7 +607,8 @@ 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"` + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + SupplierList []*Supplier `protobuf:"bytes,2,rep,name=supplierList,proto3" json:"supplierList,omitempty"` } func (x *GenesisState) Reset() { @@ -499,6 +638,13 @@ func (x *GenesisState) GetParams() *Params { return nil } +func (x *GenesisState) GetSupplierList() []*Supplier { + if x != nil { + return x.SupplierList + } + return nil +} + var File_poktroll_supplier_genesis_proto protoreflect.FileDescriptor var file_poktroll_supplier_genesis_proto_rawDesc = []byte{ @@ -509,24 +655,30 @@ var file_poktroll_supplier_genesis_proto_rawDesc = []byte{ 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4c, 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, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 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, 0x42, 0xae, 0x01, 0x0a, 0x15, - 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, - 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x93, 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, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 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, 0x45, + 0x0a, 0x0c, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x4c, 0x69, 0x73, 0x74, 0x42, 0xae, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, + 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -545,14 +697,16 @@ var file_poktroll_supplier_genesis_proto_msgTypes = make([]protoimpl.MessageInfo var file_poktroll_supplier_genesis_proto_goTypes = []interface{}{ (*GenesisState)(nil), // 0: poktroll.supplier.GenesisState (*Params)(nil), // 1: poktroll.supplier.Params + (*Supplier)(nil), // 2: poktroll.supplier.Supplier } var file_poktroll_supplier_genesis_proto_depIdxs = []int32{ 1, // 0: poktroll.supplier.GenesisState.params:type_name -> poktroll.supplier.Params - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 2, // 1: poktroll.supplier.GenesisState.supplierList:type_name -> poktroll.supplier.Supplier + 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 } func init() { file_poktroll_supplier_genesis_proto_init() } @@ -561,6 +715,7 @@ func file_poktroll_supplier_genesis_proto_init() { return } file_poktroll_supplier_params_proto_init() + file_poktroll_supplier_supplier_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_supplier_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenesisState); i { diff --git a/api/poktroll/supplier/query.pulsar.go b/api/poktroll/supplier/query.pulsar.go index 16b94d210..2245a83bd 100644 --- a/api/poktroll/supplier/query.pulsar.go +++ b/api/poktroll/supplier/query.pulsar.go @@ -3,7 +3,8 @@ package supplier import ( _ "cosmossdk.io/api/amino" - _ "cosmossdk.io/api/cosmos/base/query/v1beta1" + v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" + _ "cosmossdk.io/api/cosmos/base/v1beta1" fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" @@ -807,6 +808,1869 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } } +var ( + md_QueryGetSupplierRequest protoreflect.MessageDescriptor + fd_QueryGetSupplierRequest_index protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_query_proto_init() + md_QueryGetSupplierRequest = File_poktroll_supplier_query_proto.Messages().ByName("QueryGetSupplierRequest") + fd_QueryGetSupplierRequest_index = md_QueryGetSupplierRequest.Fields().ByName("index") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetSupplierRequest)(nil) + +type fastReflection_QueryGetSupplierRequest QueryGetSupplierRequest + +func (x *QueryGetSupplierRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetSupplierRequest)(x) +} + +func (x *QueryGetSupplierRequest) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGetSupplierRequest_messageType fastReflection_QueryGetSupplierRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetSupplierRequest_messageType{} + +type fastReflection_QueryGetSupplierRequest_messageType struct{} + +func (x fastReflection_QueryGetSupplierRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetSupplierRequest)(nil) +} +func (x fastReflection_QueryGetSupplierRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetSupplierRequest) +} +func (x fastReflection_QueryGetSupplierRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetSupplierRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetSupplierRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetSupplierRequest +} + +// 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_QueryGetSupplierRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGetSupplierRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetSupplierRequest) New() protoreflect.Message { + return new(fastReflection_QueryGetSupplierRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetSupplierRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGetSupplierRequest)(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_QueryGetSupplierRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Index != "" { + value := protoreflect.ValueOfString(x.Index) + if !f(fd_QueryGetSupplierRequest_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_QueryGetSupplierRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.QueryGetSupplierRequest.index": + return x.Index != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryGetSupplierRequest 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_QueryGetSupplierRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.QueryGetSupplierRequest.index": + x.Index = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryGetSupplierRequest 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_QueryGetSupplierRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.QueryGetSupplierRequest.index": + value := x.Index + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryGetSupplierRequest 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_QueryGetSupplierRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.QueryGetSupplierRequest.index": + x.Index = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryGetSupplierRequest 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_QueryGetSupplierRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.QueryGetSupplierRequest.index": + panic(fmt.Errorf("field index of message poktroll.supplier.QueryGetSupplierRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryGetSupplierRequest 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_QueryGetSupplierRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.QueryGetSupplierRequest.index": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryGetSupplierRequest 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_QueryGetSupplierRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.QueryGetSupplierRequest", 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_QueryGetSupplierRequest) 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_QueryGetSupplierRequest) 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_QueryGetSupplierRequest) 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_QueryGetSupplierRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetSupplierRequest) + 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().(*QueryGetSupplierRequest) + 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().(*QueryGetSupplierRequest) + 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: QueryGetSupplierRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetSupplierRequest: 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_QueryGetSupplierResponse protoreflect.MessageDescriptor + fd_QueryGetSupplierResponse_supplier protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_query_proto_init() + md_QueryGetSupplierResponse = File_poktroll_supplier_query_proto.Messages().ByName("QueryGetSupplierResponse") + fd_QueryGetSupplierResponse_supplier = md_QueryGetSupplierResponse.Fields().ByName("supplier") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetSupplierResponse)(nil) + +type fastReflection_QueryGetSupplierResponse QueryGetSupplierResponse + +func (x *QueryGetSupplierResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetSupplierResponse)(x) +} + +func (x *QueryGetSupplierResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_query_proto_msgTypes[3] + 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_QueryGetSupplierResponse_messageType fastReflection_QueryGetSupplierResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetSupplierResponse_messageType{} + +type fastReflection_QueryGetSupplierResponse_messageType struct{} + +func (x fastReflection_QueryGetSupplierResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetSupplierResponse)(nil) +} +func (x fastReflection_QueryGetSupplierResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetSupplierResponse) +} +func (x fastReflection_QueryGetSupplierResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetSupplierResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetSupplierResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetSupplierResponse +} + +// 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_QueryGetSupplierResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGetSupplierResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetSupplierResponse) New() protoreflect.Message { + return new(fastReflection_QueryGetSupplierResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetSupplierResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGetSupplierResponse)(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_QueryGetSupplierResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Supplier != nil { + value := protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) + if !f(fd_QueryGetSupplierResponse_supplier, 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_QueryGetSupplierResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.QueryGetSupplierResponse.supplier": + return x.Supplier != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryGetSupplierResponse 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_QueryGetSupplierResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.QueryGetSupplierResponse.supplier": + x.Supplier = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryGetSupplierResponse 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_QueryGetSupplierResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.QueryGetSupplierResponse.supplier": + value := x.Supplier + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryGetSupplierResponse 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_QueryGetSupplierResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.QueryGetSupplierResponse.supplier": + x.Supplier = value.Message().Interface().(*Supplier) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryGetSupplierResponse 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_QueryGetSupplierResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.QueryGetSupplierResponse.supplier": + if x.Supplier == nil { + x.Supplier = new(Supplier) + } + return protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryGetSupplierResponse 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_QueryGetSupplierResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.QueryGetSupplierResponse.supplier": + m := new(Supplier) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryGetSupplierResponse 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_QueryGetSupplierResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.QueryGetSupplierResponse", 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_QueryGetSupplierResponse) 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_QueryGetSupplierResponse) 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_QueryGetSupplierResponse) 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_QueryGetSupplierResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetSupplierResponse) + 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.Supplier != nil { + l = options.Size(x.Supplier) + 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().(*QueryGetSupplierResponse) + 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.Supplier != nil { + encoded, err := options.Marshal(x.Supplier) + 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().(*QueryGetSupplierResponse) + 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: QueryGetSupplierResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetSupplierResponse: 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 Supplier", 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.Supplier == nil { + x.Supplier = &Supplier{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Supplier); 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_QueryAllSupplierRequest protoreflect.MessageDescriptor + fd_QueryAllSupplierRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_query_proto_init() + md_QueryAllSupplierRequest = File_poktroll_supplier_query_proto.Messages().ByName("QueryAllSupplierRequest") + fd_QueryAllSupplierRequest_pagination = md_QueryAllSupplierRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllSupplierRequest)(nil) + +type fastReflection_QueryAllSupplierRequest QueryAllSupplierRequest + +func (x *QueryAllSupplierRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllSupplierRequest)(x) +} + +func (x *QueryAllSupplierRequest) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_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_QueryAllSupplierRequest_messageType fastReflection_QueryAllSupplierRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllSupplierRequest_messageType{} + +type fastReflection_QueryAllSupplierRequest_messageType struct{} + +func (x fastReflection_QueryAllSupplierRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllSupplierRequest)(nil) +} +func (x fastReflection_QueryAllSupplierRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllSupplierRequest) +} +func (x fastReflection_QueryAllSupplierRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllSupplierRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllSupplierRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllSupplierRequest +} + +// 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_QueryAllSupplierRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAllSupplierRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllSupplierRequest) New() protoreflect.Message { + return new(fastReflection_QueryAllSupplierRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllSupplierRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAllSupplierRequest)(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_QueryAllSupplierRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllSupplierRequest_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_QueryAllSupplierRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.QueryAllSupplierRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierRequest 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_QueryAllSupplierRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.QueryAllSupplierRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierRequest 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_QueryAllSupplierRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.QueryAllSupplierRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierRequest 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_QueryAllSupplierRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.QueryAllSupplierRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierRequest 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_QueryAllSupplierRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.QueryAllSupplierRequest.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: poktroll.supplier.QueryAllSupplierRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierRequest 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_QueryAllSupplierRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.QueryAllSupplierRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierRequest")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierRequest 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_QueryAllSupplierRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.QueryAllSupplierRequest", 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_QueryAllSupplierRequest) 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_QueryAllSupplierRequest) 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_QueryAllSupplierRequest) 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_QueryAllSupplierRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllSupplierRequest) + 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().(*QueryAllSupplierRequest) + 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().(*QueryAllSupplierRequest) + 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: QueryAllSupplierRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllSupplierRequest: 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 = (*_QueryAllSupplierResponse_1_list)(nil) + +type _QueryAllSupplierResponse_1_list struct { + list *[]*Supplier +} + +func (x *_QueryAllSupplierResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryAllSupplierResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryAllSupplierResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Supplier) + (*x.list)[i] = concreteValue +} + +func (x *_QueryAllSupplierResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Supplier) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryAllSupplierResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Supplier) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllSupplierResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryAllSupplierResponse_1_list) NewElement() protoreflect.Value { + v := new(Supplier) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllSupplierResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryAllSupplierResponse protoreflect.MessageDescriptor + fd_QueryAllSupplierResponse_supplier protoreflect.FieldDescriptor + fd_QueryAllSupplierResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_query_proto_init() + md_QueryAllSupplierResponse = File_poktroll_supplier_query_proto.Messages().ByName("QueryAllSupplierResponse") + fd_QueryAllSupplierResponse_supplier = md_QueryAllSupplierResponse.Fields().ByName("supplier") + fd_QueryAllSupplierResponse_pagination = md_QueryAllSupplierResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllSupplierResponse)(nil) + +type fastReflection_QueryAllSupplierResponse QueryAllSupplierResponse + +func (x *QueryAllSupplierResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllSupplierResponse)(x) +} + +func (x *QueryAllSupplierResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_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_QueryAllSupplierResponse_messageType fastReflection_QueryAllSupplierResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllSupplierResponse_messageType{} + +type fastReflection_QueryAllSupplierResponse_messageType struct{} + +func (x fastReflection_QueryAllSupplierResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllSupplierResponse)(nil) +} +func (x fastReflection_QueryAllSupplierResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllSupplierResponse) +} +func (x fastReflection_QueryAllSupplierResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllSupplierResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllSupplierResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllSupplierResponse +} + +// 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_QueryAllSupplierResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAllSupplierResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllSupplierResponse) New() protoreflect.Message { + return new(fastReflection_QueryAllSupplierResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllSupplierResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAllSupplierResponse)(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_QueryAllSupplierResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Supplier) != 0 { + value := protoreflect.ValueOfList(&_QueryAllSupplierResponse_1_list{list: &x.Supplier}) + if !f(fd_QueryAllSupplierResponse_supplier, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllSupplierResponse_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_QueryAllSupplierResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.QueryAllSupplierResponse.supplier": + return len(x.Supplier) != 0 + case "poktroll.supplier.QueryAllSupplierResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierResponse 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_QueryAllSupplierResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.QueryAllSupplierResponse.supplier": + x.Supplier = nil + case "poktroll.supplier.QueryAllSupplierResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierResponse 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_QueryAllSupplierResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.QueryAllSupplierResponse.supplier": + if len(x.Supplier) == 0 { + return protoreflect.ValueOfList(&_QueryAllSupplierResponse_1_list{}) + } + listValue := &_QueryAllSupplierResponse_1_list{list: &x.Supplier} + return protoreflect.ValueOfList(listValue) + case "poktroll.supplier.QueryAllSupplierResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierResponse 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_QueryAllSupplierResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.QueryAllSupplierResponse.supplier": + lv := value.List() + clv := lv.(*_QueryAllSupplierResponse_1_list) + x.Supplier = *clv.list + case "poktroll.supplier.QueryAllSupplierResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierResponse 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_QueryAllSupplierResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.QueryAllSupplierResponse.supplier": + if x.Supplier == nil { + x.Supplier = []*Supplier{} + } + value := &_QueryAllSupplierResponse_1_list{list: &x.Supplier} + return protoreflect.ValueOfList(value) + case "poktroll.supplier.QueryAllSupplierResponse.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: poktroll.supplier.QueryAllSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierResponse 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_QueryAllSupplierResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.QueryAllSupplierResponse.supplier": + list := []*Supplier{} + return protoreflect.ValueOfList(&_QueryAllSupplierResponse_1_list{list: &list}) + case "poktroll.supplier.QueryAllSupplierResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierResponse 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_QueryAllSupplierResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.QueryAllSupplierResponse", 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_QueryAllSupplierResponse) 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_QueryAllSupplierResponse) 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_QueryAllSupplierResponse) 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_QueryAllSupplierResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllSupplierResponse) + 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.Supplier) > 0 { + for _, e := range x.Supplier { + 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().(*QueryAllSupplierResponse) + 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.Supplier) > 0 { + for iNdEx := len(x.Supplier) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Supplier[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().(*QueryAllSupplierResponse) + 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: QueryAllSupplierResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllSupplierResponse: 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 Supplier", 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.Supplier = append(x.Supplier, &Supplier{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Supplier[len(x.Supplier)-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 @@ -884,6 +2748,154 @@ func (x *QueryParamsResponse) GetParams() *Params { return nil } +type QueryGetSupplierRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` +} + +func (x *QueryGetSupplierRequest) Reset() { + *x = QueryGetSupplierRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetSupplierRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetSupplierRequest) ProtoMessage() {} + +// Deprecated: Use QueryGetSupplierRequest.ProtoReflect.Descriptor instead. +func (*QueryGetSupplierRequest) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryGetSupplierRequest) GetIndex() string { + if x != nil { + return x.Index + } + return "" +} + +type QueryGetSupplierResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Supplier *Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` +} + +func (x *QueryGetSupplierResponse) Reset() { + *x = QueryGetSupplierResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetSupplierResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetSupplierResponse) ProtoMessage() {} + +// Deprecated: Use QueryGetSupplierResponse.ProtoReflect.Descriptor instead. +func (*QueryGetSupplierResponse) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryGetSupplierResponse) GetSupplier() *Supplier { + if x != nil { + return x.Supplier + } + return nil +} + +type QueryAllSupplierRequest 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 *QueryAllSupplierRequest) Reset() { + *x = QueryAllSupplierRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllSupplierRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllSupplierRequest) ProtoMessage() {} + +// Deprecated: Use QueryAllSupplierRequest.ProtoReflect.Descriptor instead. +func (*QueryAllSupplierRequest) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryAllSupplierRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryAllSupplierResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Supplier []*Supplier `protobuf:"bytes,1,rep,name=supplier,proto3" json:"supplier,omitempty"` + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllSupplierResponse) Reset() { + *x = QueryAllSupplierResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllSupplierResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllSupplierResponse) ProtoMessage() {} + +// Deprecated: Use QueryAllSupplierResponse.ProtoReflect.Descriptor instead. +func (*QueryAllSupplierResponse) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryAllSupplierResponse) GetSupplier() []*Supplier { + if x != nil { + return x.Supplier + } + return nil +} + +func (x *QueryAllSupplierResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + var File_poktroll_supplier_query_proto protoreflect.FileDescriptor var file_poktroll_supplier_query_proto_rawDesc = []byte{ @@ -899,34 +2911,83 @@ var file_poktroll_supplier_query_proto_rawDesc = []byte{ 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 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, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, - 0x32, 0x91, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x87, 0x01, 0x0a, 0x06, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x70, - 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x42, 0xac, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0a, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, - 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x2f, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x59, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3d, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, 0x61, + 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 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, 0xa2, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, + 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0xcc, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x87, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x28, 0x12, 0x26, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x9d, 0x01, 0x0a, 0x08, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x2f, 0x7b, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x7d, 0x12, 0x98, 0x01, 0x0a, 0x0b, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x12, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x70, 0x6f, + 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0xac, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, + 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, + 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -941,21 +3002,36 @@ func file_poktroll_supplier_query_proto_rawDescGZIP() []byte { return file_poktroll_supplier_query_proto_rawDescData } -var file_poktroll_supplier_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_poktroll_supplier_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_poktroll_supplier_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: poktroll.supplier.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: poktroll.supplier.QueryParamsResponse - (*Params)(nil), // 2: poktroll.supplier.Params + (*QueryParamsRequest)(nil), // 0: poktroll.supplier.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: poktroll.supplier.QueryParamsResponse + (*QueryGetSupplierRequest)(nil), // 2: poktroll.supplier.QueryGetSupplierRequest + (*QueryGetSupplierResponse)(nil), // 3: poktroll.supplier.QueryGetSupplierResponse + (*QueryAllSupplierRequest)(nil), // 4: poktroll.supplier.QueryAllSupplierRequest + (*QueryAllSupplierResponse)(nil), // 5: poktroll.supplier.QueryAllSupplierResponse + (*Params)(nil), // 6: poktroll.supplier.Params + (*Supplier)(nil), // 7: poktroll.supplier.Supplier + (*v1beta1.PageRequest)(nil), // 8: cosmos.base.query.v1beta1.PageRequest + (*v1beta1.PageResponse)(nil), // 9: cosmos.base.query.v1beta1.PageResponse } var file_poktroll_supplier_query_proto_depIdxs = []int32{ - 2, // 0: poktroll.supplier.QueryParamsResponse.params:type_name -> poktroll.supplier.Params - 0, // 1: poktroll.supplier.Query.Params:input_type -> poktroll.supplier.QueryParamsRequest - 1, // 2: poktroll.supplier.Query.Params:output_type -> poktroll.supplier.QueryParamsResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 6, // 0: poktroll.supplier.QueryParamsResponse.params:type_name -> poktroll.supplier.Params + 7, // 1: poktroll.supplier.QueryGetSupplierResponse.supplier:type_name -> poktroll.supplier.Supplier + 8, // 2: poktroll.supplier.QueryAllSupplierRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 7, // 3: poktroll.supplier.QueryAllSupplierResponse.supplier:type_name -> poktroll.supplier.Supplier + 9, // 4: poktroll.supplier.QueryAllSupplierResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 0, // 5: poktroll.supplier.Query.Params:input_type -> poktroll.supplier.QueryParamsRequest + 2, // 6: poktroll.supplier.Query.Supplier:input_type -> poktroll.supplier.QueryGetSupplierRequest + 4, // 7: poktroll.supplier.Query.SupplierAll:input_type -> poktroll.supplier.QueryAllSupplierRequest + 1, // 8: poktroll.supplier.Query.Params:output_type -> poktroll.supplier.QueryParamsResponse + 3, // 9: poktroll.supplier.Query.Supplier:output_type -> poktroll.supplier.QueryGetSupplierResponse + 5, // 10: poktroll.supplier.Query.SupplierAll:output_type -> poktroll.supplier.QueryAllSupplierResponse + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_poktroll_supplier_query_proto_init() } @@ -964,6 +3040,7 @@ func file_poktroll_supplier_query_proto_init() { return } file_poktroll_supplier_params_proto_init() + file_poktroll_supplier_supplier_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_supplier_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParamsRequest); i { @@ -989,6 +3066,54 @@ func file_poktroll_supplier_query_proto_init() { return nil } } + file_poktroll_supplier_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetSupplierRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_supplier_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetSupplierResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_supplier_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllSupplierRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_supplier_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllSupplierResponse); 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{ @@ -996,7 +3121,7 @@ func file_poktroll_supplier_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_supplier_query_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/api/poktroll/supplier/supplier.pulsar.go b/api/poktroll/supplier/supplier.pulsar.go new file mode 100644 index 000000000..ae580c72d --- /dev/null +++ b/api/poktroll/supplier/supplier.pulsar.go @@ -0,0 +1,812 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package supplier + +import ( + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Supplier protoreflect.MessageDescriptor + fd_Supplier_index protoreflect.FieldDescriptor + fd_Supplier_address protoreflect.FieldDescriptor + fd_Supplier_stake protoreflect.FieldDescriptor + fd_Supplier_services protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_supplier_proto_init() + md_Supplier = File_poktroll_supplier_supplier_proto.Messages().ByName("Supplier") + fd_Supplier_index = md_Supplier.Fields().ByName("index") + fd_Supplier_address = md_Supplier.Fields().ByName("address") + fd_Supplier_stake = md_Supplier.Fields().ByName("stake") + fd_Supplier_services = md_Supplier.Fields().ByName("services") +} + +var _ protoreflect.Message = (*fastReflection_Supplier)(nil) + +type fastReflection_Supplier Supplier + +func (x *Supplier) ProtoReflect() protoreflect.Message { + return (*fastReflection_Supplier)(x) +} + +func (x *Supplier) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_supplier_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_Supplier_messageType fastReflection_Supplier_messageType +var _ protoreflect.MessageType = fastReflection_Supplier_messageType{} + +type fastReflection_Supplier_messageType struct{} + +func (x fastReflection_Supplier_messageType) Zero() protoreflect.Message { + return (*fastReflection_Supplier)(nil) +} +func (x fastReflection_Supplier_messageType) New() protoreflect.Message { + return new(fastReflection_Supplier) +} +func (x fastReflection_Supplier_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Supplier +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Supplier) Descriptor() protoreflect.MessageDescriptor { + return md_Supplier +} + +// 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_Supplier) Type() protoreflect.MessageType { + return _fastReflection_Supplier_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Supplier) New() protoreflect.Message { + return new(fastReflection_Supplier) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Supplier) Interface() protoreflect.ProtoMessage { + return (*Supplier)(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_Supplier) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Index != "" { + value := protoreflect.ValueOfString(x.Index) + if !f(fd_Supplier_index, value) { + return + } + } + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_Supplier_address, value) { + return + } + } + if x.Stake != nil { + value := protoreflect.ValueOfMessage(x.Stake.ProtoReflect()) + if !f(fd_Supplier_stake, value) { + return + } + } + if x.Services != "" { + value := protoreflect.ValueOfString(x.Services) + if !f(fd_Supplier_services, 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_Supplier) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.Supplier.index": + return x.Index != "" + case "poktroll.supplier.Supplier.address": + return x.Address != "" + case "poktroll.supplier.Supplier.stake": + return x.Stake != nil + case "poktroll.supplier.Supplier.services": + return x.Services != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Supplier")) + } + panic(fmt.Errorf("message poktroll.supplier.Supplier 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_Supplier) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.Supplier.index": + x.Index = "" + case "poktroll.supplier.Supplier.address": + x.Address = "" + case "poktroll.supplier.Supplier.stake": + x.Stake = nil + case "poktroll.supplier.Supplier.services": + x.Services = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Supplier")) + } + panic(fmt.Errorf("message poktroll.supplier.Supplier 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_Supplier) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.Supplier.index": + value := x.Index + return protoreflect.ValueOfString(value) + case "poktroll.supplier.Supplier.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "poktroll.supplier.Supplier.stake": + value := x.Stake + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.supplier.Supplier.services": + value := x.Services + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Supplier")) + } + panic(fmt.Errorf("message poktroll.supplier.Supplier 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_Supplier) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.Supplier.index": + x.Index = value.Interface().(string) + case "poktroll.supplier.Supplier.address": + x.Address = value.Interface().(string) + case "poktroll.supplier.Supplier.stake": + x.Stake = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.supplier.Supplier.services": + x.Services = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Supplier")) + } + panic(fmt.Errorf("message poktroll.supplier.Supplier 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_Supplier) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.Supplier.stake": + if x.Stake == nil { + x.Stake = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Stake.ProtoReflect()) + case "poktroll.supplier.Supplier.index": + panic(fmt.Errorf("field index of message poktroll.supplier.Supplier is not mutable")) + case "poktroll.supplier.Supplier.address": + panic(fmt.Errorf("field address of message poktroll.supplier.Supplier is not mutable")) + case "poktroll.supplier.Supplier.services": + panic(fmt.Errorf("field services of message poktroll.supplier.Supplier is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Supplier")) + } + panic(fmt.Errorf("message poktroll.supplier.Supplier 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_Supplier) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.Supplier.index": + return protoreflect.ValueOfString("") + case "poktroll.supplier.Supplier.address": + return protoreflect.ValueOfString("") + case "poktroll.supplier.Supplier.stake": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.supplier.Supplier.services": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Supplier")) + } + panic(fmt.Errorf("message poktroll.supplier.Supplier 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_Supplier) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.Supplier", 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_Supplier) 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_Supplier) 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_Supplier) 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_Supplier) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Supplier) + 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.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Stake != nil { + l = options.Size(x.Stake) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Services) + 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().(*Supplier) + 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.Services) > 0 { + i -= len(x.Services) + copy(dAtA[i:], x.Services) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Services))) + i-- + dAtA[i] = 0x22 + } + if x.Stake != nil { + encoded, err := options.Marshal(x.Stake) + 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 len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + 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().(*Supplier) + 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: Supplier: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Supplier: 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 Address", 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.Address = 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 Stake", 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.Stake == nil { + x.Stake = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Stake); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Services", 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.Services = 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: poktroll/supplier/supplier.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 Supplier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Stake *v1beta1.Coin `protobuf:"bytes,3,opt,name=stake,proto3" json:"stake,omitempty"` + Services string `protobuf:"bytes,4,opt,name=services,proto3" json:"services,omitempty"` +} + +func (x *Supplier) Reset() { + *x = Supplier{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_supplier_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Supplier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Supplier) ProtoMessage() {} + +// Deprecated: Use Supplier.ProtoReflect.Descriptor instead. +func (*Supplier) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_supplier_proto_rawDescGZIP(), []int{0} +} + +func (x *Supplier) GetIndex() string { + if x != nil { + return x.Index + } + return "" +} + +func (x *Supplier) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Supplier) GetStake() *v1beta1.Coin { + if x != nil { + return x.Stake + } + return nil +} + +func (x *Supplier) GetServices() string { + if x != nil { + return x.Services + } + return "" +} + +var File_poktroll_supplier_supplier_proto protoreflect.FileDescriptor + +var file_poktroll_supplier_supplier_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x11, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x01, 0x0a, 0x08, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x42, 0xaf, 0x01, 0x0a, 0x15, + 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0d, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, + 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_supplier_supplier_proto_rawDescOnce sync.Once + file_poktroll_supplier_supplier_proto_rawDescData = file_poktroll_supplier_supplier_proto_rawDesc +) + +func file_poktroll_supplier_supplier_proto_rawDescGZIP() []byte { + file_poktroll_supplier_supplier_proto_rawDescOnce.Do(func() { + file_poktroll_supplier_supplier_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_supplier_supplier_proto_rawDescData) + }) + return file_poktroll_supplier_supplier_proto_rawDescData +} + +var file_poktroll_supplier_supplier_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_supplier_supplier_proto_goTypes = []interface{}{ + (*Supplier)(nil), // 0: poktroll.supplier.Supplier + (*v1beta1.Coin)(nil), // 1: cosmos.base.v1beta1.Coin +} +var file_poktroll_supplier_supplier_proto_depIdxs = []int32{ + 1, // 0: poktroll.supplier.Supplier.stake:type_name -> cosmos.base.v1beta1.Coin + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_poktroll_supplier_supplier_proto_init() } +func file_poktroll_supplier_supplier_proto_init() { + if File_poktroll_supplier_supplier_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_poktroll_supplier_supplier_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Supplier); 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_poktroll_supplier_supplier_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_supplier_supplier_proto_goTypes, + DependencyIndexes: file_poktroll_supplier_supplier_proto_depIdxs, + MessageInfos: file_poktroll_supplier_supplier_proto_msgTypes, + }.Build() + File_poktroll_supplier_supplier_proto = out.File + file_poktroll_supplier_supplier_proto_rawDesc = nil + file_poktroll_supplier_supplier_proto_goTypes = nil + file_poktroll_supplier_supplier_proto_depIdxs = nil +} diff --git a/proto/poktroll/supplier/genesis.proto b/proto/poktroll/supplier/genesis.proto index 271750d68..1ae2bd210 100644 --- a/proto/poktroll/supplier/genesis.proto +++ b/proto/poktroll/supplier/genesis.proto @@ -1,17 +1,19 @@ syntax = "proto3"; + package poktroll.supplier; import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "poktroll/supplier/params.proto"; +import "poktroll/supplier/supplier.proto"; option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; // GenesisState defines the supplier module's genesis state. message GenesisState { + // params defines all the parameters of the module. - Params params = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated Supplier supplierList = 2 [(gogoproto.nullable) = false] ; } + diff --git a/proto/poktroll/supplier/query.proto b/proto/poktroll/supplier/query.proto index a9f01c722..a43fd9a68 100644 --- a/proto/poktroll/supplier/query.proto +++ b/proto/poktroll/supplier/query.proto @@ -1,4 +1,5 @@ syntax = "proto3"; + package poktroll.supplier; import "amino/amino.proto"; @@ -6,25 +7,54 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "poktroll/supplier/params.proto"; +import "poktroll/supplier/supplier.proto"; +import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; // Query defines the gRPC querier service. service Query { + // Parameters queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + rpc Params (QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/pokt-network/poktroll/supplier/params"; + + } + + // Queries a list of Supplier items. + rpc Supplier (QueryGetSupplierRequest) returns (QueryGetSupplierResponse) { + option (google.api.http).get = "/pokt-network/poktroll/supplier/supplier/{index}"; + + } + rpc SupplierAll (QueryAllSupplierRequest) returns (QueryAllSupplierResponse) { + option (google.api.http).get = "/pokt-network/poktroll/supplier/supplier"; + } } - // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { + // params holds all the parameters of this module. - Params params = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} \ No newline at end of file + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +message QueryGetSupplierRequest { + string index = 1; +} + +message QueryGetSupplierResponse { + Supplier supplier = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllSupplierRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllSupplierResponse { + repeated Supplier supplier = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + diff --git a/proto/poktroll/supplier/supplier.proto b/proto/poktroll/supplier/supplier.proto new file mode 100644 index 000000000..f4bdf8226 --- /dev/null +++ b/proto/poktroll/supplier/supplier.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package poktroll.supplier; + +option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +message Supplier { + string index = 1; + string address = 2; + cosmos.base.v1beta1.Coin stake = 3 [(gogoproto.nullable) = false]; + string services = 4; + +} + diff --git a/x/supplier/keeper/query_supplier.go b/x/supplier/keeper/query_supplier.go new file mode 100644 index 000000000..598b719f5 --- /dev/null +++ b/x/supplier/keeper/query_supplier.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/pokt-network/poktroll/x/supplier/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) SupplierAll(ctx context.Context, req *types.QueryAllSupplierRequest) (*types.QueryAllSupplierResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var suppliers []types.Supplier + + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + supplierStore := prefix.NewStore(store, types.KeyPrefix(types.SupplierKeyPrefix)) + + pageRes, err := query.Paginate(supplierStore, req.Pagination, func(key []byte, value []byte) error { + var supplier types.Supplier + if err := k.cdc.Unmarshal(value, &supplier); err != nil { + return err + } + + suppliers = append(suppliers, supplier) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllSupplierResponse{Supplier: suppliers, Pagination: pageRes}, nil +} + +func (k Keeper) Supplier(ctx context.Context, req *types.QueryGetSupplierRequest) (*types.QueryGetSupplierResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + val, found := k.GetSupplier( + ctx, + req.Index, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetSupplierResponse{Supplier: val}, nil +} diff --git a/x/supplier/keeper/query_supplier_test.go b/x/supplier/keeper/query_supplier_test.go new file mode 100644 index 000000000..7d950dc42 --- /dev/null +++ b/x/supplier/keeper/query_supplier_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/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/testutil/nullify" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestSupplierQuerySingle(t *testing.T) { + keeper, ctx := keepertest.SupplierKeeper(t) + msgs := createNSupplier(keeper, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetSupplierRequest + response *types.QueryGetSupplierResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetSupplierRequest{ + Index: msgs[0].Index, + }, + response: &types.QueryGetSupplierResponse{Supplier: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetSupplierRequest{ + Index: msgs[1].Index, + }, + response: &types.QueryGetSupplierResponse{Supplier: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetSupplierRequest{ + 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.Supplier(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 TestSupplierQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.SupplierKeeper(t) + msgs := createNSupplier(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllSupplierRequest { + return &types.QueryAllSupplierRequest{ + 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.SupplierAll(ctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Supplier), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.Supplier), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.SupplierAll(ctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Supplier), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.Supplier), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.SupplierAll(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.Supplier), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.SupplierAll(ctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/supplier/keeper/supplier.go b/x/supplier/keeper/supplier.go new file mode 100644 index 000000000..dc661e8bb --- /dev/null +++ b/x/supplier/keeper/supplier.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/pokt-network/poktroll/x/supplier/types" +) + +// SetSupplier set a specific supplier in the store from its index +func (k Keeper) SetSupplier(ctx context.Context, supplier types.Supplier) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) + b := k.cdc.MustMarshal(&supplier) + store.Set(types.SupplierKey( + supplier.Index, + ), b) +} + +// GetSupplier returns a supplier from its index +func (k Keeper) GetSupplier( + ctx context.Context, + index string, + +) (val types.Supplier, found bool) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) + + b := store.Get(types.SupplierKey( + index, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveSupplier removes a supplier from the store +func (k Keeper) RemoveSupplier( + ctx context.Context, + index string, + +) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) + store.Delete(types.SupplierKey( + index, + )) +} + +// GetAllSupplier returns all supplier +func (k Keeper) GetAllSupplier(ctx context.Context) (list []types.Supplier) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Supplier + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/supplier/keeper/supplier_test.go b/x/supplier/keeper/supplier_test.go new file mode 100644 index 000000000..993c3b74b --- /dev/null +++ b/x/supplier/keeper/supplier_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "context" + "strconv" + "testing" + + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/testutil/nullify" + "github.com/pokt-network/poktroll/x/supplier/keeper" + "github.com/pokt-network/poktroll/x/supplier/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNSupplier(keeper keeper.Keeper, ctx context.Context, n int) []types.Supplier { + items := make([]types.Supplier, n) + for i := range items { + items[i].Index = strconv.Itoa(i) + + keeper.SetSupplier(ctx, items[i]) + } + return items +} + +func TestSupplierGet(t *testing.T) { + keeper, ctx := keepertest.SupplierKeeper(t) + items := createNSupplier(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetSupplier(ctx, + item.Index, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} +func TestSupplierRemove(t *testing.T) { + keeper, ctx := keepertest.SupplierKeeper(t) + items := createNSupplier(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveSupplier(ctx, + item.Index, + ) + _, found := keeper.GetSupplier(ctx, + item.Index, + ) + require.False(t, found) + } +} + +func TestSupplierGetAll(t *testing.T) { + keeper, ctx := keepertest.SupplierKeeper(t) + items := createNSupplier(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllSupplier(ctx)), + ) +} diff --git a/x/supplier/module/autocli.go b/x/supplier/module/autocli.go index 737ce98ea..2325ea034 100644 --- a/x/supplier/module/autocli.go +++ b/x/supplier/module/autocli.go @@ -17,6 +17,17 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Use: "params", Short: "Shows the parameters of the module", }, + { + RpcMethod: "SupplierAll", + Use: "list-supplier", + Short: "List all supplier", + }, + { + RpcMethod: "Supplier", + Use: "show-supplier [id]", + Short: "Shows a supplier", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "index"}}, + }, // this line is used by ignite scaffolding # autocli/query }, }, diff --git a/x/supplier/module/debug_container.dot b/x/supplier/module/debug_container.dot new file mode 100644 index 000000000..cb918fde8 --- /dev/null +++ b/x/supplier/module/debug_container.dot @@ -0,0 +1,502 @@ +digraph "" { + subgraph "cluster_auth" { + graph [fontsize="12.0", label="Module: auth", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + } + + subgraph "cluster_authz" { + graph [fontsize="12.0", label="Module: authz", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_bank" { + graph [fontsize="12.0", label="Module: bank", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + } + + subgraph "cluster_circuit" { + graph [fontsize="12.0", label="Module: circuit", penwidth="0.5", style="rounded"]; + "cosmossdk.io/x/circuit.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_consensus" { + graph [fontsize="12.0", label="Module: consensus", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_crisis" { + graph [fontsize="12.0", label="Module: crisis", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_distribution" { + graph [fontsize="12.0", label="Module: distribution", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_evidence" { + graph [fontsize="12.0", label="Module: evidence", penwidth="0.5", style="rounded"]; + "cosmossdk.io/x/evidence.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_feegrant" { + graph [fontsize="12.0", label="Module: feegrant", penwidth="0.5", style="rounded"]; + "cosmossdk.io/x/feegrant/module.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + } + + subgraph "cluster_genutil" { + graph [fontsize="12.0", label="Module: genutil", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_gov" { + graph [fontsize="12.0", label="Module: gov", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_group" { + graph [fontsize="12.0", label="Module: group", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + } + + subgraph "cluster_mint" { + graph [fontsize="12.0", label="Module: mint", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_params" { + graph [fontsize="12.0", label="Module: params", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/params.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + } + + subgraph "cluster_runtime" { + graph [fontsize="12.0", label="Module: runtime", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideApp"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideBasicManager"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideCometInfoService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideEventService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideGenesisTxHandler"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideHeaderInfoService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreKey"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder"[color="red", fontcolor="red", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_service" { + graph [fontsize="12.0", label="Module: service", penwidth="0.5", style="rounded"]; + "github.com/pokt-network/poktroll/x/service/module.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + } + + subgraph "cluster_slashing" { + graph [fontsize="12.0", label="Module: slashing", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_staking" { + graph [fontsize="12.0", label="Module: staking", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + } + + subgraph "cluster_supplier" { + graph [fontsize="12.0", label="Module: supplier", penwidth="0.5", style="rounded"]; + "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"[color="red", fontcolor="red", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_tx" { + graph [fontsize="12.0", label="Module: tx", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideProtoRegistry"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + } + + subgraph "cluster_upgrade" { + graph [fontsize="12.0", label="Module: upgrade", penwidth="0.5", style="rounded"]; + "cosmossdk.io/x/upgrade.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + } + + subgraph "cluster_vesting" { + graph [fontsize="12.0", label="Module: vesting", penwidth="0.5", style="rounded"]; + "github.com/cosmos/cosmos-sdk/x/auth/vesting.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; + } + + "*cosmossdk.io/api/cosmos/app/runtime/v1alpha1.Module"[color="black", fontcolor="black", penwidth="1.5"]; + "*cosmossdk.io/api/cosmos/app/v1alpha1.Config"[color="black", fontcolor="black", penwidth="1.5"]; + "*cosmossdk.io/api/cosmos/auth/module/v1.Module"[color="black", fontcolor="black", penwidth="1.5"]; + "*cosmossdk.io/api/cosmos/authz/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/bank/module/v1.Module"[color="black", fontcolor="black", penwidth="1.5"]; + "*cosmossdk.io/api/cosmos/circuit/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/consensus/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/crisis/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/distribution/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/evidence/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/feegrant/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/genutil/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/gov/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/group/module/v1.Module"[color="black", fontcolor="black", penwidth="1.5"]; + "*cosmossdk.io/api/cosmos/mint/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/params/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/slashing/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/staking/module/v1.Module"[color="black", fontcolor="black", penwidth="1.5"]; + "*cosmossdk.io/api/cosmos/tx/config/v1.Config"[color="black", fontcolor="black", penwidth="1.5"]; + "*cosmossdk.io/api/cosmos/upgrade/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/api/cosmos/vesting/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/store/types.KVStoreKey"[color="black", fontcolor="black", penwidth="1.5"]; + "*cosmossdk.io/store/types.MemoryStoreKey"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*cosmossdk.io/store/types.TransientStoreKey"[color="black", fontcolor="black", penwidth="1.5"]; + "*cosmossdk.io/x/upgrade/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*github.com/cosmos/cosmos-sdk/baseapp.MsgServiceRouter"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*github.com/cosmos/cosmos-sdk/codec.LegacyAmino"[color="black", fontcolor="black", penwidth="1.5"]; + "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder"[color="black", fontcolor="black", penwidth="1.5"]; + "*github.com/cosmos/cosmos-sdk/x/crisis/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*github.com/cosmos/cosmos-sdk/x/gov/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "*github.com/pokt-network/poktroll/api/poktroll/service/module.Module"[color="black", fontcolor="black", penwidth="1.5"]; + "*github.com/pokt-network/poktroll/api/poktroll/supplier/module.Module"[color="black", fontcolor="black", penwidth="1.5"]; + "[]cosmossdk.io/x/tx/signing.CustomGetSigner"[color="black", comment="many-per-container", fontcolor="black", penwidth="1.5"]; + "[]github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1.HandlerRoute"[color="lightgrey", comment="many-per-container", fontcolor="dimgrey", penwidth="0.5"]; + "[]runtime.BaseAppOption"[color="lightgrey", comment="many-per-container", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/core/address.Codec"[color="black", fontcolor="black", penwidth="1.5"]; + "cosmossdk.io/core/appconfig.Compose"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + "cosmossdk.io/core/comet.BlockInfoService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/core/event.Service"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/core/genesis.TxHandler"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/core/header.Service"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/core/store.KVStoreService"[color="black", fontcolor="black", penwidth="1.5"]; + "cosmossdk.io/core/store.MemoryStoreService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/core/store.TransientStoreService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/depinject.ModuleKey"[color="black", fontcolor="black", penwidth="1.5"]; + "cosmossdk.io/depinject.OwnModuleKey"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/log.Logger"[color="black", fontcolor="black", penwidth="1.5"]; + "cosmossdk.io/log.nopLogger"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/x/circuit/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/x/evidence/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/x/feegrant.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "cosmossdk.io/x/feegrant.BankKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "cosmossdk.io/x/feegrant/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/x/tx/signing.ProtoFileResolver"[color="black", fontcolor="black", penwidth="1.5"]; + "func() []signing.SignModeHandler"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "func() address.Codec"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "func() runtime.ConsensusAddressCodec"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "func() runtime.ValidatorAddressCodec"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "func() types.AccountI"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/baseapp.MessageRouter"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/client.TxConfig"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/codec.Codec"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/runtime.ConsensusAddressCodec"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/runtime.ValidatorAddressCodec"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/server/types.AppOptions"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig"[color="black", fontcolor="black", penwidth="1.5", shape="hexagon"]; + "github.com/cosmos/cosmos-sdk/x/auth/ante.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/x/auth/ante.FeegrantKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/x/auth/exported.Subspace"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/x/auth/tx.ConfigOptions"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/x/auth/tx/config.BankKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/x/auth/types.BankKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/x/auth/vesting/types.BankKeeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/x/authz/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/x/bank/exported.Subspace"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/x/bank/types.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/x/consensus/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/x/distribution/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/x/group.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/x/group.BankKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/x/group/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/x/mint/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/x/params/keeper.Keeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/x/params/types.Subspace"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/x/slashing/exported.Subspace"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/x/slashing/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/cosmos/cosmos-sdk/x/staking/exported.Subspace"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/x/staking/types.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/cosmos/cosmos-sdk/x/staking/types.BankKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/pokt-network/poktroll/app.AppConfig"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; + "github.com/pokt-network/poktroll/x/service/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/pokt-network/poktroll/x/service/types.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/pokt-network/poktroll/x/service/types.BankKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/pokt-network/poktroll/x/supplier/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "github.com/pokt-network/poktroll/x/supplier/types.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; + "github.com/pokt-network/poktroll/x/supplier/types.BankKeeper"[color="red", fontcolor="red", penwidth="0.5"]; + "google.golang.org/protobuf/reflect/protodesc.Resolver"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "google.golang.org/protobuf/reflect/protoregistry.MessageTypeResolver"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "map[string]cosmossdk.io/core/appmodule.AppModule"[color="red", comment="one-per-module", fontcolor="red", penwidth="0.5"]; + "map[string]github.com/cosmos/cosmos-sdk/types/module.AppModuleBasic"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "map[string]github.com/cosmos/cosmos-sdk/x/params/types.KeyTable"[color="black", comment="one-per-module", fontcolor="black", penwidth="1.5"]; + "map[string]github.com/cosmos/cosmos-sdk/x/staking/types.StakingHooksWrapper"[color="lightgrey", comment="one-per-module", fontcolor="dimgrey", penwidth="0.5"]; + "types.InflationCalculationFn"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "types.RandomGenesisAccountsFn"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/app/v1alpha1.Config"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/app/runtime/v1alpha1.Module"; + "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideApp"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "github.com/cosmos/cosmos-sdk/codec.Codec"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "*github.com/cosmos/cosmos-sdk/codec.LegacyAmino"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "*github.com/cosmos/cosmos-sdk/baseapp.MsgServiceRouter"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "google.golang.org/protobuf/reflect/protodesc.Resolver"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "google.golang.org/protobuf/reflect/protoregistry.MessageTypeResolver"; + "cosmossdk.io/core/address.Codec" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry"; + "github.com/cosmos/cosmos-sdk/runtime.ValidatorAddressCodec" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry"; + "[]cosmossdk.io/x/tx/signing.CustomGetSigner" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry" -> "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry"; + "*cosmossdk.io/api/cosmos/app/runtime/v1alpha1.Module" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey"; + "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey"; + "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey" -> "*cosmossdk.io/store/types.KVStoreKey"; + "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey"; + "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey" -> "*cosmossdk.io/store/types.TransientStoreKey"; + "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreKey"; + "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreKey"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreKey" -> "*cosmossdk.io/store/types.MemoryStoreKey"; + "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideGenesisTxHandler"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideGenesisTxHandler" -> "cosmossdk.io/core/genesis.TxHandler"; + "*cosmossdk.io/api/cosmos/app/runtime/v1alpha1.Module" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService"; + "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService"; + "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService" -> "cosmossdk.io/core/store.KVStoreService"; + "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreService"; + "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreService"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreService" -> "cosmossdk.io/core/store.MemoryStoreService"; + "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreService"; + "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreService"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreService" -> "cosmossdk.io/core/store.TransientStoreService"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideEventService" -> "cosmossdk.io/core/event.Service"; + "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideHeaderInfoService"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideHeaderInfoService" -> "cosmossdk.io/core/header.Service"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideCometInfoService" -> "cosmossdk.io/core/comet.BlockInfoService"; + "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideBasicManager"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideBasicManager" -> "map[string]github.com/cosmos/cosmos-sdk/types/module.AppModuleBasic"; + "*cosmossdk.io/api/cosmos/auth/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec"; + "*cosmossdk.io/api/cosmos/staking/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec"; + "func() address.Codec" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec"; + "func() runtime.ValidatorAddressCodec" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec"; + "func() runtime.ConsensusAddressCodec" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec" -> "cosmossdk.io/core/address.Codec"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec" -> "github.com/cosmos/cosmos-sdk/runtime.ValidatorAddressCodec"; + "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec" -> "github.com/cosmos/cosmos-sdk/runtime.ConsensusAddressCodec"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/auth/module/v1.Module"; + "*cosmossdk.io/api/cosmos/auth/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; + "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; + "cosmossdk.io/core/address.Codec" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; + "types.RandomGenesisAccountsFn" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; + "func() types.AccountI" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/exported.Subspace" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper"; + "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/vesting/module/v1.Module"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/auth/vesting.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/vesting/types.BankKeeper" -> "github.com/cosmos/cosmos-sdk/x/auth/vesting.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/vesting.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/bank/module/v1.Module"; + "*cosmossdk.io/api/cosmos/bank/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"; + "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"; + "cosmossdk.io/log.Logger" -> "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/exported.Subspace" -> "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper"; + "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/staking/module/v1.Module"; + "*cosmossdk.io/api/cosmos/staking/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; + "github.com/cosmos/cosmos-sdk/runtime.ValidatorAddressCodec" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; + "github.com/cosmos/cosmos-sdk/runtime.ConsensusAddressCodec" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; + "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/staking/exported.Subspace" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule" -> "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper"; + "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/slashing/module/v1.Module"; + "*cosmossdk.io/api/cosmos/slashing/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; + "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; + "*github.com/cosmos/cosmos-sdk/codec.LegacyAmino" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; + "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/slashing/exported.Subspace" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/slashing/keeper.Keeper"; + "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule" -> "map[string]github.com/cosmos/cosmos-sdk/x/staking/types.StakingHooksWrapper"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/params/module/v1.Module"; + "*cosmossdk.io/store/types.KVStoreKey" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideModule"; + "*cosmossdk.io/store/types.TransientStoreKey" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideModule"; + "*github.com/cosmos/cosmos-sdk/codec.LegacyAmino" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/params.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/params/keeper.Keeper"; + "github.com/cosmos/cosmos-sdk/x/params.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "github.com/cosmos/cosmos-sdk/x/params.ProvideModule" -> "[]github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1.HandlerRoute"; + "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace"; + "github.com/cosmos/cosmos-sdk/x/params/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace"; + "map[string]github.com/cosmos/cosmos-sdk/x/params/types.KeyTable" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace"; + "github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace" -> "github.com/cosmos/cosmos-sdk/x/params/types.Subspace"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/tx/config/v1.Config"; + "*cosmossdk.io/api/cosmos/tx/config/v1.Config" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; + "cosmossdk.io/core/address.Codec" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; + "github.com/cosmos/cosmos-sdk/runtime.ValidatorAddressCodec" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; + "cosmossdk.io/x/tx/signing.ProtoFileResolver" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/ante.FeegrantKeeper" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; + "func() []signing.SignModeHandler" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule" -> "github.com/cosmos/cosmos-sdk/client.TxConfig"; + "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/auth/tx.ConfigOptions"; + "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule" -> "[]runtime.BaseAppOption"; + "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideProtoRegistry" -> "cosmossdk.io/x/tx/signing.ProtoFileResolver"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/genutil/module/v1.Module"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule"; + "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule"; + "cosmossdk.io/core/genesis.TxHandler" -> "github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule"; + "github.com/cosmos/cosmos-sdk/client.TxConfig" -> "github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/authz/module/v1.Module"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry" -> "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"; + "*github.com/cosmos/cosmos-sdk/baseapp.MsgServiceRouter" -> "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"; + "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/authz/keeper.Keeper"; + "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/upgrade/module/v1.Module"; + "*cosmossdk.io/api/cosmos/upgrade/module/v1.Module" -> "cosmossdk.io/x/upgrade.ProvideModule"; + "cosmossdk.io/core/store.KVStoreService" -> "cosmossdk.io/x/upgrade.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "cosmossdk.io/x/upgrade.ProvideModule"; + "cosmossdk.io/core/address.Codec" -> "cosmossdk.io/x/upgrade.ProvideModule"; + "github.com/cosmos/cosmos-sdk/server/types.AppOptions" -> "cosmossdk.io/x/upgrade.ProvideModule"; + "cosmossdk.io/x/upgrade.ProvideModule" -> "*cosmossdk.io/x/upgrade/keeper.Keeper"; + "cosmossdk.io/x/upgrade.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/x/upgrade.ProvideModule" -> "[]runtime.BaseAppOption"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/distribution/module/v1.Module"; + "*cosmossdk.io/api/cosmos/distribution/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; + "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; + "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/params/types.Subspace" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/distribution/keeper.Keeper"; + "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule" -> "map[string]github.com/cosmos/cosmos-sdk/x/staking/types.StakingHooksWrapper"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/evidence/module/v1.Module"; + "cosmossdk.io/core/store.KVStoreService" -> "cosmossdk.io/x/evidence.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "cosmossdk.io/x/evidence.ProvideModule"; + "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper" -> "cosmossdk.io/x/evidence.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/slashing/keeper.Keeper" -> "cosmossdk.io/x/evidence.ProvideModule"; + "cosmossdk.io/core/address.Codec" -> "cosmossdk.io/x/evidence.ProvideModule"; + "cosmossdk.io/core/comet.BlockInfoService" -> "cosmossdk.io/x/evidence.ProvideModule"; + "cosmossdk.io/x/evidence.ProvideModule" -> "cosmossdk.io/x/evidence/keeper.Keeper"; + "cosmossdk.io/x/evidence.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/mint/module/v1.Module"; + "cosmossdk.io/depinject.OwnModuleKey" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; + "*cosmossdk.io/api/cosmos/mint/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; + "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; + "types.InflationCalculationFn" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/params/types.Subspace" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; + "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/mint/keeper.Keeper"; + "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/group/module/v1.Module"; + "*cosmossdk.io/api/cosmos/group/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; + "*cosmossdk.io/store/types.KVStoreKey" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; + "*github.com/cosmos/cosmos-sdk/baseapp.MsgServiceRouter" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/group/keeper.Keeper"; + "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/feegrant/module/v1.Module"; + "cosmossdk.io/core/store.KVStoreService" -> "cosmossdk.io/x/feegrant/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "cosmossdk.io/x/feegrant/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "cosmossdk.io/x/feegrant/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "cosmossdk.io/x/feegrant/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry" -> "cosmossdk.io/x/feegrant/module.ProvideModule"; + "cosmossdk.io/x/feegrant/module.ProvideModule" -> "cosmossdk.io/x/feegrant/keeper.Keeper"; + "cosmossdk.io/x/feegrant/module.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/gov/module/v1.Module"; + "*cosmossdk.io/api/cosmos/gov/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; + "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; + "cosmossdk.io/depinject.OwnModuleKey" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; + "*github.com/cosmos/cosmos-sdk/baseapp.MsgServiceRouter" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; + "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/distribution/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/params/types.Subspace" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule" -> "*github.com/cosmos/cosmos-sdk/x/gov/keeper.Keeper"; + "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule" -> "[]github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1.HandlerRoute"; + "github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable" -> "map[string]github.com/cosmos/cosmos-sdk/x/params/types.KeyTable"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/crisis/module/v1.Module"; + "*cosmossdk.io/api/cosmos/crisis/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; + "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; + "github.com/cosmos/cosmos-sdk/server/types.AppOptions" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; + "cosmossdk.io/core/address.Codec" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/params/types.Subspace" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule" -> "*github.com/cosmos/cosmos-sdk/x/crisis/keeper.Keeper"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/consensus/module/v1.Module"; + "*cosmossdk.io/api/cosmos/consensus/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule"; + "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule"; + "cosmossdk.io/core/event.Service" -> "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/consensus/keeper.Keeper"; + "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule" -> "[]runtime.BaseAppOption"; + "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/circuit/module/v1.Module"; + "*cosmossdk.io/api/cosmos/circuit/module/v1.Module" -> "cosmossdk.io/x/circuit.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "cosmossdk.io/x/circuit.ProvideModule"; + "cosmossdk.io/core/store.KVStoreService" -> "cosmossdk.io/x/circuit.ProvideModule"; + "cosmossdk.io/core/address.Codec" -> "cosmossdk.io/x/circuit.ProvideModule"; + "cosmossdk.io/x/circuit.ProvideModule" -> "cosmossdk.io/x/circuit/keeper.Keeper"; + "cosmossdk.io/x/circuit.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/x/circuit.ProvideModule" -> "[]runtime.BaseAppOption"; + "cosmossdk.io/core/appconfig.Compose" -> "*github.com/pokt-network/poktroll/api/poktroll/service/module.Module"; + "cosmossdk.io/core/store.KVStoreService" -> "github.com/pokt-network/poktroll/x/service/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/pokt-network/poktroll/x/service/module.ProvideModule"; + "*github.com/pokt-network/poktroll/api/poktroll/service/module.Module" -> "github.com/pokt-network/poktroll/x/service/module.ProvideModule"; + "cosmossdk.io/log.Logger" -> "github.com/pokt-network/poktroll/x/service/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/pokt-network/poktroll/x/service/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/pokt-network/poktroll/x/service/module.ProvideModule"; + "github.com/pokt-network/poktroll/x/service/module.ProvideModule" -> "github.com/pokt-network/poktroll/x/service/keeper.Keeper"; + "github.com/pokt-network/poktroll/x/service/module.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "cosmossdk.io/core/appconfig.Compose" -> "*github.com/pokt-network/poktroll/api/poktroll/supplier/module.Module"; + "cosmossdk.io/core/store.KVStoreService" -> "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"; + "*github.com/pokt-network/poktroll/api/poktroll/supplier/module.Module" -> "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"; + "cosmossdk.io/log.Logger" -> "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"; + "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"; + "github.com/pokt-network/poktroll/x/supplier/types.BankKeeper" -> "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"; + "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule" -> "github.com/pokt-network/poktroll/x/supplier/keeper.Keeper"; + "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; + "github.com/pokt-network/poktroll/app.AppConfig" -> "map[string]github.com/cosmos/cosmos-sdk/types/module.AppModuleBasic"; + "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig" -> "cosmossdk.io/log.nopLogger"; + "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig"; + "github.com/cosmos/cosmos-sdk/client.TxConfig" -> "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig"; + "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig"; + "*github.com/cosmos/cosmos-sdk/codec.LegacyAmino" -> "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig"; + "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry" -> "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig"; +} + diff --git a/x/supplier/module/debug_container.log b/x/supplier/module/debug_container.log new file mode 100644 index 000000000..099d5cb93 --- /dev/null +++ b/x/supplier/module/debug_container.log @@ -0,0 +1,379 @@ +Initializing logger +Registering providers + Registering github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) + Registering resolver for simple type codec.Codec + Registering resolver for simple type *codec.LegacyAmino + Registering resolver for simple type *runtime.AppBuilder + Registering resolver for simple type *baseapp.MsgServiceRouter + Registering resolver for one-per-module type appmodule.AppModule + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Registering resolver for simple type protodesc.Resolver + Registering resolver for simple type protoregistry.MessageTypeResolver + Registering resolver for many-per-container type signing.CustomGetSigner + Registering github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) + Registering resolver for simple type types.InterfaceRegistry + Registering module-scoped provider: github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) + Registering resolver for module-scoped type *types.KVStoreKey + Registering module-scoped provider: github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:213) + Registering resolver for module-scoped type *types.TransientStoreKey + Registering module-scoped provider: github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:219) + Registering resolver for module-scoped type *types.MemoryStoreKey + Registering github.com/cosmos/cosmos-sdk/runtime.ProvideGenesisTxHandler (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:226) + Registering resolver for simple type genesis.TxHandler + Registering module-scoped provider: github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Registering resolver for module-scoped type store.KVStoreService + Registering module-scoped provider: github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:234) + Registering resolver for module-scoped type store.MemoryStoreService + Registering module-scoped provider: github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:239) + Registering resolver for module-scoped type store.TransientStoreService + Registering github.com/cosmos/cosmos-sdk/runtime.ProvideEventService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:244) + Registering resolver for simple type event.Service + Registering github.com/cosmos/cosmos-sdk/runtime.ProvideHeaderInfoService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:253) + Registering resolver for simple type header.Service + Registering github.com/cosmos/cosmos-sdk/runtime.ProvideCometInfoService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:249) + Registering resolver for simple type comet.BlockInfoService + Registering github.com/cosmos/cosmos-sdk/runtime.ProvideBasicManager (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:257) + Registering resolver for simple type module.BasicManager + Registering github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) + Registering resolver for simple type address.Codec + Registering resolver for simple type runtime.ValidatorAddressCodec + Registering resolver for simple type runtime.ConsensusAddressCodec + Registering github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) + Registering resolver for simple type keeper.AccountKeeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Registering github.com/cosmos/cosmos-sdk/x/auth/vesting.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/vesting/module.go:140) + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper + Registering github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) + Registering resolver for simple type keeper.BaseKeeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper + Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper + Registering github.com/cosmos/cosmos-sdk/x/staking.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/staking/module.go:221) + Registering resolver for simple type *keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper + Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper + Implicitly registering resolver *keeper.Keeper for interface type types.StakingKeeper + Registering github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/slashing/module.go:230) + Registering resolver for simple type keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Registering resolver for one-per-module type types.StakingHooksWrapper + Found resolver for types.StakingHooksWrapper: *depinject.onePerModuleResolver + Registering github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) + Registering resolver for simple type keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Registering resolver for many-per-container type v1beta1.HandlerRoute + Found resolver for v1beta1.HandlerRoute: *depinject.groupResolver + Registering resolver for one-per-module type types.KeyTable + Registering module-scoped provider: github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) + Registering resolver for module-scoped type types.Subspace + Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper + Implicitly registering resolver keeper.BaseKeeper for interface type tx.BankKeeper + Implicitly registering resolver keeper.AccountKeeper for interface type ante.AccountKeeper + Registering github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:68) + Registering resolver for simple type client.TxConfig + Registering resolver for simple type tx.ConfigOptions + Registering resolver for many-per-container type runtime.BaseAppOption + Found resolver for runtime.BaseAppOption: *depinject.groupResolver + Registering github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideProtoRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:65) + Registering resolver for simple type signing.ProtoFileResolver + Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper + Implicitly registering resolver *keeper.Keeper for interface type types.StakingKeeper + Registering github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/genutil/module.go:138) + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Implicitly registering resolver keeper.AccountKeeper for interface type authz.AccountKeeper + Implicitly registering resolver keeper.BaseKeeper for interface type authz.BankKeeper + Implicitly registering resolver *baseapp.MsgServiceRouter for interface type baseapp.MessageRouter + Registering github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/authz/module/module.go:178) + Registering resolver for simple type keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Registering cosmossdk.io/x/upgrade.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/upgrade@v0.1.1/module.go:194) + Registering resolver for simple type *keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Found resolver for runtime.BaseAppOption: *depinject.groupResolver + Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper + Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper + Implicitly registering resolver *keeper.Keeper for interface type types.StakingKeeper + Implicitly registering resolver types.Subspace for interface type exported.Subspace + Registering github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/distribution/module.go:232) + Registering resolver for simple type keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Found resolver for types.StakingHooksWrapper: *depinject.onePerModuleResolver + Implicitly registering resolver *keeper.Keeper for interface type types.StakingKeeper + Implicitly registering resolver keeper.Keeper for interface type types.SlashingKeeper + Registering cosmossdk.io/x/evidence.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/evidence@v0.1.0/module.go:210) + Registering resolver for simple type keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Implicitly registering resolver types.Subspace for interface type exported.Subspace + Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper + Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper + Implicitly registering resolver *keeper.Keeper for interface type types.StakingKeeper + Registering github.com/cosmos/cosmos-sdk/x/mint.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/mint/module.go:221) + Registering resolver for simple type keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Implicitly registering resolver keeper.AccountKeeper for interface type group.AccountKeeper + Implicitly registering resolver keeper.BaseKeeper for interface type group.BankKeeper + Registering github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/group/module/module.go:208) + Registering resolver for simple type keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Implicitly registering resolver keeper.AccountKeeper for interface type feegrant.AccountKeeper + Implicitly registering resolver keeper.BaseKeeper for interface type feegrant.BankKeeper + Registering cosmossdk.io/x/feegrant/module.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/feegrant@v0.1.0/module/module.go:184) + Registering resolver for simple type keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper + Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper + Implicitly registering resolver *keeper.Keeper for interface type types.StakingKeeper + Implicitly registering resolver keeper.Keeper for interface type types.DistributionKeeper + Implicitly registering resolver types.Subspace for interface type types.ParamSubspace + Registering github.com/cosmos/cosmos-sdk/x/gov.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:189) + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Registering resolver for simple type *keeper.Keeper + Found resolver for v1beta1.HandlerRoute: *depinject.groupResolver + Registering github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:218) + Found resolver for types.KeyTable: *depinject.onePerModuleResolver + Implicitly registering resolver keeper.BaseKeeper for interface type types.SupplyKeeper + Implicitly registering resolver types.Subspace for interface type exported.Subspace + Registering github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/crisis/module.go:201) + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Registering resolver for simple type *keeper.Keeper + Registering github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/consensus/module.go:117) + Registering resolver for simple type keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Found resolver for runtime.BaseAppOption: *depinject.groupResolver + Registering cosmossdk.io/x/circuit.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/circuit@v0.1.0/module.go:154) + Registering resolver for simple type keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Found resolver for runtime.BaseAppOption: *depinject.groupResolver + Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper + Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper + Registering github.com/pokt-network/poktroll/x/service/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/service/module/module.go:194) + Registering resolver for simple type keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver + Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper + Registering github.com/pokt-network/poktroll/x/supplier/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/supplier/module/module.go:194) + Registering resolver for simple type keeper.Keeper + Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver +Registering outputs + Registering github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:186) +Building container +Resolving dependencies for github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:186) + Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig + Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) + Providing types.InterfaceRegistry from github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) to github.com/cosmos/cosmos-sdk/runtime.ProvideApp + Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) + Providing address.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry + Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) + Supplying *modulev1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec + Supplying *modulev1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec + Providing zero value for optional dependency func() address.Codec + Providing zero value for optional dependency func() runtime.ValidatorAddressCodec + Providing zero value for optional dependency func() runtime.ConsensusAddressCodec + Calling github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) + Providing runtime.ValidatorAddressCodec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry + Providing many-per-container type slice []signing.CustomGetSigner to github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry from: + Calling github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) + Calling github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) + Providing client.TxConfig from github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:68) to github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig + Resolving dependencies for github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:68) + Supplying *configv1.Config from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule + Providing address.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule + Providing runtime.ValidatorAddressCodec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule + Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule + Providing signing.ProtoFileResolver from github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideProtoRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:65) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideProtoRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:65) + Calling github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideProtoRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:65) + Providing keeper.BaseKeeper from github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) + Supplying *modulev1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/x/bank.ProvideModule + Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/bank.ProvideModule + Providing store.KVStoreService from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) to github.com/cosmos/cosmos-sdk/x/bank.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService + Providing ModuleKey bank + Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService + Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Implicitly registering resolver log.nopLogger for interface type log.Logger + Supplying log.nopLogger from github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:189) to github.com/cosmos/cosmos-sdk/x/bank.ProvideModule + Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to github.com/cosmos/cosmos-sdk/x/bank.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) + Supplying *modulev1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/x/auth.ProvideModule + Providing store.KVStoreService from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) to github.com/cosmos/cosmos-sdk/x/auth.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService + Providing ModuleKey auth + Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService + Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/auth.ProvideModule + Providing address.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/x/auth.ProvideModule + Providing zero value for optional dependency types.RandomGenesisAccountsFn + Providing zero value for optional dependency func() types.AccountI + Implicitly registering resolver types.Subspace for interface type exported.Subspace + Providing types.Subspace from github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) to github.com/cosmos/cosmos-sdk/x/auth.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) + Providing ModuleKey auth + Providing keeper.Keeper from github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) to github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace + Resolving dependencies for github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) + Providing *types.KVStoreKey from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) to github.com/cosmos/cosmos-sdk/x/params.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) + Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey + Providing ModuleKey params + Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey + Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) + Providing *types.TransientStoreKey from github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:213) to github.com/cosmos/cosmos-sdk/x/params.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:213) + Providing ModuleKey params + Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey + Calling github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:213) + Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/params.ProvideModule + Providing *codec.LegacyAmino from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/params.ProvideModule + Calling github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) + Providing one-per-module type map map[string]types.KeyTable to github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace from: + gov: github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:218) + Resolving dependencies for github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:218) + Calling github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:218) + Calling github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) + Calling github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) + Implicitly registering resolver types.Subspace for interface type exported.Subspace + Providing types.Subspace from github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) to github.com/cosmos/cosmos-sdk/x/bank.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) + Providing ModuleKey bank + Providing keeper.Keeper from github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) to github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace + Providing one-per-module type map map[string]types.KeyTable to github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace from: + gov: github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:218) + Calling github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) + Calling github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) + Providing keeper.BaseKeeper from github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule + Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule + Implicitly registering resolver keeper.Keeper for interface type ante.FeegrantKeeper + Providing keeper.Keeper from cosmossdk.io/x/feegrant/module.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/feegrant@v0.1.0/module/module.go:184) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule + Resolving dependencies for cosmossdk.io/x/feegrant/module.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/feegrant@v0.1.0/module/module.go:184) + Providing store.KVStoreService from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) to cosmossdk.io/x/feegrant/module.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService + Providing ModuleKey feegrant + Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService + Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to cosmossdk.io/x/feegrant/module.ProvideModule + Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to cosmossdk.io/x/feegrant/module.ProvideModule + Providing keeper.BaseKeeper from github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) to cosmossdk.io/x/feegrant/module.ProvideModule + Providing types.InterfaceRegistry from github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) to cosmossdk.io/x/feegrant/module.ProvideModule + Calling cosmossdk.io/x/feegrant/module.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/feegrant@v0.1.0/module/module.go:184) + Providing zero value for optional dependency func() []signing.SignModeHandler + Calling github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:68) + Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig + Providing *codec.LegacyAmino from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig + Providing types.InterfaceRegistry from github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) to github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig +Calling github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:186) +Done building container +Calling invokers +Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:138) + Supplying *appv1alpha1.Config from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:55) to github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder + Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder + Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder + Providing one-per-module type map map[string]appmodule.AppModule to github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder from: + distribution: github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/distribution/module.go:232) + crisis: github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/crisis/module.go:201) + consensus: github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/consensus/module.go:117) + runtime: github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) + bank: github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) + slashing: github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/slashing/module.go:230) + genutil: github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/genutil/module.go:138) + authz: github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/authz/module/module.go:178) + mint: github.com/cosmos/cosmos-sdk/x/mint.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/mint/module.go:221) + gov: github.com/cosmos/cosmos-sdk/x/gov.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:189) + circuit: cosmossdk.io/x/circuit.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/circuit@v0.1.0/module.go:154) + auth: github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) + staking: github.com/cosmos/cosmos-sdk/x/staking.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/staking/module.go:221) + feegrant: cosmossdk.io/x/feegrant/module.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/feegrant@v0.1.0/module/module.go:184) + vesting: github.com/cosmos/cosmos-sdk/x/auth/vesting.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/vesting/module.go:140) + params: github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) + upgrade: cosmossdk.io/x/upgrade.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/upgrade@v0.1.1/module.go:194) + evidence: cosmossdk.io/x/evidence.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/evidence@v0.1.0/module.go:210) + group: github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/group/module/module.go:208) + service: github.com/pokt-network/poktroll/x/service/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/service/module/module.go:194) + supplier: github.com/pokt-network/poktroll/x/supplier/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/supplier/module/module.go:194) + Resolving dependencies for github.com/cosmos/cosmos-sdk/x/staking.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/staking/module.go:221) + Supplying *modulev1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule + Providing runtime.ValidatorAddressCodec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule + Providing runtime.ConsensusAddressCodec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule + Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule + Providing keeper.BaseKeeper from github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule + Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule + Providing store.KVStoreService from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService + Providing ModuleKey staking + Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService + Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Implicitly registering resolver types.Subspace for interface type exported.Subspace + Providing types.Subspace from github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) + Providing ModuleKey staking + Providing keeper.Keeper from github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) to github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace + Providing one-per-module type map map[string]types.KeyTable to github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace from: + gov: github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:218) + Calling github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) + Calling github.com/cosmos/cosmos-sdk/x/staking.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/staking/module.go:221) + Resolving dependencies for github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/group/module/module.go:208) + Supplying *modulev1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule + Providing *types.KVStoreKey from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) + Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey + Providing ModuleKey group + Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey + Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) + Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule + Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule + Providing keeper.BaseKeeper from github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule + Providing types.InterfaceRegistry from github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule + Providing *baseapp.MsgServiceRouter from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule + Calling github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/group/module/module.go:208) + Resolving dependencies for github.com/pokt-network/poktroll/x/service/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/service/module/module.go:194) + Providing store.KVStoreService from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) to github.com/pokt-network/poktroll/x/service/module.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService + Providing ModuleKey service + Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService + Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/pokt-network/poktroll/x/service/module.ProvideModule + Supplying *module.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/pokt-network/poktroll/x/service/module.ProvideModule + Supplying log.nopLogger from github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:189) to github.com/pokt-network/poktroll/x/service/module.ProvideModule + Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to github.com/pokt-network/poktroll/x/service/module.ProvideModule + Providing keeper.BaseKeeper from github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) to github.com/pokt-network/poktroll/x/service/module.ProvideModule + Calling github.com/pokt-network/poktroll/x/service/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/service/module/module.go:194) + Resolving dependencies for github.com/pokt-network/poktroll/x/supplier/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/supplier/module/module.go:194) + Providing store.KVStoreService from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) to github.com/pokt-network/poktroll/x/supplier/module.ProvideModule + Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService + Providing ModuleKey supplier + Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService + Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) + Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/pokt-network/poktroll/x/supplier/module.ProvideModule + Supplying *module.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/pokt-network/poktroll/x/supplier/module.ProvideModule + Supplying log.nopLogger from github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:189) to github.com/pokt-network/poktroll/x/supplier/module.ProvideModule + Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to github.com/pokt-network/poktroll/x/supplier/module.ProvideModule + Error: can't resolve type github.com/pokt-network/poktroll/x/supplier/types/types.BankKeeper for github.com/pokt-network/poktroll/x/supplier/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/supplier/module/module.go:194): + while resolving: + types.BankKeeper for github.com/pokt-network/poktroll/x/supplier/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/supplier/module/module.go:194) + store.KVStoreService for github.com/pokt-network/poktroll/x/supplier/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/supplier/module/module.go:194) + store.KVStoreService for github.com/pokt-network/poktroll/x/service/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/service/module/module.go:194) + *types.KVStoreKey for github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/group/module/module.go:208) + exported.Subspace for github.com/cosmos/cosmos-sdk/x/staking.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/staking/module.go:221) + store.KVStoreService for github.com/cosmos/cosmos-sdk/x/staking.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/staking/module.go:221) + map[string]appmodule.AppModule for github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:138) + ante.FeegrantKeeper for github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:68) + depinject.ModuleKey for github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) + exported.Subspace for github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) + func() types.AccountI for github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) + types.RandomGenesisAccountsFn for github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) + store.KVStoreService for github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) + types.AccountKeeper for github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) + store.KVStoreService for github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) + types.BankKeeper for github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:68) + client.TxConfig for github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:186) + address.Codec for github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) + types.InterfaceRegistry for github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) + *runtime.AppBuilder for github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:186) + Saved graph of container to /home/bwhite/Projects/pokt/poktroll/x/supplier/module/debug_container.dot diff --git a/x/supplier/module/genesis.go b/x/supplier/module/genesis.go index 7c12c8a1d..f0a857fe4 100644 --- a/x/supplier/module/genesis.go +++ b/x/supplier/module/genesis.go @@ -9,6 +9,10 @@ import ( // InitGenesis initializes the module's state from a provided genesis state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // Set all the supplier + for _, elem := range genState.SupplierList { + k.SetSupplier(ctx, elem) + } // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -18,6 +22,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) + genesis.SupplierList = k.GetAllSupplier(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/supplier/module/genesis_test.go b/x/supplier/module/genesis_test.go index 3c1559a34..4d931b698 100644 --- a/x/supplier/module/genesis_test.go +++ b/x/supplier/module/genesis_test.go @@ -14,6 +14,14 @@ func TestGenesis(t *testing.T) { genesisState := types.GenesisState{ Params: types.DefaultParams(), + SupplierList: []types.Supplier{ + { + Index: "0", + }, + { + Index: "1", + }, + }, // this line is used by starport scaffolding # genesis/test/state } @@ -25,5 +33,6 @@ func TestGenesis(t *testing.T) { nullify.Fill(&genesisState) nullify.Fill(got) + require.ElementsMatch(t, genesisState.SupplierList, got.SupplierList) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/supplier/types/genesis.go b/x/supplier/types/genesis.go index 0af9b4416..f6bd94129 100644 --- a/x/supplier/types/genesis.go +++ b/x/supplier/types/genesis.go @@ -1,7 +1,7 @@ package types import ( -// this line is used by starport scaffolding # genesis/types/import + "fmt" ) // DefaultIndex is the default global index @@ -10,6 +10,7 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ + SupplierList: []Supplier{}, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } @@ -18,6 +19,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 supplier + supplierIndexMap := make(map[string]struct{}) + + for _, elem := range gs.SupplierList { + index := string(SupplierKey(elem.Index)) + if _, ok := supplierIndexMap[index]; ok { + return fmt.Errorf("duplicated index for supplier") + } + supplierIndexMap[index] = struct{}{} + } // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() diff --git a/x/supplier/types/genesis_test.go b/x/supplier/types/genesis_test.go index ee12da6e2..a7a5f4e06 100644 --- a/x/supplier/types/genesis_test.go +++ b/x/supplier/types/genesis_test.go @@ -19,13 +19,35 @@ func TestGenesisState_Validate(t *testing.T) { valid: true, }, { - desc: "valid genesis state", + desc: "valid genesis state", genState: &types.GenesisState{ + SupplierList: []types.Supplier{ + { + Index: "0", + }, + { + Index: "1", + }, + }, // this line is used by starport scaffolding # types/genesis/validField }, valid: true, }, + { + desc: "duplicated supplier", + genState: &types.GenesisState{ + SupplierList: []types.Supplier{ + { + Index: "0", + }, + { + Index: "0", + }, + }, + }, + valid: false, + }, // this line is used by starport scaffolding # types/genesis/testcase } for _, tc := range tests { diff --git a/x/supplier/types/key_supplier.go b/x/supplier/types/key_supplier.go new file mode 100644 index 000000000..e91fd76e4 --- /dev/null +++ b/x/supplier/types/key_supplier.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // SupplierKeyPrefix is the prefix to retrieve all Supplier + SupplierKeyPrefix = "Supplier/value/" +) + +// SupplierKey returns the store key to retrieve a Supplier from the index fields +func SupplierKey( + index string, +) []byte { + var key []byte + + indexBytes := []byte(index) + key = append(key, indexBytes...) + key = append(key, []byte("/")...) + + return key +} From bc0bc417e76303450a7fea837345a72d0d42d0d3 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 8 Feb 2024 14:22:34 +0100 Subject: [PATCH 03/29] chore: move supplier.proto to shared --- .../{supplier => shared}/supplier.pulsar.go | 199 +++++++++--------- api/poktroll/supplier/genesis.pulsar.go | 78 +++---- api/poktroll/supplier/query.pulsar.go | 192 ++++++++--------- proto/buf.gen.pulsar.yaml | 2 +- .../{supplier => shared}/supplier.proto | 4 +- proto/poktroll/supplier/genesis.proto | 8 +- proto/poktroll/supplier/query.proto | 8 +- x/supplier/keeper/query_supplier.go | 8 +- 8 files changed, 250 insertions(+), 249 deletions(-) rename api/poktroll/{supplier => shared}/supplier.pulsar.go (77%) rename proto/poktroll/{supplier => shared}/supplier.proto (72%) diff --git a/api/poktroll/supplier/supplier.pulsar.go b/api/poktroll/shared/supplier.pulsar.go similarity index 77% rename from api/poktroll/supplier/supplier.pulsar.go rename to api/poktroll/shared/supplier.pulsar.go index ae580c72d..ee0b7abd4 100644 --- a/api/poktroll/supplier/supplier.pulsar.go +++ b/api/poktroll/shared/supplier.pulsar.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package supplier +package shared import ( v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" @@ -23,8 +23,8 @@ var ( ) func init() { - file_poktroll_supplier_supplier_proto_init() - md_Supplier = File_poktroll_supplier_supplier_proto.Messages().ByName("Supplier") + file_poktroll_shared_supplier_proto_init() + md_Supplier = File_poktroll_shared_supplier_proto.Messages().ByName("Supplier") fd_Supplier_index = md_Supplier.Fields().ByName("index") fd_Supplier_address = md_Supplier.Fields().ByName("address") fd_Supplier_stake = md_Supplier.Fields().ByName("stake") @@ -40,7 +40,7 @@ func (x *Supplier) ProtoReflect() protoreflect.Message { } func (x *Supplier) slowProtoReflect() protoreflect.Message { - mi := &file_poktroll_supplier_supplier_proto_msgTypes[0] + mi := &file_poktroll_shared_supplier_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -135,19 +135,19 @@ func (x *fastReflection_Supplier) Range(f func(protoreflect.FieldDescriptor, pro // a repeated field is populated if it is non-empty. func (x *fastReflection_Supplier) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.supplier.Supplier.index": + case "poktroll.shared.Supplier.index": return x.Index != "" - case "poktroll.supplier.Supplier.address": + case "poktroll.shared.Supplier.address": return x.Address != "" - case "poktroll.supplier.Supplier.stake": + case "poktroll.shared.Supplier.stake": return x.Stake != nil - case "poktroll.supplier.Supplier.services": + case "poktroll.shared.Supplier.services": return x.Services != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Supplier")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) } - panic(fmt.Errorf("message poktroll.supplier.Supplier does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.shared.Supplier does not contain field %s", fd.FullName())) } } @@ -159,19 +159,19 @@ func (x *fastReflection_Supplier) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Supplier) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.supplier.Supplier.index": + case "poktroll.shared.Supplier.index": x.Index = "" - case "poktroll.supplier.Supplier.address": + case "poktroll.shared.Supplier.address": x.Address = "" - case "poktroll.supplier.Supplier.stake": + case "poktroll.shared.Supplier.stake": x.Stake = nil - case "poktroll.supplier.Supplier.services": + case "poktroll.shared.Supplier.services": x.Services = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Supplier")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) } - panic(fmt.Errorf("message poktroll.supplier.Supplier does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.shared.Supplier does not contain field %s", fd.FullName())) } } @@ -183,23 +183,23 @@ func (x *fastReflection_Supplier) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Supplier) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.supplier.Supplier.index": + case "poktroll.shared.Supplier.index": value := x.Index return protoreflect.ValueOfString(value) - case "poktroll.supplier.Supplier.address": + case "poktroll.shared.Supplier.address": value := x.Address return protoreflect.ValueOfString(value) - case "poktroll.supplier.Supplier.stake": + case "poktroll.shared.Supplier.stake": value := x.Stake return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "poktroll.supplier.Supplier.services": + case "poktroll.shared.Supplier.services": value := x.Services return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Supplier")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) } - panic(fmt.Errorf("message poktroll.supplier.Supplier does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message poktroll.shared.Supplier does not contain field %s", descriptor.FullName())) } } @@ -215,19 +215,19 @@ func (x *fastReflection_Supplier) Get(descriptor protoreflect.FieldDescriptor) p // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Supplier) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.supplier.Supplier.index": + case "poktroll.shared.Supplier.index": x.Index = value.Interface().(string) - case "poktroll.supplier.Supplier.address": + case "poktroll.shared.Supplier.address": x.Address = value.Interface().(string) - case "poktroll.supplier.Supplier.stake": + case "poktroll.shared.Supplier.stake": x.Stake = value.Message().Interface().(*v1beta1.Coin) - case "poktroll.supplier.Supplier.services": + case "poktroll.shared.Supplier.services": x.Services = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Supplier")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) } - panic(fmt.Errorf("message poktroll.supplier.Supplier does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.shared.Supplier does not contain field %s", fd.FullName())) } } @@ -243,22 +243,22 @@ func (x *fastReflection_Supplier) Set(fd protoreflect.FieldDescriptor, value pro // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Supplier) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.supplier.Supplier.stake": + case "poktroll.shared.Supplier.stake": if x.Stake == nil { x.Stake = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.Stake.ProtoReflect()) - case "poktroll.supplier.Supplier.index": - panic(fmt.Errorf("field index of message poktroll.supplier.Supplier is not mutable")) - case "poktroll.supplier.Supplier.address": - panic(fmt.Errorf("field address of message poktroll.supplier.Supplier is not mutable")) - case "poktroll.supplier.Supplier.services": - panic(fmt.Errorf("field services of message poktroll.supplier.Supplier is not mutable")) + case "poktroll.shared.Supplier.index": + panic(fmt.Errorf("field index of message poktroll.shared.Supplier is not mutable")) + case "poktroll.shared.Supplier.address": + panic(fmt.Errorf("field address of message poktroll.shared.Supplier is not mutable")) + case "poktroll.shared.Supplier.services": + panic(fmt.Errorf("field services of message poktroll.shared.Supplier is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Supplier")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) } - panic(fmt.Errorf("message poktroll.supplier.Supplier does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.shared.Supplier does not contain field %s", fd.FullName())) } } @@ -267,20 +267,20 @@ func (x *fastReflection_Supplier) Mutable(fd protoreflect.FieldDescriptor) proto // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Supplier) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.supplier.Supplier.index": + case "poktroll.shared.Supplier.index": return protoreflect.ValueOfString("") - case "poktroll.supplier.Supplier.address": + case "poktroll.shared.Supplier.address": return protoreflect.ValueOfString("") - case "poktroll.supplier.Supplier.stake": + case "poktroll.shared.Supplier.stake": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "poktroll.supplier.Supplier.services": + case "poktroll.shared.Supplier.services": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.Supplier")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) } - panic(fmt.Errorf("message poktroll.supplier.Supplier does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.shared.Supplier does not contain field %s", fd.FullName())) } } @@ -290,7 +290,7 @@ func (x *fastReflection_Supplier) NewField(fd protoreflect.FieldDescriptor) prot func (x *fastReflection_Supplier) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.Supplier", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in poktroll.shared.Supplier", d.FullName())) } panic("unreachable") } @@ -645,7 +645,7 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { // versions: // protoc-gen-go v1.27.0 // protoc (unknown) -// source: poktroll/supplier/supplier.proto +// source: poktroll/shared/supplier.proto const ( // Verify that this generated code is sufficiently up-to-date. @@ -668,7 +668,7 @@ type Supplier struct { func (x *Supplier) Reset() { *x = Supplier{} if protoimpl.UnsafeEnabled { - mi := &file_poktroll_supplier_supplier_proto_msgTypes[0] + mi := &file_poktroll_shared_supplier_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -682,7 +682,7 @@ func (*Supplier) ProtoMessage() {} // Deprecated: Use Supplier.ProtoReflect.Descriptor instead. func (*Supplier) Descriptor() ([]byte, []int) { - return file_poktroll_supplier_supplier_proto_rawDescGZIP(), []int{0} + return file_poktroll_shared_supplier_proto_rawDescGZIP(), []int{0} } func (x *Supplier) GetIndex() string { @@ -713,58 +713,57 @@ func (x *Supplier) GetServices() string { return "" } -var File_poktroll_supplier_supplier_proto protoreflect.FileDescriptor - -var file_poktroll_supplier_supplier_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x11, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x01, 0x0a, 0x08, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x42, 0xaf, 0x01, 0x0a, 0x15, - 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0d, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, - 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, +var File_poktroll_shared_supplier_proto protoreflect.FileDescriptor + +var file_poktroll_shared_supplier_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x64, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x64, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x01, 0x0a, 0x08, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x42, 0xa3, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, + 0x0d, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, + 0x65, 0x64, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_poktroll_supplier_supplier_proto_rawDescOnce sync.Once - file_poktroll_supplier_supplier_proto_rawDescData = file_poktroll_supplier_supplier_proto_rawDesc + file_poktroll_shared_supplier_proto_rawDescOnce sync.Once + file_poktroll_shared_supplier_proto_rawDescData = file_poktroll_shared_supplier_proto_rawDesc ) -func file_poktroll_supplier_supplier_proto_rawDescGZIP() []byte { - file_poktroll_supplier_supplier_proto_rawDescOnce.Do(func() { - file_poktroll_supplier_supplier_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_supplier_supplier_proto_rawDescData) +func file_poktroll_shared_supplier_proto_rawDescGZIP() []byte { + file_poktroll_shared_supplier_proto_rawDescOnce.Do(func() { + file_poktroll_shared_supplier_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_shared_supplier_proto_rawDescData) }) - return file_poktroll_supplier_supplier_proto_rawDescData + return file_poktroll_shared_supplier_proto_rawDescData } -var file_poktroll_supplier_supplier_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_poktroll_supplier_supplier_proto_goTypes = []interface{}{ - (*Supplier)(nil), // 0: poktroll.supplier.Supplier +var file_poktroll_shared_supplier_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_shared_supplier_proto_goTypes = []interface{}{ + (*Supplier)(nil), // 0: poktroll.shared.Supplier (*v1beta1.Coin)(nil), // 1: cosmos.base.v1beta1.Coin } -var file_poktroll_supplier_supplier_proto_depIdxs = []int32{ - 1, // 0: poktroll.supplier.Supplier.stake:type_name -> cosmos.base.v1beta1.Coin +var file_poktroll_shared_supplier_proto_depIdxs = []int32{ + 1, // 0: poktroll.shared.Supplier.stake:type_name -> cosmos.base.v1beta1.Coin 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -772,13 +771,13 @@ var file_poktroll_supplier_supplier_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_poktroll_supplier_supplier_proto_init() } -func file_poktroll_supplier_supplier_proto_init() { - if File_poktroll_supplier_supplier_proto != nil { +func init() { file_poktroll_shared_supplier_proto_init() } +func file_poktroll_shared_supplier_proto_init() { + if File_poktroll_shared_supplier_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_poktroll_supplier_supplier_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_poktroll_shared_supplier_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Supplier); i { case 0: return &v.state @@ -795,18 +794,18 @@ func file_poktroll_supplier_supplier_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_poktroll_supplier_supplier_proto_rawDesc, + RawDescriptor: file_poktroll_shared_supplier_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_poktroll_supplier_supplier_proto_goTypes, - DependencyIndexes: file_poktroll_supplier_supplier_proto_depIdxs, - MessageInfos: file_poktroll_supplier_supplier_proto_msgTypes, + GoTypes: file_poktroll_shared_supplier_proto_goTypes, + DependencyIndexes: file_poktroll_shared_supplier_proto_depIdxs, + MessageInfos: file_poktroll_shared_supplier_proto_msgTypes, }.Build() - File_poktroll_supplier_supplier_proto = out.File - file_poktroll_supplier_supplier_proto_rawDesc = nil - file_poktroll_supplier_supplier_proto_goTypes = nil - file_poktroll_supplier_supplier_proto_depIdxs = nil + File_poktroll_shared_supplier_proto = out.File + file_poktroll_shared_supplier_proto_rawDesc = nil + file_poktroll_shared_supplier_proto_goTypes = nil + file_poktroll_shared_supplier_proto_depIdxs = nil } diff --git a/api/poktroll/supplier/genesis.pulsar.go b/api/poktroll/supplier/genesis.pulsar.go index 9e9b76ad8..86a864a41 100644 --- a/api/poktroll/supplier/genesis.pulsar.go +++ b/api/poktroll/supplier/genesis.pulsar.go @@ -6,6 +6,7 @@ import ( fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" + shared "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -17,7 +18,7 @@ import ( var _ protoreflect.List = (*_GenesisState_2_list)(nil) type _GenesisState_2_list struct { - list *[]*Supplier + list *[]*shared.Supplier } func (x *_GenesisState_2_list) Len() int { @@ -33,18 +34,18 @@ func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Supplier) + concreteValue := valueUnwrapped.Interface().(*shared.Supplier) (*x.list)[i] = concreteValue } func (x *_GenesisState_2_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Supplier) + concreteValue := valueUnwrapped.Interface().(*shared.Supplier) *x.list = append(*x.list, concreteValue) } func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { - v := new(Supplier) + v := new(shared.Supplier) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } @@ -57,7 +58,7 @@ func (x *_GenesisState_2_list) Truncate(n int) { } func (x *_GenesisState_2_list) NewElement() protoreflect.Value { - v := new(Supplier) + v := new(shared.Supplier) return protoreflect.ValueOfMessage(v.ProtoReflect()) } @@ -272,7 +273,7 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) case "poktroll.supplier.GenesisState.supplierList": if x.SupplierList == nil { - x.SupplierList = []*Supplier{} + x.SupplierList = []*shared.Supplier{} } value := &_GenesisState_2_list{list: &x.SupplierList} return protoreflect.ValueOfList(value) @@ -293,7 +294,7 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) m := new(Params) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "poktroll.supplier.GenesisState.supplierList": - list := []*Supplier{} + list := []*shared.Supplier{} return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) default: if fd.IsExtension() { @@ -547,7 +548,7 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.SupplierList = append(x.SupplierList, &Supplier{}) + x.SupplierList = append(x.SupplierList, &shared.Supplier{}) if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SupplierList[len(x.SupplierList)-1]); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } @@ -607,8 +608,8 @@ 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"` - SupplierList []*Supplier `protobuf:"bytes,2,rep,name=supplierList,proto3" json:"supplierList,omitempty"` + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + SupplierList []*shared.Supplier `protobuf:"bytes,2,rep,name=supplierList,proto3" json:"supplierList,omitempty"` } func (x *GenesisState) Reset() { @@ -638,7 +639,7 @@ func (x *GenesisState) GetParams() *Params { return nil } -func (x *GenesisState) GetSupplierList() []*Supplier { +func (x *GenesisState) GetSupplierList() []*shared.Supplier { if x != nil { return x.SupplierList } @@ -655,30 +656,30 @@ var file_poktroll_supplier_genesis_proto_rawDesc = []byte{ 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x93, 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, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 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, 0x45, - 0x0a, 0x0c, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x4c, 0x69, 0x73, 0x74, 0x42, 0xae, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, - 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 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, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 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, 0x43, 0x0a, 0x0c, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c, 0x69, 0x73, + 0x74, 0x42, 0xae, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0c, 0x47, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, + 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -695,13 +696,13 @@ func file_poktroll_supplier_genesis_proto_rawDescGZIP() []byte { var file_poktroll_supplier_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_poktroll_supplier_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: poktroll.supplier.GenesisState - (*Params)(nil), // 1: poktroll.supplier.Params - (*Supplier)(nil), // 2: poktroll.supplier.Supplier + (*GenesisState)(nil), // 0: poktroll.supplier.GenesisState + (*Params)(nil), // 1: poktroll.supplier.Params + (*shared.Supplier)(nil), // 2: poktroll.shared.Supplier } var file_poktroll_supplier_genesis_proto_depIdxs = []int32{ 1, // 0: poktroll.supplier.GenesisState.params:type_name -> poktroll.supplier.Params - 2, // 1: poktroll.supplier.GenesisState.supplierList:type_name -> poktroll.supplier.Supplier + 2, // 1: poktroll.supplier.GenesisState.supplierList:type_name -> poktroll.shared.Supplier 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 @@ -715,7 +716,6 @@ func file_poktroll_supplier_genesis_proto_init() { return } file_poktroll_supplier_params_proto_init() - file_poktroll_supplier_supplier_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_supplier_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenesisState); i { diff --git a/api/poktroll/supplier/query.pulsar.go b/api/poktroll/supplier/query.pulsar.go index 2245a83bd..c66f2da6d 100644 --- a/api/poktroll/supplier/query.pulsar.go +++ b/api/poktroll/supplier/query.pulsar.go @@ -8,6 +8,7 @@ import ( fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" + shared "github.com/pokt-network/poktroll/api/poktroll/shared" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" @@ -1385,7 +1386,7 @@ func (x *fastReflection_QueryGetSupplierResponse) Get(descriptor protoreflect.Fi func (x *fastReflection_QueryGetSupplierResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "poktroll.supplier.QueryGetSupplierResponse.supplier": - x.Supplier = value.Message().Interface().(*Supplier) + x.Supplier = value.Message().Interface().(*shared.Supplier) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierResponse")) @@ -1408,7 +1409,7 @@ func (x *fastReflection_QueryGetSupplierResponse) Mutable(fd protoreflect.FieldD switch fd.FullName() { case "poktroll.supplier.QueryGetSupplierResponse.supplier": if x.Supplier == nil { - x.Supplier = new(Supplier) + x.Supplier = new(shared.Supplier) } return protoreflect.ValueOfMessage(x.Supplier.ProtoReflect()) default: @@ -1425,7 +1426,7 @@ func (x *fastReflection_QueryGetSupplierResponse) Mutable(fd protoreflect.FieldD func (x *fastReflection_QueryGetSupplierResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "poktroll.supplier.QueryGetSupplierResponse.supplier": - m := new(Supplier) + m := new(shared.Supplier) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { @@ -1622,7 +1623,7 @@ func (x *fastReflection_QueryGetSupplierResponse) ProtoMethods() *protoiface.Met return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Supplier == nil { - x.Supplier = &Supplier{} + x.Supplier = &shared.Supplier{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Supplier); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err @@ -2101,7 +2102,7 @@ func (x *fastReflection_QueryAllSupplierRequest) ProtoMethods() *protoiface.Meth var _ protoreflect.List = (*_QueryAllSupplierResponse_1_list)(nil) type _QueryAllSupplierResponse_1_list struct { - list *[]*Supplier + list *[]*shared.Supplier } func (x *_QueryAllSupplierResponse_1_list) Len() int { @@ -2117,18 +2118,18 @@ func (x *_QueryAllSupplierResponse_1_list) Get(i int) protoreflect.Value { func (x *_QueryAllSupplierResponse_1_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Supplier) + concreteValue := valueUnwrapped.Interface().(*shared.Supplier) (*x.list)[i] = concreteValue } func (x *_QueryAllSupplierResponse_1_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Supplier) + concreteValue := valueUnwrapped.Interface().(*shared.Supplier) *x.list = append(*x.list, concreteValue) } func (x *_QueryAllSupplierResponse_1_list) AppendMutable() protoreflect.Value { - v := new(Supplier) + v := new(shared.Supplier) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } @@ -2141,7 +2142,7 @@ func (x *_QueryAllSupplierResponse_1_list) Truncate(n int) { } func (x *_QueryAllSupplierResponse_1_list) NewElement() protoreflect.Value { - v := new(Supplier) + v := new(shared.Supplier) return protoreflect.ValueOfMessage(v.ProtoReflect()) } @@ -2351,7 +2352,7 @@ func (x *fastReflection_QueryAllSupplierResponse) Mutable(fd protoreflect.FieldD switch fd.FullName() { case "poktroll.supplier.QueryAllSupplierResponse.supplier": if x.Supplier == nil { - x.Supplier = []*Supplier{} + x.Supplier = []*shared.Supplier{} } value := &_QueryAllSupplierResponse_1_list{list: &x.Supplier} return protoreflect.ValueOfList(value) @@ -2374,7 +2375,7 @@ func (x *fastReflection_QueryAllSupplierResponse) Mutable(fd protoreflect.FieldD func (x *fastReflection_QueryAllSupplierResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "poktroll.supplier.QueryAllSupplierResponse.supplier": - list := []*Supplier{} + list := []*shared.Supplier{} return protoreflect.ValueOfList(&_QueryAllSupplierResponse_1_list{list: &list}) case "poktroll.supplier.QueryAllSupplierResponse.pagination": m := new(v1beta1.PageResponse) @@ -2595,7 +2596,7 @@ func (x *fastReflection_QueryAllSupplierResponse) ProtoMethods() *protoiface.Met if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Supplier = append(x.Supplier, &Supplier{}) + x.Supplier = append(x.Supplier, &shared.Supplier{}) if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Supplier[len(x.Supplier)-1]); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } @@ -2788,7 +2789,7 @@ type QueryGetSupplierResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Supplier *Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` + Supplier *shared.Supplier `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` } func (x *QueryGetSupplierResponse) Reset() { @@ -2811,7 +2812,7 @@ func (*QueryGetSupplierResponse) Descriptor() ([]byte, []int) { return file_poktroll_supplier_query_proto_rawDescGZIP(), []int{3} } -func (x *QueryGetSupplierResponse) GetSupplier() *Supplier { +func (x *QueryGetSupplierResponse) GetSupplier() *shared.Supplier { if x != nil { return x.Supplier } @@ -2858,7 +2859,7 @@ type QueryAllSupplierResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Supplier []*Supplier `protobuf:"bytes,1,rep,name=supplier,proto3" json:"supplier,omitempty"` + Supplier []*shared.Supplier `protobuf:"bytes,1,rep,name=supplier,proto3" json:"supplier,omitempty"` Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -2882,7 +2883,7 @@ func (*QueryAllSupplierResponse) Descriptor() ([]byte, []int) { return file_poktroll_supplier_query_proto_rawDescGZIP(), []int{5} } -func (x *QueryAllSupplierResponse) GetSupplier() []*Supplier { +func (x *QueryAllSupplierResponse) GetSupplier() []*shared.Supplier { if x != nil { return x.Supplier } @@ -2911,83 +2912,83 @@ var file_poktroll_supplier_query_proto_rawDesc = []byte{ 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x2f, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x59, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3d, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x04, - 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, 0x61, - 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 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, 0xa2, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, - 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x04, 0xc8, - 0xde, 0x1f, 0x00, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0xcc, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x12, 0x87, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x28, 0x12, 0x26, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, + 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x2f, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 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, 0x57, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, + 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, 0x61, 0x0a, 0x17, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0xa0, 0x01, + 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x73, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0xcc, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x87, 0x01, 0x0a, 0x06, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x70, + 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x9d, 0x01, 0x0a, 0x08, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x12, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x32, 0x12, 0x30, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x9d, 0x01, 0x0a, 0x08, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, - 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x2f, 0x7b, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x7d, 0x12, 0x98, 0x01, 0x0a, 0x0b, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x12, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x70, 0x6f, - 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0xac, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, - 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, - 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x7b, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x7d, 0x12, 0x98, 0x01, 0x0a, 0x0b, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x41, 0x6c, 0x6c, 0x12, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, + 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, + 0xac, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, + 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3011,15 +3012,15 @@ var file_poktroll_supplier_query_proto_goTypes = []interface{}{ (*QueryAllSupplierRequest)(nil), // 4: poktroll.supplier.QueryAllSupplierRequest (*QueryAllSupplierResponse)(nil), // 5: poktroll.supplier.QueryAllSupplierResponse (*Params)(nil), // 6: poktroll.supplier.Params - (*Supplier)(nil), // 7: poktroll.supplier.Supplier + (*shared.Supplier)(nil), // 7: poktroll.shared.Supplier (*v1beta1.PageRequest)(nil), // 8: cosmos.base.query.v1beta1.PageRequest (*v1beta1.PageResponse)(nil), // 9: cosmos.base.query.v1beta1.PageResponse } var file_poktroll_supplier_query_proto_depIdxs = []int32{ 6, // 0: poktroll.supplier.QueryParamsResponse.params:type_name -> poktroll.supplier.Params - 7, // 1: poktroll.supplier.QueryGetSupplierResponse.supplier:type_name -> poktroll.supplier.Supplier + 7, // 1: poktroll.supplier.QueryGetSupplierResponse.supplier:type_name -> poktroll.shared.Supplier 8, // 2: poktroll.supplier.QueryAllSupplierRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 7, // 3: poktroll.supplier.QueryAllSupplierResponse.supplier:type_name -> poktroll.supplier.Supplier + 7, // 3: poktroll.supplier.QueryAllSupplierResponse.supplier:type_name -> poktroll.shared.Supplier 9, // 4: poktroll.supplier.QueryAllSupplierResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse 0, // 5: poktroll.supplier.Query.Params:input_type -> poktroll.supplier.QueryParamsRequest 2, // 6: poktroll.supplier.Query.Supplier:input_type -> poktroll.supplier.QueryGetSupplierRequest @@ -3040,7 +3041,6 @@ func file_poktroll_supplier_query_proto_init() { return } file_poktroll_supplier_params_proto_init() - file_poktroll_supplier_supplier_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_supplier_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParamsRequest); i { diff --git a/proto/buf.gen.pulsar.yaml b/proto/buf.gen.pulsar.yaml index 89a67f2b2..1fcae879e 100644 --- a/proto/buf.gen.pulsar.yaml +++ b/proto/buf.gen.pulsar.yaml @@ -16,7 +16,7 @@ managed: plugins: - name: go-pulsar out: ./api - opt: paths=source_relative,Mpoktroll/shared/service.proto=github.com/pokt-network/poktroll/api/poktroll/shared + opt: paths=source_relative,Mpoktroll/shared/service.proto=github.com/pokt-network/poktroll/api/poktroll/shared,Mpoktroll/shared/supplier.proto=github.com/pokt-network/poktroll/api/poktroll/shared - name: go-grpc out: ./api opt: paths=source_relative diff --git a/proto/poktroll/supplier/supplier.proto b/proto/poktroll/shared/supplier.proto similarity index 72% rename from proto/poktroll/supplier/supplier.proto rename to proto/poktroll/shared/supplier.proto index f4bdf8226..122e78000 100644 --- a/proto/poktroll/supplier/supplier.proto +++ b/proto/poktroll/shared/supplier.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package poktroll.supplier; +package poktroll.shared; -option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; +option go_package = "github.com/pokt-network/poktroll/x/shared/types"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/proto/poktroll/supplier/genesis.proto b/proto/poktroll/supplier/genesis.proto index 1ae2bd210..5970cc005 100644 --- a/proto/poktroll/supplier/genesis.proto +++ b/proto/poktroll/supplier/genesis.proto @@ -5,15 +5,15 @@ package poktroll.supplier; import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "poktroll/supplier/params.proto"; -import "poktroll/supplier/supplier.proto"; +import "poktroll/shared/supplier.proto"; option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; // GenesisState defines the supplier module's genesis state. message GenesisState { - + // params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - repeated Supplier supplierList = 2 [(gogoproto.nullable) = false] ; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated poktroll.shared.Supplier supplierList = 2 [(gogoproto.nullable) = false] ; } diff --git a/proto/poktroll/supplier/query.proto b/proto/poktroll/supplier/query.proto index a43fd9a68..0f1b27663 100644 --- a/proto/poktroll/supplier/query.proto +++ b/proto/poktroll/supplier/query.proto @@ -7,7 +7,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "poktroll/supplier/params.proto"; -import "poktroll/supplier/supplier.proto"; +import "poktroll/shared/supplier.proto"; import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; @@ -46,7 +46,7 @@ message QueryGetSupplierRequest { } message QueryGetSupplierResponse { - Supplier supplier = 1 [(gogoproto.nullable) = false]; + poktroll.shared.Supplier supplier = 1 [(gogoproto.nullable) = false]; } message QueryAllSupplierRequest { @@ -54,7 +54,7 @@ message QueryAllSupplierRequest { } message QueryAllSupplierResponse { - repeated Supplier supplier = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated poktroll.shared.Supplier supplier = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } diff --git a/x/supplier/keeper/query_supplier.go b/x/supplier/keeper/query_supplier.go index 598b719f5..33bdb0b0e 100644 --- a/x/supplier/keeper/query_supplier.go +++ b/x/supplier/keeper/query_supplier.go @@ -6,9 +6,11 @@ import ( "cosmossdk.io/store/prefix" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/pokt-network/poktroll/x/supplier/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + "github.com/pokt-network/poktroll/x/supplier/types" ) func (k Keeper) SupplierAll(ctx context.Context, req *types.QueryAllSupplierRequest) (*types.QueryAllSupplierResponse, error) { @@ -16,13 +18,13 @@ func (k Keeper) SupplierAll(ctx context.Context, req *types.QueryAllSupplierRequ return nil, status.Error(codes.InvalidArgument, "invalid request") } - var suppliers []types.Supplier + var suppliers []sharedtypes.Supplier store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) supplierStore := prefix.NewStore(store, types.KeyPrefix(types.SupplierKeyPrefix)) pageRes, err := query.Paginate(supplierStore, req.Pagination, func(key []byte, value []byte) error { - var supplier types.Supplier + var supplier sharedtypes.Supplier if err := k.cdc.Unmarshal(value, &supplier); err != nil { return err } From e470fd8b01778e248e03535ef13e07ab300e69e4 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 8 Feb 2024 14:17:58 +0100 Subject: [PATCH 04/29] reconcile: `SupplierServiceConfig` & dep proto types --- api/poktroll/shared/service.pulsar.go | 2013 ++++++++++++++++++++++++- proto/poktroll/shared/service.proto | 38 + 2 files changed, 2030 insertions(+), 21 deletions(-) diff --git a/api/poktroll/shared/service.pulsar.go b/api/poktroll/shared/service.pulsar.go index 8cece2d86..30f0e198d 100644 --- a/api/poktroll/shared/service.pulsar.go +++ b/api/poktroll/shared/service.pulsar.go @@ -496,6 +496,1653 @@ func (x *fastReflection_Service) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_SupplierServiceConfig_2_list)(nil) + +type _SupplierServiceConfig_2_list struct { + list *[]*SupplierEndpoint +} + +func (x *_SupplierServiceConfig_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_SupplierServiceConfig_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_SupplierServiceConfig_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SupplierEndpoint) + (*x.list)[i] = concreteValue +} + +func (x *_SupplierServiceConfig_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SupplierEndpoint) + *x.list = append(*x.list, concreteValue) +} + +func (x *_SupplierServiceConfig_2_list) AppendMutable() protoreflect.Value { + v := new(SupplierEndpoint) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_SupplierServiceConfig_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_SupplierServiceConfig_2_list) NewElement() protoreflect.Value { + v := new(SupplierEndpoint) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_SupplierServiceConfig_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_SupplierServiceConfig protoreflect.MessageDescriptor + fd_SupplierServiceConfig_service protoreflect.FieldDescriptor + fd_SupplierServiceConfig_endpoints protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_shared_service_proto_init() + md_SupplierServiceConfig = File_poktroll_shared_service_proto.Messages().ByName("SupplierServiceConfig") + fd_SupplierServiceConfig_service = md_SupplierServiceConfig.Fields().ByName("service") + fd_SupplierServiceConfig_endpoints = md_SupplierServiceConfig.Fields().ByName("endpoints") +} + +var _ protoreflect.Message = (*fastReflection_SupplierServiceConfig)(nil) + +type fastReflection_SupplierServiceConfig SupplierServiceConfig + +func (x *SupplierServiceConfig) ProtoReflect() protoreflect.Message { + return (*fastReflection_SupplierServiceConfig)(x) +} + +func (x *SupplierServiceConfig) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_shared_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_SupplierServiceConfig_messageType fastReflection_SupplierServiceConfig_messageType +var _ protoreflect.MessageType = fastReflection_SupplierServiceConfig_messageType{} + +type fastReflection_SupplierServiceConfig_messageType struct{} + +func (x fastReflection_SupplierServiceConfig_messageType) Zero() protoreflect.Message { + return (*fastReflection_SupplierServiceConfig)(nil) +} +func (x fastReflection_SupplierServiceConfig_messageType) New() protoreflect.Message { + return new(fastReflection_SupplierServiceConfig) +} +func (x fastReflection_SupplierServiceConfig_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_SupplierServiceConfig +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_SupplierServiceConfig) Descriptor() protoreflect.MessageDescriptor { + return md_SupplierServiceConfig +} + +// 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_SupplierServiceConfig) Type() protoreflect.MessageType { + return _fastReflection_SupplierServiceConfig_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_SupplierServiceConfig) New() protoreflect.Message { + return new(fastReflection_SupplierServiceConfig) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_SupplierServiceConfig) Interface() protoreflect.ProtoMessage { + return (*SupplierServiceConfig)(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_SupplierServiceConfig) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Service != nil { + value := protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + if !f(fd_SupplierServiceConfig_service, value) { + return + } + } + if len(x.Endpoints) != 0 { + value := protoreflect.ValueOfList(&_SupplierServiceConfig_2_list{list: &x.Endpoints}) + if !f(fd_SupplierServiceConfig_endpoints, 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_SupplierServiceConfig) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.shared.SupplierServiceConfig.service": + return x.Service != nil + case "poktroll.shared.SupplierServiceConfig.endpoints": + return len(x.Endpoints) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.SupplierServiceConfig")) + } + panic(fmt.Errorf("message poktroll.shared.SupplierServiceConfig 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_SupplierServiceConfig) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.shared.SupplierServiceConfig.service": + x.Service = nil + case "poktroll.shared.SupplierServiceConfig.endpoints": + x.Endpoints = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.SupplierServiceConfig")) + } + panic(fmt.Errorf("message poktroll.shared.SupplierServiceConfig 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_SupplierServiceConfig) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.shared.SupplierServiceConfig.service": + value := x.Service + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.shared.SupplierServiceConfig.endpoints": + if len(x.Endpoints) == 0 { + return protoreflect.ValueOfList(&_SupplierServiceConfig_2_list{}) + } + listValue := &_SupplierServiceConfig_2_list{list: &x.Endpoints} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.SupplierServiceConfig")) + } + panic(fmt.Errorf("message poktroll.shared.SupplierServiceConfig 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_SupplierServiceConfig) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.shared.SupplierServiceConfig.service": + x.Service = value.Message().Interface().(*Service) + case "poktroll.shared.SupplierServiceConfig.endpoints": + lv := value.List() + clv := lv.(*_SupplierServiceConfig_2_list) + x.Endpoints = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.SupplierServiceConfig")) + } + panic(fmt.Errorf("message poktroll.shared.SupplierServiceConfig 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_SupplierServiceConfig) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.shared.SupplierServiceConfig.service": + if x.Service == nil { + x.Service = new(Service) + } + return protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + case "poktroll.shared.SupplierServiceConfig.endpoints": + if x.Endpoints == nil { + x.Endpoints = []*SupplierEndpoint{} + } + value := &_SupplierServiceConfig_2_list{list: &x.Endpoints} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.SupplierServiceConfig")) + } + panic(fmt.Errorf("message poktroll.shared.SupplierServiceConfig 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_SupplierServiceConfig) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.shared.SupplierServiceConfig.service": + m := new(Service) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.shared.SupplierServiceConfig.endpoints": + list := []*SupplierEndpoint{} + return protoreflect.ValueOfList(&_SupplierServiceConfig_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.SupplierServiceConfig")) + } + panic(fmt.Errorf("message poktroll.shared.SupplierServiceConfig 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_SupplierServiceConfig) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.shared.SupplierServiceConfig", 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_SupplierServiceConfig) 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_SupplierServiceConfig) 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_SupplierServiceConfig) 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_SupplierServiceConfig) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*SupplierServiceConfig) + 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.Service != nil { + l = options.Size(x.Service) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Endpoints) > 0 { + for _, e := range x.Endpoints { + l = options.Size(e) + 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().(*SupplierServiceConfig) + 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.Endpoints) > 0 { + for iNdEx := len(x.Endpoints) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Endpoints[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] = 0x12 + } + } + if x.Service != nil { + encoded, err := options.Marshal(x.Service) + 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().(*SupplierServiceConfig) + 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: SupplierServiceConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SupplierServiceConfig: 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 Service", 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.Service == nil { + x.Service = &Service{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Service); 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 Endpoints", 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.Endpoints = append(x.Endpoints, &SupplierEndpoint{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Endpoints[len(x.Endpoints)-1]); 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 = (*_SupplierEndpoint_3_list)(nil) + +type _SupplierEndpoint_3_list struct { + list *[]*ConfigOption +} + +func (x *_SupplierEndpoint_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_SupplierEndpoint_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_SupplierEndpoint_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ConfigOption) + (*x.list)[i] = concreteValue +} + +func (x *_SupplierEndpoint_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ConfigOption) + *x.list = append(*x.list, concreteValue) +} + +func (x *_SupplierEndpoint_3_list) AppendMutable() protoreflect.Value { + v := new(ConfigOption) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_SupplierEndpoint_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_SupplierEndpoint_3_list) NewElement() protoreflect.Value { + v := new(ConfigOption) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_SupplierEndpoint_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_SupplierEndpoint protoreflect.MessageDescriptor + fd_SupplierEndpoint_url protoreflect.FieldDescriptor + fd_SupplierEndpoint_rpc_type protoreflect.FieldDescriptor + fd_SupplierEndpoint_configs protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_shared_service_proto_init() + md_SupplierEndpoint = File_poktroll_shared_service_proto.Messages().ByName("SupplierEndpoint") + fd_SupplierEndpoint_url = md_SupplierEndpoint.Fields().ByName("url") + fd_SupplierEndpoint_rpc_type = md_SupplierEndpoint.Fields().ByName("rpc_type") + fd_SupplierEndpoint_configs = md_SupplierEndpoint.Fields().ByName("configs") +} + +var _ protoreflect.Message = (*fastReflection_SupplierEndpoint)(nil) + +type fastReflection_SupplierEndpoint SupplierEndpoint + +func (x *SupplierEndpoint) ProtoReflect() protoreflect.Message { + return (*fastReflection_SupplierEndpoint)(x) +} + +func (x *SupplierEndpoint) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_shared_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_SupplierEndpoint_messageType fastReflection_SupplierEndpoint_messageType +var _ protoreflect.MessageType = fastReflection_SupplierEndpoint_messageType{} + +type fastReflection_SupplierEndpoint_messageType struct{} + +func (x fastReflection_SupplierEndpoint_messageType) Zero() protoreflect.Message { + return (*fastReflection_SupplierEndpoint)(nil) +} +func (x fastReflection_SupplierEndpoint_messageType) New() protoreflect.Message { + return new(fastReflection_SupplierEndpoint) +} +func (x fastReflection_SupplierEndpoint_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_SupplierEndpoint +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_SupplierEndpoint) Descriptor() protoreflect.MessageDescriptor { + return md_SupplierEndpoint +} + +// 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_SupplierEndpoint) Type() protoreflect.MessageType { + return _fastReflection_SupplierEndpoint_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_SupplierEndpoint) New() protoreflect.Message { + return new(fastReflection_SupplierEndpoint) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_SupplierEndpoint) Interface() protoreflect.ProtoMessage { + return (*SupplierEndpoint)(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_SupplierEndpoint) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Url != "" { + value := protoreflect.ValueOfString(x.Url) + if !f(fd_SupplierEndpoint_url, value) { + return + } + } + if x.RpcType != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.RpcType)) + if !f(fd_SupplierEndpoint_rpc_type, value) { + return + } + } + if len(x.Configs) != 0 { + value := protoreflect.ValueOfList(&_SupplierEndpoint_3_list{list: &x.Configs}) + if !f(fd_SupplierEndpoint_configs, 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_SupplierEndpoint) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.shared.SupplierEndpoint.url": + return x.Url != "" + case "poktroll.shared.SupplierEndpoint.rpc_type": + return x.RpcType != 0 + case "poktroll.shared.SupplierEndpoint.configs": + return len(x.Configs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.SupplierEndpoint")) + } + panic(fmt.Errorf("message poktroll.shared.SupplierEndpoint 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_SupplierEndpoint) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.shared.SupplierEndpoint.url": + x.Url = "" + case "poktroll.shared.SupplierEndpoint.rpc_type": + x.RpcType = 0 + case "poktroll.shared.SupplierEndpoint.configs": + x.Configs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.SupplierEndpoint")) + } + panic(fmt.Errorf("message poktroll.shared.SupplierEndpoint 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_SupplierEndpoint) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.shared.SupplierEndpoint.url": + value := x.Url + return protoreflect.ValueOfString(value) + case "poktroll.shared.SupplierEndpoint.rpc_type": + value := x.RpcType + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "poktroll.shared.SupplierEndpoint.configs": + if len(x.Configs) == 0 { + return protoreflect.ValueOfList(&_SupplierEndpoint_3_list{}) + } + listValue := &_SupplierEndpoint_3_list{list: &x.Configs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.SupplierEndpoint")) + } + panic(fmt.Errorf("message poktroll.shared.SupplierEndpoint 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_SupplierEndpoint) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.shared.SupplierEndpoint.url": + x.Url = value.Interface().(string) + case "poktroll.shared.SupplierEndpoint.rpc_type": + x.RpcType = (RPCType)(value.Enum()) + case "poktroll.shared.SupplierEndpoint.configs": + lv := value.List() + clv := lv.(*_SupplierEndpoint_3_list) + x.Configs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.SupplierEndpoint")) + } + panic(fmt.Errorf("message poktroll.shared.SupplierEndpoint 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_SupplierEndpoint) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.shared.SupplierEndpoint.configs": + if x.Configs == nil { + x.Configs = []*ConfigOption{} + } + value := &_SupplierEndpoint_3_list{list: &x.Configs} + return protoreflect.ValueOfList(value) + case "poktroll.shared.SupplierEndpoint.url": + panic(fmt.Errorf("field url of message poktroll.shared.SupplierEndpoint is not mutable")) + case "poktroll.shared.SupplierEndpoint.rpc_type": + panic(fmt.Errorf("field rpc_type of message poktroll.shared.SupplierEndpoint is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.SupplierEndpoint")) + } + panic(fmt.Errorf("message poktroll.shared.SupplierEndpoint 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_SupplierEndpoint) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.shared.SupplierEndpoint.url": + return protoreflect.ValueOfString("") + case "poktroll.shared.SupplierEndpoint.rpc_type": + return protoreflect.ValueOfEnum(0) + case "poktroll.shared.SupplierEndpoint.configs": + list := []*ConfigOption{} + return protoreflect.ValueOfList(&_SupplierEndpoint_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.SupplierEndpoint")) + } + panic(fmt.Errorf("message poktroll.shared.SupplierEndpoint 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_SupplierEndpoint) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.shared.SupplierEndpoint", 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_SupplierEndpoint) 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_SupplierEndpoint) 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_SupplierEndpoint) 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_SupplierEndpoint) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*SupplierEndpoint) + 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.Url) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.RpcType != 0 { + n += 1 + runtime.Sov(uint64(x.RpcType)) + } + if len(x.Configs) > 0 { + for _, e := range x.Configs { + l = options.Size(e) + 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().(*SupplierEndpoint) + 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.Configs) > 0 { + for iNdEx := len(x.Configs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Configs[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.RpcType != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RpcType)) + i-- + dAtA[i] = 0x10 + } + if len(x.Url) > 0 { + i -= len(x.Url) + copy(dAtA[i:], x.Url) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Url))) + 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().(*SupplierEndpoint) + 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: SupplierEndpoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SupplierEndpoint: 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 Url", 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.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RpcType", wireType) + } + x.RpcType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.RpcType |= RPCType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Configs", 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.Configs = append(x.Configs, &ConfigOption{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Configs[len(x.Configs)-1]); 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_ConfigOption protoreflect.MessageDescriptor + fd_ConfigOption_key protoreflect.FieldDescriptor + fd_ConfigOption_value protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_shared_service_proto_init() + md_ConfigOption = File_poktroll_shared_service_proto.Messages().ByName("ConfigOption") + fd_ConfigOption_key = md_ConfigOption.Fields().ByName("key") + fd_ConfigOption_value = md_ConfigOption.Fields().ByName("value") +} + +var _ protoreflect.Message = (*fastReflection_ConfigOption)(nil) + +type fastReflection_ConfigOption ConfigOption + +func (x *ConfigOption) ProtoReflect() protoreflect.Message { + return (*fastReflection_ConfigOption)(x) +} + +func (x *ConfigOption) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_shared_service_proto_msgTypes[3] + 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_ConfigOption_messageType fastReflection_ConfigOption_messageType +var _ protoreflect.MessageType = fastReflection_ConfigOption_messageType{} + +type fastReflection_ConfigOption_messageType struct{} + +func (x fastReflection_ConfigOption_messageType) Zero() protoreflect.Message { + return (*fastReflection_ConfigOption)(nil) +} +func (x fastReflection_ConfigOption_messageType) New() protoreflect.Message { + return new(fastReflection_ConfigOption) +} +func (x fastReflection_ConfigOption_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ConfigOption +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ConfigOption) Descriptor() protoreflect.MessageDescriptor { + return md_ConfigOption +} + +// 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_ConfigOption) Type() protoreflect.MessageType { + return _fastReflection_ConfigOption_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ConfigOption) New() protoreflect.Message { + return new(fastReflection_ConfigOption) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ConfigOption) Interface() protoreflect.ProtoMessage { + return (*ConfigOption)(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_ConfigOption) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Key != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Key)) + if !f(fd_ConfigOption_key, value) { + return + } + } + if x.Value != "" { + value := protoreflect.ValueOfString(x.Value) + if !f(fd_ConfigOption_value, 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_ConfigOption) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.shared.ConfigOption.key": + return x.Key != 0 + case "poktroll.shared.ConfigOption.value": + return x.Value != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.ConfigOption")) + } + panic(fmt.Errorf("message poktroll.shared.ConfigOption 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_ConfigOption) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.shared.ConfigOption.key": + x.Key = 0 + case "poktroll.shared.ConfigOption.value": + x.Value = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.ConfigOption")) + } + panic(fmt.Errorf("message poktroll.shared.ConfigOption 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_ConfigOption) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.shared.ConfigOption.key": + value := x.Key + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "poktroll.shared.ConfigOption.value": + value := x.Value + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.ConfigOption")) + } + panic(fmt.Errorf("message poktroll.shared.ConfigOption 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_ConfigOption) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.shared.ConfigOption.key": + x.Key = (ConfigOptions)(value.Enum()) + case "poktroll.shared.ConfigOption.value": + x.Value = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.ConfigOption")) + } + panic(fmt.Errorf("message poktroll.shared.ConfigOption 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_ConfigOption) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.shared.ConfigOption.key": + panic(fmt.Errorf("field key of message poktroll.shared.ConfigOption is not mutable")) + case "poktroll.shared.ConfigOption.value": + panic(fmt.Errorf("field value of message poktroll.shared.ConfigOption is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.ConfigOption")) + } + panic(fmt.Errorf("message poktroll.shared.ConfigOption 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_ConfigOption) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.shared.ConfigOption.key": + return protoreflect.ValueOfEnum(0) + case "poktroll.shared.ConfigOption.value": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.ConfigOption")) + } + panic(fmt.Errorf("message poktroll.shared.ConfigOption 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_ConfigOption) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.shared.ConfigOption", 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_ConfigOption) 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_ConfigOption) 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_ConfigOption) 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_ConfigOption) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ConfigOption) + 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.Key != 0 { + n += 1 + runtime.Sov(uint64(x.Key)) + } + l = len(x.Value) + 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().(*ConfigOption) + 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.Value) > 0 { + i -= len(x.Value) + copy(dAtA[i:], x.Value) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Value))) + i-- + dAtA[i] = 0x12 + } + if x.Key != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Key)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ConfigOption) + 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: ConfigOption: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConfigOption: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + x.Key = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Key |= ConfigOptions(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Value", 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.Value = 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 @@ -512,6 +2159,110 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// Enum to define RPC types +type RPCType int32 + +const ( + RPCType_UNKNOWN_RPC RPCType = 0 // Undefined RPC type + RPCType_GRPC RPCType = 1 // gRPC + RPCType_WEBSOCKET RPCType = 2 // WebSocket + RPCType_JSON_RPC RPCType = 3 // JSON-RPC + RPCType_REST RPCType = 4 // REST +) + +// Enum value maps for RPCType. +var ( + RPCType_name = map[int32]string{ + 0: "UNKNOWN_RPC", + 1: "GRPC", + 2: "WEBSOCKET", + 3: "JSON_RPC", + 4: "REST", + } + RPCType_value = map[string]int32{ + "UNKNOWN_RPC": 0, + "GRPC": 1, + "WEBSOCKET": 2, + "JSON_RPC": 3, + "REST": 4, + } +) + +func (x RPCType) Enum() *RPCType { + p := new(RPCType) + *p = x + return p +} + +func (x RPCType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RPCType) Descriptor() protoreflect.EnumDescriptor { + return file_poktroll_shared_service_proto_enumTypes[0].Descriptor() +} + +func (RPCType) Type() protoreflect.EnumType { + return &file_poktroll_shared_service_proto_enumTypes[0] +} + +func (x RPCType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RPCType.Descriptor instead. +func (RPCType) EnumDescriptor() ([]byte, []int) { + return file_poktroll_shared_service_proto_rawDescGZIP(), []int{0} +} + +// Enum to define configuration options +// TODO_RESEARCH: Should these be configs, SLAs or something else? There will be more discussion once we get closer to implementing on-chain QoS. +type ConfigOptions int32 + +const ( + ConfigOptions_UNKNOWN_CONFIG ConfigOptions = 0 // Undefined config option + ConfigOptions_TIMEOUT ConfigOptions = 1 // Timeout setting +) + +// Enum value maps for ConfigOptions. +var ( + ConfigOptions_name = map[int32]string{ + 0: "UNKNOWN_CONFIG", + 1: "TIMEOUT", + } + ConfigOptions_value = map[string]int32{ + "UNKNOWN_CONFIG": 0, + "TIMEOUT": 1, + } +) + +func (x ConfigOptions) Enum() *ConfigOptions { + p := new(ConfigOptions) + *p = x + return p +} + +func (x ConfigOptions) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ConfigOptions) Descriptor() protoreflect.EnumDescriptor { + return file_poktroll_shared_service_proto_enumTypes[1].Descriptor() +} + +func (ConfigOptions) Type() protoreflect.EnumType { + return &file_poktroll_shared_service_proto_enumTypes[1] +} + +func (x ConfigOptions) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ConfigOptions.Descriptor instead. +func (ConfigOptions) EnumDescriptor() ([]byte, []int) { + return file_poktroll_shared_service_proto_rawDescGZIP(), []int{1} +} + // Service message to encapsulate unique and semantic identifiers for a service on the network type Service struct { state protoimpl.MessageState @@ -558,6 +2309,146 @@ func (x *Service) GetName() string { return "" } +// SupplierServiceConfig holds the service configuration the supplier stakes for +type SupplierServiceConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` // The Service for which the supplier is configured + Endpoints []*SupplierEndpoint `protobuf:"bytes,2,rep,name=endpoints,proto3" json:"endpoints,omitempty"` // List of endpoints for the service +} + +func (x *SupplierServiceConfig) Reset() { + *x = SupplierServiceConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_shared_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SupplierServiceConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SupplierServiceConfig) ProtoMessage() {} + +// Deprecated: Use SupplierServiceConfig.ProtoReflect.Descriptor instead. +func (*SupplierServiceConfig) Descriptor() ([]byte, []int) { + return file_poktroll_shared_service_proto_rawDescGZIP(), []int{1} +} + +func (x *SupplierServiceConfig) GetService() *Service { + if x != nil { + return x.Service + } + return nil +} + +func (x *SupplierServiceConfig) GetEndpoints() []*SupplierEndpoint { + if x != nil { + return x.Endpoints + } + return nil +} + +// SupplierEndpoint message to hold service configuration details +type SupplierEndpoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // URL of the endpoint + RpcType RPCType `protobuf:"varint,2,opt,name=rpc_type,json=rpcType,proto3,enum=poktroll.shared.RPCType" json:"rpc_type,omitempty"` // Type of RPC exposed on the url above + Configs []*ConfigOption `protobuf:"bytes,3,rep,name=configs,proto3" json:"configs,omitempty"` // Additional configuration options for the endpoint +} + +func (x *SupplierEndpoint) Reset() { + *x = SupplierEndpoint{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_shared_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SupplierEndpoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SupplierEndpoint) ProtoMessage() {} + +// Deprecated: Use SupplierEndpoint.ProtoReflect.Descriptor instead. +func (*SupplierEndpoint) Descriptor() ([]byte, []int) { + return file_poktroll_shared_service_proto_rawDescGZIP(), []int{2} +} + +func (x *SupplierEndpoint) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *SupplierEndpoint) GetRpcType() RPCType { + if x != nil { + return x.RpcType + } + return RPCType_UNKNOWN_RPC +} + +func (x *SupplierEndpoint) GetConfigs() []*ConfigOption { + if x != nil { + return x.Configs + } + return nil +} + +// Key-value wrapper for config options, as proto maps can't be keyed by enums +type ConfigOption struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key ConfigOptions `protobuf:"varint,1,opt,name=key,proto3,enum=poktroll.shared.ConfigOptions" json:"key,omitempty"` // Config option key + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // Config option value +} + +func (x *ConfigOption) Reset() { + *x = ConfigOption{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_shared_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigOption) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigOption) ProtoMessage() {} + +// Deprecated: Use ConfigOption.ProtoReflect.Descriptor instead. +func (*ConfigOption) Descriptor() ([]byte, []int) { + return file_poktroll_shared_service_proto_rawDescGZIP(), []int{3} +} + +func (x *ConfigOption) GetKey() ConfigOptions { + if x != nil { + return x.Key + } + return ConfigOptions_UNKNOWN_CONFIG +} + +func (x *ConfigOption) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + var File_poktroll_shared_service_proto protoreflect.FileDescriptor var file_poktroll_shared_service_proto_rawDesc = []byte{ @@ -566,18 +2457,50 @@ var file_poktroll_shared_service_proto_rawDesc = []byte{ 0x0f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x22, 0x2d, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, - 0xa2, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, - 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, - 0x64, 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, - 0x72, 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, - 0x68, 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x68, - 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, + 0x8c, 0x01, 0x0a, 0x15, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x32, 0x0a, 0x07, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3f, 0x0a, + 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, + 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x92, + 0x01, 0x0a, 0x10, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x33, 0x0a, 0x08, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x52, 0x50, 0x43, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x07, 0x72, 0x70, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x73, 0x22, 0x56, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, + 0x65, 0x64, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x4b, 0x0a, 0x07, 0x52, + 0x50, 0x43, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x5f, 0x52, 0x50, 0x43, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x10, + 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x45, 0x42, 0x53, 0x4f, 0x43, 0x4b, 0x45, 0x54, 0x10, 0x02, + 0x12, 0x0c, 0x0a, 0x08, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x52, 0x50, 0x43, 0x10, 0x03, 0x12, 0x08, + 0x0a, 0x04, 0x52, 0x45, 0x53, 0x54, 0x10, 0x04, 0x2a, 0x30, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x00, 0x12, 0x0b, 0x0a, + 0x07, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, 0x01, 0x42, 0xa2, 0x01, 0x0a, 0x13, 0x63, + 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, + 0x65, 0x64, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x64, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xca, 0x02, 0x0f, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xe2, 0x02, + 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -592,16 +2515,27 @@ func file_poktroll_shared_service_proto_rawDescGZIP() []byte { return file_poktroll_shared_service_proto_rawDescData } -var file_poktroll_shared_service_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_shared_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_poktroll_shared_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_poktroll_shared_service_proto_goTypes = []interface{}{ - (*Service)(nil), // 0: poktroll.shared.Service + (RPCType)(0), // 0: poktroll.shared.RPCType + (ConfigOptions)(0), // 1: poktroll.shared.ConfigOptions + (*Service)(nil), // 2: poktroll.shared.Service + (*SupplierServiceConfig)(nil), // 3: poktroll.shared.SupplierServiceConfig + (*SupplierEndpoint)(nil), // 4: poktroll.shared.SupplierEndpoint + (*ConfigOption)(nil), // 5: poktroll.shared.ConfigOption } var file_poktroll_shared_service_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 + 2, // 0: poktroll.shared.SupplierServiceConfig.service:type_name -> poktroll.shared.Service + 4, // 1: poktroll.shared.SupplierServiceConfig.endpoints:type_name -> poktroll.shared.SupplierEndpoint + 0, // 2: poktroll.shared.SupplierEndpoint.rpc_type:type_name -> poktroll.shared.RPCType + 5, // 3: poktroll.shared.SupplierEndpoint.configs:type_name -> poktroll.shared.ConfigOption + 1, // 4: poktroll.shared.ConfigOption.key:type_name -> poktroll.shared.ConfigOptions + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_poktroll_shared_service_proto_init() } @@ -622,19 +2556,56 @@ func file_poktroll_shared_service_proto_init() { return nil } } + file_poktroll_shared_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SupplierServiceConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_shared_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SupplierEndpoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_shared_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigOption); 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_poktroll_shared_service_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, + NumEnums: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, GoTypes: file_poktroll_shared_service_proto_goTypes, DependencyIndexes: file_poktroll_shared_service_proto_depIdxs, + EnumInfos: file_poktroll_shared_service_proto_enumTypes, MessageInfos: file_poktroll_shared_service_proto_msgTypes, }.Build() File_poktroll_shared_service_proto = out.File diff --git a/proto/poktroll/shared/service.proto b/proto/poktroll/shared/service.proto index 60a046eac..249db3f0a 100644 --- a/proto/poktroll/shared/service.proto +++ b/proto/poktroll/shared/service.proto @@ -17,3 +17,41 @@ message Service { string name = 2; // (Optional) Semantic human readable name for the service } +// SupplierServiceConfig holds the service configuration the supplier stakes for +message SupplierServiceConfig { + Service service = 1; // The Service for which the supplier is configured + repeated SupplierEndpoint endpoints = 2; // List of endpoints for the service + // TODO_RESEARCH: There is an opportunity for supplier to advertise the min + // they're willing to earn for a certain configuration/price, but this is outside of scope. +} + +// SupplierEndpoint message to hold service configuration details +message SupplierEndpoint { + string url = 1; // URL of the endpoint + RPCType rpc_type = 2; // Type of RPC exposed on the url above + repeated ConfigOption configs = 3; // Additional configuration options for the endpoint +} + +// Enum to define RPC types +enum RPCType { + UNKNOWN_RPC = 0; // Undefined RPC type + GRPC = 1; // gRPC + WEBSOCKET = 2; // WebSocket + JSON_RPC = 3; // JSON-RPC + REST = 4; // REST + // Add new RPC types here as needed +} + +// Enum to define configuration options +// TODO_RESEARCH: Should these be configs, SLAs or something else? There will be more discussion once we get closer to implementing on-chain QoS. +enum ConfigOptions { + UNKNOWN_CONFIG = 0; // Undefined config option + TIMEOUT = 1; // Timeout setting + // Add new config options here as needed +} + +// Key-value wrapper for config options, as proto maps can't be keyed by enums +message ConfigOption { + ConfigOptions key = 1; // Config option key + string value = 2; // Config option value +} From 237952779c9c455b9036a6a7d48e2619fc65ddec Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 8 Feb 2024 15:07:12 +0100 Subject: [PATCH 05/29] reconcile: `Suppler` proto type --- api/poktroll/shared/supplier.pulsar.go | 257 +++++++++++++------------ proto/poktroll/shared/supplier.proto | 15 +- 2 files changed, 143 insertions(+), 129 deletions(-) diff --git a/api/poktroll/shared/supplier.pulsar.go b/api/poktroll/shared/supplier.pulsar.go index ee0b7abd4..a0e0c637e 100644 --- a/api/poktroll/shared/supplier.pulsar.go +++ b/api/poktroll/shared/supplier.pulsar.go @@ -4,6 +4,7 @@ package shared import ( v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -14,9 +15,59 @@ import ( sync "sync" ) +var _ protoreflect.List = (*_Supplier_3_list)(nil) + +type _Supplier_3_list struct { + list *[]*SupplierServiceConfig +} + +func (x *_Supplier_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Supplier_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Supplier_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SupplierServiceConfig) + (*x.list)[i] = concreteValue +} + +func (x *_Supplier_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SupplierServiceConfig) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Supplier_3_list) AppendMutable() protoreflect.Value { + v := new(SupplierServiceConfig) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Supplier_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Supplier_3_list) NewElement() protoreflect.Value { + v := new(SupplierServiceConfig) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Supplier_3_list) IsValid() bool { + return x.list != nil +} + var ( md_Supplier protoreflect.MessageDescriptor - fd_Supplier_index protoreflect.FieldDescriptor fd_Supplier_address protoreflect.FieldDescriptor fd_Supplier_stake protoreflect.FieldDescriptor fd_Supplier_services protoreflect.FieldDescriptor @@ -25,7 +76,6 @@ var ( func init() { file_poktroll_shared_supplier_proto_init() md_Supplier = File_poktroll_shared_supplier_proto.Messages().ByName("Supplier") - fd_Supplier_index = md_Supplier.Fields().ByName("index") fd_Supplier_address = md_Supplier.Fields().ByName("address") fd_Supplier_stake = md_Supplier.Fields().ByName("stake") fd_Supplier_services = md_Supplier.Fields().ByName("services") @@ -96,12 +146,6 @@ func (x *fastReflection_Supplier) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Supplier) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Index != "" { - value := protoreflect.ValueOfString(x.Index) - if !f(fd_Supplier_index, value) { - return - } - } if x.Address != "" { value := protoreflect.ValueOfString(x.Address) if !f(fd_Supplier_address, value) { @@ -114,8 +158,8 @@ func (x *fastReflection_Supplier) Range(f func(protoreflect.FieldDescriptor, pro return } } - if x.Services != "" { - value := protoreflect.ValueOfString(x.Services) + if len(x.Services) != 0 { + value := protoreflect.ValueOfList(&_Supplier_3_list{list: &x.Services}) if !f(fd_Supplier_services, value) { return } @@ -135,14 +179,12 @@ func (x *fastReflection_Supplier) Range(f func(protoreflect.FieldDescriptor, pro // a repeated field is populated if it is non-empty. func (x *fastReflection_Supplier) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.shared.Supplier.index": - return x.Index != "" case "poktroll.shared.Supplier.address": return x.Address != "" case "poktroll.shared.Supplier.stake": return x.Stake != nil case "poktroll.shared.Supplier.services": - return x.Services != "" + return len(x.Services) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) @@ -159,14 +201,12 @@ func (x *fastReflection_Supplier) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Supplier) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.shared.Supplier.index": - x.Index = "" case "poktroll.shared.Supplier.address": x.Address = "" case "poktroll.shared.Supplier.stake": x.Stake = nil case "poktroll.shared.Supplier.services": - x.Services = "" + x.Services = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) @@ -183,9 +223,6 @@ func (x *fastReflection_Supplier) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Supplier) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.shared.Supplier.index": - value := x.Index - return protoreflect.ValueOfString(value) case "poktroll.shared.Supplier.address": value := x.Address return protoreflect.ValueOfString(value) @@ -193,8 +230,11 @@ func (x *fastReflection_Supplier) Get(descriptor protoreflect.FieldDescriptor) p value := x.Stake return protoreflect.ValueOfMessage(value.ProtoReflect()) case "poktroll.shared.Supplier.services": - value := x.Services - return protoreflect.ValueOfString(value) + if len(x.Services) == 0 { + return protoreflect.ValueOfList(&_Supplier_3_list{}) + } + listValue := &_Supplier_3_list{list: &x.Services} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) @@ -215,14 +255,14 @@ func (x *fastReflection_Supplier) Get(descriptor protoreflect.FieldDescriptor) p // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Supplier) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.shared.Supplier.index": - x.Index = value.Interface().(string) case "poktroll.shared.Supplier.address": x.Address = value.Interface().(string) case "poktroll.shared.Supplier.stake": x.Stake = value.Message().Interface().(*v1beta1.Coin) case "poktroll.shared.Supplier.services": - x.Services = value.Interface().(string) + lv := value.List() + clv := lv.(*_Supplier_3_list) + x.Services = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) @@ -248,12 +288,14 @@ func (x *fastReflection_Supplier) Mutable(fd protoreflect.FieldDescriptor) proto x.Stake = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.Stake.ProtoReflect()) - case "poktroll.shared.Supplier.index": - panic(fmt.Errorf("field index of message poktroll.shared.Supplier is not mutable")) + case "poktroll.shared.Supplier.services": + if x.Services == nil { + x.Services = []*SupplierServiceConfig{} + } + value := &_Supplier_3_list{list: &x.Services} + return protoreflect.ValueOfList(value) case "poktroll.shared.Supplier.address": panic(fmt.Errorf("field address of message poktroll.shared.Supplier is not mutable")) - case "poktroll.shared.Supplier.services": - panic(fmt.Errorf("field services of message poktroll.shared.Supplier is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) @@ -267,15 +309,14 @@ func (x *fastReflection_Supplier) Mutable(fd protoreflect.FieldDescriptor) proto // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Supplier) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.shared.Supplier.index": - return protoreflect.ValueOfString("") case "poktroll.shared.Supplier.address": return protoreflect.ValueOfString("") case "poktroll.shared.Supplier.stake": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "poktroll.shared.Supplier.services": - return protoreflect.ValueOfString("") + list := []*SupplierServiceConfig{} + return protoreflect.ValueOfList(&_Supplier_3_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) @@ -345,10 +386,6 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Index) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -357,9 +394,11 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { l = options.Size(x.Stake) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Services) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.Services) > 0 { + for _, e := range x.Services { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.unknownFields != nil { n += len(x.unknownFields) @@ -391,11 +430,20 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.unknownFields) } if len(x.Services) > 0 { - i -= len(x.Services) - copy(dAtA[i:], x.Services) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Services))) - i-- - dAtA[i] = 0x22 + for iNdEx := len(x.Services) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Services[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.Stake != nil { encoded, err := options.Marshal(x.Stake) @@ -409,20 +457,13 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } if len(x.Address) > 0 { i -= len(x.Address) copy(dAtA[i:], x.Address) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) 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 { @@ -475,38 +516,6 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { } 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 Address", wireType) } @@ -538,7 +547,7 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { } x.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 2: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) } @@ -574,11 +583,11 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -588,23 +597,25 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + 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.Services = string(dAtA[iNdEx:postIndex]) + x.Services = append(x.Services, &SupplierServiceConfig{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Services[len(x.Services)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex default: iNdEx = preIndex @@ -654,15 +665,15 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// Supplier is the type defining the actor in Pocket Network that provides RPC services. type Supplier struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Stake *v1beta1.Coin `protobuf:"bytes,3,opt,name=stake,proto3" json:"stake,omitempty"` - Services string `protobuf:"bytes,4,opt,name=services,proto3" json:"services,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic encoding + Stake *v1beta1.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the supplier has staked + Services []*SupplierServiceConfig `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` // The service configs this supplier can support } func (x *Supplier) Reset() { @@ -685,13 +696,6 @@ func (*Supplier) Descriptor() ([]byte, []int) { return file_poktroll_shared_supplier_proto_rawDescGZIP(), []int{0} } -func (x *Supplier) GetIndex() string { - if x != nil { - return x.Index - } - return "" -} - func (x *Supplier) GetAddress() string { if x != nil { return x.Address @@ -706,11 +710,11 @@ func (x *Supplier) GetStake() *v1beta1.Coin { return nil } -func (x *Supplier) GetServices() string { +func (x *Supplier) GetServices() []*SupplierServiceConfig { if x != nil { return x.Services } - return "" + return nil } var File_poktroll_shared_supplier_proto protoreflect.FileDescriptor @@ -720,17 +724,23 @@ var file_poktroll_shared_supplier_proto_rawDesc = []byte{ 0x64, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, - 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x01, 0x0a, 0x08, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, - 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1d, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xb3, 0x01, 0x0a, 0x08, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x32, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x12, 0x42, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x42, 0xa3, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x0d, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, @@ -759,16 +769,18 @@ func file_poktroll_shared_supplier_proto_rawDescGZIP() []byte { var file_poktroll_shared_supplier_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_poktroll_shared_supplier_proto_goTypes = []interface{}{ - (*Supplier)(nil), // 0: poktroll.shared.Supplier - (*v1beta1.Coin)(nil), // 1: cosmos.base.v1beta1.Coin + (*Supplier)(nil), // 0: poktroll.shared.Supplier + (*v1beta1.Coin)(nil), // 1: cosmos.base.v1beta1.Coin + (*SupplierServiceConfig)(nil), // 2: poktroll.shared.SupplierServiceConfig } var file_poktroll_shared_supplier_proto_depIdxs = []int32{ 1, // 0: poktroll.shared.Supplier.stake:type_name -> cosmos.base.v1beta1.Coin - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 2, // 1: poktroll.shared.Supplier.services:type_name -> poktroll.shared.SupplierServiceConfig + 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 } func init() { file_poktroll_shared_supplier_proto_init() } @@ -776,6 +788,7 @@ func file_poktroll_shared_supplier_proto_init() { if File_poktroll_shared_supplier_proto != nil { return } + file_poktroll_shared_service_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_shared_supplier_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Supplier); i { diff --git a/proto/poktroll/shared/supplier.proto b/proto/poktroll/shared/supplier.proto index 122e78000..42c65eb67 100644 --- a/proto/poktroll/shared/supplier.proto +++ b/proto/poktroll/shared/supplier.proto @@ -2,14 +2,15 @@ syntax = "proto3"; package poktroll.shared; option go_package = "github.com/pokt-network/poktroll/x/shared/types"; -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "poktroll/shared/service.proto"; +// Supplier is the type defining the actor in Pocket Network that provides RPC services. message Supplier { - string index = 1; - string address = 2; - cosmos.base.v1beta1.Coin stake = 3 [(gogoproto.nullable) = false]; - string services = 4; - + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic encoding + cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the supplier has staked + repeated SupplierServiceConfig services = 3; // The service configs this supplier can support } From 35b7505b421d12980449c3f39276799100cb1577 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 13 Feb 2024 16:21:01 +0100 Subject: [PATCH 06/29] reconcile: types genesis --- x/supplier/types/genesis.go | 40 ++++- x/supplier/types/genesis_test.go | 267 ++++++++++++++++++++++++++++++- 2 files changed, 295 insertions(+), 12 deletions(-) diff --git a/x/supplier/types/genesis.go b/x/supplier/types/genesis.go index f6bd94129..9d06b42ff 100644 --- a/x/supplier/types/genesis.go +++ b/x/supplier/types/genesis.go @@ -2,6 +2,12 @@ package types import ( "fmt" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + servicehelpers "github.com/pokt-network/poktroll/x/shared/helpers" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) // DefaultIndex is the default global index @@ -10,7 +16,7 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - SupplierList: []Supplier{}, + SupplierList: []sharedtypes.Supplier{}, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } @@ -21,14 +27,40 @@ func DefaultGenesis() *GenesisState { func (gs GenesisState) Validate() error { // Check for duplicated index in supplier supplierIndexMap := make(map[string]struct{}) - - for _, elem := range gs.SupplierList { - index := string(SupplierKey(elem.Index)) + for _, supplier := range gs.SupplierList { + index := string(SupplierKey(supplier.Address)) if _, ok := supplierIndexMap[index]; ok { return fmt.Errorf("duplicated index for supplier") } supplierIndexMap[index] = struct{}{} } + + // Check that the stake value for the suppliers is valid + for _, supplier := range gs.SupplierList { + // TODO_TECHDEBT: Consider creating shared helpers across the board for stake validation, + // similar to how we have `ValidateAppServiceConfigs` below + if supplier.Stake == nil { + return sdkerrors.Wrapf(ErrSupplierInvalidStake, "nil stake amount for supplier") + } + stake, err := sdk.ParseCoinNormalized(supplier.Stake.String()) + if !stake.IsValid() { + return sdkerrors.Wrapf(ErrSupplierInvalidStake, "invalid stake amount for supplier %v; (%v)", supplier.Stake, stake.Validate()) + } + if err != nil { + return sdkerrors.Wrapf(ErrSupplierInvalidStake, "cannot parse stake amount for supplier %v; (%v)", supplier.Stake, err) + } + if stake.IsZero() || stake.IsNegative() { + return sdkerrors.Wrapf(ErrSupplierInvalidStake, "invalid stake amount for supplier: %v <= 0", supplier.Stake) + } + if stake.Denom != "upokt" { + return sdkerrors.Wrapf(ErrSupplierInvalidStake, "invalid stake amount denom for supplier %v", supplier.Stake) + } + + // Validate the application service configs + if err := servicehelpers.ValidateSupplierServiceConfigs(supplier.Services); err != nil { + return sdkerrors.Wrapf(ErrSupplierInvalidServiceConfig, err.Error()) + } + } // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() diff --git a/x/supplier/types/genesis_test.go b/x/supplier/types/genesis_test.go index a7a5f4e06..282c2b01d 100644 --- a/x/supplier/types/genesis_test.go +++ b/x/supplier/types/genesis_test.go @@ -3,11 +3,48 @@ package types_test import ( "testing" - "github.com/pokt-network/poktroll/x/supplier/types" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/sample" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + "github.com/pokt-network/poktroll/x/supplier/types" ) func TestGenesisState_Validate(t *testing.T) { + addr1 := sample.AccAddress() + stake1 := sdk.NewCoin("upokt", math.NewInt(100)) + serviceConfig1 := &sharedtypes.SupplierServiceConfig{ + Service: &sharedtypes.Service{ + Id: "svcId1", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8081", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + } + serviceList1 := []*sharedtypes.SupplierServiceConfig{serviceConfig1} + + addr2 := sample.AccAddress() + stake2 := sdk.NewCoin("upokt", math.NewInt(100)) + serviceConfig2 := &sharedtypes.SupplierServiceConfig{ + Service: &sharedtypes.Service{ + Id: "svcId2", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8082", + RpcType: sharedtypes.RPCType_GRPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + } + serviceList2 := []*sharedtypes.SupplierServiceConfig{serviceConfig2} + tests := []struct { desc string genState *types.GenesisState @@ -22,12 +59,16 @@ func TestGenesisState_Validate(t *testing.T) { desc: "valid genesis state", genState: &types.GenesisState{ - SupplierList: []types.Supplier{ + SupplierList: []sharedtypes.Supplier{ { - Index: "0", + Address: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Index: "1", + Address: addr2, + Stake: &stake2, + Services: serviceList2, }, }, // this line is used by starport scaffolding # types/genesis/validField @@ -35,14 +76,224 @@ func TestGenesisState_Validate(t *testing.T) { valid: true, }, { - desc: "duplicated supplier", + desc: "invalid - zero supplier stake", + genState: &types.GenesisState{ + SupplierList: []sharedtypes.Supplier{ + { + Address: addr1, + Stake: &stake1, + Services: serviceList1, + }, + { + Address: addr2, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(0)}, + Services: serviceList2, + }, + }, + }, + valid: false, + }, + { + desc: "invalid - negative supplier stake", + genState: &types.GenesisState{ + SupplierList: []sharedtypes.Supplier{ + { + Address: addr1, + Stake: &stake1, + Services: serviceList1, + }, + { + Address: addr2, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(-100)}, + Services: serviceList2, + }, + }, + }, + valid: false, + }, + { + desc: "invalid - wrong stake denom", + genState: &types.GenesisState{ + SupplierList: []sharedtypes.Supplier{ + { + Address: addr1, + Stake: &stake1, + Services: serviceList1, + }, + { + Address: addr2, + Stake: &sdk.Coin{Denom: "invalid", Amount: math.NewInt(100)}, + Services: serviceList2, + }, + }, + }, + valid: false, + }, + { + desc: "invalid - missing denom", + genState: &types.GenesisState{ + SupplierList: []sharedtypes.Supplier{ + { + Address: addr1, + Stake: &stake1, + Services: serviceList1, + }, + { + Address: addr2, + Stake: &sdk.Coin{Denom: "", Amount: math.NewInt(100)}, + Services: serviceList2, + }, + }, + }, + valid: false, + }, + { + desc: "invalid - due to duplicated supplier address", + genState: &types.GenesisState{ + SupplierList: []sharedtypes.Supplier{ + { + Address: addr1, + Stake: &stake1, + Services: serviceList1, + }, + { + Address: addr1, + Stake: &stake2, + Services: serviceList2, + }, + }, + }, + valid: false, + }, + { + desc: "invalid - due to nil supplier stake", + genState: &types.GenesisState{ + SupplierList: []sharedtypes.Supplier{ + { + Address: addr1, + Stake: &stake1, + Services: serviceList1, + }, + { + Address: addr2, + Stake: nil, + Services: serviceList2, + }, + }, + }, + valid: false, + }, + { + desc: "invalid - due to missing supplier stake", + genState: &types.GenesisState{ + SupplierList: []sharedtypes.Supplier{ + { + Address: addr1, + Stake: &stake1, + Services: serviceList1, + }, + { + Address: addr2, + // Explicitly missing stake + Services: serviceList2, + }, + }, + }, + valid: false, + }, + { + desc: "invalid - missing services list", + genState: &types.GenesisState{ + SupplierList: []sharedtypes.Supplier{ + { + Address: addr1, + Stake: &stake1, + Services: serviceList1, + }, + { + Address: addr2, + Stake: &stake2, + // Services: intentionally omitted + }, + }, + }, + valid: false, + }, + { + desc: "invalid - empty services list", + genState: &types.GenesisState{ + SupplierList: []sharedtypes.Supplier{ + { + Address: addr1, + Stake: &stake1, + Services: serviceList1, + }, + { + Address: addr2, + Stake: &stake2, + Services: []*sharedtypes.SupplierServiceConfig{}, + }, + }, + }, + valid: false, + }, + { + desc: "invalid - invalid URL", + genState: &types.GenesisState{ + SupplierList: []sharedtypes.Supplier{ + { + Address: addr1, + Stake: &stake1, + Services: serviceList1, + }, + { + Address: addr2, + Stake: &stake2, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId1", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "invalid URL", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + }, + }, + }, + valid: false, + }, + { + desc: "invalid - invalid RPC Type", genState: &types.GenesisState{ - SupplierList: []types.Supplier{ + SupplierList: []sharedtypes.Supplier{ { - Index: "0", + Address: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Index: "0", + Address: addr2, + Stake: &stake2, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId1", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8081", + RpcType: sharedtypes.RPCType_UNKNOWN_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, }, }, }, From 6de85a9c56e7b6692036e58f655229b554dfe136 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 13 Feb 2024 16:21:52 +0100 Subject: [PATCH 07/29] reconcile: error types --- x/supplier/types/errors.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/x/supplier/types/errors.go b/x/supplier/types/errors.go index 0e998c507..b6424cc9f 100644 --- a/x/supplier/types/errors.go +++ b/x/supplier/types/errors.go @@ -8,6 +8,20 @@ import ( // x/supplier module sentinel errors var ( - ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") - ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") + ErrSupplierInvalidStake = sdkerrors.Register(ModuleName, 1, "invalid supplier stake") + ErrSupplierInvalidAddress = sdkerrors.Register(ModuleName, 2, "invalid address") + ErrSupplierUnauthorized = sdkerrors.Register(ModuleName, 3, "unauthorized supplier signer") + ErrSupplierNotFound = sdkerrors.Register(ModuleName, 4, "supplier not found") + ErrSupplierInvalidServiceConfig = sdkerrors.Register(ModuleName, 5, "invalid service config") + ErrSupplierInvalidSessionStartHeight = sdkerrors.Register(ModuleName, 6, "invalid session start height") + ErrSupplierInvalidSessionId = sdkerrors.Register(ModuleName, 7, "invalid session ID") + ErrSupplierInvalidService = sdkerrors.Register(ModuleName, 8, "invalid service in supplier") + ErrSupplierInvalidClaimRootHash = sdkerrors.Register(ModuleName, 9, "invalid root hash") + ErrSupplierInvalidSessionEndHeight = sdkerrors.Register(ModuleName, 10, "invalid session ending height") + ErrSupplierInvalidQueryRequest = sdkerrors.Register(ModuleName, 11, "invalid query request") + ErrSupplierClaimNotFound = sdkerrors.Register(ModuleName, 12, "claim not found") + ErrSupplierProofNotFound = sdkerrors.Register(ModuleName, 13, "proof not found") + ErrSupplierInvalidProof = sdkerrors.Register(ModuleName, 14, "invalid proof") + ErrSupplierInvalidClosestMerkleProof = sdkerrors.Register(ModuleName, 15, "invalid closest merkle proof") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") ) From c788d7420063c84b3ec215c172a11a4586e43885 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 13 Feb 2024 16:25:45 +0100 Subject: [PATCH 08/29] reconcile: shared service helpers (1/2) --- x/shared/helpers/service.go | 86 +++++++++ x/shared/helpers/service_configs.go | 82 +++++++++ x/shared/helpers/service_test.go | 261 ++++++++++++++++++++++++++++ 3 files changed, 429 insertions(+) create mode 100644 x/shared/helpers/service.go create mode 100644 x/shared/helpers/service_configs.go create mode 100644 x/shared/helpers/service_test.go diff --git a/x/shared/helpers/service.go b/x/shared/helpers/service.go new file mode 100644 index 000000000..9825f26d4 --- /dev/null +++ b/x/shared/helpers/service.go @@ -0,0 +1,86 @@ +package helpers + +import ( + "net/url" + "regexp" + + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" +) + +const ( + maxServiceIdLength = 8 // Limiting all serviceIds to 8 characters + maxServiceIdName = 42 // Limit the the name of the + + regexServiceId = "^[a-zA-Z0-9_-]+$" // Define the regex pattern to match allowed characters + regexServiceName = "^[a-zA-Z0-9-_ ]+$" // Define the regex pattern to match allowed characters (allows spaces) +) + +var ( + regexExprServiceId *regexp.Regexp + regexExprServiceName *regexp.Regexp +) + +func init() { + // Compile the regex pattern + regexExprServiceId = regexp.MustCompile(regexServiceId) + regexExprServiceName = regexp.MustCompile(regexServiceName) + +} + +// IsValidService checks if the provided ServiceId struct has valid fields +func IsValidService(service *sharedtypes.Service) bool { + // Check if service Id and Name are valid using the provided helper functions + return service != nil && + IsValidServiceId(service.Id) && + IsValidServiceName(service.Name) +} + +// IsValidServiceId checks if the input string is a valid serviceId +func IsValidServiceId(serviceId string) bool { + // ServiceId CANNOT be empty + if len(serviceId) == 0 { + return false + } + + if len(serviceId) > maxServiceIdLength { + return false + } + + // Use the regex to match against the input string + return regexExprServiceId.MatchString(serviceId) +} + +// IsValidServiceName checks if the input string is a valid serviceName +func IsValidServiceName(serviceName string) bool { + // ServiceName CAN be empty + if len(serviceName) == 0 { + return true + } + + if len(serviceName) > maxServiceIdName { + return false + } + + // Use the regex to match against the input string + return regexExprServiceName.MatchString(serviceName) +} + +// IsValidEndpointUrl checks if the provided string is a valid URL. +func IsValidEndpointUrl(endpoint string) bool { + u, err := url.Parse(endpoint) + if err != nil { + return false + } + + // Check if scheme is http or https + if u.Scheme != "http" && u.Scheme != "https" { + return false + } + + // Ensure the URL has a host + if u.Host == "" { + return false + } + + return true +} diff --git a/x/shared/helpers/service_configs.go b/x/shared/helpers/service_configs.go new file mode 100644 index 000000000..2719c224f --- /dev/null +++ b/x/shared/helpers/service_configs.go @@ -0,0 +1,82 @@ +package helpers + +import ( + "fmt" + + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" +) + +// TODO_IN_THIS_COMMIT: uncomment +//// ValidateAppServiceConfigs returns an error if any of the application service configs are invalid +//func ValidateAppServiceConfigs(services []*sharedtypes.ApplicationServiceConfig) error { +// if len(services) == 0 { +// return fmt.Errorf("no services configs provided for application: %v", services) +// } +// for _, serviceConfig := range services { +// if serviceConfig == nil { +// return fmt.Errorf("serviceConfig cannot be nil: %v", services) +// } +// // Check the Service +// if !IsValidService(serviceConfig.Service) { +// return fmt.Errorf("invalid service: %v", serviceConfig.Service) +// } +// } +// return nil +//} + +// ValidateSupplierServiceConfigs returns an error if any of the supplier service configs are invalid +func ValidateSupplierServiceConfigs(services []*sharedtypes.SupplierServiceConfig) error { + if len(services) == 0 { + return fmt.Errorf("no services provided for supplier: %v", services) + } + for _, serviceConfig := range services { + if serviceConfig == nil { + return fmt.Errorf("serviceConfig cannot be nil: %v", services) + } + + // Check the Service + if !IsValidService(serviceConfig.Service) { + return fmt.Errorf("invalid service: %v", serviceConfig.Service) + } + + // Check the Endpoints + if serviceConfig.Endpoints == nil { + return fmt.Errorf("endpoints cannot be nil: %v", serviceConfig) + } + if len(serviceConfig.Endpoints) == 0 { + return fmt.Errorf("endpoints must have at least one entry: %v", serviceConfig) + } + + // Check each endpoint + for _, endpoint := range serviceConfig.Endpoints { + if endpoint == nil { + return fmt.Errorf("endpoint cannot be nil: %v", serviceConfig) + } + + // Validate the URL + if endpoint.Url == "" { + return fmt.Errorf("endpoint.Url cannot be empty: %v", serviceConfig) + } + if !IsValidEndpointUrl(endpoint.Url) { + return fmt.Errorf("invalid endpoint.Url: %v", serviceConfig) + } + + // Validate the RPC type + if endpoint.RpcType == sharedtypes.RPCType_UNKNOWN_RPC { + return fmt.Errorf("endpoint.RpcType cannot be UNKNOWN_RPC: %v", serviceConfig) + } + if _, ok := sharedtypes.RPCType_name[int32(endpoint.RpcType)]; !ok { + return fmt.Errorf("endpoint.RpcType is not a valid RPCType: %v", serviceConfig) + } + + // TODO: Validate configs once they are being used + // if endpoint.Configs == nil { + // return fmt.Errorf("endpoint.Configs cannot be nil: %v", serviceConfig) + // } + // if len(endpoint.Configs) == 0 { + // return fmt.Errorf("endpoint.Configs must have at least one entry: %v", serviceConfig) + // } + } + } + return nil +} diff --git a/x/shared/helpers/service_test.go b/x/shared/helpers/service_test.go new file mode 100644 index 000000000..e3dcf57d6 --- /dev/null +++ b/x/shared/helpers/service_test.go @@ -0,0 +1,261 @@ +package helpers + +import ( + "testing" + + "github.com/stretchr/testify/require" + + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" +) + +func TestIsValidService(t *testing.T) { + tests := []struct { + desc string + + serviceId string + serviceName string + + expectedIsValid bool + }{ + { + desc: "Valid ID and Name", + + serviceId: "Service1", + serviceName: "Valid Service Name", + + expectedIsValid: true, + }, + { + desc: "Valid ID and empty Name", + + serviceId: "svc", + serviceName: "", // Valid because the service name can be empty + + expectedIsValid: true, + }, + { + desc: "ID exceeds max length", + + serviceId: "TooLongId123", // Exceeds maxServiceIdLength + serviceName: "Valid Name", + + expectedIsValid: false, + }, + { + desc: "Name exceeds max length", + + serviceId: "ValidID", + serviceName: "This service name is way too long to be considered valid since it exceeds the max length", + + expectedIsValid: false, + }, + { + desc: "Empty ID is invalid", + + serviceId: "", // Invalid because the service ID cannot be empty + serviceName: "Valid Name", + + expectedIsValid: false, + }, + { + desc: "Invalid characters in ID", + + serviceId: "ID@Invalid", // Invalid character '@' + serviceName: "Valid Name", + + expectedIsValid: false, + }, + } + + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + service := &sharedtypes.Service{ + Id: test.serviceId, + Name: test.serviceName, + } + result := IsValidService(service) + require.Equal(t, test.expectedIsValid, result) + }) + } +} + +func TestIsValidServiceName(t *testing.T) { + tests := []struct { + desc string + input string + expected bool + }{ + { + desc: "Valid with hyphen and number", + input: "ValidName-1", + expected: true, + }, + { + desc: "Valid with space and underscore", + input: "Valid Name_1", + expected: true, + }, + { + desc: "Valid name with spaces", + input: "valid name with spaces", + expected: true, + }, + { + desc: "Invalid character '@'", + input: "invalid@name", + expected: false, + }, + { + desc: "Invalid character '.'", + input: "Valid.Name", + expected: false, + }, + { + desc: "Empty string", + input: "", + expected: true, + }, + { + desc: "Exceeds maximum length", + input: "validnamebuttoolongvalidnamebuttoolongvalidnamebuttoolong", + expected: false, + }, + } + + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + result := IsValidServiceName(test.input) + require.Equal(t, test.expected, result) + }) + } +} + +func TestIsValidServiceId(t *testing.T) { + tests := []struct { + desc string + + input string + expected bool + }{ + { + desc: "Valid alphanumeric with hyphen", + + input: "Hello-1", + expected: true, + }, + { + desc: "Valid alphanumeric with underscore", + + input: "Hello_2", + expected: true, + }, + { + desc: "Exceeds maximum length", + + input: "hello-world", + expected: false, // exceeds maxServiceIdLength + }, + { + desc: "Contains invalid character '@'", + + input: "Hello@", + expected: false, // contains invalid character '@' + }, + { + desc: "All uppercase", + + input: "HELLO", + expected: true, + }, + { + desc: "Maximum length boundary", + + input: "12345678", + expected: true, // exactly maxServiceIdLength + }, + { + desc: "Above maximum length boundary", + + input: "123456789", + expected: false, // exceeds maxServiceIdLength + }, + { + desc: "Contains invalid character '.'", + + input: "Hello.World", + expected: false, // contains invalid character '.' + }, + { + desc: "Empty string", + + input: "", + expected: false, // empty string + }, + } + + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + result := IsValidServiceId(test.input) + require.Equal(t, test.expected, result) + }) + } +} + +func TestIsValidEndpointUrl(t *testing.T) { + tests := []struct { + desc string + + input string + expected bool + }{ + { + desc: "valid http URL", + + input: "http://example.com", + expected: true, + }, + { + desc: "valid https URL", + + input: "https://example.com/path?query=value#fragment", + expected: true, + }, + { + desc: "valid localhost URL with scheme", + + input: "https://localhost:8081", + expected: true, + }, + { + desc: "valid loopback URL with scheme", + + input: "http://127.0.0.1:8081", + expected: true, + }, + { + desc: "invalid scheme", + + input: "ftp://example.com", + expected: false, + }, + { + desc: "missing scheme", + + input: "example.com", + expected: false, + }, + { + desc: "invalid URL", + + input: "not-a-valid-url", + expected: false, + }, + } + + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + got := IsValidEndpointUrl(tt.input) + require.Equal(t, tt.expected, got) + }) + } +} From 2813fa6ef1d7b0d1d7f80d3fe043e89a8d3caa4a Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 13 Feb 2024 16:37:09 +0100 Subject: [PATCH 09/29] reconcile: module genesis --- testutil/keeper/supplier.go | 2 ++ x/supplier/module/genesis_test.go | 44 +++++++++++++++++++++++++++---- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/testutil/keeper/supplier.go b/testutil/keeper/supplier.go index 3b1fcf575..e848b5e84 100644 --- a/testutil/keeper/supplier.go +++ b/testutil/keeper/supplier.go @@ -22,6 +22,8 @@ import ( ) func SupplierKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { + t.Helper() + storeKey := storetypes.NewKVStoreKey(types.StoreKey) db := dbm.NewMemDB() diff --git a/x/supplier/module/genesis_test.go b/x/supplier/module/genesis_test.go index 4d931b698..c98821dc4 100644 --- a/x/supplier/module/genesis_test.go +++ b/x/supplier/module/genesis_test.go @@ -3,23 +3,57 @@ package supplier_test import ( "testing" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + keepertest "github.com/pokt-network/poktroll/testutil/keeper" "github.com/pokt-network/poktroll/testutil/nullify" + "github.com/pokt-network/poktroll/testutil/sample" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" "github.com/pokt-network/poktroll/x/supplier/module" "github.com/pokt-network/poktroll/x/supplier/types" - "github.com/stretchr/testify/require" ) func TestGenesis(t *testing.T) { genesisState := types.GenesisState{ Params: types.DefaultParams(), - - SupplierList: []types.Supplier{ + SupplierList: []sharedtypes.Supplier{ { - Index: "0", + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId1", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8081", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, }, { - Index: "1", + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId2", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8082", + RpcType: sharedtypes.RPCType_GRPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, }, }, // this line is used by starport scaffolding # genesis/test/state From e57fc045348ccf3753eb9df94bdd8cdb37489728 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 13 Feb 2024 17:00:37 +0100 Subject: [PATCH 10/29] reconcile: supplier store (map) --- x/supplier/keeper/supplier.go | 38 ++++++++------- x/supplier/keeper/supplier_test.go | 78 +++++++++++++++++++++--------- 2 files changed, 76 insertions(+), 40 deletions(-) diff --git a/x/supplier/keeper/supplier.go b/x/supplier/keeper/supplier.go index dc661e8bb..9f2ba9eb3 100644 --- a/x/supplier/keeper/supplier.go +++ b/x/supplier/keeper/supplier.go @@ -6,54 +6,56 @@ import ( "cosmossdk.io/store/prefix" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/runtime" + + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" "github.com/pokt-network/poktroll/x/supplier/types" ) // SetSupplier set a specific supplier in the store from its index -func (k Keeper) SetSupplier(ctx context.Context, supplier types.Supplier) { +func (k Keeper) SetSupplier(ctx context.Context, supplier sharedtypes.Supplier) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) - b := k.cdc.MustMarshal(&supplier) + supplierBz := k.cdc.MustMarshal(&supplier) store.Set(types.SupplierKey( - supplier.Index, - ), b) + supplier.Address, + ), supplierBz) } // GetSupplier returns a supplier from its index func (k Keeper) GetSupplier( ctx context.Context, - index string, + address string, -) (val types.Supplier, found bool) { +) (supplier sharedtypes.Supplier, found bool) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) - b := store.Get(types.SupplierKey( - index, + supplierBz := store.Get(types.SupplierKey( + address, )) - if b == nil { - return val, false + if supplierBz == nil { + return supplier, false } - k.cdc.MustUnmarshal(b, &val) - return val, true + k.cdc.MustUnmarshal(supplierBz, &supplier) + return supplier, true } // RemoveSupplier removes a supplier from the store func (k Keeper) RemoveSupplier( ctx context.Context, - index string, + address string, ) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) store.Delete(types.SupplierKey( - index, + address, )) } // GetAllSupplier returns all supplier -func (k Keeper) GetAllSupplier(ctx context.Context) (list []types.Supplier) { +func (k Keeper) GetAllSupplier(ctx context.Context) (suppliers []sharedtypes.Supplier) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) iterator := storetypes.KVStorePrefixIterator(store, []byte{}) @@ -61,9 +63,9 @@ func (k Keeper) GetAllSupplier(ctx context.Context) (list []types.Supplier) { defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var val types.Supplier - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) + var supplier sharedtypes.Supplier + k.cdc.MustUnmarshal(iterator.Value(), &supplier) + suppliers = append(suppliers, supplier) } return diff --git a/x/supplier/keeper/supplier_test.go b/x/supplier/keeper/supplier_test.go index 993c3b74b..28e324e07 100644 --- a/x/supplier/keeper/supplier_test.go +++ b/x/supplier/keeper/supplier_test.go @@ -2,62 +2,96 @@ package keeper_test import ( "context" + "fmt" "strconv" "testing" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/cmd/poktrolld/cmd" keepertest "github.com/pokt-network/poktroll/testutil/keeper" "github.com/pokt-network/poktroll/testutil/nullify" + "github.com/pokt-network/poktroll/testutil/sample" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" "github.com/pokt-network/poktroll/x/supplier/keeper" "github.com/pokt-network/poktroll/x/supplier/types" - "github.com/stretchr/testify/require" ) // Prevent strconv unused error var _ = strconv.IntSize -func createNSupplier(keeper keeper.Keeper, ctx context.Context, n int) []types.Supplier { - items := make([]types.Supplier, n) - for i := range items { - items[i].Index = strconv.Itoa(i) +func init() { + cmd.InitSDKConfig() +} - keeper.SetSupplier(ctx, items[i]) +func createNSupplier(keeper keeper.Keeper, ctx context.Context, n int) []sharedtypes.Supplier { + suppliers := make([]sharedtypes.Supplier, n) + for i := range suppliers { + supplier := &suppliers[i] + supplier.Address = sample.AccAddress() + supplier.Stake = &sdk.Coin{Denom: "upokt", Amount: math.NewInt(int64(i))} + supplier.Services = []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{Id: fmt.Sprintf("svc%d", i)}, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: fmt.Sprintf("http://localhost:%d", i), + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + } + keeper.SetSupplier(ctx, *supplier) } - return items + + return suppliers } func TestSupplierGet(t *testing.T) { keeper, ctx := keepertest.SupplierKeeper(t) - items := createNSupplier(keeper, ctx, 10) - for _, item := range items { - rst, found := keeper.GetSupplier(ctx, - item.Index, + suppliers := createNSupplier(keeper, ctx, 10) + for _, supplier := range suppliers { + supplierFound, isSupplierFound := keeper.GetSupplier(ctx, + supplier.Address, ) - require.True(t, found) + require.True(t, isSupplierFound) require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&rst), + nullify.Fill(&supplier), + nullify.Fill(&supplierFound), ) } } + func TestSupplierRemove(t *testing.T) { keeper, ctx := keepertest.SupplierKeeper(t) - items := createNSupplier(keeper, ctx, 10) - for _, item := range items { + suppliers := createNSupplier(keeper, ctx, 10) + for _, supplier := range suppliers { keeper.RemoveSupplier(ctx, - item.Index, + supplier.Address, ) - _, found := keeper.GetSupplier(ctx, - item.Index, + _, isSupplierFound := keeper.GetSupplier(ctx, + supplier.Address, ) - require.False(t, found) + require.False(t, isSupplierFound) } } func TestSupplierGetAll(t *testing.T) { keeper, ctx := keepertest.SupplierKeeper(t) - items := createNSupplier(keeper, ctx, 10) + suppliers := createNSupplier(keeper, ctx, 10) require.ElementsMatch(t, - nullify.Fill(items), + nullify.Fill(suppliers), nullify.Fill(keeper.GetAllSupplier(ctx)), ) } + +// The application module address is derived off of its semantic name. +// This test is a helper for us to easily identify the underlying address. +func TestApplicationModuleAddress(t *testing.T) { + moduleAddress := authtypes.NewModuleAddress(types.ModuleName) + require.Equal(t, "pokt1j40dzzmn6cn9kxku7a5tjnud6hv37vesr5ccaa", moduleAddress.String()) +} From 8d2e1b9aaa79ac75d4d64ab7dcba96362d5313a6 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 13 Feb 2024 17:42:09 +0100 Subject: [PATCH 11/29] reconcile: suppliers query --- api/poktroll/supplier/query.pulsar.go | 561 ++++++++++++----------- proto/poktroll/supplier/query.proto | 27 +- x/supplier/keeper/query_supplier.go | 15 +- x/supplier/keeper/query_supplier_test.go | 26 +- x/supplier/module/autocli.go | 2 +- 5 files changed, 320 insertions(+), 311 deletions(-) diff --git a/api/poktroll/supplier/query.pulsar.go b/api/poktroll/supplier/query.pulsar.go index c66f2da6d..827e8bc66 100644 --- a/api/poktroll/supplier/query.pulsar.go +++ b/api/poktroll/supplier/query.pulsar.go @@ -6,6 +6,7 @@ import ( v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" _ "cosmossdk.io/api/cosmos/base/v1beta1" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" shared "github.com/pokt-network/poktroll/api/poktroll/shared" @@ -810,14 +811,14 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } var ( - md_QueryGetSupplierRequest protoreflect.MessageDescriptor - fd_QueryGetSupplierRequest_index protoreflect.FieldDescriptor + md_QueryGetSupplierRequest protoreflect.MessageDescriptor + fd_QueryGetSupplierRequest_address protoreflect.FieldDescriptor ) func init() { file_poktroll_supplier_query_proto_init() md_QueryGetSupplierRequest = File_poktroll_supplier_query_proto.Messages().ByName("QueryGetSupplierRequest") - fd_QueryGetSupplierRequest_index = md_QueryGetSupplierRequest.Fields().ByName("index") + fd_QueryGetSupplierRequest_address = md_QueryGetSupplierRequest.Fields().ByName("address") } var _ protoreflect.Message = (*fastReflection_QueryGetSupplierRequest)(nil) @@ -885,9 +886,9 @@ func (x *fastReflection_QueryGetSupplierRequest) Interface() protoreflect.ProtoM // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_QueryGetSupplierRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Index != "" { - value := protoreflect.ValueOfString(x.Index) - if !f(fd_QueryGetSupplierRequest_index, value) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_QueryGetSupplierRequest_address, value) { return } } @@ -906,8 +907,8 @@ func (x *fastReflection_QueryGetSupplierRequest) Range(f func(protoreflect.Field // a repeated field is populated if it is non-empty. func (x *fastReflection_QueryGetSupplierRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.supplier.QueryGetSupplierRequest.index": - return x.Index != "" + case "poktroll.supplier.QueryGetSupplierRequest.address": + return x.Address != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) @@ -924,8 +925,8 @@ func (x *fastReflection_QueryGetSupplierRequest) Has(fd protoreflect.FieldDescri // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryGetSupplierRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.supplier.QueryGetSupplierRequest.index": - x.Index = "" + case "poktroll.supplier.QueryGetSupplierRequest.address": + x.Address = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) @@ -942,8 +943,8 @@ func (x *fastReflection_QueryGetSupplierRequest) Clear(fd protoreflect.FieldDesc // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_QueryGetSupplierRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.supplier.QueryGetSupplierRequest.index": - value := x.Index + case "poktroll.supplier.QueryGetSupplierRequest.address": + value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -965,8 +966,8 @@ func (x *fastReflection_QueryGetSupplierRequest) Get(descriptor protoreflect.Fie // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryGetSupplierRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.supplier.QueryGetSupplierRequest.index": - x.Index = value.Interface().(string) + case "poktroll.supplier.QueryGetSupplierRequest.address": + x.Address = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) @@ -987,8 +988,8 @@ func (x *fastReflection_QueryGetSupplierRequest) Set(fd protoreflect.FieldDescri // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryGetSupplierRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.supplier.QueryGetSupplierRequest.index": - panic(fmt.Errorf("field index of message poktroll.supplier.QueryGetSupplierRequest is not mutable")) + case "poktroll.supplier.QueryGetSupplierRequest.address": + panic(fmt.Errorf("field address of message poktroll.supplier.QueryGetSupplierRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) @@ -1002,7 +1003,7 @@ func (x *fastReflection_QueryGetSupplierRequest) Mutable(fd protoreflect.FieldDe // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_QueryGetSupplierRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.supplier.QueryGetSupplierRequest.index": + case "poktroll.supplier.QueryGetSupplierRequest.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -1073,7 +1074,7 @@ func (x *fastReflection_QueryGetSupplierRequest) ProtoMethods() *protoiface.Meth var n int var l int _ = l - l = len(x.Index) + l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1106,10 +1107,10 @@ func (x *fastReflection_QueryGetSupplierRequest) ProtoMethods() *protoiface.Meth 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))) + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) i-- dAtA[i] = 0xa } @@ -1164,7 +1165,7 @@ func (x *fastReflection_QueryGetSupplierRequest) ProtoMethods() *protoiface.Meth 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) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1192,7 +1193,7 @@ func (x *fastReflection_QueryGetSupplierRequest) ProtoMethods() *protoiface.Meth if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Index = string(dAtA[iNdEx:postIndex]) + x.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1665,25 +1666,25 @@ func (x *fastReflection_QueryGetSupplierResponse) ProtoMethods() *protoiface.Met } var ( - md_QueryAllSupplierRequest protoreflect.MessageDescriptor - fd_QueryAllSupplierRequest_pagination protoreflect.FieldDescriptor + md_QueryAllSuppliersRequest protoreflect.MessageDescriptor + fd_QueryAllSuppliersRequest_pagination protoreflect.FieldDescriptor ) func init() { file_poktroll_supplier_query_proto_init() - md_QueryAllSupplierRequest = File_poktroll_supplier_query_proto.Messages().ByName("QueryAllSupplierRequest") - fd_QueryAllSupplierRequest_pagination = md_QueryAllSupplierRequest.Fields().ByName("pagination") + md_QueryAllSuppliersRequest = File_poktroll_supplier_query_proto.Messages().ByName("QueryAllSuppliersRequest") + fd_QueryAllSuppliersRequest_pagination = md_QueryAllSuppliersRequest.Fields().ByName("pagination") } -var _ protoreflect.Message = (*fastReflection_QueryAllSupplierRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QueryAllSuppliersRequest)(nil) -type fastReflection_QueryAllSupplierRequest QueryAllSupplierRequest +type fastReflection_QueryAllSuppliersRequest QueryAllSuppliersRequest -func (x *QueryAllSupplierRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAllSupplierRequest)(x) +func (x *QueryAllSuppliersRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllSuppliersRequest)(x) } -func (x *QueryAllSupplierRequest) slowProtoReflect() protoreflect.Message { +func (x *QueryAllSuppliersRequest) slowProtoReflect() protoreflect.Message { mi := &file_poktroll_supplier_query_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1695,43 +1696,43 @@ func (x *QueryAllSupplierRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryAllSupplierRequest_messageType fastReflection_QueryAllSupplierRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryAllSupplierRequest_messageType{} +var _fastReflection_QueryAllSuppliersRequest_messageType fastReflection_QueryAllSuppliersRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllSuppliersRequest_messageType{} -type fastReflection_QueryAllSupplierRequest_messageType struct{} +type fastReflection_QueryAllSuppliersRequest_messageType struct{} -func (x fastReflection_QueryAllSupplierRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAllSupplierRequest)(nil) +func (x fastReflection_QueryAllSuppliersRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllSuppliersRequest)(nil) } -func (x fastReflection_QueryAllSupplierRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAllSupplierRequest) +func (x fastReflection_QueryAllSuppliersRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllSuppliersRequest) } -func (x fastReflection_QueryAllSupplierRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAllSupplierRequest +func (x fastReflection_QueryAllSuppliersRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllSuppliersRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryAllSupplierRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAllSupplierRequest +func (x *fastReflection_QueryAllSuppliersRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllSuppliersRequest } // 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_QueryAllSupplierRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryAllSupplierRequest_messageType +func (x *fastReflection_QueryAllSuppliersRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAllSuppliersRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAllSupplierRequest) New() protoreflect.Message { - return new(fastReflection_QueryAllSupplierRequest) +func (x *fastReflection_QueryAllSuppliersRequest) New() protoreflect.Message { + return new(fastReflection_QueryAllSuppliersRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAllSupplierRequest) Interface() protoreflect.ProtoMessage { - return (*QueryAllSupplierRequest)(x) +func (x *fastReflection_QueryAllSuppliersRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAllSuppliersRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -1739,10 +1740,10 @@ func (x *fastReflection_QueryAllSupplierRequest) Interface() protoreflect.ProtoM // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryAllSupplierRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QueryAllSuppliersRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Pagination != nil { value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_QueryAllSupplierRequest_pagination, value) { + if !f(fd_QueryAllSuppliersRequest_pagination, value) { return } } @@ -1759,15 +1760,15 @@ func (x *fastReflection_QueryAllSupplierRequest) Range(f func(protoreflect.Field // 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_QueryAllSupplierRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryAllSuppliersRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.supplier.QueryAllSupplierRequest.pagination": + case "poktroll.supplier.QueryAllSuppliersRequest.pagination": return x.Pagination != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSuppliersRequest")) } - panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.supplier.QueryAllSuppliersRequest does not contain field %s", fd.FullName())) } } @@ -1777,15 +1778,15 @@ func (x *fastReflection_QueryAllSupplierRequest) Has(fd protoreflect.FieldDescri // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllSupplierRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryAllSuppliersRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.supplier.QueryAllSupplierRequest.pagination": + case "poktroll.supplier.QueryAllSuppliersRequest.pagination": x.Pagination = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSuppliersRequest")) } - panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.supplier.QueryAllSuppliersRequest does not contain field %s", fd.FullName())) } } @@ -1795,16 +1796,16 @@ func (x *fastReflection_QueryAllSupplierRequest) Clear(fd protoreflect.FieldDesc // 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_QueryAllSupplierRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAllSuppliersRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.supplier.QueryAllSupplierRequest.pagination": + case "poktroll.supplier.QueryAllSuppliersRequest.pagination": value := x.Pagination return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSuppliersRequest")) } - panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message poktroll.supplier.QueryAllSuppliersRequest does not contain field %s", descriptor.FullName())) } } @@ -1818,15 +1819,15 @@ func (x *fastReflection_QueryAllSupplierRequest) Get(descriptor protoreflect.Fie // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllSupplierRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryAllSuppliersRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.supplier.QueryAllSupplierRequest.pagination": + case "poktroll.supplier.QueryAllSuppliersRequest.pagination": x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSuppliersRequest")) } - panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.supplier.QueryAllSuppliersRequest does not contain field %s", fd.FullName())) } } @@ -1840,44 +1841,44 @@ func (x *fastReflection_QueryAllSupplierRequest) Set(fd protoreflect.FieldDescri // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllSupplierRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAllSuppliersRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.supplier.QueryAllSupplierRequest.pagination": + case "poktroll.supplier.QueryAllSuppliersRequest.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: poktroll.supplier.QueryAllSupplierRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSuppliersRequest")) } - panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.supplier.QueryAllSuppliersRequest 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_QueryAllSupplierRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAllSuppliersRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.supplier.QueryAllSupplierRequest.pagination": + case "poktroll.supplier.QueryAllSuppliersRequest.pagination": m := new(v1beta1.PageRequest) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSuppliersRequest")) } - panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.supplier.QueryAllSuppliersRequest 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_QueryAllSupplierRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryAllSuppliersRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.QueryAllSupplierRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.QueryAllSuppliersRequest", d.FullName())) } panic("unreachable") } @@ -1885,7 +1886,7 @@ func (x *fastReflection_QueryAllSupplierRequest) WhichOneof(d protoreflect.Oneof // 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_QueryAllSupplierRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryAllSuppliersRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1896,7 +1897,7 @@ func (x *fastReflection_QueryAllSupplierRequest) GetUnknown() protoreflect.RawFi // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllSupplierRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryAllSuppliersRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1908,7 +1909,7 @@ func (x *fastReflection_QueryAllSupplierRequest) SetUnknown(fields protoreflect. // 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_QueryAllSupplierRequest) IsValid() bool { +func (x *fastReflection_QueryAllSuppliersRequest) IsValid() bool { return x != nil } @@ -1918,9 +1919,9 @@ func (x *fastReflection_QueryAllSupplierRequest) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_QueryAllSupplierRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryAllSuppliersRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAllSupplierRequest) + x := input.Message.Interface().(*QueryAllSuppliersRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1946,7 +1947,7 @@ func (x *fastReflection_QueryAllSupplierRequest) ProtoMethods() *protoiface.Meth } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryAllSupplierRequest) + x := input.Message.Interface().(*QueryAllSuppliersRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1990,7 +1991,7 @@ func (x *fastReflection_QueryAllSupplierRequest) ProtoMethods() *protoiface.Meth }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryAllSupplierRequest) + x := input.Message.Interface().(*QueryAllSuppliersRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2022,10 +2023,10 @@ func (x *fastReflection_QueryAllSupplierRequest) ProtoMethods() *protoiface.Meth fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllSupplierRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllSuppliersRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllSupplierRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllSuppliersRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2099,79 +2100,79 @@ func (x *fastReflection_QueryAllSupplierRequest) ProtoMethods() *protoiface.Meth } } -var _ protoreflect.List = (*_QueryAllSupplierResponse_1_list)(nil) +var _ protoreflect.List = (*_QueryAllSuppliersResponse_1_list)(nil) -type _QueryAllSupplierResponse_1_list struct { +type _QueryAllSuppliersResponse_1_list struct { list *[]*shared.Supplier } -func (x *_QueryAllSupplierResponse_1_list) Len() int { +func (x *_QueryAllSuppliersResponse_1_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_QueryAllSupplierResponse_1_list) Get(i int) protoreflect.Value { +func (x *_QueryAllSuppliersResponse_1_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_QueryAllSupplierResponse_1_list) Set(i int, value protoreflect.Value) { +func (x *_QueryAllSuppliersResponse_1_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*shared.Supplier) (*x.list)[i] = concreteValue } -func (x *_QueryAllSupplierResponse_1_list) Append(value protoreflect.Value) { +func (x *_QueryAllSuppliersResponse_1_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*shared.Supplier) *x.list = append(*x.list, concreteValue) } -func (x *_QueryAllSupplierResponse_1_list) AppendMutable() protoreflect.Value { +func (x *_QueryAllSuppliersResponse_1_list) AppendMutable() protoreflect.Value { v := new(shared.Supplier) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_QueryAllSupplierResponse_1_list) Truncate(n int) { +func (x *_QueryAllSuppliersResponse_1_list) Truncate(n int) { for i := n; i < len(*x.list); i++ { (*x.list)[i] = nil } *x.list = (*x.list)[:n] } -func (x *_QueryAllSupplierResponse_1_list) NewElement() protoreflect.Value { +func (x *_QueryAllSuppliersResponse_1_list) NewElement() protoreflect.Value { v := new(shared.Supplier) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_QueryAllSupplierResponse_1_list) IsValid() bool { +func (x *_QueryAllSuppliersResponse_1_list) IsValid() bool { return x.list != nil } var ( - md_QueryAllSupplierResponse protoreflect.MessageDescriptor - fd_QueryAllSupplierResponse_supplier protoreflect.FieldDescriptor - fd_QueryAllSupplierResponse_pagination protoreflect.FieldDescriptor + md_QueryAllSuppliersResponse protoreflect.MessageDescriptor + fd_QueryAllSuppliersResponse_supplier protoreflect.FieldDescriptor + fd_QueryAllSuppliersResponse_pagination protoreflect.FieldDescriptor ) func init() { file_poktroll_supplier_query_proto_init() - md_QueryAllSupplierResponse = File_poktroll_supplier_query_proto.Messages().ByName("QueryAllSupplierResponse") - fd_QueryAllSupplierResponse_supplier = md_QueryAllSupplierResponse.Fields().ByName("supplier") - fd_QueryAllSupplierResponse_pagination = md_QueryAllSupplierResponse.Fields().ByName("pagination") + md_QueryAllSuppliersResponse = File_poktroll_supplier_query_proto.Messages().ByName("QueryAllSuppliersResponse") + fd_QueryAllSuppliersResponse_supplier = md_QueryAllSuppliersResponse.Fields().ByName("supplier") + fd_QueryAllSuppliersResponse_pagination = md_QueryAllSuppliersResponse.Fields().ByName("pagination") } -var _ protoreflect.Message = (*fastReflection_QueryAllSupplierResponse)(nil) +var _ protoreflect.Message = (*fastReflection_QueryAllSuppliersResponse)(nil) -type fastReflection_QueryAllSupplierResponse QueryAllSupplierResponse +type fastReflection_QueryAllSuppliersResponse QueryAllSuppliersResponse -func (x *QueryAllSupplierResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAllSupplierResponse)(x) +func (x *QueryAllSuppliersResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllSuppliersResponse)(x) } -func (x *QueryAllSupplierResponse) slowProtoReflect() protoreflect.Message { +func (x *QueryAllSuppliersResponse) slowProtoReflect() protoreflect.Message { mi := &file_poktroll_supplier_query_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2183,43 +2184,43 @@ func (x *QueryAllSupplierResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryAllSupplierResponse_messageType fastReflection_QueryAllSupplierResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryAllSupplierResponse_messageType{} +var _fastReflection_QueryAllSuppliersResponse_messageType fastReflection_QueryAllSuppliersResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllSuppliersResponse_messageType{} -type fastReflection_QueryAllSupplierResponse_messageType struct{} +type fastReflection_QueryAllSuppliersResponse_messageType struct{} -func (x fastReflection_QueryAllSupplierResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAllSupplierResponse)(nil) +func (x fastReflection_QueryAllSuppliersResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllSuppliersResponse)(nil) } -func (x fastReflection_QueryAllSupplierResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAllSupplierResponse) +func (x fastReflection_QueryAllSuppliersResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllSuppliersResponse) } -func (x fastReflection_QueryAllSupplierResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAllSupplierResponse +func (x fastReflection_QueryAllSuppliersResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllSuppliersResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryAllSupplierResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAllSupplierResponse +func (x *fastReflection_QueryAllSuppliersResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllSuppliersResponse } // 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_QueryAllSupplierResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryAllSupplierResponse_messageType +func (x *fastReflection_QueryAllSuppliersResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAllSuppliersResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAllSupplierResponse) New() protoreflect.Message { - return new(fastReflection_QueryAllSupplierResponse) +func (x *fastReflection_QueryAllSuppliersResponse) New() protoreflect.Message { + return new(fastReflection_QueryAllSuppliersResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAllSupplierResponse) Interface() protoreflect.ProtoMessage { - return (*QueryAllSupplierResponse)(x) +func (x *fastReflection_QueryAllSuppliersResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAllSuppliersResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -2227,16 +2228,16 @@ func (x *fastReflection_QueryAllSupplierResponse) Interface() protoreflect.Proto // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryAllSupplierResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QueryAllSuppliersResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if len(x.Supplier) != 0 { - value := protoreflect.ValueOfList(&_QueryAllSupplierResponse_1_list{list: &x.Supplier}) - if !f(fd_QueryAllSupplierResponse_supplier, value) { + value := protoreflect.ValueOfList(&_QueryAllSuppliersResponse_1_list{list: &x.Supplier}) + if !f(fd_QueryAllSuppliersResponse_supplier, value) { return } } if x.Pagination != nil { value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_QueryAllSupplierResponse_pagination, value) { + if !f(fd_QueryAllSuppliersResponse_pagination, value) { return } } @@ -2253,17 +2254,17 @@ func (x *fastReflection_QueryAllSupplierResponse) Range(f func(protoreflect.Fiel // 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_QueryAllSupplierResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryAllSuppliersResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.supplier.QueryAllSupplierResponse.supplier": + case "poktroll.supplier.QueryAllSuppliersResponse.supplier": return len(x.Supplier) != 0 - case "poktroll.supplier.QueryAllSupplierResponse.pagination": + case "poktroll.supplier.QueryAllSuppliersResponse.pagination": return x.Pagination != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSuppliersResponse")) } - panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.supplier.QueryAllSuppliersResponse does not contain field %s", fd.FullName())) } } @@ -2273,17 +2274,17 @@ func (x *fastReflection_QueryAllSupplierResponse) Has(fd protoreflect.FieldDescr // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllSupplierResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryAllSuppliersResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.supplier.QueryAllSupplierResponse.supplier": + case "poktroll.supplier.QueryAllSuppliersResponse.supplier": x.Supplier = nil - case "poktroll.supplier.QueryAllSupplierResponse.pagination": + case "poktroll.supplier.QueryAllSuppliersResponse.pagination": x.Pagination = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSuppliersResponse")) } - panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.supplier.QueryAllSuppliersResponse does not contain field %s", fd.FullName())) } } @@ -2293,22 +2294,22 @@ func (x *fastReflection_QueryAllSupplierResponse) Clear(fd protoreflect.FieldDes // 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_QueryAllSupplierResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAllSuppliersResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.supplier.QueryAllSupplierResponse.supplier": + case "poktroll.supplier.QueryAllSuppliersResponse.supplier": if len(x.Supplier) == 0 { - return protoreflect.ValueOfList(&_QueryAllSupplierResponse_1_list{}) + return protoreflect.ValueOfList(&_QueryAllSuppliersResponse_1_list{}) } - listValue := &_QueryAllSupplierResponse_1_list{list: &x.Supplier} + listValue := &_QueryAllSuppliersResponse_1_list{list: &x.Supplier} return protoreflect.ValueOfList(listValue) - case "poktroll.supplier.QueryAllSupplierResponse.pagination": + case "poktroll.supplier.QueryAllSuppliersResponse.pagination": value := x.Pagination return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSuppliersResponse")) } - panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message poktroll.supplier.QueryAllSuppliersResponse does not contain field %s", descriptor.FullName())) } } @@ -2322,19 +2323,19 @@ func (x *fastReflection_QueryAllSupplierResponse) Get(descriptor protoreflect.Fi // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllSupplierResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryAllSuppliersResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.supplier.QueryAllSupplierResponse.supplier": + case "poktroll.supplier.QueryAllSuppliersResponse.supplier": lv := value.List() - clv := lv.(*_QueryAllSupplierResponse_1_list) + clv := lv.(*_QueryAllSuppliersResponse_1_list) x.Supplier = *clv.list - case "poktroll.supplier.QueryAllSupplierResponse.pagination": + case "poktroll.supplier.QueryAllSuppliersResponse.pagination": x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSuppliersResponse")) } - panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.supplier.QueryAllSuppliersResponse does not contain field %s", fd.FullName())) } } @@ -2348,53 +2349,53 @@ func (x *fastReflection_QueryAllSupplierResponse) Set(fd protoreflect.FieldDescr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllSupplierResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAllSuppliersResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.supplier.QueryAllSupplierResponse.supplier": + case "poktroll.supplier.QueryAllSuppliersResponse.supplier": if x.Supplier == nil { x.Supplier = []*shared.Supplier{} } - value := &_QueryAllSupplierResponse_1_list{list: &x.Supplier} + value := &_QueryAllSuppliersResponse_1_list{list: &x.Supplier} return protoreflect.ValueOfList(value) - case "poktroll.supplier.QueryAllSupplierResponse.pagination": + case "poktroll.supplier.QueryAllSuppliersResponse.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: poktroll.supplier.QueryAllSupplierResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSuppliersResponse")) } - panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.supplier.QueryAllSuppliersResponse 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_QueryAllSupplierResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryAllSuppliersResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.supplier.QueryAllSupplierResponse.supplier": + case "poktroll.supplier.QueryAllSuppliersResponse.supplier": list := []*shared.Supplier{} - return protoreflect.ValueOfList(&_QueryAllSupplierResponse_1_list{list: &list}) - case "poktroll.supplier.QueryAllSupplierResponse.pagination": + return protoreflect.ValueOfList(&_QueryAllSuppliersResponse_1_list{list: &list}) + case "poktroll.supplier.QueryAllSuppliersResponse.pagination": m := new(v1beta1.PageResponse) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSupplierResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryAllSuppliersResponse")) } - panic(fmt.Errorf("message poktroll.supplier.QueryAllSupplierResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.supplier.QueryAllSuppliersResponse 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_QueryAllSupplierResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryAllSuppliersResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.QueryAllSupplierResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.QueryAllSuppliersResponse", d.FullName())) } panic("unreachable") } @@ -2402,7 +2403,7 @@ func (x *fastReflection_QueryAllSupplierResponse) WhichOneof(d protoreflect.Oneo // 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_QueryAllSupplierResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryAllSuppliersResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2413,7 +2414,7 @@ func (x *fastReflection_QueryAllSupplierResponse) GetUnknown() protoreflect.RawF // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllSupplierResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryAllSuppliersResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2425,7 +2426,7 @@ func (x *fastReflection_QueryAllSupplierResponse) SetUnknown(fields protoreflect // 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_QueryAllSupplierResponse) IsValid() bool { +func (x *fastReflection_QueryAllSuppliersResponse) IsValid() bool { return x != nil } @@ -2435,9 +2436,9 @@ func (x *fastReflection_QueryAllSupplierResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_QueryAllSupplierResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryAllSuppliersResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAllSupplierResponse) + x := input.Message.Interface().(*QueryAllSuppliersResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2469,7 +2470,7 @@ func (x *fastReflection_QueryAllSupplierResponse) ProtoMethods() *protoiface.Met } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryAllSupplierResponse) + x := input.Message.Interface().(*QueryAllSuppliersResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2529,7 +2530,7 @@ func (x *fastReflection_QueryAllSupplierResponse) ProtoMethods() *protoiface.Met }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryAllSupplierResponse) + x := input.Message.Interface().(*QueryAllSuppliersResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2561,10 +2562,10 @@ func (x *fastReflection_QueryAllSupplierResponse) ProtoMethods() *protoiface.Met fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllSupplierResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllSuppliersResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllSupplierResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllSuppliersResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2754,7 +2755,7 @@ type QueryGetSupplierRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } func (x *QueryGetSupplierRequest) Reset() { @@ -2777,9 +2778,9 @@ func (*QueryGetSupplierRequest) Descriptor() ([]byte, []int) { return file_poktroll_supplier_query_proto_rawDescGZIP(), []int{2} } -func (x *QueryGetSupplierRequest) GetIndex() string { +func (x *QueryGetSupplierRequest) GetAddress() string { if x != nil { - return x.Index + return x.Address } return "" } @@ -2819,7 +2820,7 @@ func (x *QueryGetSupplierResponse) GetSupplier() *shared.Supplier { return nil } -type QueryAllSupplierRequest struct { +type QueryAllSuppliersRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2827,8 +2828,8 @@ type QueryAllSupplierRequest struct { Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryAllSupplierRequest) Reset() { - *x = QueryAllSupplierRequest{} +func (x *QueryAllSuppliersRequest) Reset() { + *x = QueryAllSuppliersRequest{} if protoimpl.UnsafeEnabled { mi := &file_poktroll_supplier_query_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2836,25 +2837,25 @@ func (x *QueryAllSupplierRequest) Reset() { } } -func (x *QueryAllSupplierRequest) String() string { +func (x *QueryAllSuppliersRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryAllSupplierRequest) ProtoMessage() {} +func (*QueryAllSuppliersRequest) ProtoMessage() {} -// Deprecated: Use QueryAllSupplierRequest.ProtoReflect.Descriptor instead. -func (*QueryAllSupplierRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryAllSuppliersRequest.ProtoReflect.Descriptor instead. +func (*QueryAllSuppliersRequest) Descriptor() ([]byte, []int) { return file_poktroll_supplier_query_proto_rawDescGZIP(), []int{4} } -func (x *QueryAllSupplierRequest) GetPagination() *v1beta1.PageRequest { +func (x *QueryAllSuppliersRequest) GetPagination() *v1beta1.PageRequest { if x != nil { return x.Pagination } return nil } -type QueryAllSupplierResponse struct { +type QueryAllSuppliersResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2863,8 +2864,8 @@ type QueryAllSupplierResponse struct { Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryAllSupplierResponse) Reset() { - *x = QueryAllSupplierResponse{} +func (x *QueryAllSuppliersResponse) Reset() { + *x = QueryAllSuppliersResponse{} if protoimpl.UnsafeEnabled { mi := &file_poktroll_supplier_query_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2872,25 +2873,25 @@ func (x *QueryAllSupplierResponse) Reset() { } } -func (x *QueryAllSupplierResponse) String() string { +func (x *QueryAllSuppliersResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryAllSupplierResponse) ProtoMessage() {} +func (*QueryAllSuppliersResponse) ProtoMessage() {} -// Deprecated: Use QueryAllSupplierResponse.ProtoReflect.Descriptor instead. -func (*QueryAllSupplierResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryAllSuppliersResponse.ProtoReflect.Descriptor instead. +func (*QueryAllSuppliersResponse) Descriptor() ([]byte, []int) { return file_poktroll_supplier_query_proto_rawDescGZIP(), []int{5} } -func (x *QueryAllSupplierResponse) GetSupplier() []*shared.Supplier { +func (x *QueryAllSuppliersResponse) GetSupplier() []*shared.Supplier { if x != nil { return x.Supplier } return nil } -func (x *QueryAllSupplierResponse) GetPagination() *v1beta1.PageResponse { +func (x *QueryAllSuppliersResponse) GetPagination() *v1beta1.PageResponse { if x != nil { return x.Pagination } @@ -2907,73 +2908,77 @@ var file_poktroll_supplier_query_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, - 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x2f, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 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, 0x57, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, - 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, - 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, 0x61, 0x0a, 0x17, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0xa0, 0x01, - 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0xcc, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x87, 0x01, 0x0a, 0x06, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x70, - 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x9d, 0x01, 0x0a, 0x08, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x12, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, + 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x64, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x32, 0x12, 0x30, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x7b, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x7d, 0x12, 0x98, 0x01, 0x0a, 0x0b, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x41, 0x6c, 0x6c, 0x12, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, - 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, + 0x72, 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, 0x4d, 0x0a, 0x17, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x57, 0x0a, 0x18, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x22, 0x62, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x73, 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, 0xa1, 0x01, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 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, 0xd1, 0x03, 0x0a, 0x05, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x87, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x9f, 0x01, 0x0a, 0x08, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, + 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x73, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x7d, 0x12, 0x9b, 0x01, 0x0a, 0x0c, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x73, 0x12, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, @@ -3005,29 +3010,29 @@ func file_poktroll_supplier_query_proto_rawDescGZIP() []byte { var file_poktroll_supplier_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_poktroll_supplier_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: poktroll.supplier.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: poktroll.supplier.QueryParamsResponse - (*QueryGetSupplierRequest)(nil), // 2: poktroll.supplier.QueryGetSupplierRequest - (*QueryGetSupplierResponse)(nil), // 3: poktroll.supplier.QueryGetSupplierResponse - (*QueryAllSupplierRequest)(nil), // 4: poktroll.supplier.QueryAllSupplierRequest - (*QueryAllSupplierResponse)(nil), // 5: poktroll.supplier.QueryAllSupplierResponse - (*Params)(nil), // 6: poktroll.supplier.Params - (*shared.Supplier)(nil), // 7: poktroll.shared.Supplier - (*v1beta1.PageRequest)(nil), // 8: cosmos.base.query.v1beta1.PageRequest - (*v1beta1.PageResponse)(nil), // 9: cosmos.base.query.v1beta1.PageResponse + (*QueryParamsRequest)(nil), // 0: poktroll.supplier.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: poktroll.supplier.QueryParamsResponse + (*QueryGetSupplierRequest)(nil), // 2: poktroll.supplier.QueryGetSupplierRequest + (*QueryGetSupplierResponse)(nil), // 3: poktroll.supplier.QueryGetSupplierResponse + (*QueryAllSuppliersRequest)(nil), // 4: poktroll.supplier.QueryAllSuppliersRequest + (*QueryAllSuppliersResponse)(nil), // 5: poktroll.supplier.QueryAllSuppliersResponse + (*Params)(nil), // 6: poktroll.supplier.Params + (*shared.Supplier)(nil), // 7: poktroll.shared.Supplier + (*v1beta1.PageRequest)(nil), // 8: cosmos.base.query.v1beta1.PageRequest + (*v1beta1.PageResponse)(nil), // 9: cosmos.base.query.v1beta1.PageResponse } var file_poktroll_supplier_query_proto_depIdxs = []int32{ 6, // 0: poktroll.supplier.QueryParamsResponse.params:type_name -> poktroll.supplier.Params 7, // 1: poktroll.supplier.QueryGetSupplierResponse.supplier:type_name -> poktroll.shared.Supplier - 8, // 2: poktroll.supplier.QueryAllSupplierRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 7, // 3: poktroll.supplier.QueryAllSupplierResponse.supplier:type_name -> poktroll.shared.Supplier - 9, // 4: poktroll.supplier.QueryAllSupplierResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 8, // 2: poktroll.supplier.QueryAllSuppliersRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 7, // 3: poktroll.supplier.QueryAllSuppliersResponse.supplier:type_name -> poktroll.shared.Supplier + 9, // 4: poktroll.supplier.QueryAllSuppliersResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse 0, // 5: poktroll.supplier.Query.Params:input_type -> poktroll.supplier.QueryParamsRequest 2, // 6: poktroll.supplier.Query.Supplier:input_type -> poktroll.supplier.QueryGetSupplierRequest - 4, // 7: poktroll.supplier.Query.SupplierAll:input_type -> poktroll.supplier.QueryAllSupplierRequest + 4, // 7: poktroll.supplier.Query.AllSuppliers:input_type -> poktroll.supplier.QueryAllSuppliersRequest 1, // 8: poktroll.supplier.Query.Params:output_type -> poktroll.supplier.QueryParamsResponse 3, // 9: poktroll.supplier.Query.Supplier:output_type -> poktroll.supplier.QueryGetSupplierResponse - 5, // 10: poktroll.supplier.Query.SupplierAll:output_type -> poktroll.supplier.QueryAllSupplierResponse + 5, // 10: poktroll.supplier.Query.AllSuppliers:output_type -> poktroll.supplier.QueryAllSuppliersResponse 8, // [8:11] is the sub-list for method output_type 5, // [5:8] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name @@ -3091,7 +3096,7 @@ func file_poktroll_supplier_query_proto_init() { } } file_poktroll_supplier_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAllSupplierRequest); i { + switch v := v.(*QueryAllSuppliersRequest); i { case 0: return &v.state case 1: @@ -3103,7 +3108,7 @@ func file_poktroll_supplier_query_proto_init() { } } file_poktroll_supplier_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAllSupplierResponse); i { + switch v := v.(*QueryAllSuppliersResponse); i { case 0: return &v.state case 1: diff --git a/proto/poktroll/supplier/query.proto b/proto/poktroll/supplier/query.proto index 0f1b27663..8d3ad532d 100644 --- a/proto/poktroll/supplier/query.proto +++ b/proto/poktroll/supplier/query.proto @@ -5,30 +5,31 @@ package poktroll.supplier; import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; +import "cosmos_proto/cosmos.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; import "poktroll/supplier/params.proto"; import "poktroll/shared/supplier.proto"; -import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; // Query defines the gRPC querier service. service Query { - + // Parameters queries the parameters of the module. rpc Params (QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/pokt-network/poktroll/supplier/params"; - + } - + // Queries a list of Supplier items. rpc Supplier (QueryGetSupplierRequest) returns (QueryGetSupplierResponse) { - option (google.api.http).get = "/pokt-network/poktroll/supplier/supplier/{index}"; - + option (google.api.http).get = "/pokt-network/poktroll/supplier/supplier/{address}"; + } - rpc SupplierAll (QueryAllSupplierRequest) returns (QueryAllSupplierResponse) { + rpc AllSuppliers (QueryAllSuppliersRequest) returns (QueryAllSuppliersResponse) { option (google.api.http).get = "/pokt-network/poktroll/supplier/supplier"; - + } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -36,25 +37,25 @@ message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { - + // params holds all the parameters of this module. Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } message QueryGetSupplierRequest { - string index = 1; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } message QueryGetSupplierResponse { poktroll.shared.Supplier supplier = 1 [(gogoproto.nullable) = false]; } -message QueryAllSupplierRequest { +message QueryAllSuppliersRequest { cosmos.base.query.v1beta1.PageRequest pagination = 1; } -message QueryAllSupplierResponse { - repeated poktroll.shared.Supplier supplier = 1 [(gogoproto.nullable) = false]; +message QueryAllSuppliersResponse { + repeated poktroll.shared.Supplier supplier = 1 [(gogoproto.nullable) = false]; cosmos.base.query.v1beta1.PageResponse pagination = 2; } diff --git a/x/supplier/keeper/query_supplier.go b/x/supplier/keeper/query_supplier.go index 33bdb0b0e..d364ede93 100644 --- a/x/supplier/keeper/query_supplier.go +++ b/x/supplier/keeper/query_supplier.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" "cosmossdk.io/store/prefix" "github.com/cosmos/cosmos-sdk/runtime" @@ -13,7 +14,7 @@ import ( "github.com/pokt-network/poktroll/x/supplier/types" ) -func (k Keeper) SupplierAll(ctx context.Context, req *types.QueryAllSupplierRequest) (*types.QueryAllSupplierResponse, error) { +func (k Keeper) AllSuppliers(ctx context.Context, req *types.QueryAllSuppliersRequest) (*types.QueryAllSuppliersResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -37,7 +38,7 @@ func (k Keeper) SupplierAll(ctx context.Context, req *types.QueryAllSupplierRequ return nil, status.Error(codes.Internal, err.Error()) } - return &types.QueryAllSupplierResponse{Supplier: suppliers, Pagination: pageRes}, nil + return &types.QueryAllSuppliersResponse{Supplier: suppliers, Pagination: pageRes}, nil } func (k Keeper) Supplier(ctx context.Context, req *types.QueryGetSupplierRequest) (*types.QueryGetSupplierResponse, error) { @@ -45,13 +46,15 @@ func (k Keeper) Supplier(ctx context.Context, req *types.QueryGetSupplierRequest return nil, status.Error(codes.InvalidArgument, "invalid request") } - val, found := k.GetSupplier( + supplier, found := k.GetSupplier( ctx, - req.Index, + req.Address, ) if !found { - return nil, status.Error(codes.NotFound, "not found") + // TODO_TECHDEBT(#181): conform to logging conventions once established + msg := fmt.Sprintf("supplier with address %q", req.GetAddress()) + return nil, status.Error(codes.NotFound, msg) } - return &types.QueryGetSupplierResponse{Supplier: val}, nil + return &types.QueryGetSupplierResponse{Supplier: supplier}, nil } diff --git a/x/supplier/keeper/query_supplier_test.go b/x/supplier/keeper/query_supplier_test.go index 7d950dc42..ca80180c3 100644 --- a/x/supplier/keeper/query_supplier_test.go +++ b/x/supplier/keeper/query_supplier_test.go @@ -19,7 +19,7 @@ var _ = strconv.IntSize func TestSupplierQuerySingle(t *testing.T) { keeper, ctx := keepertest.SupplierKeeper(t) - msgs := createNSupplier(keeper, ctx, 2) + suppliers := createNSupplier(keeper, ctx, 2) tests := []struct { desc string request *types.QueryGetSupplierRequest @@ -29,23 +29,23 @@ func TestSupplierQuerySingle(t *testing.T) { { desc: "First", request: &types.QueryGetSupplierRequest{ - Index: msgs[0].Index, + Address: suppliers[0].Address, }, - response: &types.QueryGetSupplierResponse{Supplier: msgs[0]}, + response: &types.QueryGetSupplierResponse{Supplier: suppliers[0]}, }, { desc: "Second", request: &types.QueryGetSupplierRequest{ - Index: msgs[1].Index, + Address: suppliers[1].Address, }, - response: &types.QueryGetSupplierResponse{Supplier: msgs[1]}, + response: &types.QueryGetSupplierResponse{Supplier: suppliers[1]}, }, { desc: "KeyNotFound", request: &types.QueryGetSupplierRequest{ - Index: strconv.Itoa(100000), + Address: strconv.Itoa(100000), }, - err: status.Error(codes.NotFound, "not found"), + err: status.Error(codes.NotFound, "supplier with address \"100000\""), }, { desc: "InvalidRequest", @@ -72,8 +72,8 @@ func TestSupplierQueryPaginated(t *testing.T) { keeper, ctx := keepertest.SupplierKeeper(t) msgs := createNSupplier(keeper, ctx, 5) - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllSupplierRequest { - return &types.QueryAllSupplierRequest{ + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllSuppliersRequest { + return &types.QueryAllSuppliersRequest{ Pagination: &query.PageRequest{ Key: next, Offset: offset, @@ -85,7 +85,7 @@ func TestSupplierQueryPaginated(t *testing.T) { t.Run("ByOffset", func(t *testing.T) { step := 2 for i := 0; i < len(msgs); i += step { - resp, err := keeper.SupplierAll(ctx, request(nil, uint64(i), uint64(step), false)) + resp, err := keeper.AllSuppliers(ctx, request(nil, uint64(i), uint64(step), false)) require.NoError(t, err) require.LessOrEqual(t, len(resp.Supplier), step) require.Subset(t, @@ -98,7 +98,7 @@ func TestSupplierQueryPaginated(t *testing.T) { step := 2 var next []byte for i := 0; i < len(msgs); i += step { - resp, err := keeper.SupplierAll(ctx, request(next, 0, uint64(step), false)) + resp, err := keeper.AllSuppliers(ctx, request(next, 0, uint64(step), false)) require.NoError(t, err) require.LessOrEqual(t, len(resp.Supplier), step) require.Subset(t, @@ -109,7 +109,7 @@ func TestSupplierQueryPaginated(t *testing.T) { } }) t.Run("Total", func(t *testing.T) { - resp, err := keeper.SupplierAll(ctx, request(nil, 0, 0, true)) + resp, err := keeper.AllSuppliers(ctx, request(nil, 0, 0, true)) require.NoError(t, err) require.Equal(t, len(msgs), int(resp.Pagination.Total)) require.ElementsMatch(t, @@ -118,7 +118,7 @@ func TestSupplierQueryPaginated(t *testing.T) { ) }) t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.SupplierAll(ctx, nil) + _, err := keeper.AllSuppliers(ctx, nil) require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) }) } diff --git a/x/supplier/module/autocli.go b/x/supplier/module/autocli.go index 2325ea034..c93ecb201 100644 --- a/x/supplier/module/autocli.go +++ b/x/supplier/module/autocli.go @@ -18,7 +18,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Short: "Shows the parameters of the module", }, { - RpcMethod: "SupplierAll", + RpcMethod: "AllSuppliers", Use: "list-supplier", Short: "List all supplier", }, From a636eeb14b96a7a2328c910d589381bcf32604a3 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 11:18:15 +0100 Subject: [PATCH 12/29] scaffold: message stake-supplier --module supplier --signer address stake:coin services --- api/poktroll/supplier/tx.pulsar.go | 1090 ++++++++++++++++- proto/poktroll/supplier/tx.proto | 33 +- .../keeper/msg_server_stake_supplier.go | 17 + x/supplier/module/autocli.go | 6 + x/supplier/module/simulation.go | 25 +- x/supplier/simulation/stake_supplier.go | 29 + x/supplier/types/codec.go | 3 + x/supplier/types/message_stake_supplier.go | 25 + .../types/message_stake_supplier_test.go | 40 + 9 files changed, 1232 insertions(+), 36 deletions(-) create mode 100644 x/supplier/keeper/msg_server_stake_supplier.go create mode 100644 x/supplier/simulation/stake_supplier.go create mode 100644 x/supplier/types/message_stake_supplier.go create mode 100644 x/supplier/types/message_stake_supplier_test.go diff --git a/api/poktroll/supplier/tx.pulsar.go b/api/poktroll/supplier/tx.pulsar.go index 91020fcfe..ed51c87e8 100644 --- a/api/poktroll/supplier/tx.pulsar.go +++ b/api/poktroll/supplier/tx.pulsar.go @@ -3,6 +3,7 @@ package supplier import ( _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" _ "cosmossdk.io/api/cosmos/msg/v1" fmt "fmt" _ "github.com/cosmos/cosmos-proto" @@ -871,6 +872,925 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } +var ( + md_MsgStakeSupplier protoreflect.MessageDescriptor + fd_MsgStakeSupplier_address protoreflect.FieldDescriptor + fd_MsgStakeSupplier_stake protoreflect.FieldDescriptor + fd_MsgStakeSupplier_services protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_tx_proto_init() + md_MsgStakeSupplier = File_poktroll_supplier_tx_proto.Messages().ByName("MsgStakeSupplier") + fd_MsgStakeSupplier_address = md_MsgStakeSupplier.Fields().ByName("address") + fd_MsgStakeSupplier_stake = md_MsgStakeSupplier.Fields().ByName("stake") + fd_MsgStakeSupplier_services = md_MsgStakeSupplier.Fields().ByName("services") +} + +var _ protoreflect.Message = (*fastReflection_MsgStakeSupplier)(nil) + +type fastReflection_MsgStakeSupplier MsgStakeSupplier + +func (x *MsgStakeSupplier) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgStakeSupplier)(x) +} + +func (x *MsgStakeSupplier) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_tx_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgStakeSupplier_messageType fastReflection_MsgStakeSupplier_messageType +var _ protoreflect.MessageType = fastReflection_MsgStakeSupplier_messageType{} + +type fastReflection_MsgStakeSupplier_messageType struct{} + +func (x fastReflection_MsgStakeSupplier_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgStakeSupplier)(nil) +} +func (x fastReflection_MsgStakeSupplier_messageType) New() protoreflect.Message { + return new(fastReflection_MsgStakeSupplier) +} +func (x fastReflection_MsgStakeSupplier_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgStakeSupplier +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgStakeSupplier) Descriptor() protoreflect.MessageDescriptor { + return md_MsgStakeSupplier +} + +// 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_MsgStakeSupplier) Type() protoreflect.MessageType { + return _fastReflection_MsgStakeSupplier_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgStakeSupplier) New() protoreflect.Message { + return new(fastReflection_MsgStakeSupplier) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgStakeSupplier) Interface() protoreflect.ProtoMessage { + return (*MsgStakeSupplier)(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_MsgStakeSupplier) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_MsgStakeSupplier_address, value) { + return + } + } + if x.Stake != nil { + value := protoreflect.ValueOfMessage(x.Stake.ProtoReflect()) + if !f(fd_MsgStakeSupplier_stake, value) { + return + } + } + if x.Services != "" { + value := protoreflect.ValueOfString(x.Services) + if !f(fd_MsgStakeSupplier_services, 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_MsgStakeSupplier) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplier.address": + return x.Address != "" + case "poktroll.supplier.MsgStakeSupplier.stake": + return x.Stake != nil + case "poktroll.supplier.MsgStakeSupplier.services": + return x.Services != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgStakeSupplier 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_MsgStakeSupplier) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplier.address": + x.Address = "" + case "poktroll.supplier.MsgStakeSupplier.stake": + x.Stake = nil + case "poktroll.supplier.MsgStakeSupplier.services": + x.Services = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgStakeSupplier 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_MsgStakeSupplier) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.MsgStakeSupplier.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "poktroll.supplier.MsgStakeSupplier.stake": + value := x.Stake + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.supplier.MsgStakeSupplier.services": + value := x.Services + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgStakeSupplier 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_MsgStakeSupplier) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplier.address": + x.Address = value.Interface().(string) + case "poktroll.supplier.MsgStakeSupplier.stake": + x.Stake = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.supplier.MsgStakeSupplier.services": + x.Services = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgStakeSupplier 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_MsgStakeSupplier) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplier.stake": + if x.Stake == nil { + x.Stake = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Stake.ProtoReflect()) + case "poktroll.supplier.MsgStakeSupplier.address": + panic(fmt.Errorf("field address of message poktroll.supplier.MsgStakeSupplier is not mutable")) + case "poktroll.supplier.MsgStakeSupplier.services": + panic(fmt.Errorf("field services of message poktroll.supplier.MsgStakeSupplier is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgStakeSupplier 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_MsgStakeSupplier) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplier.address": + return protoreflect.ValueOfString("") + case "poktroll.supplier.MsgStakeSupplier.stake": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.supplier.MsgStakeSupplier.services": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgStakeSupplier 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_MsgStakeSupplier) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.MsgStakeSupplier", 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_MsgStakeSupplier) 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_MsgStakeSupplier) 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_MsgStakeSupplier) 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_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgStakeSupplier) + 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.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Stake != nil { + l = options.Size(x.Stake) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Services) + 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().(*MsgStakeSupplier) + 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.Services) > 0 { + i -= len(x.Services) + copy(dAtA[i:], x.Services) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Services))) + i-- + dAtA[i] = 0x1a + } + if x.Stake != nil { + encoded, err := options.Marshal(x.Stake) + 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.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + 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().(*MsgStakeSupplier) + 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: MsgStakeSupplier: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgStakeSupplier: 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 Address", 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.Address = 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 Stake", 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.Stake == nil { + x.Stake = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Stake); err != nil { + 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 Services", 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.Services = 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_MsgStakeSupplierResponse protoreflect.MessageDescriptor +) + +func init() { + file_poktroll_supplier_tx_proto_init() + md_MsgStakeSupplierResponse = File_poktroll_supplier_tx_proto.Messages().ByName("MsgStakeSupplierResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgStakeSupplierResponse)(nil) + +type fastReflection_MsgStakeSupplierResponse MsgStakeSupplierResponse + +func (x *MsgStakeSupplierResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgStakeSupplierResponse)(x) +} + +func (x *MsgStakeSupplierResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_tx_proto_msgTypes[3] + 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_MsgStakeSupplierResponse_messageType fastReflection_MsgStakeSupplierResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgStakeSupplierResponse_messageType{} + +type fastReflection_MsgStakeSupplierResponse_messageType struct{} + +func (x fastReflection_MsgStakeSupplierResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgStakeSupplierResponse)(nil) +} +func (x fastReflection_MsgStakeSupplierResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgStakeSupplierResponse) +} +func (x fastReflection_MsgStakeSupplierResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgStakeSupplierResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgStakeSupplierResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgStakeSupplierResponse +} + +// 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_MsgStakeSupplierResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgStakeSupplierResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgStakeSupplierResponse) New() protoreflect.Message { + return new(fastReflection_MsgStakeSupplierResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgStakeSupplierResponse) Interface() protoreflect.ProtoMessage { + return (*MsgStakeSupplierResponse)(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_MsgStakeSupplierResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgStakeSupplierResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgStakeSupplierResponse 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_MsgStakeSupplierResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgStakeSupplierResponse 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_MsgStakeSupplierResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgStakeSupplierResponse 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_MsgStakeSupplierResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgStakeSupplierResponse 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_MsgStakeSupplierResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgStakeSupplierResponse 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_MsgStakeSupplierResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgStakeSupplierResponse 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_MsgStakeSupplierResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.MsgStakeSupplierResponse", 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_MsgStakeSupplierResponse) 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_MsgStakeSupplierResponse) 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_MsgStakeSupplierResponse) 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_MsgStakeSupplierResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgStakeSupplierResponse) + 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.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().(*MsgStakeSupplierResponse) + 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 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().(*MsgStakeSupplierResponse) + 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: MsgStakeSupplierResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgStakeSupplierResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 @@ -892,8 +1812,6 @@ type MsgUpdateParams struct { // authority is the address that controls the module (defaults to x/gov unless overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the module parameters to update. - // // NOTE: All parameters must be supplied. Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` } @@ -960,6 +1878,83 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_poktroll_supplier_tx_proto_rawDescGZIP(), []int{1} } +type MsgStakeSupplier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Stake *v1beta1.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` + Services string `protobuf:"bytes,3,opt,name=services,proto3" json:"services,omitempty"` +} + +func (x *MsgStakeSupplier) Reset() { + *x = MsgStakeSupplier{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgStakeSupplier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgStakeSupplier) ProtoMessage() {} + +// Deprecated: Use MsgStakeSupplier.ProtoReflect.Descriptor instead. +func (*MsgStakeSupplier) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgStakeSupplier) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *MsgStakeSupplier) GetStake() *v1beta1.Coin { + if x != nil { + return x.Stake + } + return nil +} + +func (x *MsgStakeSupplier) GetServices() string { + if x != nil { + return x.Services + } + return "" +} + +type MsgStakeSupplierResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgStakeSupplierResponse) Reset() { + *x = MsgStakeSupplierResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgStakeSupplierResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgStakeSupplierResponse) ProtoMessage() {} + +// Deprecated: Use MsgStakeSupplierResponse.ProtoReflect.Descriptor instead. +func (*MsgStakeSupplierResponse) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_tx_proto_rawDescGZIP(), []int{3} +} + var File_poktroll_supplier_tx_proto protoreflect.FileDescriptor var file_poktroll_supplier_tx_proto_rawDesc = []byte{ @@ -973,7 +1968,9 @@ var file_poktroll_supplier_tx_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x01, 0x0a, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, @@ -987,13 +1984,30 @@ var file_poktroll_supplier_tx_proto_rawDesc = []byte{ 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x6c, 0x0a, 0x03, 0x4d, 0x73, 0x67, - 0x12, 0x5e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8d, 0x01, 0x0a, 0x10, 0x4d, 0x73, + 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, + 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, + 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xcf, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5e, 0x0a, + 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, + 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x23, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, @@ -1020,21 +2034,27 @@ func file_poktroll_supplier_tx_proto_rawDescGZIP() []byte { return file_poktroll_supplier_tx_proto_rawDescData } -var file_poktroll_supplier_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_poktroll_supplier_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_poktroll_supplier_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: poktroll.supplier.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: poktroll.supplier.MsgUpdateParamsResponse - (*Params)(nil), // 2: poktroll.supplier.Params + (*MsgUpdateParams)(nil), // 0: poktroll.supplier.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: poktroll.supplier.MsgUpdateParamsResponse + (*MsgStakeSupplier)(nil), // 2: poktroll.supplier.MsgStakeSupplier + (*MsgStakeSupplierResponse)(nil), // 3: poktroll.supplier.MsgStakeSupplierResponse + (*Params)(nil), // 4: poktroll.supplier.Params + (*v1beta1.Coin)(nil), // 5: cosmos.base.v1beta1.Coin } var file_poktroll_supplier_tx_proto_depIdxs = []int32{ - 2, // 0: poktroll.supplier.MsgUpdateParams.params:type_name -> poktroll.supplier.Params - 0, // 1: poktroll.supplier.Msg.UpdateParams:input_type -> poktroll.supplier.MsgUpdateParams - 1, // 2: poktroll.supplier.Msg.UpdateParams:output_type -> poktroll.supplier.MsgUpdateParamsResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 4, // 0: poktroll.supplier.MsgUpdateParams.params:type_name -> poktroll.supplier.Params + 5, // 1: poktroll.supplier.MsgStakeSupplier.stake:type_name -> cosmos.base.v1beta1.Coin + 0, // 2: poktroll.supplier.Msg.UpdateParams:input_type -> poktroll.supplier.MsgUpdateParams + 2, // 3: poktroll.supplier.Msg.StakeSupplier:input_type -> poktroll.supplier.MsgStakeSupplier + 1, // 4: poktroll.supplier.Msg.UpdateParams:output_type -> poktroll.supplier.MsgUpdateParamsResponse + 3, // 5: poktroll.supplier.Msg.StakeSupplier:output_type -> poktroll.supplier.MsgStakeSupplierResponse + 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 } func init() { file_poktroll_supplier_tx_proto_init() } @@ -1068,6 +2088,30 @@ func file_poktroll_supplier_tx_proto_init() { return nil } } + file_poktroll_supplier_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgStakeSupplier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_supplier_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgStakeSupplierResponse); 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{ @@ -1075,7 +2119,7 @@ func file_poktroll_supplier_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_supplier_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/poktroll/supplier/tx.proto b/proto/poktroll/supplier/tx.proto index 6e3498e66..df81f2a54 100644 --- a/proto/poktroll/supplier/tx.proto +++ b/proto/poktroll/supplier/tx.proto @@ -1,4 +1,5 @@ syntax = "proto3"; + package poktroll.supplier; import "amino/amino.proto"; @@ -6,35 +7,43 @@ import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "poktroll/supplier/params.proto"; +import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; // Msg defines the Msg service. service Msg { option (cosmos.msg.v1.service) = true; - + // UpdateParams defines a (governance) operation for updating the module // parameters. The authority defaults to the x/gov module account. - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + rpc UpdateParams (MsgUpdateParams ) returns (MsgUpdateParamsResponse ); + rpc StakeSupplier (MsgStakeSupplier) returns (MsgStakeSupplierResponse); } - // MsgUpdateParams is the Msg/UpdateParams request type. message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "poktroll/x/supplier/MsgUpdateParams"; - + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "poktroll/x/supplier/MsgUpdateParams"; + // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // params defines the module parameters to update. - // + // NOTE: All parameters must be supplied. - Params params = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. -message MsgUpdateParamsResponse {} \ No newline at end of file +message MsgUpdateParamsResponse {} + +message MsgStakeSupplier { + option (cosmos.msg.v1.signer) = "address"; + string address = 1; + cosmos.base.v1beta1.Coin stake = 2 [(gogoproto.nullable) = false]; + string services = 3; +} + +message MsgStakeSupplierResponse {} + diff --git a/x/supplier/keeper/msg_server_stake_supplier.go b/x/supplier/keeper/msg_server_stake_supplier.go new file mode 100644 index 000000000..812efdbef --- /dev/null +++ b/x/supplier/keeper/msg_server_stake_supplier.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func (k msgServer) StakeSupplier(goCtx context.Context, msg *types.MsgStakeSupplier) (*types.MsgStakeSupplierResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgStakeSupplierResponse{}, nil +} diff --git a/x/supplier/module/autocli.go b/x/supplier/module/autocli.go index c93ecb201..f2dfc3ac5 100644 --- a/x/supplier/module/autocli.go +++ b/x/supplier/module/autocli.go @@ -39,6 +39,12 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcMethod: "UpdateParams", Skip: true, // skipped because authority gated }, + { + RpcMethod: "StakeSupplier", + Use: "stake-supplier [stake] [services]", + Short: "Send a stake-supplier tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "stake"}, {ProtoField: "services"}}, + }, // this line is used by ignite scaffolding # autocli/tx }, }, diff --git a/x/supplier/module/simulation.go b/x/supplier/module/simulation.go index 67a000511..5b9a3b82f 100644 --- a/x/supplier/module/simulation.go +++ b/x/supplier/module/simulation.go @@ -23,7 +23,11 @@ var ( ) const ( -// this line is used by starport scaffolding # simapp/module/const + opWeightMsgStakeSupplier = "op_weight_msg_stake_supplier" + // TODO: Determine the simulation weight value + defaultWeightMsgStakeSupplier int = 100 + + // this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module. @@ -51,6 +55,17 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) + var weightMsgStakeSupplier int + simState.AppParams.GetOrGenerate(opWeightMsgStakeSupplier, &weightMsgStakeSupplier, nil, + func(_ *rand.Rand) { + weightMsgStakeSupplier = defaultWeightMsgStakeSupplier + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgStakeSupplier, + suppliersimulation.SimulateMsgStakeSupplier(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations @@ -59,6 +74,14 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp // ProposalMsgs returns msgs used for governance proposals for simulations. func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { return []simtypes.WeightedProposalMsg{ + simulation.NewWeightedProposalMsg( + opWeightMsgStakeSupplier, + defaultWeightMsgStakeSupplier, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + suppliersimulation.SimulateMsgStakeSupplier(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/supplier/simulation/stake_supplier.go b/x/supplier/simulation/stake_supplier.go new file mode 100644 index 000000000..a6f79739c --- /dev/null +++ b/x/supplier/simulation/stake_supplier.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/pokt-network/poktroll/x/supplier/keeper" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func SimulateMsgStakeSupplier( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgStakeSupplier{ + Address: simAccount.Address.String(), + } + + // TODO: Handling the StakeSupplier simulation + + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "StakeSupplier simulation not implemented"), nil, nil + } +} diff --git a/x/supplier/types/codec.go b/x/supplier/types/codec.go index ac5526374..cdb58673f 100644 --- a/x/supplier/types/codec.go +++ b/x/supplier/types/codec.go @@ -8,6 +8,9 @@ import ( ) func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgStakeSupplier{}, + ) // this line is used by starport scaffolding # 3 registry.RegisterImplementations((*sdk.Msg)(nil), diff --git a/x/supplier/types/message_stake_supplier.go b/x/supplier/types/message_stake_supplier.go new file mode 100644 index 000000000..033e3049e --- /dev/null +++ b/x/supplier/types/message_stake_supplier.go @@ -0,0 +1,25 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgStakeSupplier{} + +func NewMsgStakeSupplier(address string, stake sdk.Coin, services string) *MsgStakeSupplier { + return &MsgStakeSupplier{ + Address: address, + Stake: stake, + Services: services, + } +} + +func (msg *MsgStakeSupplier) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid address address (%s)", err) + } + return nil +} diff --git a/x/supplier/types/message_stake_supplier_test.go b/x/supplier/types/message_stake_supplier_test.go new file mode 100644 index 000000000..a76170d18 --- /dev/null +++ b/x/supplier/types/message_stake_supplier_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/pokt-network/poktroll/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgStakeSupplier + err error + }{ + { + name: "invalid address", + msg: MsgStakeSupplier{ + Address: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} From 62f7b97f5e3c83e201d73732df92052788770486 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 11:39:27 +0100 Subject: [PATCH 13/29] reconcile: stake supplier message --- api/poktroll/supplier/tx.pulsar.go | 273 ++++++++++++------ proto/poktroll/supplier/tx.proto | 22 +- .../keeper/msg_server_stake_supplier.go | 90 +++++- .../keeper/msg_server_stake_supplier_test.go | 235 +++++++++++++++ x/supplier/types/message_stake_supplier.go | 44 ++- .../types/message_stake_supplier_test.go | 265 ++++++++++++++++- 6 files changed, 812 insertions(+), 117 deletions(-) create mode 100644 x/supplier/keeper/msg_server_stake_supplier_test.go diff --git a/api/poktroll/supplier/tx.pulsar.go b/api/poktroll/supplier/tx.pulsar.go index ed51c87e8..35dcda3f0 100644 --- a/api/poktroll/supplier/tx.pulsar.go +++ b/api/poktroll/supplier/tx.pulsar.go @@ -9,6 +9,7 @@ import ( _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" + shared "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -872,6 +873,57 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } +var _ protoreflect.List = (*_MsgStakeSupplier_3_list)(nil) + +type _MsgStakeSupplier_3_list struct { + list *[]*shared.SupplierServiceConfig +} + +func (x *_MsgStakeSupplier_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgStakeSupplier_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgStakeSupplier_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*shared.SupplierServiceConfig) + (*x.list)[i] = concreteValue +} + +func (x *_MsgStakeSupplier_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*shared.SupplierServiceConfig) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgStakeSupplier_3_list) AppendMutable() protoreflect.Value { + v := new(shared.SupplierServiceConfig) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgStakeSupplier_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgStakeSupplier_3_list) NewElement() protoreflect.Value { + v := new(shared.SupplierServiceConfig) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgStakeSupplier_3_list) IsValid() bool { + return x.list != nil +} + var ( md_MsgStakeSupplier protoreflect.MessageDescriptor fd_MsgStakeSupplier_address protoreflect.FieldDescriptor @@ -964,8 +1016,8 @@ func (x *fastReflection_MsgStakeSupplier) Range(f func(protoreflect.FieldDescrip return } } - if x.Services != "" { - value := protoreflect.ValueOfString(x.Services) + if len(x.Services) != 0 { + value := protoreflect.ValueOfList(&_MsgStakeSupplier_3_list{list: &x.Services}) if !f(fd_MsgStakeSupplier_services, value) { return } @@ -990,7 +1042,7 @@ func (x *fastReflection_MsgStakeSupplier) Has(fd protoreflect.FieldDescriptor) b case "poktroll.supplier.MsgStakeSupplier.stake": return x.Stake != nil case "poktroll.supplier.MsgStakeSupplier.services": - return x.Services != "" + return len(x.Services) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) @@ -1012,7 +1064,7 @@ func (x *fastReflection_MsgStakeSupplier) Clear(fd protoreflect.FieldDescriptor) case "poktroll.supplier.MsgStakeSupplier.stake": x.Stake = nil case "poktroll.supplier.MsgStakeSupplier.services": - x.Services = "" + x.Services = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) @@ -1036,8 +1088,11 @@ func (x *fastReflection_MsgStakeSupplier) Get(descriptor protoreflect.FieldDescr value := x.Stake return protoreflect.ValueOfMessage(value.ProtoReflect()) case "poktroll.supplier.MsgStakeSupplier.services": - value := x.Services - return protoreflect.ValueOfString(value) + if len(x.Services) == 0 { + return protoreflect.ValueOfList(&_MsgStakeSupplier_3_list{}) + } + listValue := &_MsgStakeSupplier_3_list{list: &x.Services} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) @@ -1063,7 +1118,9 @@ func (x *fastReflection_MsgStakeSupplier) Set(fd protoreflect.FieldDescriptor, v case "poktroll.supplier.MsgStakeSupplier.stake": x.Stake = value.Message().Interface().(*v1beta1.Coin) case "poktroll.supplier.MsgStakeSupplier.services": - x.Services = value.Interface().(string) + lv := value.List() + clv := lv.(*_MsgStakeSupplier_3_list) + x.Services = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) @@ -1089,10 +1146,14 @@ func (x *fastReflection_MsgStakeSupplier) Mutable(fd protoreflect.FieldDescripto x.Stake = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.Stake.ProtoReflect()) + case "poktroll.supplier.MsgStakeSupplier.services": + if x.Services == nil { + x.Services = []*shared.SupplierServiceConfig{} + } + value := &_MsgStakeSupplier_3_list{list: &x.Services} + return protoreflect.ValueOfList(value) case "poktroll.supplier.MsgStakeSupplier.address": panic(fmt.Errorf("field address of message poktroll.supplier.MsgStakeSupplier is not mutable")) - case "poktroll.supplier.MsgStakeSupplier.services": - panic(fmt.Errorf("field services of message poktroll.supplier.MsgStakeSupplier is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) @@ -1112,7 +1173,8 @@ func (x *fastReflection_MsgStakeSupplier) NewField(fd protoreflect.FieldDescript m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "poktroll.supplier.MsgStakeSupplier.services": - return protoreflect.ValueOfString("") + list := []*shared.SupplierServiceConfig{} + return protoreflect.ValueOfList(&_MsgStakeSupplier_3_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) @@ -1190,9 +1252,11 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { l = options.Size(x.Stake) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Services) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.Services) > 0 { + for _, e := range x.Services { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.unknownFields != nil { n += len(x.unknownFields) @@ -1224,11 +1288,20 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.unknownFields) } if len(x.Services) > 0 { - i -= len(x.Services) - copy(dAtA[i:], x.Services) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Services))) - i-- - dAtA[i] = 0x1a + for iNdEx := len(x.Services) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Services[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.Stake != nil { encoded, err := options.Marshal(x.Stake) @@ -1372,7 +1445,7 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1382,23 +1455,25 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + 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.Services = string(dAtA[iNdEx:postIndex]) + x.Services = append(x.Services, &shared.SupplierServiceConfig{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Services[len(x.Services)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex default: iNdEx = preIndex @@ -1883,9 +1958,9 @@ type MsgStakeSupplier struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Stake *v1beta1.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` - Services string `protobuf:"bytes,3,opt,name=services,proto3" json:"services,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding + Stake *v1beta1.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) + Services []*shared.SupplierServiceConfig `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` // The list of services this supplier is staked to provide service for } func (x *MsgStakeSupplier) Reset() { @@ -1922,11 +1997,11 @@ func (x *MsgStakeSupplier) GetStake() *v1beta1.Coin { return nil } -func (x *MsgStakeSupplier) GetServices() string { +func (x *MsgStakeSupplier) GetServices() []*shared.SupplierServiceConfig { if x != nil { return x.Services } - return "" + return nil } type MsgStakeSupplierResponse struct { @@ -1966,60 +2041,66 @@ var file_poktroll_supplier_tx_proto_rawDesc = []byte{ 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, + 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x01, 0x0a, - 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x3a, 0x36, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x23, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, - 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8d, 0x01, 0x0a, 0x10, 0x4d, 0x73, - 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, - 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, - 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xcf, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5e, 0x0a, - 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, - 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x23, + 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x01, 0x0a, 0x0f, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x3a, 0x36, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x23, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, + 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc9, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, + 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x32, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x6b, 0x65, 0x12, 0x42, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0xcf, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, + 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, + 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, - 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, + 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x07, 0x54, 0x78, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, + 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2036,25 +2117,27 @@ func file_poktroll_supplier_tx_proto_rawDescGZIP() []byte { var file_poktroll_supplier_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_poktroll_supplier_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: poktroll.supplier.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: poktroll.supplier.MsgUpdateParamsResponse - (*MsgStakeSupplier)(nil), // 2: poktroll.supplier.MsgStakeSupplier - (*MsgStakeSupplierResponse)(nil), // 3: poktroll.supplier.MsgStakeSupplierResponse - (*Params)(nil), // 4: poktroll.supplier.Params - (*v1beta1.Coin)(nil), // 5: cosmos.base.v1beta1.Coin + (*MsgUpdateParams)(nil), // 0: poktroll.supplier.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: poktroll.supplier.MsgUpdateParamsResponse + (*MsgStakeSupplier)(nil), // 2: poktroll.supplier.MsgStakeSupplier + (*MsgStakeSupplierResponse)(nil), // 3: poktroll.supplier.MsgStakeSupplierResponse + (*Params)(nil), // 4: poktroll.supplier.Params + (*v1beta1.Coin)(nil), // 5: cosmos.base.v1beta1.Coin + (*shared.SupplierServiceConfig)(nil), // 6: poktroll.shared.SupplierServiceConfig } var file_poktroll_supplier_tx_proto_depIdxs = []int32{ 4, // 0: poktroll.supplier.MsgUpdateParams.params:type_name -> poktroll.supplier.Params 5, // 1: poktroll.supplier.MsgStakeSupplier.stake:type_name -> cosmos.base.v1beta1.Coin - 0, // 2: poktroll.supplier.Msg.UpdateParams:input_type -> poktroll.supplier.MsgUpdateParams - 2, // 3: poktroll.supplier.Msg.StakeSupplier:input_type -> poktroll.supplier.MsgStakeSupplier - 1, // 4: poktroll.supplier.Msg.UpdateParams:output_type -> poktroll.supplier.MsgUpdateParamsResponse - 3, // 5: poktroll.supplier.Msg.StakeSupplier:output_type -> poktroll.supplier.MsgStakeSupplierResponse - 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 + 6, // 2: poktroll.supplier.MsgStakeSupplier.services:type_name -> poktroll.shared.SupplierServiceConfig + 0, // 3: poktroll.supplier.Msg.UpdateParams:input_type -> poktroll.supplier.MsgUpdateParams + 2, // 4: poktroll.supplier.Msg.StakeSupplier:input_type -> poktroll.supplier.MsgStakeSupplier + 1, // 5: poktroll.supplier.Msg.UpdateParams:output_type -> poktroll.supplier.MsgUpdateParamsResponse + 3, // 6: poktroll.supplier.Msg.StakeSupplier:output_type -> poktroll.supplier.MsgStakeSupplierResponse + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] 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_poktroll_supplier_tx_proto_init() } diff --git a/proto/poktroll/supplier/tx.proto b/proto/poktroll/supplier/tx.proto index df81f2a54..4b1eab4cf 100644 --- a/proto/poktroll/supplier/tx.proto +++ b/proto/poktroll/supplier/tx.proto @@ -6,30 +6,31 @@ import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -import "poktroll/supplier/params.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "poktroll/supplier/params.proto"; +import "poktroll/shared/service.proto"; option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; // Msg defines the Msg service. service Msg { option (cosmos.msg.v1.service) = true; - + // UpdateParams defines a (governance) operation for updating the module // parameters. The authority defaults to the x/gov module account. - rpc UpdateParams (MsgUpdateParams ) returns (MsgUpdateParamsResponse ); + rpc UpdateParams (MsgUpdateParams) returns (MsgUpdateParamsResponse); rpc StakeSupplier (MsgStakeSupplier) returns (MsgStakeSupplierResponse); } // MsgUpdateParams is the Msg/UpdateParams request type. message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; + option (cosmos.msg.v1.signer) = "authority"; option (amino.name) = "poktroll/x/supplier/MsgUpdateParams"; - + // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // params defines the module parameters to update. - + // NOTE: All parameters must be supplied. Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } @@ -39,10 +40,11 @@ message MsgUpdateParams { message MsgUpdateParamsResponse {} message MsgStakeSupplier { - option (cosmos.msg.v1.signer) = "address"; - string address = 1; - cosmos.base.v1beta1.Coin stake = 2 [(gogoproto.nullable) = false]; - string services = 3; + option (cosmos.msg.v1.signer) = "address"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding + cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) + repeated poktroll.shared.SupplierServiceConfig services = 3; // The list of services this supplier is staked to provide service for } message MsgStakeSupplierResponse {} diff --git a/x/supplier/keeper/msg_server_stake_supplier.go b/x/supplier/keeper/msg_server_stake_supplier.go index 812efdbef..d99447da1 100644 --- a/x/supplier/keeper/msg_server_stake_supplier.go +++ b/x/supplier/keeper/msg_server_stake_supplier.go @@ -2,16 +2,102 @@ package keeper import ( "context" + "fmt" + sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" + + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" "github.com/pokt-network/poktroll/x/supplier/types" ) func (k msgServer) StakeSupplier(goCtx context.Context, msg *types.MsgStakeSupplier) (*types.MsgStakeSupplierResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - // TODO: Handling the message - _ = ctx + logger := k.Logger().With("method", "StakeSupplier") + logger.Info(fmt.Sprintf("About to stake supplier with msg: %v", msg)) + + if err := msg.ValidateBasic(); err != nil { + logger.Error(fmt.Sprintf("invalid MsgStakeSupplier: %v", msg)) + return nil, err + } + + // Check if the supplier already exists or not + var err error + var coinsToDelegate sdk.Coin + supplier, isSupplierFound := k.GetSupplier(ctx, msg.Address) + if !isSupplierFound { + logger.Info(fmt.Sprintf("Supplier not found. Creating new supplier for address %s", msg.Address)) + supplier = k.createSupplier(ctx, msg) + coinsToDelegate = *msg.Stake + } else { + logger.Info(fmt.Sprintf("Supplier found. Updating supplier for address %s", msg.Address)) + currSupplierStake := *supplier.Stake + if err = k.updateSupplier(ctx, &supplier, msg); err != nil { + return nil, err + } + coinsToDelegate = (*msg.Stake).Sub(currSupplierStake) + } + + // Retrieve the address of the supplier + supplierAddress, err := sdk.AccAddressFromBech32(msg.Address) + if err != nil { + logger.Error(fmt.Sprintf("could not parse address %s", msg.Address)) + return nil, err + } + + // TODO_IMPROVE: Should we avoid making this call if `coinsToDelegate` = 0? + // Send the coins from the supplier to the staked supplier pool + err = k.bankKeeper.DelegateCoinsFromAccountToModule(ctx, supplierAddress, types.ModuleName, []sdk.Coin{coinsToDelegate}) + if err != nil { + logger.Error(fmt.Sprintf("could not send %v coins from %s to %s module account due to %v", coinsToDelegate, supplierAddress, types.ModuleName, err)) + return nil, err + } + + // Update the Supplier in the store + k.SetSupplier(ctx, supplier) + logger.Info(fmt.Sprintf("Successfully updated supplier stake for supplier: %+v", supplier)) return &types.MsgStakeSupplierResponse{}, nil } + +func (k msgServer) createSupplier( + ctx sdk.Context, + msg *types.MsgStakeSupplier, +) sharedtypes.Supplier { + return sharedtypes.Supplier{ + Address: msg.Address, + Stake: msg.Stake, + Services: msg.Services, + } +} + +func (k msgServer) updateSupplier( + ctx sdk.Context, + supplier *sharedtypes.Supplier, + msg *types.MsgStakeSupplier, +) error { + // Checks if the the msg address is the same as the current owner + if msg.Address != supplier.Address { + return sdkerrors.Wrapf(types.ErrSupplierUnauthorized, "msg Address (%s) != supplier address (%s)", msg.Address, supplier.Address) + } + + // Validate that the stake is not being lowered + if msg.Stake == nil { + return sdkerrors.Wrapf(types.ErrSupplierInvalidStake, "stake amount cannot be nil") + } + if msg.Stake.IsLTE(*supplier.Stake) { + + return sdkerrors.Wrapf(types.ErrSupplierInvalidStake, "stake amount %v must be higher than previous stake amount %v", msg.Stake, supplier.Stake) + } + supplier.Stake = msg.Stake + + // Validate that the service configs maintain at least one service. + // Additional validation is done in `msg.ValidateBasic` above. + if len(msg.Services) == 0 { + return sdkerrors.Wrapf(types.ErrSupplierInvalidServiceConfig, "must have at least one service") + } + supplier.Services = msg.Services + + return nil +} diff --git a/x/supplier/keeper/msg_server_stake_supplier_test.go b/x/supplier/keeper/msg_server_stake_supplier_test.go new file mode 100644 index 000000000..c97ee5558 --- /dev/null +++ b/x/supplier/keeper/msg_server_stake_supplier_test.go @@ -0,0 +1,235 @@ +package keeper_test + +import ( + "testing" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/testutil/sample" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + "github.com/pokt-network/poktroll/x/supplier/keeper" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func TestMsgServer_StakeSupplier_SuccessfulCreateAndUpdate(t *testing.T) { + k, ctx := keepertest.SupplierKeeper(t) + srv := keeper.NewMsgServerImpl(k) + wctx := sdk.WrapSDKContext(ctx) + + // Generate an address for the supplier + addr := sample.AccAddress() + + // Verify that the supplier does not exist yet + _, isSupplierFound := k.GetSupplier(ctx, addr) + require.False(t, isSupplierFound) + + // Prepare the stakeMsg + stakeMsg := &types.MsgStakeSupplier{ + Address: addr, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8080", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + } + + // Stake the supplier + _, err := srv.StakeSupplier(wctx, stakeMsg) + require.NoError(t, err) + + // Verify that the supplier exists + supplierFound, isSupplierFound := k.GetSupplier(ctx, addr) + require.True(t, isSupplierFound) + require.Equal(t, addr, supplierFound.Address) + require.Equal(t, int64(100), supplierFound.Stake.Amount.Int64()) + require.Len(t, supplierFound.Services, 1) + require.Equal(t, "svcId", supplierFound.Services[0].Service.Id) + require.Len(t, supplierFound.Services[0].Endpoints, 1) + require.Equal(t, "http://localhost:8080", supplierFound.Services[0].Endpoints[0].Url) + + // Prepare an updated supplier with a higher stake and a different URL for the service + updateMsg := &types.MsgStakeSupplier{ + Address: addr, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(200)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId2", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8082", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + } + + // Update the staked supplier + _, err = srv.StakeSupplier(wctx, updateMsg) + require.NoError(t, err) + supplierFound, isSupplierFound = k.GetSupplier(ctx, addr) + require.True(t, isSupplierFound) + require.Equal(t, int64(200), supplierFound.Stake.Amount.Int64()) + require.Len(t, supplierFound.Services, 1) + require.Equal(t, "svcId2", supplierFound.Services[0].Service.Id) + require.Len(t, supplierFound.Services[0].Endpoints, 1) + require.Equal(t, "http://localhost:8082", supplierFound.Services[0].Endpoints[0].Url) +} + +func TestMsgServer_StakeSupplier_FailRestakingDueToInvalidServices(t *testing.T) { + k, ctx := keepertest.SupplierKeeper(t) + srv := keeper.NewMsgServerImpl(k) + + supplierAddr := sample.AccAddress() + + // Prepare the supplier stake message + stakeMsg := &types.MsgStakeSupplier{ + Address: supplierAddr, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8080", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + } + + // Stake the supplier + _, err := srv.StakeSupplier(ctx, stakeMsg) + require.NoError(t, err) + + // Prepare the supplier stake message without any service endpoints + updateStakeMsg := &types.MsgStakeSupplier{ + Address: supplierAddr, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{Id: "svcId"}, + Endpoints: []*sharedtypes.SupplierEndpoint{}, + }, + }, + } + + // Fail updating the supplier when the list of service endpoints is empty + _, err = srv.StakeSupplier(ctx, updateStakeMsg) + require.Error(t, err) + + // Verify the supplierFound still exists and is staked for svc1 + supplierFound, isSupplierFound := k.GetSupplier(ctx, supplierAddr) + require.True(t, isSupplierFound) + require.Equal(t, supplierAddr, supplierFound.Address) + require.Len(t, supplierFound.Services, 1) + require.Equal(t, "svcId", supplierFound.Services[0].Service.Id) + require.Len(t, supplierFound.Services[0].Endpoints, 1) + require.Equal(t, "http://localhost:8080", supplierFound.Services[0].Endpoints[0].Url) + + // Prepare the supplier stake message with an invalid service ID + updateStakeMsg = &types.MsgStakeSupplier{ + Address: supplierAddr, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{Id: "svc1 INVALID ! & *"}, + }, + }, + } + + // Fail updating the supplier when the list of services is empty + _, err = srv.StakeSupplier(ctx, updateStakeMsg) + require.Error(t, err) + + // Verify the supplier still exists and is staked for svc1 + supplierFound, isSupplierFound = k.GetSupplier(ctx, supplierAddr) + require.True(t, isSupplierFound) + require.Equal(t, supplierAddr, supplierFound.Address) + require.Len(t, supplierFound.Services, 1) + require.Equal(t, "svcId", supplierFound.Services[0].Service.Id) + require.Len(t, supplierFound.Services[0].Endpoints, 1) + require.Equal(t, "http://localhost:8080", supplierFound.Services[0].Endpoints[0].Url) +} + +func TestMsgServer_StakeSupplier_FailLoweringStake(t *testing.T) { + k, ctx := keepertest.SupplierKeeper(t) + srv := keeper.NewMsgServerImpl(k) + + // Prepare the supplier + addr := sample.AccAddress() + stakeMsg := &types.MsgStakeSupplier{ + Address: addr, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8080", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + } + + // Stake the supplier & verify that the supplier exists + _, err := srv.StakeSupplier(ctx, stakeMsg) + require.NoError(t, err) + _, isSupplierFound := k.GetSupplier(ctx, addr) + require.True(t, isSupplierFound) + + // Prepare an updated supplier with a lower stake + updateMsg := &types.MsgStakeSupplier{ + Address: addr, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(50)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8080", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + } + + // Verify that it fails + _, err = srv.StakeSupplier(ctx, updateMsg) + require.Error(t, err) + + // Verify that the supplier stake is unchanged + supplierFound, isSupplierFound := k.GetSupplier(ctx, addr) + require.True(t, isSupplierFound) + require.Equal(t, int64(100), supplierFound.Stake.Amount.Int64()) + require.Len(t, supplierFound.Services, 1) +} diff --git a/x/supplier/types/message_stake_supplier.go b/x/supplier/types/message_stake_supplier.go index 033e3049e..44589187d 100644 --- a/x/supplier/types/message_stake_supplier.go +++ b/x/supplier/types/message_stake_supplier.go @@ -1,25 +1,57 @@ package types import ( - errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + servicehelpers "github.com/pokt-network/poktroll/x/shared/helpers" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) +const TypeMsgStakeSupplier = "stake_supplier" + var _ sdk.Msg = &MsgStakeSupplier{} -func NewMsgStakeSupplier(address string, stake sdk.Coin, services string) *MsgStakeSupplier { +func NewMsgStakeSupplier( + address string, + stake sdk.Coin, + services []*sharedtypes.SupplierServiceConfig, +) *MsgStakeSupplier { return &MsgStakeSupplier{ Address: address, - Stake: stake, + Stake: &stake, Services: services, } } func (msg *MsgStakeSupplier) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Address) + // Validate the address + if _, err := sdk.AccAddressFromBech32(msg.Address); err != nil { + return ErrSupplierInvalidAddress.Wrapf("invalid supplier address %s; (%v)", msg.Address, err) + } + + // TODO_TECHDEBT: Centralize stake related verification and share across different parts of the source code + // Validate the stake amount + if msg.Stake == nil { + return ErrSupplierInvalidStake.Wrap("nil supplier stake") + } + stake, err := sdk.ParseCoinNormalized(msg.Stake.String()) + if !stake.IsValid() { + return ErrSupplierInvalidStake.Wrapf("invalid supplier stake %v; (%v)", msg.Stake, stake.Validate()) + } if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid address address (%s)", err) + return ErrSupplierInvalidStake.Wrapf("cannot parse supplier stake %v; (%v)", msg.Stake, err) } + if stake.IsZero() || stake.IsNegative() { + return ErrSupplierInvalidStake.Wrapf("invalid stake amount for supplier: %v <= 0", msg.Stake) + } + if stake.Denom != "upokt" { + return ErrSupplierInvalidStake.Wrapf("invalid stake amount denom for supplier %v", msg.Stake) + } + + // Validate the supplier service configs + if err := servicehelpers.ValidateSupplierServiceConfigs(msg.Services); err != nil { + return ErrSupplierInvalidServiceConfig.Wrapf(err.Error()) + } + return nil } diff --git a/x/supplier/types/message_stake_supplier_test.go b/x/supplier/types/message_stake_supplier_test.go index a76170d18..76798c98a 100644 --- a/x/supplier/types/message_stake_supplier_test.go +++ b/x/supplier/types/message_stake_supplier_test.go @@ -3,30 +3,287 @@ package types import ( "testing" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/pokt-network/poktroll/testutil/sample" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + "github.com/stretchr/testify/require" ) func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { + defaultServicesList := []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId1", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8081", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }} + tests := []struct { name string msg MsgStakeSupplier err error }{ + // address related tests { - name: "invalid address", + name: "invalid address - nil stake", msg: MsgStakeSupplier{ Address: "invalid_address", + // Stake explicitly nil + Services: defaultServicesList, + }, + err: ErrSupplierInvalidAddress, + }, + + // stake related tests + { + name: "valid address - nil stake", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + // Stake explicitly nil + Services: defaultServicesList, + }, + err: ErrSupplierInvalidStake, + }, { + name: "valid address - valid stake", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: defaultServicesList, + }, + }, { + name: "valid address - zero stake", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(0)}, + Services: defaultServicesList, }, - err: sdkerrors.ErrInvalidAddress, + err: ErrSupplierInvalidStake, }, { - name: "valid address", + name: "valid address - negative stake", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(-100)}, + Services: defaultServicesList, + }, + err: ErrSupplierInvalidStake, + }, { + name: "valid address - invalid stake denom", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "invalid", Amount: math.NewInt(100)}, + Services: defaultServicesList, + }, + err: ErrSupplierInvalidStake, + }, { + name: "valid address - invalid stake missing denom", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "", Amount: math.NewInt(100)}, + Services: defaultServicesList, + }, + err: ErrSupplierInvalidStake, + }, + + // service related tests + { + name: "valid service configs - multiple services", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId1", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8081", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + { + Service: &sharedtypes.Service{ + Id: "svcId2", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8082", + RpcType: sharedtypes.RPCType_GRPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + }, + }, + { + name: "invalid service configs - omitted", msg: MsgStakeSupplier{ Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + // Services: intentionally omitted }, + err: ErrSupplierInvalidServiceConfig, }, + { + name: "invalid service configs - empty", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{}, + }, + err: ErrSupplierInvalidServiceConfig, + }, + { + name: "invalid service configs - invalid service ID that's too long", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "123456790", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8080", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + }, + err: ErrSupplierInvalidServiceConfig, + }, + { + name: "invalid service configs - invalid service Name that's too long", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "123", + Name: "abcdefghijklmnopqrstuvwxyzab-abcdefghijklmnopqrstuvwxyzab", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8080", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + }, + err: ErrSupplierInvalidServiceConfig, + }, + { + name: "invalid service configs - invalid service ID that contains invalid characters", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "12 45 !", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8080", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + }, + err: ErrSupplierInvalidServiceConfig, + }, + { + name: "invalid service configs - missing url", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId", + Name: "name", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + // Url: intentionally omitted + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + }, + err: ErrSupplierInvalidServiceConfig, + }, + { + name: "invalid service configs - invalid url", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId", + Name: "name", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "I am not a valid URL", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + }, + err: ErrSupplierInvalidServiceConfig, + }, + { + name: "invalid service configs - missing rpc type", + msg: MsgStakeSupplier{ + Address: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId", + Name: "name", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8080", + // RpcType: intentionally omitted, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + }, + err: ErrSupplierInvalidServiceConfig, + }, + // TODO_TEST: Need to add more tests around config types } + for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { err := tt.msg.ValidateBasic() From bf72fea748f6234a8894b43773040c328f6bae56 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 11:44:24 +0100 Subject: [PATCH 14/29] reconcile: mock bank keeper --- Makefile | 2 +- testutil/keeper/supplier.go | 9 ++++++++- x/supplier/types/expected_keepers.go | 6 ++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9948dce6d..12dc3ce5d 100644 --- a/Makefile +++ b/Makefile @@ -246,7 +246,7 @@ go_mockgen: ## Use `mockgen` to generate mocks used for testing purposes of all find . -name "*_mock.go" | xargs --no-run-if-empty rm # go generate ./x/application/types/ go generate ./x/gateway/types/ - # go generate ./x/supplier/types/ + go generate ./x/supplier/types/ # go generate ./x/session/types/ go generate ./x/service/types/ # go generate ./x/tokenomics/types/ diff --git a/testutil/keeper/supplier.go b/testutil/keeper/supplier.go index e848b5e84..ba9cb9b46 100644 --- a/testutil/keeper/supplier.go +++ b/testutil/keeper/supplier.go @@ -15,8 +15,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/testutil/supplier/mocks" "github.com/pokt-network/poktroll/x/supplier/keeper" "github.com/pokt-network/poktroll/x/supplier/types" ) @@ -35,12 +37,17 @@ func SupplierKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { cdc := codec.NewProtoCodec(registry) authority := authtypes.NewModuleAddress(govtypes.ModuleName) + ctrl := gomock.NewController(t) + mockBankKeeper := mocks.NewMockBankKeeper(ctrl) + mockBankKeeper.EXPECT().DelegateCoinsFromAccountToModule(gomock.Any(), gomock.Any(), types.ModuleName, gomock.Any()).AnyTimes() + mockBankKeeper.EXPECT().UndelegateCoinsFromModuleToAccount(gomock.Any(), types.ModuleName, gomock.Any(), gomock.Any()).AnyTimes() + k := keeper.NewKeeper( cdc, runtime.NewKVStoreService(storeKey), log.NewNopLogger(), authority.String(), - nil, + mockBankKeeper, ) ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) diff --git a/x/supplier/types/expected_keepers.go b/x/supplier/types/expected_keepers.go index 4a50d01a9..6680b26e0 100644 --- a/x/supplier/types/expected_keepers.go +++ b/x/supplier/types/expected_keepers.go @@ -1,3 +1,5 @@ +//go:generate mockgen -destination ../../../testutil/supplier/mocks/expected_keepers_mock.go -package mocks . AccountKeeper,BankKeeper + package types import ( @@ -14,8 +16,8 @@ type AccountKeeper interface { // BankKeeper defines the expected interface for the Bank module. type BankKeeper interface { - SpendableCoins(context.Context, sdk.AccAddress) sdk.Coins - // Methods imported from bank should be defined here + DelegateCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error } // ParamSubspace defines the expected Subspace interface for parameters. From 6c2ba4efcae6d2f72cb67d9d93a431ac1864f222 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 11:46:22 +0100 Subject: [PATCH 15/29] scaffold: message unstake-supplier --module supplier --signer address --- api/poktroll/supplier/tx.pulsar.go | 949 +++++++++++++++++- proto/poktroll/supplier/tx.proto | 25 +- .../keeper/msg_server_unstake_supplier.go | 17 + x/supplier/module/autocli.go | 6 + x/supplier/module/simulation.go | 23 + x/supplier/simulation/unstake_supplier.go | 29 + x/supplier/types/codec.go | 3 + x/supplier/types/message_unstake_supplier.go | 23 + .../types/message_unstake_supplier_test.go | 40 + 9 files changed, 1070 insertions(+), 45 deletions(-) create mode 100644 x/supplier/keeper/msg_server_unstake_supplier.go create mode 100644 x/supplier/simulation/unstake_supplier.go create mode 100644 x/supplier/types/message_unstake_supplier.go create mode 100644 x/supplier/types/message_unstake_supplier_test.go diff --git a/api/poktroll/supplier/tx.pulsar.go b/api/poktroll/supplier/tx.pulsar.go index 35dcda3f0..b621f6d0f 100644 --- a/api/poktroll/supplier/tx.pulsar.go +++ b/api/poktroll/supplier/tx.pulsar.go @@ -1866,6 +1866,782 @@ func (x *fastReflection_MsgStakeSupplierResponse) ProtoMethods() *protoiface.Met } } +var ( + md_MsgUnstakeSupplier protoreflect.MessageDescriptor + fd_MsgUnstakeSupplier_address protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_supplier_tx_proto_init() + md_MsgUnstakeSupplier = File_poktroll_supplier_tx_proto.Messages().ByName("MsgUnstakeSupplier") + fd_MsgUnstakeSupplier_address = md_MsgUnstakeSupplier.Fields().ByName("address") +} + +var _ protoreflect.Message = (*fastReflection_MsgUnstakeSupplier)(nil) + +type fastReflection_MsgUnstakeSupplier MsgUnstakeSupplier + +func (x *MsgUnstakeSupplier) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUnstakeSupplier)(x) +} + +func (x *MsgUnstakeSupplier) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_tx_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_MsgUnstakeSupplier_messageType fastReflection_MsgUnstakeSupplier_messageType +var _ protoreflect.MessageType = fastReflection_MsgUnstakeSupplier_messageType{} + +type fastReflection_MsgUnstakeSupplier_messageType struct{} + +func (x fastReflection_MsgUnstakeSupplier_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUnstakeSupplier)(nil) +} +func (x fastReflection_MsgUnstakeSupplier_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUnstakeSupplier) +} +func (x fastReflection_MsgUnstakeSupplier_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUnstakeSupplier +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUnstakeSupplier) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUnstakeSupplier +} + +// 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_MsgUnstakeSupplier) Type() protoreflect.MessageType { + return _fastReflection_MsgUnstakeSupplier_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUnstakeSupplier) New() protoreflect.Message { + return new(fastReflection_MsgUnstakeSupplier) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUnstakeSupplier) Interface() protoreflect.ProtoMessage { + return (*MsgUnstakeSupplier)(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_MsgUnstakeSupplier) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_MsgUnstakeSupplier_address, 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_MsgUnstakeSupplier) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplier.address": + return x.Address != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplier")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUnstakeSupplier 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_MsgUnstakeSupplier) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplier.address": + x.Address = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplier")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUnstakeSupplier 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_MsgUnstakeSupplier) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.supplier.MsgUnstakeSupplier.address": + value := x.Address + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplier")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUnstakeSupplier 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_MsgUnstakeSupplier) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplier.address": + x.Address = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplier")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUnstakeSupplier 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_MsgUnstakeSupplier) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplier.address": + panic(fmt.Errorf("field address of message poktroll.supplier.MsgUnstakeSupplier is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplier")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUnstakeSupplier 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_MsgUnstakeSupplier) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplier.address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplier")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUnstakeSupplier 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_MsgUnstakeSupplier) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.MsgUnstakeSupplier", 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_MsgUnstakeSupplier) 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_MsgUnstakeSupplier) 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_MsgUnstakeSupplier) 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_MsgUnstakeSupplier) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUnstakeSupplier) + 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.Address) + 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().(*MsgUnstakeSupplier) + 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.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + 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().(*MsgUnstakeSupplier) + 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: MsgUnstakeSupplier: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUnstakeSupplier: 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 Address", 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.Address = 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_MsgUnstakeSupplierResponse protoreflect.MessageDescriptor +) + +func init() { + file_poktroll_supplier_tx_proto_init() + md_MsgUnstakeSupplierResponse = File_poktroll_supplier_tx_proto.Messages().ByName("MsgUnstakeSupplierResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUnstakeSupplierResponse)(nil) + +type fastReflection_MsgUnstakeSupplierResponse MsgUnstakeSupplierResponse + +func (x *MsgUnstakeSupplierResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUnstakeSupplierResponse)(x) +} + +func (x *MsgUnstakeSupplierResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_supplier_tx_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_MsgUnstakeSupplierResponse_messageType fastReflection_MsgUnstakeSupplierResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUnstakeSupplierResponse_messageType{} + +type fastReflection_MsgUnstakeSupplierResponse_messageType struct{} + +func (x fastReflection_MsgUnstakeSupplierResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUnstakeSupplierResponse)(nil) +} +func (x fastReflection_MsgUnstakeSupplierResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUnstakeSupplierResponse) +} +func (x fastReflection_MsgUnstakeSupplierResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUnstakeSupplierResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUnstakeSupplierResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUnstakeSupplierResponse +} + +// 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_MsgUnstakeSupplierResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUnstakeSupplierResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUnstakeSupplierResponse) New() protoreflect.Message { + return new(fastReflection_MsgUnstakeSupplierResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUnstakeSupplierResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUnstakeSupplierResponse)(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_MsgUnstakeSupplierResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgUnstakeSupplierResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUnstakeSupplierResponse 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_MsgUnstakeSupplierResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUnstakeSupplierResponse 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_MsgUnstakeSupplierResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUnstakeSupplierResponse 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_MsgUnstakeSupplierResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUnstakeSupplierResponse 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_MsgUnstakeSupplierResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUnstakeSupplierResponse 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_MsgUnstakeSupplierResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplierResponse")) + } + panic(fmt.Errorf("message poktroll.supplier.MsgUnstakeSupplierResponse 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_MsgUnstakeSupplierResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.supplier.MsgUnstakeSupplierResponse", 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_MsgUnstakeSupplierResponse) 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_MsgUnstakeSupplierResponse) 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_MsgUnstakeSupplierResponse) 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_MsgUnstakeSupplierResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUnstakeSupplierResponse) + 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.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().(*MsgUnstakeSupplierResponse) + 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 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().(*MsgUnstakeSupplierResponse) + 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: MsgUnstakeSupplierResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUnstakeSupplierResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 @@ -2030,6 +2806,67 @@ func (*MsgStakeSupplierResponse) Descriptor() ([]byte, []int) { return file_poktroll_supplier_tx_proto_rawDescGZIP(), []int{3} } +type MsgUnstakeSupplier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *MsgUnstakeSupplier) Reset() { + *x = MsgUnstakeSupplier{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUnstakeSupplier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUnstakeSupplier) ProtoMessage() {} + +// Deprecated: Use MsgUnstakeSupplier.ProtoReflect.Descriptor instead. +func (*MsgUnstakeSupplier) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgUnstakeSupplier) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +type MsgUnstakeSupplierResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUnstakeSupplierResponse) Reset() { + *x = MsgUnstakeSupplierResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_supplier_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUnstakeSupplierResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUnstakeSupplierResponse) ProtoMessage() {} + +// Deprecated: Use MsgUnstakeSupplierResponse.ProtoReflect.Descriptor instead. +func (*MsgUnstakeSupplierResponse) Descriptor() ([]byte, []int) { + return file_poktroll_supplier_tx_proto_rawDescGZIP(), []int{5} +} + var File_poktroll_supplier_tx_proto protoreflect.FileDescriptor var file_poktroll_supplier_tx_proto_rawDesc = []byte{ @@ -2076,31 +2913,43 @@ var file_poktroll_supplier_tx_proto_rawDesc = []byte{ 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0xcf, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x22, 0x3c, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1c, + 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb8, 0x02, 0x0a, + 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, - 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, - 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2b, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, - 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x07, 0x54, 0x78, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, - 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, + 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, + 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x0f, 0x55, 0x6e, 0x73, 0x74, 0x61, + 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x1a, 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, + 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2115,26 +2964,30 @@ func file_poktroll_supplier_tx_proto_rawDescGZIP() []byte { return file_poktroll_supplier_tx_proto_rawDescData } -var file_poktroll_supplier_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_poktroll_supplier_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_poktroll_supplier_tx_proto_goTypes = []interface{}{ (*MsgUpdateParams)(nil), // 0: poktroll.supplier.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 1: poktroll.supplier.MsgUpdateParamsResponse (*MsgStakeSupplier)(nil), // 2: poktroll.supplier.MsgStakeSupplier (*MsgStakeSupplierResponse)(nil), // 3: poktroll.supplier.MsgStakeSupplierResponse - (*Params)(nil), // 4: poktroll.supplier.Params - (*v1beta1.Coin)(nil), // 5: cosmos.base.v1beta1.Coin - (*shared.SupplierServiceConfig)(nil), // 6: poktroll.shared.SupplierServiceConfig + (*MsgUnstakeSupplier)(nil), // 4: poktroll.supplier.MsgUnstakeSupplier + (*MsgUnstakeSupplierResponse)(nil), // 5: poktroll.supplier.MsgUnstakeSupplierResponse + (*Params)(nil), // 6: poktroll.supplier.Params + (*v1beta1.Coin)(nil), // 7: cosmos.base.v1beta1.Coin + (*shared.SupplierServiceConfig)(nil), // 8: poktroll.shared.SupplierServiceConfig } var file_poktroll_supplier_tx_proto_depIdxs = []int32{ - 4, // 0: poktroll.supplier.MsgUpdateParams.params:type_name -> poktroll.supplier.Params - 5, // 1: poktroll.supplier.MsgStakeSupplier.stake:type_name -> cosmos.base.v1beta1.Coin - 6, // 2: poktroll.supplier.MsgStakeSupplier.services:type_name -> poktroll.shared.SupplierServiceConfig + 6, // 0: poktroll.supplier.MsgUpdateParams.params:type_name -> poktroll.supplier.Params + 7, // 1: poktroll.supplier.MsgStakeSupplier.stake:type_name -> cosmos.base.v1beta1.Coin + 8, // 2: poktroll.supplier.MsgStakeSupplier.services:type_name -> poktroll.shared.SupplierServiceConfig 0, // 3: poktroll.supplier.Msg.UpdateParams:input_type -> poktroll.supplier.MsgUpdateParams 2, // 4: poktroll.supplier.Msg.StakeSupplier:input_type -> poktroll.supplier.MsgStakeSupplier - 1, // 5: poktroll.supplier.Msg.UpdateParams:output_type -> poktroll.supplier.MsgUpdateParamsResponse - 3, // 6: poktroll.supplier.Msg.StakeSupplier:output_type -> poktroll.supplier.MsgStakeSupplierResponse - 5, // [5:7] is the sub-list for method output_type - 3, // [3:5] is the sub-list for method input_type + 4, // 5: poktroll.supplier.Msg.UnstakeSupplier:input_type -> poktroll.supplier.MsgUnstakeSupplier + 1, // 6: poktroll.supplier.Msg.UpdateParams:output_type -> poktroll.supplier.MsgUpdateParamsResponse + 3, // 7: poktroll.supplier.Msg.StakeSupplier:output_type -> poktroll.supplier.MsgStakeSupplierResponse + 5, // 8: poktroll.supplier.Msg.UnstakeSupplier:output_type -> poktroll.supplier.MsgUnstakeSupplierResponse + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] 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 @@ -2195,6 +3048,30 @@ func file_poktroll_supplier_tx_proto_init() { return nil } } + file_poktroll_supplier_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUnstakeSupplier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_supplier_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUnstakeSupplierResponse); 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{ @@ -2202,7 +3079,7 @@ func file_poktroll_supplier_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_supplier_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/poktroll/supplier/tx.proto b/proto/poktroll/supplier/tx.proto index 4b1eab4cf..3249fbbca 100644 --- a/proto/poktroll/supplier/tx.proto +++ b/proto/poktroll/supplier/tx.proto @@ -15,22 +15,23 @@ option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; // Msg defines the Msg service. service Msg { option (cosmos.msg.v1.service) = true; - + // UpdateParams defines a (governance) operation for updating the module // parameters. The authority defaults to the x/gov module account. - rpc UpdateParams (MsgUpdateParams) returns (MsgUpdateParamsResponse); - rpc StakeSupplier (MsgStakeSupplier) returns (MsgStakeSupplierResponse); + rpc UpdateParams (MsgUpdateParams ) returns (MsgUpdateParamsResponse ); + rpc StakeSupplier (MsgStakeSupplier ) returns (MsgStakeSupplierResponse ); + rpc UnstakeSupplier (MsgUnstakeSupplier) returns (MsgUnstakeSupplierResponse); } // MsgUpdateParams is the Msg/UpdateParams request type. message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; + option (cosmos.msg.v1.signer) = "authority"; option (amino.name) = "poktroll/x/supplier/MsgUpdateParams"; - + // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // params defines the module parameters to update. - + // NOTE: All parameters must be supplied. Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } @@ -41,11 +42,17 @@ message MsgUpdateParamsResponse {} message MsgStakeSupplier { option (cosmos.msg.v1.signer) = "address"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries - - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding - cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding + cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) repeated poktroll.shared.SupplierServiceConfig services = 3; // The list of services this supplier is staked to provide service for } message MsgStakeSupplierResponse {} +message MsgUnstakeSupplier { + option (cosmos.msg.v1.signer) = "address"; + string address = 1; +} + +message MsgUnstakeSupplierResponse {} + diff --git a/x/supplier/keeper/msg_server_unstake_supplier.go b/x/supplier/keeper/msg_server_unstake_supplier.go new file mode 100644 index 000000000..82d447346 --- /dev/null +++ b/x/supplier/keeper/msg_server_unstake_supplier.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func (k msgServer) UnstakeSupplier(goCtx context.Context, msg *types.MsgUnstakeSupplier) (*types.MsgUnstakeSupplierResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgUnstakeSupplierResponse{}, nil +} diff --git a/x/supplier/module/autocli.go b/x/supplier/module/autocli.go index f2dfc3ac5..ec75e7031 100644 --- a/x/supplier/module/autocli.go +++ b/x/supplier/module/autocli.go @@ -45,6 +45,12 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Short: "Send a stake-supplier tx", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "stake"}, {ProtoField: "services"}}, }, + { + RpcMethod: "UnstakeSupplier", + Use: "unstake-supplier", + Short: "Send a unstake-supplier tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{}, + }, // this line is used by ignite scaffolding # autocli/tx }, }, diff --git a/x/supplier/module/simulation.go b/x/supplier/module/simulation.go index 5b9a3b82f..0d735d61f 100644 --- a/x/supplier/module/simulation.go +++ b/x/supplier/module/simulation.go @@ -27,6 +27,10 @@ const ( // TODO: Determine the simulation weight value defaultWeightMsgStakeSupplier int = 100 + opWeightMsgUnstakeSupplier = "op_weight_msg_unstake_supplier" + // TODO: Determine the simulation weight value + defaultWeightMsgUnstakeSupplier int = 100 + // this line is used by starport scaffolding # simapp/module/const ) @@ -66,6 +70,17 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp suppliersimulation.SimulateMsgStakeSupplier(am.accountKeeper, am.bankKeeper, am.keeper), )) + var weightMsgUnstakeSupplier int + simState.AppParams.GetOrGenerate(opWeightMsgUnstakeSupplier, &weightMsgUnstakeSupplier, nil, + func(_ *rand.Rand) { + weightMsgUnstakeSupplier = defaultWeightMsgUnstakeSupplier + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgUnstakeSupplier, + suppliersimulation.SimulateMsgUnstakeSupplier(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations @@ -82,6 +97,14 @@ func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.Wei return nil }, ), + simulation.NewWeightedProposalMsg( + opWeightMsgUnstakeSupplier, + defaultWeightMsgUnstakeSupplier, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + suppliersimulation.SimulateMsgUnstakeSupplier(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/supplier/simulation/unstake_supplier.go b/x/supplier/simulation/unstake_supplier.go new file mode 100644 index 000000000..377b74176 --- /dev/null +++ b/x/supplier/simulation/unstake_supplier.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/pokt-network/poktroll/x/supplier/keeper" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func SimulateMsgUnstakeSupplier( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgUnstakeSupplier{ + Address: simAccount.Address.String(), + } + + // TODO: Handling the UnstakeSupplier simulation + + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "UnstakeSupplier simulation not implemented"), nil, nil + } +} diff --git a/x/supplier/types/codec.go b/x/supplier/types/codec.go index cdb58673f..9ecbe1202 100644 --- a/x/supplier/types/codec.go +++ b/x/supplier/types/codec.go @@ -11,6 +11,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgStakeSupplier{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUnstakeSupplier{}, + ) // this line is used by starport scaffolding # 3 registry.RegisterImplementations((*sdk.Msg)(nil), diff --git a/x/supplier/types/message_unstake_supplier.go b/x/supplier/types/message_unstake_supplier.go new file mode 100644 index 000000000..4d07746ba --- /dev/null +++ b/x/supplier/types/message_unstake_supplier.go @@ -0,0 +1,23 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgUnstakeSupplier{} + +func NewMsgUnstakeSupplier(address string) *MsgUnstakeSupplier { + return &MsgUnstakeSupplier{ + Address: address, + } +} + +func (msg *MsgUnstakeSupplier) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid address address (%s)", err) + } + return nil +} diff --git a/x/supplier/types/message_unstake_supplier_test.go b/x/supplier/types/message_unstake_supplier_test.go new file mode 100644 index 000000000..c9845c927 --- /dev/null +++ b/x/supplier/types/message_unstake_supplier_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/pokt-network/poktroll/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgUnstakeSupplier_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgUnstakeSupplier + err error + }{ + { + name: "invalid address", + msg: MsgUnstakeSupplier{ + Address: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgUnstakeSupplier{ + Address: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} From 898a2954ad0f4ad28efaba87e474916e4e952966 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 11:53:34 +0100 Subject: [PATCH 16/29] reconcile: unstake supplier message --- api/poktroll/supplier/tx.pulsar.go | 78 ++++++++-------- proto/poktroll/supplier/tx.proto | 2 +- .../keeper/msg_server_unstake_supplier.go | 41 ++++++++- .../msg_server_unstake_supplier_test.go | 89 +++++++++++++++++++ x/supplier/types/message_unstake_supplier.go | 9 +- .../types/message_unstake_supplier_test.go | 10 ++- 6 files changed, 179 insertions(+), 50 deletions(-) create mode 100644 x/supplier/keeper/msg_server_unstake_supplier_test.go diff --git a/api/poktroll/supplier/tx.pulsar.go b/api/poktroll/supplier/tx.pulsar.go index b621f6d0f..362a13a3b 100644 --- a/api/poktroll/supplier/tx.pulsar.go +++ b/api/poktroll/supplier/tx.pulsar.go @@ -2811,7 +2811,7 @@ type MsgUnstakeSupplier struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding } func (x *MsgUnstakeSupplier) Reset() { @@ -2913,43 +2913,45 @@ var file_poktroll_supplier_tx_proto_rawDesc = []byte{ 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x3c, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1c, - 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb8, 0x02, 0x0a, - 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, - 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, - 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x0f, 0x55, 0x6e, 0x73, 0x74, 0x61, - 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x1a, 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, - 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x56, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x55, + 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb8, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5e, + 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, + 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, + 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, + 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x67, 0x0a, 0x0f, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2d, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, + 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, + 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x07, 0x54, 0x78, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, + 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/poktroll/supplier/tx.proto b/proto/poktroll/supplier/tx.proto index 3249fbbca..79ed6f5c3 100644 --- a/proto/poktroll/supplier/tx.proto +++ b/proto/poktroll/supplier/tx.proto @@ -51,7 +51,7 @@ message MsgStakeSupplierResponse {} message MsgUnstakeSupplier { option (cosmos.msg.v1.signer) = "address"; - string address = 1; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding } message MsgUnstakeSupplierResponse {} diff --git a/x/supplier/keeper/msg_server_unstake_supplier.go b/x/supplier/keeper/msg_server_unstake_supplier.go index 82d447346..41f3de736 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier.go +++ b/x/supplier/keeper/msg_server_unstake_supplier.go @@ -2,16 +2,51 @@ package keeper import ( "context" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/pokt-network/poktroll/x/supplier/types" ) -func (k msgServer) UnstakeSupplier(goCtx context.Context, msg *types.MsgUnstakeSupplier) (*types.MsgUnstakeSupplierResponse, error) { +func (k msgServer) UnstakeSupplier( + goCtx context.Context, + msg *types.MsgUnstakeSupplier, +) (*types.MsgUnstakeSupplierResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - // TODO: Handling the message - _ = ctx + logger := k.Logger().With("method", "UnstakeSupplier") + logger.Info(fmt.Sprintf("About to unstake supplier with msg: %v", msg)) + + if err := msg.ValidateBasic(); err != nil { + return nil, err + } + + // Check if the supplier already exists or not + supplier, isSupplierFound := k.GetSupplier(ctx, msg.Address) + if !isSupplierFound { + logger.Info(fmt.Sprintf("Supplier not found. Cannot unstake address %s", msg.Address)) + return nil, types.ErrSupplierNotFound + } + logger.Info(fmt.Sprintf("Supplier found. Unstaking supplier for address %s", msg.Address)) + // Retrieve the address of the supplier + supplierAddress, err := sdk.AccAddressFromBech32(msg.Address) + if err != nil { + logger.Error(fmt.Sprintf("could not parse address %s", msg.Address)) + return nil, err + } + + // Send the coins from the supplier pool back to the supplier + err = k.bankKeeper.UndelegateCoinsFromModuleToAccount(ctx, types.ModuleName, supplierAddress, []sdk.Coin{*supplier.Stake}) + if err != nil { + logger.Error(fmt.Sprintf("could not send %v coins from %s module to %s account due to %v", supplier.Stake, supplierAddress, types.ModuleName, err)) + return nil, err + } + + // Update the Supplier in the store + k.RemoveSupplier(ctx, supplierAddress.String()) + logger.Info(fmt.Sprintf("Successfully removed the supplier: %+v", supplier)) return &types.MsgUnstakeSupplierResponse{}, nil + } diff --git a/x/supplier/keeper/msg_server_unstake_supplier_test.go b/x/supplier/keeper/msg_server_unstake_supplier_test.go new file mode 100644 index 000000000..c3b9d9144 --- /dev/null +++ b/x/supplier/keeper/msg_server_unstake_supplier_test.go @@ -0,0 +1,89 @@ +package keeper_test + +import ( + "testing" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/testutil/sample" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + "github.com/pokt-network/poktroll/x/supplier/keeper" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func TestMsgServer_UnstakeSupplier_Success(t *testing.T) { + k, ctx := keepertest.SupplierKeeper(t) + srv := keeper.NewMsgServerImpl(k) + + // Generate an address for the supplier + addr := sample.AccAddress() + + // Verify that the supplier does not exist yet + _, isSupplierFound := k.GetSupplier(ctx, addr) + require.False(t, isSupplierFound) + + // Prepare the supplier + initialStake := sdk.NewCoin("upokt", math.NewInt(100)) + stakeMsg := &types.MsgStakeSupplier{ + Address: addr, + Stake: &initialStake, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{ + Id: "svcId", + }, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: "http://localhost:8080", + RpcType: sharedtypes.RPCType_JSON_RPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, + }, + } + + // Stake the supplier + _, err := srv.StakeSupplier(ctx, stakeMsg) + require.NoError(t, err) + + // Verify that the supplier exists + foundSupplier, isSupplierFound := k.GetSupplier(ctx, addr) + require.True(t, isSupplierFound) + require.Equal(t, addr, foundSupplier.Address) + require.Equal(t, initialStake.Amount, foundSupplier.Stake.Amount) + require.Len(t, foundSupplier.Services, 1) + + // Unstake the supplier + unstakeMsg := &types.MsgUnstakeSupplier{Address: addr} + _, err = srv.UnstakeSupplier(ctx, unstakeMsg) + require.NoError(t, err) + + // Make sure the supplier can no longer be found after unstaking + _, isSupplierFound = k.GetSupplier(ctx, addr) + require.False(t, isSupplierFound) +} + +func TestMsgServer_UnstakeSupplier_FailIfNotStaked(t *testing.T) { + k, ctx := keepertest.SupplierKeeper(t) + srv := keeper.NewMsgServerImpl(k) + + // Generate an address for the supplier + addr := sample.AccAddress() + + // Verify that the supplier does not exist yet + _, isSupplierFound := k.GetSupplier(ctx, addr) + require.False(t, isSupplierFound) + + // Unstake the supplier + unstakeMsg := &types.MsgUnstakeSupplier{Address: addr} + _, err := srv.UnstakeSupplier(ctx, unstakeMsg) + require.Error(t, err) + require.ErrorIs(t, err, types.ErrSupplierNotFound) + + _, isSupplierFound = k.GetSupplier(ctx, addr) + require.False(t, isSupplierFound) +} diff --git a/x/supplier/types/message_unstake_supplier.go b/x/supplier/types/message_unstake_supplier.go index 4d07746ba..4a5226ee5 100644 --- a/x/supplier/types/message_unstake_supplier.go +++ b/x/supplier/types/message_unstake_supplier.go @@ -1,11 +1,11 @@ package types import ( - errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) +const TypeMsgUnstakeSupplier = "unstake_supplier" + var _ sdk.Msg = &MsgUnstakeSupplier{} func NewMsgUnstakeSupplier(address string) *MsgUnstakeSupplier { @@ -15,9 +15,8 @@ func NewMsgUnstakeSupplier(address string) *MsgUnstakeSupplier { } func (msg *MsgUnstakeSupplier) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Address) - if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid address address (%s)", err) + if _, err := sdk.AccAddressFromBech32(msg.Address); err != nil { + return ErrSupplierInvalidAddress.Wrapf("invalid address address (%s)", err) } return nil } diff --git a/x/supplier/types/message_unstake_supplier_test.go b/x/supplier/types/message_unstake_supplier_test.go index c9845c927..b447397ed 100644 --- a/x/supplier/types/message_unstake_supplier_test.go +++ b/x/supplier/types/message_unstake_supplier_test.go @@ -3,9 +3,9 @@ package types import ( "testing" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/pokt-network/poktroll/testutil/sample" "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/sample" ) func TestMsgUnstakeSupplier_ValidateBasic(t *testing.T) { @@ -19,7 +19,11 @@ func TestMsgUnstakeSupplier_ValidateBasic(t *testing.T) { msg: MsgUnstakeSupplier{ Address: "invalid_address", }, - err: sdkerrors.ErrInvalidAddress, + err: ErrSupplierInvalidAddress, + }, { + name: "missing address", + msg: MsgUnstakeSupplier{}, + err: ErrSupplierInvalidAddress, }, { name: "valid address", msg: MsgUnstakeSupplier{ From 9bbe1db2f6a1f6f3f6e7cbb5787ca1713f8e03e1 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 11:58:42 +0100 Subject: [PATCH 17/29] reconcile: supplier CLI configs --- x/supplier/config/errors.go | 15 ++ x/supplier/config/supplier_configs_reader.go | 192 ++++++++++++++++++ .../config/supplier_configs_reader_test.go | 1 + 3 files changed, 208 insertions(+) create mode 100644 x/supplier/config/errors.go create mode 100644 x/supplier/config/supplier_configs_reader.go create mode 100644 x/supplier/config/supplier_configs_reader_test.go diff --git a/x/supplier/config/errors.go b/x/supplier/config/errors.go new file mode 100644 index 000000000..6a0194a75 --- /dev/null +++ b/x/supplier/config/errors.go @@ -0,0 +1,15 @@ +package config + +import sdkerrors "cosmossdk.io/errors" + +var ( + codespace = "supplierconfig" + ErrSupplierConfigUnmarshalYAML = sdkerrors.Register(codespace, 1, "config reader cannot unmarshal yaml content") + ErrSupplierConfigInvalidServiceId = sdkerrors.Register(codespace, 2, "invalid serviceId in supplier config") + ErrSupplierConfigNoEndpoints = sdkerrors.Register(codespace, 3, "no endpoints defined for serviceId in supplier config") + ErrSupplierConfigInvalidEndpointConfig = sdkerrors.Register(codespace, 4, "invalid endpoint config in supplier config") + ErrSupplierConfigInvalidRPCType = sdkerrors.Register(codespace, 5, "invalid rpc type in supplier config") + ErrSupplierConfigInvalidURL = sdkerrors.Register(codespace, 6, "invalid endpoint url in supplier config") + ErrSupplierConfigEmptyContent = sdkerrors.Register(codespace, 7, "empty supplier config content") + ErrSupplierConfigInvalidStake = sdkerrors.Register(codespace, 8, "invalid stake amount in supplier config") +) diff --git a/x/supplier/config/supplier_configs_reader.go b/x/supplier/config/supplier_configs_reader.go new file mode 100644 index 000000000..de9549553 --- /dev/null +++ b/x/supplier/config/supplier_configs_reader.go @@ -0,0 +1,192 @@ +package config + +import ( + "net/url" + + sdk "github.com/cosmos/cosmos-sdk/types" + "gopkg.in/yaml.v2" + + sharedhelpers "github.com/pokt-network/poktroll/x/shared/helpers" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" +) + +// YAMLStakeConfig is the structure describing the supplier stake config file +type YAMLStakeConfig struct { + StakeAmount string `yaml:"stake_amount"` + Services []*YAMLStakeService `yaml:"services"` +} + +// YAMLStakeService is the structure describing a single service stake entry in the stake config file +type YAMLStakeService struct { + ServiceId string `yaml:"service_id"` + Endpoints []YAMLServiceEndpoint `yaml:"endpoints"` +} + +// YAMLServiceEndpoint is the structure describing a single service endpoint in the stake config file +type YAMLServiceEndpoint struct { + Url string `yaml:"url"` + RPCType string `yaml:"rpc_type"` + Config map[string]string `yaml:"config,omitempty"` +} + +// SupplierStakeConfig is the structure describing the parsed supplier stake config +type SupplierStakeConfig struct { + StakeAmount sdk.Coin + Services []*sharedtypes.SupplierServiceConfig +} + +// ParseSupplierServiceConfig parses the stake config file into a SupplierServiceConfig +func ParseSupplierConfigs(configContent []byte) (*SupplierStakeConfig, error) { + var stakeConfig *YAMLStakeConfig + + if len(configContent) == 0 { + return nil, ErrSupplierConfigEmptyContent + } + + // Unmarshal the stake config file into a stakeConfig + if err := yaml.Unmarshal(configContent, &stakeConfig); err != nil { + return nil, ErrSupplierConfigUnmarshalYAML.Wrapf("%s", err) + } + + // Validate the stake amount + if len(stakeConfig.StakeAmount) == 0 { + return nil, ErrSupplierConfigInvalidStake.Wrap("stake amount cannot be empty") + } + + stakeAmount, err := sdk.ParseCoinNormalized(stakeConfig.StakeAmount) + if err != nil { + return nil, ErrSupplierConfigInvalidStake.Wrap(err.Error()) + } + + if err := stakeAmount.Validate(); err != nil { + return nil, ErrSupplierConfigInvalidStake.Wrap(err.Error()) + } + + if stakeAmount.IsZero() { + return nil, ErrSupplierConfigInvalidStake.Wrap("stake amount cannot be zero") + } + + if stakeAmount.Denom != "upokt" { + return nil, ErrSupplierConfigInvalidStake.Wrapf( + "invalid stake denom, expecting: upokt, got: %s", + stakeAmount.Denom, + ) + } + + // Validate the services + if stakeConfig.Services == nil || len(stakeConfig.Services) == 0 { + return nil, ErrSupplierConfigInvalidServiceId.Wrap("serviceIds cannot be empty") + } + + // Prepare the supplierServiceConfig + supplierServiceConfig := make([]*sharedtypes.SupplierServiceConfig, 0, len(stakeConfig.Services)) + + // Populate the services slice + for _, svc := range stakeConfig.Services { + // Validate the serviceId + if !sharedhelpers.IsValidServiceId(svc.ServiceId) { + return nil, ErrSupplierConfigInvalidServiceId.Wrapf("%s", svc.ServiceId) + } + + if len(svc.Endpoints) == 0 { + return nil, ErrSupplierConfigNoEndpoints.Wrapf("%s", svc.ServiceId) + } + + // Create a supplied service config with the serviceId + service := &sharedtypes.SupplierServiceConfig{ + Service: &sharedtypes.Service{Id: svc.ServiceId}, + Endpoints: []*sharedtypes.SupplierEndpoint{}, + } + + // Iterate over the service endpoints and add their parsed representation to the supplied service config + for _, endpoint := range svc.Endpoints { + parsedEndpointEntry, err := parseEndpointEntry(endpoint) + if err != nil { + return nil, err + } + service.Endpoints = append(service.Endpoints, parsedEndpointEntry) + } + supplierServiceConfig = append(supplierServiceConfig, service) + } + + return &SupplierStakeConfig{ + StakeAmount: stakeAmount, + Services: supplierServiceConfig, + }, nil +} + +func parseEndpointEntry(endpoint YAMLServiceEndpoint) (*sharedtypes.SupplierEndpoint, error) { + endpointEntry := &sharedtypes.SupplierEndpoint{} + var err error + + // Endpoint URL + if endpointEntry.Url, err = validateEndpointURL(endpoint); err != nil { + return nil, err + } + + // Endpoint config + if endpointEntry.Configs, err = parseEndpointConfigs(endpoint); err != nil { + return nil, err + } + + // Endpoint RPC type + if endpointEntry.RpcType, err = parseEndpointRPCType(endpoint); err != nil { + return nil, err + } + + return endpointEntry, nil +} + +// validateEndpointURL validates the endpoint URL, making sure that the string provided is a valid URL +func validateEndpointURL(endpoint YAMLServiceEndpoint) (string, error) { + // Validate the endpoint URL + if _, err := url.Parse(endpoint.Url); err != nil { + return "", ErrSupplierConfigInvalidURL.Wrapf("%s", err) + } + + return endpoint.Url, nil +} + +// parseEndpointConfigs parses the endpoint config entries into a slice of ConfigOption +// compatible with the SupplierEndpointConfig. +// It accepts a nil config entry or a map of valid config keys. +func parseEndpointConfigs(endpoint YAMLServiceEndpoint) ([]*sharedtypes.ConfigOption, error) { + // Prepare the endpoint configs slice + endpointConfigs := []*sharedtypes.ConfigOption{} + + // If we have an endpoint config entry, parse it into a slice of ConfigOption + if endpoint.Config == nil { + return endpointConfigs, nil + } + + // Iterate over the endpoint config entries and add them to the slice of ConfigOption + for key, value := range endpoint.Config { + var configKey sharedtypes.ConfigOptions + + // Make sure the config key is valid + switch key { + case "timeout": + configKey = sharedtypes.ConfigOptions_TIMEOUT + default: + return nil, ErrSupplierConfigInvalidEndpointConfig.Wrapf("%s", key) + } + + config := &sharedtypes.ConfigOption{ + Key: configKey, + Value: value, + } + endpointConfigs = append(endpointConfigs, config) + } + + return endpointConfigs, nil +} + +// parseEndpointRPCType parses the endpoint RPC type into a sharedtypes.RPCType +func parseEndpointRPCType(endpoint YAMLServiceEndpoint) (sharedtypes.RPCType, error) { + switch endpoint.RPCType { + case "json_rpc": + return sharedtypes.RPCType_JSON_RPC, nil + default: + return sharedtypes.RPCType_UNKNOWN_RPC, ErrSupplierConfigInvalidRPCType.Wrapf("%s", endpoint.RPCType) + } +} diff --git a/x/supplier/config/supplier_configs_reader_test.go b/x/supplier/config/supplier_configs_reader_test.go new file mode 100644 index 000000000..d912156be --- /dev/null +++ b/x/supplier/config/supplier_configs_reader_test.go @@ -0,0 +1 @@ +package config From 334878eb8c6daf0e53f181aa83d6749e7e0b1d57 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 13:21:05 +0100 Subject: [PATCH 18/29] chore: restore mocks pkg --- testutil/supplier/mocks/mocks.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 testutil/supplier/mocks/mocks.go diff --git a/testutil/supplier/mocks/mocks.go b/testutil/supplier/mocks/mocks.go new file mode 100644 index 000000000..595954e65 --- /dev/null +++ b/testutil/supplier/mocks/mocks.go @@ -0,0 +1,11 @@ +package mocks + +// This file is in place to declare the package for dynamically generated structs. +// +// Note that this does not follow the Cosmos SDK pattern of committing Mocks to main. +// For example, they commit auto-generate code to main: https://github.com/cosmos/cosmos-sdk/blob/main/x/gov/testutil/expected_keepers_mocks.go +// Documentation on how Cosmos uses mockgen can be found here: https://docs.cosmos.network/main/build/building-modules/testing#unit-tests +// +// IMPORTANT: We have attempted to use `.gitkeep` files instead, but it causes a circular dependency issue with protobuf and mock generation +// since we are leveraging `ignite` to compile `.proto` files which runs `go mod tidy` before generating, requiring the entire dependency tree +// to be valid before mock implementations have been generated. From d2b788e79079fa5f75a56b63b703a0c8d0ee47cc Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 13:21:34 +0100 Subject: [PATCH 19/29] reconcile: in-memory network --- testutil/network/network.go | 46 ++++++++++++++++++++++++++----- x/supplier/module/helpers_test.go | 38 +++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 x/supplier/module/helpers_test.go diff --git a/testutil/network/network.go b/testutil/network/network.go index 3b64091d7..4794bce54 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - sdkmath "cosmossdk.io/math" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client/flags" addresscodec "github.com/cosmos/cosmos-sdk/codec/address" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" @@ -17,6 +17,8 @@ import ( "github.com/pokt-network/poktroll/cmd/poktrolld/cmd" "github.com/pokt-network/poktroll/testutil/sample" gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" ) type ( @@ -24,6 +26,8 @@ type ( Config = network.Config ) +var addrCodec = addresscodec.NewBech32Codec(app.AccountAddressPrefix) + func init() { cmd.InitSDKConfig() } @@ -91,9 +95,9 @@ func InitAccountWithSequence( fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdkmath.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, math.NewInt(10))).String()), } - amount := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(200))) + amount := sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(200))) addrCodec := addresscodec.NewBech32Codec(app.AccountAddressPrefix) responseRaw, err := clitestutil.MsgSendExec(ctx, val.Address, addr, amount, addrCodec, args...) require.NoError(t, err) @@ -109,7 +113,7 @@ func DefaultGatewayModuleGenesisState(t *testing.T, n int) *gatewaytypes.Genesis t.Helper() state := gatewaytypes.DefaultGenesis() for i := 0; i < n; i++ { - stake := sdk.NewCoin("upokt", sdkmath.NewInt(int64(i))) + stake := sdk.NewCoin("upokt", math.NewInt(int64(i))) gateway := gatewaytypes.Gateway{ Address: sample.AccAddress(), Stake: &stake, @@ -134,10 +138,9 @@ func InitAccount(t *testing.T, net *Network, addr sdk.AccAddress) { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdkmath.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, math.NewInt(10))).String()), } - amount := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(200))) - addrCodec := addresscodec.NewBech32Codec(app.AccountAddressPrefix) + amount := sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(200))) responseRaw, err := clitestutil.MsgSendExec(ctx, val.Address, addr, amount, addrCodec, args...) require.NoError(t, err) var responseJSON map[string]interface{} @@ -165,3 +168,32 @@ func freePorts(n int) ([]string, error) { } return ports, nil } + +// DefaultSupplierModuleGenesisState generates a GenesisState object with a given number of suppliers. +// It returns the populated GenesisState object. +func DefaultSupplierModuleGenesisState(t *testing.T, n int) *suppliertypes.GenesisState { + t.Helper() + state := suppliertypes.DefaultGenesis() + for i := 0; i < n; i++ { + stake := sdk.NewCoin("upokt", math.NewInt(int64(i))) + supplier := sharedtypes.Supplier{ + Address: sample.AccAddress(), + Stake: &stake, + Services: []*sharedtypes.SupplierServiceConfig{ + { + Service: &sharedtypes.Service{Id: fmt.Sprintf("svc%d", i)}, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: fmt.Sprintf("http://localhost:%d", i), + RpcType: sharedtypes.RPCType_JSON_RPC, + }, + }, + }, + }, + } + // TODO_CONSIDERATION: Evaluate whether we need `nullify.Fill` or if we should enforce `(gogoproto.nullable) = false` everywhere + // nullify.Fill(&supplier) + state.SupplierList = append(state.SupplierList, supplier) + } + return state +} diff --git a/x/supplier/module/helpers_test.go b/x/supplier/module/helpers_test.go new file mode 100644 index 000000000..b862169bd --- /dev/null +++ b/x/supplier/module/helpers_test.go @@ -0,0 +1,38 @@ +package supplier_test + +import ( + "strconv" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/network" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +const ( + numBlocksPerSession = 4 + testServiceId = "svc1" +) + +// Dummy variable to avoid unused import error. +var _ = strconv.IntSize + +// init initializes the SDK configuration. +//func init() { +// cmd.InitSDKConfig() +//} + +// networkWithSupplierObjects creates a new network with a given number of supplier objects. +// It returns the network and a slice of the created supplier objects. +func networkWithSupplierObjects(t *testing.T, n int) (*network.Network, []sharedtypes.Supplier) { + t.Helper() + + cfg := network.DefaultConfig() + supplierGenesisState := network.DefaultSupplierModuleGenesisState(t, n) + buf, err := cfg.Codec.MarshalJSON(supplierGenesisState) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), supplierGenesisState.SupplierList +} From 05029a23d8ee0dad145c0fb614a037f7ef52d499 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 13:22:29 +0100 Subject: [PATCH 20/29] chore: override autocli tx commands --- x/supplier/module/tx.go | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 x/supplier/module/tx.go diff --git a/x/supplier/module/tx.go b/x/supplier/module/tx.go new file mode 100644 index 000000000..86a9438ae --- /dev/null +++ b/x/supplier/module/tx.go @@ -0,0 +1,37 @@ +package supplier + +import ( + "fmt" + "time" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" + + "github.com/pokt-network/poktroll/x/supplier/types" +) + +var ( + DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) +) + +const ( + flagPacketTimeoutTimestamp = "packet-timeout-timestamp" + listSeparator = "," +) + +// GetTxCmd returns the transaction commands for this module +func (am AppModule) GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdStakeSupplier()) + cmd.AddCommand(CmdUnstakeSupplier()) + // this line is used by starport scaffolding # 1 + + return cmd +} From 1eaf8a082e4b4a3a1ebaae17f4707c649b48097a Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 13:22:47 +0100 Subject: [PATCH 21/29] reconcile: stake supplier CLI commands --- x/supplier/module/tx_stake_supplier.go | 67 +++++ x/supplier/module/tx_stake_supplier_test.go | 297 ++++++++++++++++++++ 2 files changed, 364 insertions(+) create mode 100644 x/supplier/module/tx_stake_supplier.go create mode 100644 x/supplier/module/tx_stake_supplier_test.go diff --git a/x/supplier/module/tx_stake_supplier.go b/x/supplier/module/tx_stake_supplier.go new file mode 100644 index 000000000..5923e06ec --- /dev/null +++ b/x/supplier/module/tx_stake_supplier.go @@ -0,0 +1,67 @@ +package supplier + +import ( + "os" + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + + "github.com/pokt-network/poktroll/x/supplier/config" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +var ( + flagStakeConfig string + _ = strconv.Itoa(0) // Part of the default ignite imports +) + +func CmdStakeSupplier() *cobra.Command { + // fromAddress & signature is retrieved via `flags.FlagFrom` in the `clientCtx` + cmd := &cobra.Command{ + Use: "stake-supplier --config ", + Short: "Stake a supplier", + Long: `Stake an supplier with the provided parameters. This is a broadcast operation that +will stake the tokens and associate them with the supplier specified by the 'from' address. + +Example: +$ poktrolld --home=$(POKTROLLD_HOME) tx supplier stake-supplier --config stake_config.yaml --keyring-backend test --from $(APP) --node $(POCKET_NODE)`, + + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, _ []string) (err error) { + configContent, err := os.ReadFile(flagStakeConfig) + if err != nil { + return err + } + + supplierStakeConfigs, err := config.ParseSupplierConfigs(configContent) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgStakeSupplier( + clientCtx.GetFromAddress().String(), + supplierStakeConfigs.StakeAmount, + supplierStakeConfigs.Services, + ) + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().StringVar(&flagStakeConfig, "config", "", "Path to the stake config file") + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/supplier/module/tx_stake_supplier_test.go b/x/supplier/module/tx_stake_supplier_test.go new file mode 100644 index 000000000..e7423b0d9 --- /dev/null +++ b/x/supplier/module/tx_stake_supplier_test.go @@ -0,0 +1,297 @@ +package supplier_test + +import ( + "fmt" + "testing" + + sdkerrors "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/testutil" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/status" + + "github.com/pokt-network/poktroll/testutil/network" + "github.com/pokt-network/poktroll/testutil/yaml" + supplier "github.com/pokt-network/poktroll/x/supplier/module" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func TestCLI_StakeSupplier(t *testing.T) { + net, _ := networkWithSupplierObjects(t, 2) + val := net.Validators[0] + ctx := val.ClientCtx + + // Create a keyring and add an account for the supplier to be staked + kr := ctx.Keyring + accounts := testutil.CreateKeyringAccounts(t, kr, 1) + supplierAccount := accounts[0] + + // Update the context with the new keyring + ctx = ctx.WithKeyring(kr) + + // Common args used for all requests + commonArgs := []string{ + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdkmath.NewInt(10))).String()), + } + + defaultConfig := ` + stake_amount: 1000upokt + services: + - service_id: svc1 + endpoints: + - url: http://pokt.network:8081 + rpc_type: json_rpc + ` + + tests := []struct { + desc string + address string + config string + err *sdkerrors.Error + }{ + // Happy Paths + { + desc: "stake supplier: valid", + address: supplierAccount.Address.String(), + config: defaultConfig, + }, + + // Error Paths - Address Related + { + desc: "stake supplier: missing address", + // address: "explicitly missing", + err: types.ErrSupplierInvalidAddress, + config: defaultConfig, + }, + { + desc: "stake supplier: invalid address", + address: "invalid", + err: types.ErrSupplierInvalidAddress, + config: defaultConfig, + }, + + // Error Paths - Stake Related + { + desc: "stake supplier: missing stake", + address: supplierAccount.Address.String(), + err: types.ErrSupplierInvalidStake, + config: ` + # explicitly omitted stake + services: + - service_id: svc1 + endpoints: + - url: http://pokt.network:8081 + rpc_type: json_rpc + `, + }, + { + desc: "stake supplier: invalid stake denom", + address: supplierAccount.Address.String(), + err: types.ErrSupplierInvalidStake, + config: ` + stake_amount: 1000invalid + services: + - service_id: svc1 + endpoints: + - url: http://pokt.network:8081 + rpc_type: json_rpc + `, + }, + { + desc: "stake supplier: invalid stake amount (zero)", + address: supplierAccount.Address.String(), + err: types.ErrSupplierInvalidStake, + config: ` + stake_amount: 0upokt + services: + - service_id: svc1 + endpoints: + - url: http://pokt.network:8081 + rpc_type: json_rpc + `, + }, + { + desc: "stake supplier: invalid stake amount (negative)", + address: supplierAccount.Address.String(), + err: types.ErrSupplierInvalidStake, + config: ` + stake_amount: -1000upokt + services: + - service_id: svc1 + endpoints: + - url: http://pokt.network:8081 + rpc_type: json_rpc + `, + }, + + // Happy Paths - Service Related + { + desc: "services_test: valid multiple services", + address: supplierAccount.Address.String(), + config: ` + stake_amount: 1000upokt + services: + - service_id: svc1 + endpoints: + - url: http://pokt.network:8081 + rpc_type: json_rpc + - service_id: svc2 + endpoints: + - url: http://pokt.network:8082 + rpc_type: json_rpc + `, + }, + { + desc: "services_test: valid localhost", + address: supplierAccount.Address.String(), + config: ` + stake_amount: 1000upokt + services: + - service_id: svc1 + endpoints: + - url: http://127.0.0.1:8082 + rpc_type: json_rpc + `, + }, + { + desc: "services_test: valid loopback", + address: supplierAccount.Address.String(), + config: ` + stake_amount: 1000upokt + services: + - service_id: svc1 + endpoints: + - url: http://localhost:8082 + rpc_type: json_rpc + `, + }, + { + desc: "services_test: valid without a pork", + address: supplierAccount.Address.String(), + config: ` + stake_amount: 1000upokt + services: + - service_id: svc1 + endpoints: + - url: http://pokt.network + rpc_type: json_rpc + `, + }, + + // Error Paths - Service Related + { + desc: "services_test: invalid services (missing argument)", + address: supplierAccount.Address.String(), + err: types.ErrSupplierInvalidServiceConfig, + // servicesString: "explicitly omitted", + config: ` + stake_amount: 1000upokt + `, + }, + { + desc: "services_test: invalid services (empty string)", + address: supplierAccount.Address.String(), + err: types.ErrSupplierInvalidServiceConfig, + config: ` + stake_amount: 1000upokt + services: + `, + }, + { + desc: "services_test: invalid URL", + address: supplierAccount.Address.String(), + err: types.ErrSupplierInvalidServiceConfig, + config: ` + stake_amount: 1000upokt + services: + - service_id: svc1 + endpoints: + - url: bad_url + rpc_type: json_rpc + `, + }, + { + desc: "services_test: missing URLs", + address: supplierAccount.Address.String(), + err: types.ErrSupplierInvalidServiceConfig, + config: ` + stake_amount: 1000upokt + services: + - service_id: svc1 + - service_id: svc2 + `, + }, + { + desc: "services_test: missing service IDs", + address: supplierAccount.Address.String(), + err: types.ErrSupplierInvalidServiceConfig, + config: ` + stake_amount: 1000upokt + services: + - endpoints: + - url: localhost:8081 + rpc_type: json_rpc + - endpoints: + - url: localhost:8082 + rpc_type: json_rpc + `, + }, + { + desc: "services_test: missing rpc type", + address: supplierAccount.Address.String(), + err: types.ErrSupplierInvalidServiceConfig, + config: ` + stake_amount: 1000upokt + services: + - service_id: svc1 + endpoints: + - url: localhost:8082 + `, + }, + } + + // Initialize the Supplier Account by sending it some funds from the validator account that is part of genesis + network.InitAccount(t, net, supplierAccount.Address) + + // Run the tests + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + // Wait for a new block to be committed + require.NoError(t, net.WaitForNextBlock()) + + // write the stake config to a file + configPath := testutil.WriteToNewTempFile(t, yaml.NormalizeYAMLIndentation(tt.config)).Name() + + // Prepare the arguments for the CLI command + args := []string{ + fmt.Sprintf("--config=%s", configPath), + fmt.Sprintf("--%s=%s", flags.FlagFrom, tt.address), + } + args = append(args, commonArgs...) + + // Execute the command + outStake, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdStakeSupplier(), args) + + // Validate the error if one is expected + if tt.err != nil { + stat, ok := status.FromError(tt.err) + require.True(t, ok) + require.Contains(t, stat.Message(), tt.err.Error()) + return + } + require.NoError(t, err) + + // Check the response + var resp sdk.TxResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(outStake.Bytes(), &resp)) + require.NotNil(t, resp) + require.NotNil(t, resp.TxHash) + require.Equal(t, uint32(0), resp.Code) + }) + } +} From 85c52840da554c950ed4fbe7fb7c82ca1677152b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 13:26:42 +0100 Subject: [PATCH 22/29] reconcile: unstake supplier CLI commands --- x/supplier/module/tx_unstake_supplier.go | 42 ++++++++ x/supplier/module/tx_unstake_supplier_test.go | 97 +++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 x/supplier/module/tx_unstake_supplier.go create mode 100644 x/supplier/module/tx_unstake_supplier_test.go diff --git a/x/supplier/module/tx_unstake_supplier.go b/x/supplier/module/tx_unstake_supplier.go new file mode 100644 index 000000000..9c5fa8633 --- /dev/null +++ b/x/supplier/module/tx_unstake_supplier.go @@ -0,0 +1,42 @@ +package supplier + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func CmdUnstakeSupplier() *cobra.Command { + // fromAddress & signature is retrieved via `flags.FlagFrom` in the `clientCtx` + cmd := &cobra.Command{ + Use: "unstake-supplier", + Short: "Unstake a supplier", + Long: `Unstake an supplier with the provided parameters. This is a broadcast operation that will unstake the supplier specified by the 'from' address. + +Example: +$ poktrolld --home=$(POKTROLLD_HOME) tx supplier unstake-supplier --keyring-backend test --from $(SUPPLIER) --node $(POCKET_NODE)`, + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUnstakeSupplier( + clientCtx.GetFromAddress().String(), + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/supplier/module/tx_unstake_supplier_test.go b/x/supplier/module/tx_unstake_supplier_test.go new file mode 100644 index 000000000..75644f58f --- /dev/null +++ b/x/supplier/module/tx_unstake_supplier_test.go @@ -0,0 +1,97 @@ +package supplier_test + +import ( + "fmt" + "testing" + + sdkerrors "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/testutil" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/status" + + "github.com/pokt-network/poktroll/testutil/network" + supplier "github.com/pokt-network/poktroll/x/supplier/module" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func TestCLI_UnstakeSupplier(t *testing.T) { + net, _ := networkWithSupplierObjects(t, 2) + val := net.Validators[0] + ctx := val.ClientCtx + + // Create a keyring and add an account for the supplier to be unstaked + kr := ctx.Keyring + accounts := testutil.CreateKeyringAccounts(t, kr, 1) + supplierAccount := accounts[0] + + // Update the context with the new keyring + ctx = ctx.WithKeyring(kr) + + // Common args used for all requests + commonArgs := []string{ + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdkmath.NewInt(10))).String()), + } + + tests := []struct { + desc string + address string + err *sdkerrors.Error + }{ + { + desc: "unstake supplier: valid", + address: supplierAccount.Address.String(), + }, + { + desc: "unstake supplier: missing address", + // address: supplierAccount.Address.String(), + err: types.ErrSupplierInvalidAddress, + }, + { + desc: "unstake supplier: invalid address", + address: "invalid", + err: types.ErrSupplierInvalidAddress, + }, + } + + // Initialize the Supplier Account by sending it some funds from the validator account that is part of genesis + network.InitAccount(t, net, supplierAccount.Address) + + // Run the tests + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + // Wait for a new block to be committed + require.NoError(t, net.WaitForNextBlock()) + + // Prepare the arguments for the CLI command + args := []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, tt.address), + } + args = append(args, commonArgs...) + + // Execute the command + outUnstake, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdUnstakeSupplier(), args) + + // Validate the error if one is expected + if tt.err != nil { + stat, ok := status.FromError(tt.err) + require.True(t, ok) + require.Contains(t, stat.Message(), tt.err.Error()) + return + } + require.NoError(t, err) + + // Check the response + var resp sdk.TxResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(outUnstake.Bytes(), &resp)) + require.NotNil(t, resp) + require.NotNil(t, resp.TxHash) + require.Equal(t, uint32(0), resp.Code) + }) + } +} From 53533cfdf0604e99a0d789e711720808d3d1f396 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 14 Feb 2024 13:43:43 +0100 Subject: [PATCH 23/29] fix: linter errors --- x/supplier/module/genesis_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/supplier/module/genesis_test.go b/x/supplier/module/genesis_test.go index c98821dc4..408ac8710 100644 --- a/x/supplier/module/genesis_test.go +++ b/x/supplier/module/genesis_test.go @@ -11,7 +11,7 @@ import ( "github.com/pokt-network/poktroll/testutil/nullify" "github.com/pokt-network/poktroll/testutil/sample" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - "github.com/pokt-network/poktroll/x/supplier/module" + supplier "github.com/pokt-network/poktroll/x/supplier/module" "github.com/pokt-network/poktroll/x/supplier/types" ) From d75904f5422ce3308f23f52b86c67dfbc2097786 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 15 Feb 2024 19:10:55 +0100 Subject: [PATCH 24/29] reconcile: query CLI commands --- x/supplier/module/query.go | 28 +++++++++++ x/supplier/module/query_supplier.go | 78 +++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 x/supplier/module/query.go create mode 100644 x/supplier/module/query_supplier.go diff --git a/x/supplier/module/query.go b/x/supplier/module/query.go new file mode 100644 index 000000000..2a061fad4 --- /dev/null +++ b/x/supplier/module/query.go @@ -0,0 +1,28 @@ +package supplier + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" + + "github.com/pokt-network/poktroll/x/supplier/types" +) + +// GetQueryCmd returns the cli query commands for this module +func (am AppModule) GetQueryCmd() *cobra.Command { + // Group supplier queries under a subcommand + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdListSupplier()) + cmd.AddCommand(CmdShowSupplier()) + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/supplier/module/query_supplier.go b/x/supplier/module/query_supplier.go new file mode 100644 index 000000000..4ddaefabd --- /dev/null +++ b/x/supplier/module/query_supplier.go @@ -0,0 +1,78 @@ +package supplier + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func CmdListSupplier() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-supplier", + Short: "list all supplier", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllSuppliersRequest{ + Pagination: pageReq, + } + + res, err := queryClient.AllSuppliers(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowSupplier() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-supplier ", + Short: "shows a supplier", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + argAddress := args[0] + + params := &types.QueryGetSupplierRequest{ + Address: argAddress, + } + + res, err := queryClient.Supplier(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} From 648e5d855b99643d82a047444a8245ccb9baa836 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 16 Feb 2024 08:42:21 +0100 Subject: [PATCH 25/29] fixup! scaffold: map supplier --module supplier --no-message address stake:coin services --- x/supplier/module/debug_container.dot | 502 -------------------------- x/supplier/module/debug_container.log | 379 ------------------- 2 files changed, 881 deletions(-) delete mode 100644 x/supplier/module/debug_container.dot delete mode 100644 x/supplier/module/debug_container.log diff --git a/x/supplier/module/debug_container.dot b/x/supplier/module/debug_container.dot deleted file mode 100644 index cb918fde8..000000000 --- a/x/supplier/module/debug_container.dot +++ /dev/null @@ -1,502 +0,0 @@ -digraph "" { - subgraph "cluster_auth" { - graph [fontsize="12.0", label="Module: auth", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - } - - subgraph "cluster_authz" { - graph [fontsize="12.0", label="Module: authz", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_bank" { - graph [fontsize="12.0", label="Module: bank", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - } - - subgraph "cluster_circuit" { - graph [fontsize="12.0", label="Module: circuit", penwidth="0.5", style="rounded"]; - "cosmossdk.io/x/circuit.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_consensus" { - graph [fontsize="12.0", label="Module: consensus", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_crisis" { - graph [fontsize="12.0", label="Module: crisis", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_distribution" { - graph [fontsize="12.0", label="Module: distribution", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_evidence" { - graph [fontsize="12.0", label="Module: evidence", penwidth="0.5", style="rounded"]; - "cosmossdk.io/x/evidence.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_feegrant" { - graph [fontsize="12.0", label="Module: feegrant", penwidth="0.5", style="rounded"]; - "cosmossdk.io/x/feegrant/module.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - } - - subgraph "cluster_genutil" { - graph [fontsize="12.0", label="Module: genutil", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_gov" { - graph [fontsize="12.0", label="Module: gov", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_group" { - graph [fontsize="12.0", label="Module: group", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - } - - subgraph "cluster_mint" { - graph [fontsize="12.0", label="Module: mint", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_params" { - graph [fontsize="12.0", label="Module: params", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/params.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - } - - subgraph "cluster_runtime" { - graph [fontsize="12.0", label="Module: runtime", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideApp"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideBasicManager"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideCometInfoService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideEventService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideGenesisTxHandler"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideHeaderInfoService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreKey"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder"[color="red", fontcolor="red", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_service" { - graph [fontsize="12.0", label="Module: service", penwidth="0.5", style="rounded"]; - "github.com/pokt-network/poktroll/x/service/module.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - } - - subgraph "cluster_slashing" { - graph [fontsize="12.0", label="Module: slashing", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_staking" { - graph [fontsize="12.0", label="Module: staking", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - } - - subgraph "cluster_supplier" { - graph [fontsize="12.0", label="Module: supplier", penwidth="0.5", style="rounded"]; - "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"[color="red", fontcolor="red", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_tx" { - graph [fontsize="12.0", label="Module: tx", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideProtoRegistry"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - } - - subgraph "cluster_upgrade" { - graph [fontsize="12.0", label="Module: upgrade", penwidth="0.5", style="rounded"]; - "cosmossdk.io/x/upgrade.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - } - - subgraph "cluster_vesting" { - graph [fontsize="12.0", label="Module: vesting", penwidth="0.5", style="rounded"]; - "github.com/cosmos/cosmos-sdk/x/auth/vesting.ProvideModule"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5", shape="box"]; - } - - "*cosmossdk.io/api/cosmos/app/runtime/v1alpha1.Module"[color="black", fontcolor="black", penwidth="1.5"]; - "*cosmossdk.io/api/cosmos/app/v1alpha1.Config"[color="black", fontcolor="black", penwidth="1.5"]; - "*cosmossdk.io/api/cosmos/auth/module/v1.Module"[color="black", fontcolor="black", penwidth="1.5"]; - "*cosmossdk.io/api/cosmos/authz/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/bank/module/v1.Module"[color="black", fontcolor="black", penwidth="1.5"]; - "*cosmossdk.io/api/cosmos/circuit/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/consensus/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/crisis/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/distribution/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/evidence/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/feegrant/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/genutil/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/gov/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/group/module/v1.Module"[color="black", fontcolor="black", penwidth="1.5"]; - "*cosmossdk.io/api/cosmos/mint/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/params/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/slashing/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/staking/module/v1.Module"[color="black", fontcolor="black", penwidth="1.5"]; - "*cosmossdk.io/api/cosmos/tx/config/v1.Config"[color="black", fontcolor="black", penwidth="1.5"]; - "*cosmossdk.io/api/cosmos/upgrade/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/api/cosmos/vesting/module/v1.Module"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/store/types.KVStoreKey"[color="black", fontcolor="black", penwidth="1.5"]; - "*cosmossdk.io/store/types.MemoryStoreKey"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*cosmossdk.io/store/types.TransientStoreKey"[color="black", fontcolor="black", penwidth="1.5"]; - "*cosmossdk.io/x/upgrade/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*github.com/cosmos/cosmos-sdk/baseapp.MsgServiceRouter"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*github.com/cosmos/cosmos-sdk/codec.LegacyAmino"[color="black", fontcolor="black", penwidth="1.5"]; - "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder"[color="black", fontcolor="black", penwidth="1.5"]; - "*github.com/cosmos/cosmos-sdk/x/crisis/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*github.com/cosmos/cosmos-sdk/x/gov/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "*github.com/pokt-network/poktroll/api/poktroll/service/module.Module"[color="black", fontcolor="black", penwidth="1.5"]; - "*github.com/pokt-network/poktroll/api/poktroll/supplier/module.Module"[color="black", fontcolor="black", penwidth="1.5"]; - "[]cosmossdk.io/x/tx/signing.CustomGetSigner"[color="black", comment="many-per-container", fontcolor="black", penwidth="1.5"]; - "[]github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1.HandlerRoute"[color="lightgrey", comment="many-per-container", fontcolor="dimgrey", penwidth="0.5"]; - "[]runtime.BaseAppOption"[color="lightgrey", comment="many-per-container", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/core/address.Codec"[color="black", fontcolor="black", penwidth="1.5"]; - "cosmossdk.io/core/appconfig.Compose"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - "cosmossdk.io/core/comet.BlockInfoService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/core/event.Service"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/core/genesis.TxHandler"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/core/header.Service"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/core/store.KVStoreService"[color="black", fontcolor="black", penwidth="1.5"]; - "cosmossdk.io/core/store.MemoryStoreService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/core/store.TransientStoreService"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/depinject.ModuleKey"[color="black", fontcolor="black", penwidth="1.5"]; - "cosmossdk.io/depinject.OwnModuleKey"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/log.Logger"[color="black", fontcolor="black", penwidth="1.5"]; - "cosmossdk.io/log.nopLogger"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/x/circuit/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/x/evidence/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/x/feegrant.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "cosmossdk.io/x/feegrant.BankKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "cosmossdk.io/x/feegrant/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/x/tx/signing.ProtoFileResolver"[color="black", fontcolor="black", penwidth="1.5"]; - "func() []signing.SignModeHandler"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "func() address.Codec"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "func() runtime.ConsensusAddressCodec"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "func() runtime.ValidatorAddressCodec"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "func() types.AccountI"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/baseapp.MessageRouter"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/client.TxConfig"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/codec.Codec"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/runtime.ConsensusAddressCodec"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/runtime.ValidatorAddressCodec"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/server/types.AppOptions"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig"[color="black", fontcolor="black", penwidth="1.5", shape="hexagon"]; - "github.com/cosmos/cosmos-sdk/x/auth/ante.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/x/auth/ante.FeegrantKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/x/auth/exported.Subspace"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/x/auth/tx.ConfigOptions"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/x/auth/tx/config.BankKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/x/auth/types.BankKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/x/auth/vesting/types.BankKeeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/x/authz/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/x/bank/exported.Subspace"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/x/bank/types.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/x/consensus/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/x/distribution/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/x/group.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/x/group.BankKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/x/group/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/x/mint/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/x/params/keeper.Keeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/x/params/types.Subspace"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/x/slashing/exported.Subspace"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/x/slashing/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/cosmos/cosmos-sdk/x/staking/exported.Subspace"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/x/staking/types.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/cosmos/cosmos-sdk/x/staking/types.BankKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/pokt-network/poktroll/app.AppConfig"[color="black", fontcolor="black", penwidth="1.5", shape="box"]; - "github.com/pokt-network/poktroll/x/service/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/pokt-network/poktroll/x/service/types.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/pokt-network/poktroll/x/service/types.BankKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/pokt-network/poktroll/x/supplier/keeper.Keeper"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "github.com/pokt-network/poktroll/x/supplier/types.AccountKeeper"[color="black", fontcolor="black", penwidth="1.5"]; - "github.com/pokt-network/poktroll/x/supplier/types.BankKeeper"[color="red", fontcolor="red", penwidth="0.5"]; - "google.golang.org/protobuf/reflect/protodesc.Resolver"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "google.golang.org/protobuf/reflect/protoregistry.MessageTypeResolver"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "map[string]cosmossdk.io/core/appmodule.AppModule"[color="red", comment="one-per-module", fontcolor="red", penwidth="0.5"]; - "map[string]github.com/cosmos/cosmos-sdk/types/module.AppModuleBasic"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "map[string]github.com/cosmos/cosmos-sdk/x/params/types.KeyTable"[color="black", comment="one-per-module", fontcolor="black", penwidth="1.5"]; - "map[string]github.com/cosmos/cosmos-sdk/x/staking/types.StakingHooksWrapper"[color="lightgrey", comment="one-per-module", fontcolor="dimgrey", penwidth="0.5"]; - "types.InflationCalculationFn"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "types.RandomGenesisAccountsFn"[color="lightgrey", fontcolor="dimgrey", penwidth="0.5"]; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/app/v1alpha1.Config"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/app/runtime/v1alpha1.Module"; - "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideApp"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "github.com/cosmos/cosmos-sdk/codec.Codec"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "*github.com/cosmos/cosmos-sdk/codec.LegacyAmino"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "*github.com/cosmos/cosmos-sdk/baseapp.MsgServiceRouter"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "google.golang.org/protobuf/reflect/protodesc.Resolver"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideApp" -> "google.golang.org/protobuf/reflect/protoregistry.MessageTypeResolver"; - "cosmossdk.io/core/address.Codec" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry"; - "github.com/cosmos/cosmos-sdk/runtime.ValidatorAddressCodec" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry"; - "[]cosmossdk.io/x/tx/signing.CustomGetSigner" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry" -> "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry"; - "*cosmossdk.io/api/cosmos/app/runtime/v1alpha1.Module" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey"; - "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey"; - "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey" -> "*cosmossdk.io/store/types.KVStoreKey"; - "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey"; - "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey" -> "*cosmossdk.io/store/types.TransientStoreKey"; - "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreKey"; - "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreKey"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreKey" -> "*cosmossdk.io/store/types.MemoryStoreKey"; - "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideGenesisTxHandler"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideGenesisTxHandler" -> "cosmossdk.io/core/genesis.TxHandler"; - "*cosmossdk.io/api/cosmos/app/runtime/v1alpha1.Module" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService"; - "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService"; - "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService" -> "cosmossdk.io/core/store.KVStoreService"; - "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreService"; - "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreService"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreService" -> "cosmossdk.io/core/store.MemoryStoreService"; - "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreService"; - "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreService"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreService" -> "cosmossdk.io/core/store.TransientStoreService"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideEventService" -> "cosmossdk.io/core/event.Service"; - "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideHeaderInfoService"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideHeaderInfoService" -> "cosmossdk.io/core/header.Service"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideCometInfoService" -> "cosmossdk.io/core/comet.BlockInfoService"; - "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideBasicManager"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideBasicManager" -> "map[string]github.com/cosmos/cosmos-sdk/types/module.AppModuleBasic"; - "*cosmossdk.io/api/cosmos/auth/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec"; - "*cosmossdk.io/api/cosmos/staking/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec"; - "func() address.Codec" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec"; - "func() runtime.ValidatorAddressCodec" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec"; - "func() runtime.ConsensusAddressCodec" -> "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec" -> "cosmossdk.io/core/address.Codec"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec" -> "github.com/cosmos/cosmos-sdk/runtime.ValidatorAddressCodec"; - "github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec" -> "github.com/cosmos/cosmos-sdk/runtime.ConsensusAddressCodec"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/auth/module/v1.Module"; - "*cosmossdk.io/api/cosmos/auth/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; - "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; - "cosmossdk.io/core/address.Codec" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; - "types.RandomGenesisAccountsFn" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; - "func() types.AccountI" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/exported.Subspace" -> "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper"; - "github.com/cosmos/cosmos-sdk/x/auth.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/vesting/module/v1.Module"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/auth/vesting.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/vesting/types.BankKeeper" -> "github.com/cosmos/cosmos-sdk/x/auth/vesting.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/vesting.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/bank/module/v1.Module"; - "*cosmossdk.io/api/cosmos/bank/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"; - "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"; - "cosmossdk.io/log.Logger" -> "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/exported.Subspace" -> "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper"; - "github.com/cosmos/cosmos-sdk/x/bank.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/staking/module/v1.Module"; - "*cosmossdk.io/api/cosmos/staking/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; - "github.com/cosmos/cosmos-sdk/runtime.ValidatorAddressCodec" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; - "github.com/cosmos/cosmos-sdk/runtime.ConsensusAddressCodec" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; - "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/staking/exported.Subspace" -> "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule" -> "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper"; - "github.com/cosmos/cosmos-sdk/x/staking.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/slashing/module/v1.Module"; - "*cosmossdk.io/api/cosmos/slashing/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; - "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; - "*github.com/cosmos/cosmos-sdk/codec.LegacyAmino" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; - "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/slashing/exported.Subspace" -> "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/slashing/keeper.Keeper"; - "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule" -> "map[string]github.com/cosmos/cosmos-sdk/x/staking/types.StakingHooksWrapper"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/params/module/v1.Module"; - "*cosmossdk.io/store/types.KVStoreKey" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideModule"; - "*cosmossdk.io/store/types.TransientStoreKey" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideModule"; - "*github.com/cosmos/cosmos-sdk/codec.LegacyAmino" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/params.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/params/keeper.Keeper"; - "github.com/cosmos/cosmos-sdk/x/params.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "github.com/cosmos/cosmos-sdk/x/params.ProvideModule" -> "[]github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1.HandlerRoute"; - "cosmossdk.io/depinject.ModuleKey" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace"; - "github.com/cosmos/cosmos-sdk/x/params/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace"; - "map[string]github.com/cosmos/cosmos-sdk/x/params/types.KeyTable" -> "github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace"; - "github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace" -> "github.com/cosmos/cosmos-sdk/x/params/types.Subspace"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/tx/config/v1.Config"; - "*cosmossdk.io/api/cosmos/tx/config/v1.Config" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; - "cosmossdk.io/core/address.Codec" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; - "github.com/cosmos/cosmos-sdk/runtime.ValidatorAddressCodec" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; - "cosmossdk.io/x/tx/signing.ProtoFileResolver" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/ante.FeegrantKeeper" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; - "func() []signing.SignModeHandler" -> "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule" -> "github.com/cosmos/cosmos-sdk/client.TxConfig"; - "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/auth/tx.ConfigOptions"; - "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule" -> "[]runtime.BaseAppOption"; - "github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideProtoRegistry" -> "cosmossdk.io/x/tx/signing.ProtoFileResolver"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/genutil/module/v1.Module"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule"; - "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule"; - "cosmossdk.io/core/genesis.TxHandler" -> "github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule"; - "github.com/cosmos/cosmos-sdk/client.TxConfig" -> "github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/authz/module/v1.Module"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry" -> "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"; - "*github.com/cosmos/cosmos-sdk/baseapp.MsgServiceRouter" -> "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"; - "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/authz/keeper.Keeper"; - "github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/upgrade/module/v1.Module"; - "*cosmossdk.io/api/cosmos/upgrade/module/v1.Module" -> "cosmossdk.io/x/upgrade.ProvideModule"; - "cosmossdk.io/core/store.KVStoreService" -> "cosmossdk.io/x/upgrade.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "cosmossdk.io/x/upgrade.ProvideModule"; - "cosmossdk.io/core/address.Codec" -> "cosmossdk.io/x/upgrade.ProvideModule"; - "github.com/cosmos/cosmos-sdk/server/types.AppOptions" -> "cosmossdk.io/x/upgrade.ProvideModule"; - "cosmossdk.io/x/upgrade.ProvideModule" -> "*cosmossdk.io/x/upgrade/keeper.Keeper"; - "cosmossdk.io/x/upgrade.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/x/upgrade.ProvideModule" -> "[]runtime.BaseAppOption"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/distribution/module/v1.Module"; - "*cosmossdk.io/api/cosmos/distribution/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; - "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; - "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/params/types.Subspace" -> "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/distribution/keeper.Keeper"; - "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule" -> "map[string]github.com/cosmos/cosmos-sdk/x/staking/types.StakingHooksWrapper"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/evidence/module/v1.Module"; - "cosmossdk.io/core/store.KVStoreService" -> "cosmossdk.io/x/evidence.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "cosmossdk.io/x/evidence.ProvideModule"; - "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper" -> "cosmossdk.io/x/evidence.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/slashing/keeper.Keeper" -> "cosmossdk.io/x/evidence.ProvideModule"; - "cosmossdk.io/core/address.Codec" -> "cosmossdk.io/x/evidence.ProvideModule"; - "cosmossdk.io/core/comet.BlockInfoService" -> "cosmossdk.io/x/evidence.ProvideModule"; - "cosmossdk.io/x/evidence.ProvideModule" -> "cosmossdk.io/x/evidence/keeper.Keeper"; - "cosmossdk.io/x/evidence.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/mint/module/v1.Module"; - "cosmossdk.io/depinject.OwnModuleKey" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; - "*cosmossdk.io/api/cosmos/mint/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; - "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; - "types.InflationCalculationFn" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/params/types.Subspace" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; - "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/mint/keeper.Keeper"; - "github.com/cosmos/cosmos-sdk/x/mint.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/group/module/v1.Module"; - "*cosmossdk.io/api/cosmos/group/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; - "*cosmossdk.io/store/types.KVStoreKey" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; - "*github.com/cosmos/cosmos-sdk/baseapp.MsgServiceRouter" -> "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/group/keeper.Keeper"; - "github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/feegrant/module/v1.Module"; - "cosmossdk.io/core/store.KVStoreService" -> "cosmossdk.io/x/feegrant/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "cosmossdk.io/x/feegrant/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "cosmossdk.io/x/feegrant/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "cosmossdk.io/x/feegrant/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry" -> "cosmossdk.io/x/feegrant/module.ProvideModule"; - "cosmossdk.io/x/feegrant/module.ProvideModule" -> "cosmossdk.io/x/feegrant/keeper.Keeper"; - "cosmossdk.io/x/feegrant/module.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/gov/module/v1.Module"; - "*cosmossdk.io/api/cosmos/gov/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; - "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; - "cosmossdk.io/depinject.OwnModuleKey" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; - "*github.com/cosmos/cosmos-sdk/baseapp.MsgServiceRouter" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; - "*github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/distribution/keeper.Keeper" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/params/types.Subspace" -> "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule" -> "*github.com/cosmos/cosmos-sdk/x/gov/keeper.Keeper"; - "github.com/cosmos/cosmos-sdk/x/gov.ProvideModule" -> "[]github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1.HandlerRoute"; - "github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable" -> "map[string]github.com/cosmos/cosmos-sdk/x/params/types.KeyTable"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/crisis/module/v1.Module"; - "*cosmossdk.io/api/cosmos/crisis/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; - "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; - "github.com/cosmos/cosmos-sdk/server/types.AppOptions" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; - "cosmossdk.io/core/address.Codec" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/params/types.Subspace" -> "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule" -> "*github.com/cosmos/cosmos-sdk/x/crisis/keeper.Keeper"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/consensus/module/v1.Module"; - "*cosmossdk.io/api/cosmos/consensus/module/v1.Module" -> "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule"; - "cosmossdk.io/core/store.KVStoreService" -> "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule"; - "cosmossdk.io/core/event.Service" -> "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule" -> "github.com/cosmos/cosmos-sdk/x/consensus/keeper.Keeper"; - "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule" -> "[]runtime.BaseAppOption"; - "cosmossdk.io/core/appconfig.Compose" -> "*cosmossdk.io/api/cosmos/circuit/module/v1.Module"; - "*cosmossdk.io/api/cosmos/circuit/module/v1.Module" -> "cosmossdk.io/x/circuit.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "cosmossdk.io/x/circuit.ProvideModule"; - "cosmossdk.io/core/store.KVStoreService" -> "cosmossdk.io/x/circuit.ProvideModule"; - "cosmossdk.io/core/address.Codec" -> "cosmossdk.io/x/circuit.ProvideModule"; - "cosmossdk.io/x/circuit.ProvideModule" -> "cosmossdk.io/x/circuit/keeper.Keeper"; - "cosmossdk.io/x/circuit.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/x/circuit.ProvideModule" -> "[]runtime.BaseAppOption"; - "cosmossdk.io/core/appconfig.Compose" -> "*github.com/pokt-network/poktroll/api/poktroll/service/module.Module"; - "cosmossdk.io/core/store.KVStoreService" -> "github.com/pokt-network/poktroll/x/service/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/pokt-network/poktroll/x/service/module.ProvideModule"; - "*github.com/pokt-network/poktroll/api/poktroll/service/module.Module" -> "github.com/pokt-network/poktroll/x/service/module.ProvideModule"; - "cosmossdk.io/log.Logger" -> "github.com/pokt-network/poktroll/x/service/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/pokt-network/poktroll/x/service/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper" -> "github.com/pokt-network/poktroll/x/service/module.ProvideModule"; - "github.com/pokt-network/poktroll/x/service/module.ProvideModule" -> "github.com/pokt-network/poktroll/x/service/keeper.Keeper"; - "github.com/pokt-network/poktroll/x/service/module.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "cosmossdk.io/core/appconfig.Compose" -> "*github.com/pokt-network/poktroll/api/poktroll/supplier/module.Module"; - "cosmossdk.io/core/store.KVStoreService" -> "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"; - "*github.com/pokt-network/poktroll/api/poktroll/supplier/module.Module" -> "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"; - "cosmossdk.io/log.Logger" -> "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"; - "github.com/cosmos/cosmos-sdk/x/auth/keeper.AccountKeeper" -> "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"; - "github.com/pokt-network/poktroll/x/supplier/types.BankKeeper" -> "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule"; - "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule" -> "github.com/pokt-network/poktroll/x/supplier/keeper.Keeper"; - "github.com/pokt-network/poktroll/x/supplier/module.ProvideModule" -> "map[string]cosmossdk.io/core/appmodule.AppModule"; - "github.com/pokt-network/poktroll/app.AppConfig" -> "map[string]github.com/cosmos/cosmos-sdk/types/module.AppModuleBasic"; - "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig" -> "cosmossdk.io/log.nopLogger"; - "*github.com/cosmos/cosmos-sdk/runtime.AppBuilder" -> "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig"; - "github.com/cosmos/cosmos-sdk/client.TxConfig" -> "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig"; - "github.com/cosmos/cosmos-sdk/codec.Codec" -> "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig"; - "*github.com/cosmos/cosmos-sdk/codec.LegacyAmino" -> "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig"; - "github.com/cosmos/cosmos-sdk/codec/types.InterfaceRegistry" -> "github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig"; -} - diff --git a/x/supplier/module/debug_container.log b/x/supplier/module/debug_container.log deleted file mode 100644 index 099d5cb93..000000000 --- a/x/supplier/module/debug_container.log +++ /dev/null @@ -1,379 +0,0 @@ -Initializing logger -Registering providers - Registering github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) - Registering resolver for simple type codec.Codec - Registering resolver for simple type *codec.LegacyAmino - Registering resolver for simple type *runtime.AppBuilder - Registering resolver for simple type *baseapp.MsgServiceRouter - Registering resolver for one-per-module type appmodule.AppModule - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Registering resolver for simple type protodesc.Resolver - Registering resolver for simple type protoregistry.MessageTypeResolver - Registering resolver for many-per-container type signing.CustomGetSigner - Registering github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) - Registering resolver for simple type types.InterfaceRegistry - Registering module-scoped provider: github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) - Registering resolver for module-scoped type *types.KVStoreKey - Registering module-scoped provider: github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:213) - Registering resolver for module-scoped type *types.TransientStoreKey - Registering module-scoped provider: github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:219) - Registering resolver for module-scoped type *types.MemoryStoreKey - Registering github.com/cosmos/cosmos-sdk/runtime.ProvideGenesisTxHandler (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:226) - Registering resolver for simple type genesis.TxHandler - Registering module-scoped provider: github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Registering resolver for module-scoped type store.KVStoreService - Registering module-scoped provider: github.com/cosmos/cosmos-sdk/runtime.ProvideMemoryStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:234) - Registering resolver for module-scoped type store.MemoryStoreService - Registering module-scoped provider: github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:239) - Registering resolver for module-scoped type store.TransientStoreService - Registering github.com/cosmos/cosmos-sdk/runtime.ProvideEventService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:244) - Registering resolver for simple type event.Service - Registering github.com/cosmos/cosmos-sdk/runtime.ProvideHeaderInfoService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:253) - Registering resolver for simple type header.Service - Registering github.com/cosmos/cosmos-sdk/runtime.ProvideCometInfoService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:249) - Registering resolver for simple type comet.BlockInfoService - Registering github.com/cosmos/cosmos-sdk/runtime.ProvideBasicManager (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:257) - Registering resolver for simple type module.BasicManager - Registering github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) - Registering resolver for simple type address.Codec - Registering resolver for simple type runtime.ValidatorAddressCodec - Registering resolver for simple type runtime.ConsensusAddressCodec - Registering github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) - Registering resolver for simple type keeper.AccountKeeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Registering github.com/cosmos/cosmos-sdk/x/auth/vesting.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/vesting/module.go:140) - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper - Registering github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) - Registering resolver for simple type keeper.BaseKeeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper - Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper - Registering github.com/cosmos/cosmos-sdk/x/staking.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/staking/module.go:221) - Registering resolver for simple type *keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper - Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper - Implicitly registering resolver *keeper.Keeper for interface type types.StakingKeeper - Registering github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/slashing/module.go:230) - Registering resolver for simple type keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Registering resolver for one-per-module type types.StakingHooksWrapper - Found resolver for types.StakingHooksWrapper: *depinject.onePerModuleResolver - Registering github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) - Registering resolver for simple type keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Registering resolver for many-per-container type v1beta1.HandlerRoute - Found resolver for v1beta1.HandlerRoute: *depinject.groupResolver - Registering resolver for one-per-module type types.KeyTable - Registering module-scoped provider: github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) - Registering resolver for module-scoped type types.Subspace - Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper - Implicitly registering resolver keeper.BaseKeeper for interface type tx.BankKeeper - Implicitly registering resolver keeper.AccountKeeper for interface type ante.AccountKeeper - Registering github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:68) - Registering resolver for simple type client.TxConfig - Registering resolver for simple type tx.ConfigOptions - Registering resolver for many-per-container type runtime.BaseAppOption - Found resolver for runtime.BaseAppOption: *depinject.groupResolver - Registering github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideProtoRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:65) - Registering resolver for simple type signing.ProtoFileResolver - Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper - Implicitly registering resolver *keeper.Keeper for interface type types.StakingKeeper - Registering github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/genutil/module.go:138) - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Implicitly registering resolver keeper.AccountKeeper for interface type authz.AccountKeeper - Implicitly registering resolver keeper.BaseKeeper for interface type authz.BankKeeper - Implicitly registering resolver *baseapp.MsgServiceRouter for interface type baseapp.MessageRouter - Registering github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/authz/module/module.go:178) - Registering resolver for simple type keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Registering cosmossdk.io/x/upgrade.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/upgrade@v0.1.1/module.go:194) - Registering resolver for simple type *keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Found resolver for runtime.BaseAppOption: *depinject.groupResolver - Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper - Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper - Implicitly registering resolver *keeper.Keeper for interface type types.StakingKeeper - Implicitly registering resolver types.Subspace for interface type exported.Subspace - Registering github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/distribution/module.go:232) - Registering resolver for simple type keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Found resolver for types.StakingHooksWrapper: *depinject.onePerModuleResolver - Implicitly registering resolver *keeper.Keeper for interface type types.StakingKeeper - Implicitly registering resolver keeper.Keeper for interface type types.SlashingKeeper - Registering cosmossdk.io/x/evidence.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/evidence@v0.1.0/module.go:210) - Registering resolver for simple type keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Implicitly registering resolver types.Subspace for interface type exported.Subspace - Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper - Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper - Implicitly registering resolver *keeper.Keeper for interface type types.StakingKeeper - Registering github.com/cosmos/cosmos-sdk/x/mint.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/mint/module.go:221) - Registering resolver for simple type keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Implicitly registering resolver keeper.AccountKeeper for interface type group.AccountKeeper - Implicitly registering resolver keeper.BaseKeeper for interface type group.BankKeeper - Registering github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/group/module/module.go:208) - Registering resolver for simple type keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Implicitly registering resolver keeper.AccountKeeper for interface type feegrant.AccountKeeper - Implicitly registering resolver keeper.BaseKeeper for interface type feegrant.BankKeeper - Registering cosmossdk.io/x/feegrant/module.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/feegrant@v0.1.0/module/module.go:184) - Registering resolver for simple type keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper - Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper - Implicitly registering resolver *keeper.Keeper for interface type types.StakingKeeper - Implicitly registering resolver keeper.Keeper for interface type types.DistributionKeeper - Implicitly registering resolver types.Subspace for interface type types.ParamSubspace - Registering github.com/cosmos/cosmos-sdk/x/gov.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:189) - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Registering resolver for simple type *keeper.Keeper - Found resolver for v1beta1.HandlerRoute: *depinject.groupResolver - Registering github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:218) - Found resolver for types.KeyTable: *depinject.onePerModuleResolver - Implicitly registering resolver keeper.BaseKeeper for interface type types.SupplyKeeper - Implicitly registering resolver types.Subspace for interface type exported.Subspace - Registering github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/crisis/module.go:201) - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Registering resolver for simple type *keeper.Keeper - Registering github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/consensus/module.go:117) - Registering resolver for simple type keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Found resolver for runtime.BaseAppOption: *depinject.groupResolver - Registering cosmossdk.io/x/circuit.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/circuit@v0.1.0/module.go:154) - Registering resolver for simple type keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Found resolver for runtime.BaseAppOption: *depinject.groupResolver - Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper - Implicitly registering resolver keeper.BaseKeeper for interface type types.BankKeeper - Registering github.com/pokt-network/poktroll/x/service/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/service/module/module.go:194) - Registering resolver for simple type keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver - Implicitly registering resolver keeper.AccountKeeper for interface type types.AccountKeeper - Registering github.com/pokt-network/poktroll/x/supplier/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/supplier/module/module.go:194) - Registering resolver for simple type keeper.Keeper - Found resolver for appmodule.AppModule: *depinject.onePerModuleResolver -Registering outputs - Registering github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:186) -Building container -Resolving dependencies for github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:186) - Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig - Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) - Providing types.InterfaceRegistry from github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) to github.com/cosmos/cosmos-sdk/runtime.ProvideApp - Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) - Providing address.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry - Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) - Supplying *modulev1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec - Supplying *modulev1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec - Providing zero value for optional dependency func() address.Codec - Providing zero value for optional dependency func() runtime.ValidatorAddressCodec - Providing zero value for optional dependency func() runtime.ConsensusAddressCodec - Calling github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) - Providing runtime.ValidatorAddressCodec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry - Providing many-per-container type slice []signing.CustomGetSigner to github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry from: - Calling github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) - Calling github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) - Providing client.TxConfig from github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:68) to github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig - Resolving dependencies for github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:68) - Supplying *configv1.Config from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule - Providing address.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule - Providing runtime.ValidatorAddressCodec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule - Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule - Providing signing.ProtoFileResolver from github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideProtoRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:65) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideProtoRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:65) - Calling github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideProtoRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:65) - Providing keeper.BaseKeeper from github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) - Supplying *modulev1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/x/bank.ProvideModule - Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/bank.ProvideModule - Providing store.KVStoreService from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) to github.com/cosmos/cosmos-sdk/x/bank.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService - Providing ModuleKey bank - Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService - Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Implicitly registering resolver log.nopLogger for interface type log.Logger - Supplying log.nopLogger from github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:189) to github.com/cosmos/cosmos-sdk/x/bank.ProvideModule - Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to github.com/cosmos/cosmos-sdk/x/bank.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) - Supplying *modulev1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/x/auth.ProvideModule - Providing store.KVStoreService from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) to github.com/cosmos/cosmos-sdk/x/auth.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService - Providing ModuleKey auth - Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService - Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/auth.ProvideModule - Providing address.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/x/auth.ProvideModule - Providing zero value for optional dependency types.RandomGenesisAccountsFn - Providing zero value for optional dependency func() types.AccountI - Implicitly registering resolver types.Subspace for interface type exported.Subspace - Providing types.Subspace from github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) to github.com/cosmos/cosmos-sdk/x/auth.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) - Providing ModuleKey auth - Providing keeper.Keeper from github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) to github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace - Resolving dependencies for github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) - Providing *types.KVStoreKey from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) to github.com/cosmos/cosmos-sdk/x/params.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) - Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey - Providing ModuleKey params - Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey - Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) - Providing *types.TransientStoreKey from github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:213) to github.com/cosmos/cosmos-sdk/x/params.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:213) - Providing ModuleKey params - Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey - Calling github.com/cosmos/cosmos-sdk/runtime.ProvideTransientStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:213) - Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/params.ProvideModule - Providing *codec.LegacyAmino from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/params.ProvideModule - Calling github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) - Providing one-per-module type map map[string]types.KeyTable to github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace from: - gov: github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:218) - Resolving dependencies for github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:218) - Calling github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:218) - Calling github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) - Calling github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) - Implicitly registering resolver types.Subspace for interface type exported.Subspace - Providing types.Subspace from github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) to github.com/cosmos/cosmos-sdk/x/bank.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) - Providing ModuleKey bank - Providing keeper.Keeper from github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) to github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace - Providing one-per-module type map map[string]types.KeyTable to github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace from: - gov: github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:218) - Calling github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) - Calling github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) - Providing keeper.BaseKeeper from github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule - Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule - Implicitly registering resolver keeper.Keeper for interface type ante.FeegrantKeeper - Providing keeper.Keeper from cosmossdk.io/x/feegrant/module.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/feegrant@v0.1.0/module/module.go:184) to github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule - Resolving dependencies for cosmossdk.io/x/feegrant/module.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/feegrant@v0.1.0/module/module.go:184) - Providing store.KVStoreService from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) to cosmossdk.io/x/feegrant/module.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService - Providing ModuleKey feegrant - Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService - Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to cosmossdk.io/x/feegrant/module.ProvideModule - Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to cosmossdk.io/x/feegrant/module.ProvideModule - Providing keeper.BaseKeeper from github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) to cosmossdk.io/x/feegrant/module.ProvideModule - Providing types.InterfaceRegistry from github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) to cosmossdk.io/x/feegrant/module.ProvideModule - Calling cosmossdk.io/x/feegrant/module.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/feegrant@v0.1.0/module/module.go:184) - Providing zero value for optional dependency func() []signing.SignModeHandler - Calling github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:68) - Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig - Providing *codec.LegacyAmino from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig - Providing types.InterfaceRegistry from github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) to github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig -Calling github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:186) -Done building container -Calling invokers -Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:138) - Supplying *appv1alpha1.Config from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:55) to github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder - Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder - Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder - Providing one-per-module type map map[string]appmodule.AppModule to github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder from: - distribution: github.com/cosmos/cosmos-sdk/x/distribution.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/distribution/module.go:232) - crisis: github.com/cosmos/cosmos-sdk/x/crisis.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/crisis/module.go:201) - consensus: github.com/cosmos/cosmos-sdk/x/consensus.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/consensus/module.go:117) - runtime: github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) - bank: github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) - slashing: github.com/cosmos/cosmos-sdk/x/slashing.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/slashing/module.go:230) - genutil: github.com/cosmos/cosmos-sdk/x/genutil.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/genutil/module.go:138) - authz: github.com/cosmos/cosmos-sdk/x/authz/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/authz/module/module.go:178) - mint: github.com/cosmos/cosmos-sdk/x/mint.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/mint/module.go:221) - gov: github.com/cosmos/cosmos-sdk/x/gov.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:189) - circuit: cosmossdk.io/x/circuit.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/circuit@v0.1.0/module.go:154) - auth: github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) - staking: github.com/cosmos/cosmos-sdk/x/staking.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/staking/module.go:221) - feegrant: cosmossdk.io/x/feegrant/module.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/feegrant@v0.1.0/module/module.go:184) - vesting: github.com/cosmos/cosmos-sdk/x/auth/vesting.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/vesting/module.go:140) - params: github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) - upgrade: cosmossdk.io/x/upgrade.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/upgrade@v0.1.1/module.go:194) - evidence: cosmossdk.io/x/evidence.ProvideModule (/home/bwhite/go/pkg/mod/cosmossdk.io/x/evidence@v0.1.0/module.go:210) - group: github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/group/module/module.go:208) - service: github.com/pokt-network/poktroll/x/service/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/service/module/module.go:194) - supplier: github.com/pokt-network/poktroll/x/supplier/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/supplier/module/module.go:194) - Resolving dependencies for github.com/cosmos/cosmos-sdk/x/staking.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/staking/module.go:221) - Supplying *modulev1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule - Providing runtime.ValidatorAddressCodec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule - Providing runtime.ConsensusAddressCodec from github.com/cosmos/cosmos-sdk/runtime.ProvideAddressCodec (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:281) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule - Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule - Providing keeper.BaseKeeper from github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule - Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule - Providing store.KVStoreService from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService - Providing ModuleKey staking - Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService - Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Implicitly registering resolver types.Subspace for interface type exported.Subspace - Providing types.Subspace from github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) to github.com/cosmos/cosmos-sdk/x/staking.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) - Providing ModuleKey staking - Providing keeper.Keeper from github.com/cosmos/cosmos-sdk/x/params.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:129) to github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace - Providing one-per-module type map map[string]types.KeyTable to github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace from: - gov: github.com/cosmos/cosmos-sdk/x/gov.ProvideKeyTable (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/gov/module.go:218) - Calling github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) - Calling github.com/cosmos/cosmos-sdk/x/staking.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/staking/module.go:221) - Resolving dependencies for github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/group/module/module.go:208) - Supplying *modulev1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule - Providing *types.KVStoreKey from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) - Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey - Providing ModuleKey group - Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey - Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreKey (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:198) - Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule - Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule - Providing keeper.BaseKeeper from github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule - Providing types.InterfaceRegistry from github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule - Providing *baseapp.MsgServiceRouter from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule - Calling github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/group/module/module.go:208) - Resolving dependencies for github.com/pokt-network/poktroll/x/service/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/service/module/module.go:194) - Providing store.KVStoreService from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) to github.com/pokt-network/poktroll/x/service/module.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService - Providing ModuleKey service - Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService - Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/pokt-network/poktroll/x/service/module.ProvideModule - Supplying *module.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/pokt-network/poktroll/x/service/module.ProvideModule - Supplying log.nopLogger from github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:189) to github.com/pokt-network/poktroll/x/service/module.ProvideModule - Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to github.com/pokt-network/poktroll/x/service/module.ProvideModule - Providing keeper.BaseKeeper from github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) to github.com/pokt-network/poktroll/x/service/module.ProvideModule - Calling github.com/pokt-network/poktroll/x/service/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/service/module/module.go:194) - Resolving dependencies for github.com/pokt-network/poktroll/x/supplier/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/supplier/module/module.go:194) - Providing store.KVStoreService from github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) to github.com/pokt-network/poktroll/x/supplier/module.ProvideModule - Resolving dependencies for github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Supplying *runtimev1alpha1.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService - Providing ModuleKey supplier - Providing *runtime.AppBuilder from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService - Calling github.com/cosmos/cosmos-sdk/runtime.ProvideKVStoreService (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:229) - Providing codec.Codec from github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) to github.com/pokt-network/poktroll/x/supplier/module.ProvideModule - Supplying *module.Module from cosmossdk.io/core/appconfig.Compose (/home/bwhite/go/pkg/mod/cosmossdk.io/core@v0.11.0/appconfig/config.go:95) to github.com/pokt-network/poktroll/x/supplier/module.ProvideModule - Supplying log.nopLogger from github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:189) to github.com/pokt-network/poktroll/x/supplier/module.ProvideModule - Providing keeper.AccountKeeper from github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) to github.com/pokt-network/poktroll/x/supplier/module.ProvideModule - Error: can't resolve type github.com/pokt-network/poktroll/x/supplier/types/types.BankKeeper for github.com/pokt-network/poktroll/x/supplier/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/supplier/module/module.go:194): - while resolving: - types.BankKeeper for github.com/pokt-network/poktroll/x/supplier/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/supplier/module/module.go:194) - store.KVStoreService for github.com/pokt-network/poktroll/x/supplier/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/supplier/module/module.go:194) - store.KVStoreService for github.com/pokt-network/poktroll/x/service/module.ProvideModule (/home/bwhite/Projects/pokt/poktroll/x/service/module/module.go:194) - *types.KVStoreKey for github.com/cosmos/cosmos-sdk/x/group/module.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/group/module/module.go:208) - exported.Subspace for github.com/cosmos/cosmos-sdk/x/staking.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/staking/module.go:221) - store.KVStoreService for github.com/cosmos/cosmos-sdk/x/staking.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/staking/module.go:221) - map[string]appmodule.AppModule for github.com/cosmos/cosmos-sdk/runtime.SetupAppBuilder (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:138) - ante.FeegrantKeeper for github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:68) - depinject.ModuleKey for github.com/cosmos/cosmos-sdk/x/params.ProvideSubspace (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/params/module.go:146) - exported.Subspace for github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) - func() types.AccountI for github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) - types.RandomGenesisAccountsFn for github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) - store.KVStoreService for github.com/cosmos/cosmos-sdk/x/auth.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/module.go:209) - types.AccountKeeper for github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) - store.KVStoreService for github.com/cosmos/cosmos-sdk/x/bank.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/bank/module.go:227) - types.BankKeeper for github.com/cosmos/cosmos-sdk/x/auth/tx/config.ProvideModule (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/x/auth/tx/config/config.go:68) - client.TxConfig for github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:186) - address.Codec for github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:161) - types.InterfaceRegistry for github.com/cosmos/cosmos-sdk/runtime.ProvideApp (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/runtime/module.go:84) - *runtime.AppBuilder for github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfigWithAppConfig (/home/bwhite/go/pkg/mod/github.com/rollkit/cosmos-sdk@v0.50.1-rollkit-v0.11.19-no-fraud-proofs/testutil/network/network.go:186) - Saved graph of container to /home/bwhite/Projects/pokt/poktroll/x/supplier/module/debug_container.dot From c626b04fe4580ae1e7e1a3bcea8133eb6d99598b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 16 Feb 2024 08:43:01 +0100 Subject: [PATCH 26/29] chore: cleanup test helper --- x/supplier/module/helpers_test.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/x/supplier/module/helpers_test.go b/x/supplier/module/helpers_test.go index b862169bd..19f64b683 100644 --- a/x/supplier/module/helpers_test.go +++ b/x/supplier/module/helpers_test.go @@ -11,19 +11,9 @@ import ( "github.com/pokt-network/poktroll/x/supplier/types" ) -const ( - numBlocksPerSession = 4 - testServiceId = "svc1" -) - // Dummy variable to avoid unused import error. var _ = strconv.IntSize -// init initializes the SDK configuration. -//func init() { -// cmd.InitSDKConfig() -//} - // networkWithSupplierObjects creates a new network with a given number of supplier objects. // It returns the network and a slice of the created supplier objects. func networkWithSupplierObjects(t *testing.T, n int) (*network.Network, []sharedtypes.Supplier) { From 19b6b44118060acdd388359a6d24219572395519 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 16 Feb 2024 08:43:25 +0100 Subject: [PATCH 27/29] reconcile: query CLI test --- x/supplier/module/query_supplier_test.go | 141 +++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 x/supplier/module/query_supplier_test.go diff --git a/x/supplier/module/query_supplier_test.go b/x/supplier/module/query_supplier_test.go new file mode 100644 index 000000000..1cca10675 --- /dev/null +++ b/x/supplier/module/query_supplier_test.go @@ -0,0 +1,141 @@ +package supplier_test + +import ( + "fmt" + "strconv" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/pokt-network/poktroll/testutil/nullify" + supplier "github.com/pokt-network/poktroll/x/supplier/module" + + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func TestShowSupplier(t *testing.T) { + net, suppliers := networkWithSupplierObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + idAddress string + + args []string + err error + obj sharedtypes.Supplier + }{ + { + desc: "supplier found", + idAddress: suppliers[0].Address, + + args: common, + obj: suppliers[0], + }, + { + desc: "supplier not found", + idAddress: strconv.Itoa(100000), + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + tc.idAddress, + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdShowSupplier(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetSupplierResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Supplier) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.Supplier), + ) + } + }) + } +} + +func TestListSupplier(t *testing.T) { + net, suppliers := networkWithSupplierObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(suppliers); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdListSupplier(), args) + require.NoError(t, err) + var resp types.QueryAllSuppliersResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.Supplier), step) + require.Subset(t, + nullify.Fill(suppliers), + nullify.Fill(resp.Supplier), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(suppliers); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdListSupplier(), args) + require.NoError(t, err) + var resp types.QueryAllSuppliersResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.Supplier), step) + require.Subset(t, + nullify.Fill(suppliers), + nullify.Fill(resp.Supplier), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(suppliers)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdListSupplier(), args) + require.NoError(t, err) + var resp types.QueryAllSuppliersResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(suppliers), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(suppliers), + nullify.Fill(resp.Supplier), + ) + }) +} From 62feb1d074ecbcd7d3f6117c1ca006d553183b24 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 16 Feb 2024 09:23:21 +0100 Subject: [PATCH 28/29] reconcile: query param CLI command --- x/supplier/module/query.go | 1 + x/supplier/module/query_params.go | 36 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 x/supplier/module/query_params.go diff --git a/x/supplier/module/query.go b/x/supplier/module/query.go index 2a061fad4..5fbb0b8f9 100644 --- a/x/supplier/module/query.go +++ b/x/supplier/module/query.go @@ -20,6 +20,7 @@ func (am AppModule) GetQueryCmd() *cobra.Command { RunE: client.ValidateCmd, } + cmd.AddCommand(CmdQueryParams()) cmd.AddCommand(CmdListSupplier()) cmd.AddCommand(CmdShowSupplier()) // this line is used by starport scaffolding # 1 diff --git a/x/supplier/module/query_params.go b/x/supplier/module/query_params.go new file mode 100644 index 000000000..13fc6f77f --- /dev/null +++ b/x/supplier/module/query_params.go @@ -0,0 +1,36 @@ +package supplier + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/pokt-network/poktroll/x/supplier/types" +) + +func CmdQueryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Short: "shows the parameters of the module", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} From 93fa368df80d8f275b4aee100041607f33488c76 Mon Sep 17 00:00:00 2001 From: Redouane Lakrache Date: Tue, 20 Feb 2024 10:14:35 +0100 Subject: [PATCH 29/29] chore: supplier module review improvements --- api/poktroll/shared/supplier.pulsar.go | 59 +++++----- api/poktroll/supplier/tx.pulsar.go | 1 + proto/poktroll/shared/supplier.proto | 3 +- proto/poktroll/supplier/genesis.proto | 6 +- proto/poktroll/supplier/params.proto | 6 +- proto/poktroll/supplier/query.proto | 6 +- proto/poktroll/supplier/tx.proto | 26 +++-- testutil/keeper/supplier.go | 8 +- x/supplier/config/errors.go | 23 ++-- .../config/supplier_configs_reader_test.go | 82 ++++++++++++- x/supplier/keeper/msg_server.go | 4 +- .../keeper/msg_server_stake_supplier.go | 18 ++- .../keeper/msg_server_stake_supplier_test.go | 51 ++++---- x/supplier/keeper/msg_server_test.go | 4 + .../keeper/msg_server_unstake_supplier.go | 5 +- .../msg_server_unstake_supplier_test.go | 22 ++-- x/supplier/keeper/msg_update_params.go | 11 +- x/supplier/keeper/msg_update_params_test.go | 42 ++++--- x/supplier/keeper/params.go | 10 +- x/supplier/keeper/query.go | 4 +- x/supplier/keeper/query_params.go | 7 +- x/supplier/keeper/query_supplier.go | 37 +++--- x/supplier/keeper/query_supplier_test.go | 30 ++--- x/supplier/keeper/supplier.go | 24 ++-- x/supplier/keeper/supplier_test.go | 14 +-- x/supplier/module/autocli.go | 68 +++++------ x/supplier/module/genesis.go | 16 +-- x/supplier/module/helpers_test.go | 1 - x/supplier/module/module.go | 5 +- x/supplier/module/query.go | 3 +- x/supplier/module/query_supplier.go | 2 +- x/supplier/module/query_supplier_test.go | 41 ++++--- x/supplier/module/tx.go | 11 +- x/supplier/module/tx_stake_supplier.go | 2 +- x/supplier/module/tx_stake_supplier_test.go | 109 +++++++++--------- x/supplier/module/tx_unstake_supplier_test.go | 39 ++++--- x/supplier/simulation/stake_supplier.go | 2 + x/supplier/simulation/unstake_supplier.go | 1 + x/supplier/types/errors.go | 30 ++--- x/supplier/types/expected_keepers.go | 6 - x/supplier/types/genesis.go | 24 ++-- x/supplier/types/genesis_test.go | 40 +++---- x/supplier/types/key_supplier.go | 10 +- x/supplier/types/keys.go | 8 +- x/supplier/types/message_stake_supplier.go | 2 +- .../types/message_stake_supplier_test.go | 92 +++++++-------- x/supplier/types/message_unstake_supplier.go | 6 +- .../types/message_unstake_supplier_test.go | 28 ++--- ...ate_params.go => message_update_params.go} | 2 +- x/supplier/types/params.go | 4 +- x/supplier/types/types.go | 2 + 51 files changed, 555 insertions(+), 502 deletions(-) rename x/supplier/types/{msg_update_params.go => message_update_params.go} (91%) diff --git a/api/poktroll/shared/supplier.pulsar.go b/api/poktroll/shared/supplier.pulsar.go index a0e0c637e..ac65f36e6 100644 --- a/api/poktroll/shared/supplier.pulsar.go +++ b/api/poktroll/shared/supplier.pulsar.go @@ -6,7 +6,6 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -723,36 +722,34 @@ var file_poktroll_shared_supplier_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, - 0x64, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, - 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1d, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, - 0x72, 0x65, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xb3, 0x01, 0x0a, 0x08, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x32, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x73, 0x74, - 0x61, 0x6b, 0x65, 0x12, 0x42, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x42, 0xa3, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, - 0x0d, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, - 0x65, 0x64, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb3, 0x01, 0x0a, 0x08, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x42, 0x0a, + 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x42, 0xa3, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x0d, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0xa2, 0x02, 0x03, 0x50, + 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x68, + 0x61, 0x72, 0x65, 0x64, 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, + 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, + 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/poktroll/supplier/tx.pulsar.go b/api/poktroll/supplier/tx.pulsar.go index 362a13a3b..d35e3f491 100644 --- a/api/poktroll/supplier/tx.pulsar.go +++ b/api/poktroll/supplier/tx.pulsar.go @@ -2663,6 +2663,7 @@ type MsgUpdateParams struct { // authority is the address that controls the module (defaults to x/gov unless overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/supplier parameters to update. // NOTE: All parameters must be supplied. Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` } diff --git a/proto/poktroll/shared/supplier.proto b/proto/poktroll/shared/supplier.proto index 42c65eb67..5553f5673 100644 --- a/proto/poktroll/shared/supplier.proto +++ b/proto/poktroll/shared/supplier.proto @@ -2,9 +2,10 @@ syntax = "proto3"; package poktroll.shared; option go_package = "github.com/pokt-network/poktroll/x/shared/types"; -import "gogoproto/gogo.proto"; + import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; + import "poktroll/shared/service.proto"; // Supplier is the type defining the actor in Pocket Network that provides RPC services. diff --git a/proto/poktroll/supplier/genesis.proto b/proto/poktroll/supplier/genesis.proto index 5970cc005..dbda0e28a 100644 --- a/proto/poktroll/supplier/genesis.proto +++ b/proto/poktroll/supplier/genesis.proto @@ -1,14 +1,14 @@ syntax = "proto3"; - package poktroll.supplier; +option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; + import "amino/amino.proto"; import "gogoproto/gogo.proto"; + import "poktroll/supplier/params.proto"; import "poktroll/shared/supplier.proto"; -option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; - // GenesisState defines the supplier module's genesis state. message GenesisState { diff --git a/proto/poktroll/supplier/params.proto b/proto/poktroll/supplier/params.proto index 031afe85a..a27a7ba7c 100644 --- a/proto/poktroll/supplier/params.proto +++ b/proto/poktroll/supplier/params.proto @@ -1,15 +1,13 @@ syntax = "proto3"; package poktroll.supplier; +option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; + import "amino/amino.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; - // Params defines the parameters for the module. message Params { option (amino.name) = "poktroll/x/supplier/Params"; option (gogoproto.equal) = true; - - } \ No newline at end of file diff --git a/proto/poktroll/supplier/query.proto b/proto/poktroll/supplier/query.proto index 8d3ad532d..4220f9a39 100644 --- a/proto/poktroll/supplier/query.proto +++ b/proto/poktroll/supplier/query.proto @@ -1,18 +1,18 @@ syntax = "proto3"; - package poktroll.supplier; +option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; + import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "cosmos/base/v1beta1/coin.proto"; + import "poktroll/supplier/params.proto"; import "poktroll/shared/supplier.proto"; -option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; - // Query defines the gRPC querier service. service Query { diff --git a/proto/poktroll/supplier/tx.proto b/proto/poktroll/supplier/tx.proto index 79ed6f5c3..ef75baa2f 100644 --- a/proto/poktroll/supplier/tx.proto +++ b/proto/poktroll/supplier/tx.proto @@ -1,21 +1,22 @@ syntax = "proto3"; - package poktroll.supplier; +option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; + import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; + import "poktroll/supplier/params.proto"; import "poktroll/shared/service.proto"; -option go_package = "github.com/pokt-network/poktroll/x/supplier/types"; // Msg defines the Msg service. service Msg { option (cosmos.msg.v1.service) = true; - + // UpdateParams defines a (governance) operation for updating the module // parameters. The authority defaults to the x/gov module account. rpc UpdateParams (MsgUpdateParams ) returns (MsgUpdateParamsResponse ); @@ -24,14 +25,17 @@ service Msg { } // MsgUpdateParams is the Msg/UpdateParams request type. message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "poktroll/x/supplier/MsgUpdateParams"; - + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "poktroll/x/supplier/MsgUpdateParams"; + // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // params defines the module parameters to update. - + // TODO_IMPROVE(#322): The requirement to provide all params is adopted from the + // latest Cosmos SDK version. We should look into either improving this ourselves + // or seeing if it is on their roadmap. + + // params defines the x/supplier parameters to update. // NOTE: All parameters must be supplied. Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } @@ -42,8 +46,8 @@ message MsgUpdateParamsResponse {} message MsgStakeSupplier { option (cosmos.msg.v1.signer) = "address"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding - cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding + cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) repeated poktroll.shared.SupplierServiceConfig services = 3; // The list of services this supplier is staked to provide service for } @@ -51,7 +55,7 @@ message MsgStakeSupplierResponse {} message MsgUnstakeSupplier { option (cosmos.msg.v1.signer) = "address"; - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding } message MsgUnstakeSupplierResponse {} diff --git a/testutil/keeper/supplier.go b/testutil/keeper/supplier.go index ba9cb9b46..85c1cdff1 100644 --- a/testutil/keeper/supplier.go +++ b/testutil/keeper/supplier.go @@ -1,6 +1,7 @@ package keeper import ( + "context" "testing" "cosmossdk.io/log" @@ -23,7 +24,7 @@ import ( "github.com/pokt-network/poktroll/x/supplier/types" ) -func SupplierKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { +func SupplierKeeper(t testing.TB) (keeper.Keeper, context.Context) { t.Helper() storeKey := storetypes.NewKVStoreKey(types.StoreKey) @@ -53,7 +54,10 @@ func SupplierKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) // Initialize params - k.SetParams(ctx, types.DefaultParams()) + require.NoError(t, k.SetParams(ctx, types.DefaultParams())) return k, ctx } + +// TODO_OPTIMIZE: Index suppliers by service so we can easily query k.GetAllSuppliers(ctx, Service) +// func (k Keeper) GetAllSuppliers(ctx, sdkContext, serviceId string) (suppliers []sharedtypes.Supplier) {} diff --git a/x/supplier/config/errors.go b/x/supplier/config/errors.go index 6a0194a75..80be44969 100644 --- a/x/supplier/config/errors.go +++ b/x/supplier/config/errors.go @@ -1,15 +1,18 @@ package config -import sdkerrors "cosmossdk.io/errors" +import ( + sdkerrors "cosmossdk.io/errors" + + "github.com/pokt-network/poktroll/x/supplier/types" +) var ( - codespace = "supplierconfig" - ErrSupplierConfigUnmarshalYAML = sdkerrors.Register(codespace, 1, "config reader cannot unmarshal yaml content") - ErrSupplierConfigInvalidServiceId = sdkerrors.Register(codespace, 2, "invalid serviceId in supplier config") - ErrSupplierConfigNoEndpoints = sdkerrors.Register(codespace, 3, "no endpoints defined for serviceId in supplier config") - ErrSupplierConfigInvalidEndpointConfig = sdkerrors.Register(codespace, 4, "invalid endpoint config in supplier config") - ErrSupplierConfigInvalidRPCType = sdkerrors.Register(codespace, 5, "invalid rpc type in supplier config") - ErrSupplierConfigInvalidURL = sdkerrors.Register(codespace, 6, "invalid endpoint url in supplier config") - ErrSupplierConfigEmptyContent = sdkerrors.Register(codespace, 7, "empty supplier config content") - ErrSupplierConfigInvalidStake = sdkerrors.Register(codespace, 8, "invalid stake amount in supplier config") + ErrSupplierConfigUnmarshalYAML = sdkerrors.Register(types.ModuleName, 2100, "config reader cannot unmarshal yaml content") + ErrSupplierConfigInvalidServiceId = sdkerrors.Register(types.ModuleName, 2101, "invalid serviceId in supplier config") + ErrSupplierConfigNoEndpoints = sdkerrors.Register(types.ModuleName, 2102, "no endpoints defined for serviceId in supplier config") + ErrSupplierConfigInvalidEndpointConfig = sdkerrors.Register(types.ModuleName, 2103, "invalid endpoint config in supplier config") + ErrSupplierConfigInvalidRPCType = sdkerrors.Register(types.ModuleName, 2104, "invalid rpc type in supplier config") + ErrSupplierConfigInvalidURL = sdkerrors.Register(types.ModuleName, 2105, "invalid endpoint url in supplier config") + ErrSupplierConfigEmptyContent = sdkerrors.Register(types.ModuleName, 2106, "empty supplier config content") + ErrSupplierConfigInvalidStake = sdkerrors.Register(types.ModuleName, 2107, "invalid stake amount in supplier config") ) diff --git a/x/supplier/config/supplier_configs_reader_test.go b/x/supplier/config/supplier_configs_reader_test.go index d912156be..28d567fbb 100644 --- a/x/supplier/config/supplier_configs_reader_test.go +++ b/x/supplier/config/supplier_configs_reader_test.go @@ -1 +1,81 @@ -package config +package config_test + +import ( + "testing" + + sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/yaml" + "github.com/pokt-network/poktroll/x/gateway/module/config" +) + +func Test_ParseGatewayStakeConfig(t *testing.T) { + tests := []struct { + desc string + expectedErr *sdkerrors.Error + expectedConfig *config.GatewayStakeConfig + inputConfig string + }{ + // Valid Configs + { + desc: "valid gateway stake config", + inputConfig: ` + stake_amount: 1000upokt + `, + expectedErr: nil, + expectedConfig: &config.GatewayStakeConfig{ + StakeAmount: sdk.NewCoin("upokt", math.NewInt(1000)), + }, + }, + // Invalid Configs + { + desc: "services_test: invalid service config with empty content", + expectedErr: config.ErrGatewayConfigEmptyContent, + inputConfig: ``, + }, + { + desc: "invalid stake denom", + inputConfig: ` + stake_amount: 1000invalid + `, + expectedErr: config.ErrGatewayConfigInvalidStake, + }, + { + desc: "negative stake amount", + inputConfig: ` + stake_amount: -1000upokt + `, + expectedErr: config.ErrGatewayConfigInvalidStake, + }, + { + desc: "zero stake amount", + inputConfig: ` + stake_amount: 0upokt + `, + expectedErr: config.ErrGatewayConfigInvalidStake, + }, + } + + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + normalizedConfig := yaml.NormalizeYAMLIndentation(tt.inputConfig) + supplierServiceConfig, err := config.ParseGatewayConfig([]byte(normalizedConfig)) + + if tt.expectedErr != nil { + require.Error(t, err) + require.ErrorIs(t, err, tt.expectedErr) + require.Contains(t, err.Error(), tt.expectedErr.Error()) + require.Nil(t, supplierServiceConfig) + return + } + + require.NoError(t, err) + + require.Equal(t, tt.expectedConfig.StakeAmount, supplierServiceConfig.StakeAmount) + require.Equal(t, tt.expectedConfig.StakeAmount.Denom, supplierServiceConfig.StakeAmount.Denom) + }) + } +} diff --git a/x/supplier/keeper/msg_server.go b/x/supplier/keeper/msg_server.go index 83879071c..fc7ad310a 100644 --- a/x/supplier/keeper/msg_server.go +++ b/x/supplier/keeper/msg_server.go @@ -1,8 +1,6 @@ package keeper -import ( - "github.com/pokt-network/poktroll/x/supplier/types" -) +import "github.com/pokt-network/poktroll/x/supplier/types" type msgServer struct { Keeper diff --git a/x/supplier/keeper/msg_server_stake_supplier.go b/x/supplier/keeper/msg_server_stake_supplier.go index d99447da1..3d6101f97 100644 --- a/x/supplier/keeper/msg_server_stake_supplier.go +++ b/x/supplier/keeper/msg_server_stake_supplier.go @@ -4,16 +4,13 @@ import ( "context" "fmt" - sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" "github.com/pokt-network/poktroll/x/supplier/types" ) -func (k msgServer) StakeSupplier(goCtx context.Context, msg *types.MsgStakeSupplier) (*types.MsgStakeSupplierResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - +func (k msgServer) StakeSupplier(ctx context.Context, msg *types.MsgStakeSupplier) (*types.MsgStakeSupplierResponse, error) { logger := k.Logger().With("method", "StakeSupplier") logger.Info(fmt.Sprintf("About to stake supplier with msg: %v", msg)) @@ -26,6 +23,7 @@ func (k msgServer) StakeSupplier(goCtx context.Context, msg *types.MsgStakeSuppl var err error var coinsToDelegate sdk.Coin supplier, isSupplierFound := k.GetSupplier(ctx, msg.Address) + if !isSupplierFound { logger.Info(fmt.Sprintf("Supplier not found. Creating new supplier for address %s", msg.Address)) supplier = k.createSupplier(ctx, msg) @@ -62,7 +60,7 @@ func (k msgServer) StakeSupplier(goCtx context.Context, msg *types.MsgStakeSuppl } func (k msgServer) createSupplier( - ctx sdk.Context, + _ context.Context, msg *types.MsgStakeSupplier, ) sharedtypes.Supplier { return sharedtypes.Supplier{ @@ -73,29 +71,29 @@ func (k msgServer) createSupplier( } func (k msgServer) updateSupplier( - ctx sdk.Context, + _ context.Context, supplier *sharedtypes.Supplier, msg *types.MsgStakeSupplier, ) error { // Checks if the the msg address is the same as the current owner if msg.Address != supplier.Address { - return sdkerrors.Wrapf(types.ErrSupplierUnauthorized, "msg Address (%s) != supplier address (%s)", msg.Address, supplier.Address) + return types.ErrSupplierUnauthorized.Wrapf("msg Address (%s) != supplier address (%s)", msg.Address, supplier.Address) } // Validate that the stake is not being lowered if msg.Stake == nil { - return sdkerrors.Wrapf(types.ErrSupplierInvalidStake, "stake amount cannot be nil") + return types.ErrSupplierInvalidStake.Wrapf("stake amount cannot be nil") } if msg.Stake.IsLTE(*supplier.Stake) { - return sdkerrors.Wrapf(types.ErrSupplierInvalidStake, "stake amount %v must be higher than previous stake amount %v", msg.Stake, supplier.Stake) + return types.ErrSupplierInvalidStake.Wrapf("stake amount %v must be higher than previous stake amount %v", msg.Stake, supplier.Stake) } supplier.Stake = msg.Stake // Validate that the service configs maintain at least one service. // Additional validation is done in `msg.ValidateBasic` above. if len(msg.Services) == 0 { - return sdkerrors.Wrapf(types.ErrSupplierInvalidServiceConfig, "must have at least one service") + return types.ErrSupplierInvalidServiceConfig.Wrapf("must have at least one service") } supplier.Services = msg.Services diff --git a/x/supplier/keeper/msg_server_stake_supplier_test.go b/x/supplier/keeper/msg_server_stake_supplier_test.go index c97ee5558..b0d3f1d50 100644 --- a/x/supplier/keeper/msg_server_stake_supplier_test.go +++ b/x/supplier/keeper/msg_server_stake_supplier_test.go @@ -17,18 +17,17 @@ import ( func TestMsgServer_StakeSupplier_SuccessfulCreateAndUpdate(t *testing.T) { k, ctx := keepertest.SupplierKeeper(t) srv := keeper.NewMsgServerImpl(k) - wctx := sdk.WrapSDKContext(ctx) // Generate an address for the supplier - addr := sample.AccAddress() + supplierAddr := sample.AccAddress() // Verify that the supplier does not exist yet - _, isSupplierFound := k.GetSupplier(ctx, addr) + _, isSupplierFound := k.GetSupplier(ctx, supplierAddr) require.False(t, isSupplierFound) // Prepare the stakeMsg stakeMsg := &types.MsgStakeSupplier{ - Address: addr, + Address: supplierAddr, Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{ { @@ -47,22 +46,22 @@ func TestMsgServer_StakeSupplier_SuccessfulCreateAndUpdate(t *testing.T) { } // Stake the supplier - _, err := srv.StakeSupplier(wctx, stakeMsg) + _, err := srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) // Verify that the supplier exists - supplierFound, isSupplierFound := k.GetSupplier(ctx, addr) + foundSupplier, isSupplierFound := k.GetSupplier(ctx, supplierAddr) require.True(t, isSupplierFound) - require.Equal(t, addr, supplierFound.Address) - require.Equal(t, int64(100), supplierFound.Stake.Amount.Int64()) - require.Len(t, supplierFound.Services, 1) - require.Equal(t, "svcId", supplierFound.Services[0].Service.Id) - require.Len(t, supplierFound.Services[0].Endpoints, 1) - require.Equal(t, "http://localhost:8080", supplierFound.Services[0].Endpoints[0].Url) + require.Equal(t, supplierAddr, foundSupplier.Address) + require.Equal(t, int64(100), foundSupplier.Stake.Amount.Int64()) + require.Len(t, foundSupplier.Services, 1) + require.Equal(t, "svcId", foundSupplier.Services[0].Service.Id) + require.Len(t, foundSupplier.Services[0].Endpoints, 1) + require.Equal(t, "http://localhost:8080", foundSupplier.Services[0].Endpoints[0].Url) // Prepare an updated supplier with a higher stake and a different URL for the service updateMsg := &types.MsgStakeSupplier{ - Address: addr, + Address: supplierAddr, Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(200)}, Services: []*sharedtypes.SupplierServiceConfig{ { @@ -81,15 +80,16 @@ func TestMsgServer_StakeSupplier_SuccessfulCreateAndUpdate(t *testing.T) { } // Update the staked supplier - _, err = srv.StakeSupplier(wctx, updateMsg) + _, err = srv.StakeSupplier(ctx, updateMsg) require.NoError(t, err) - supplierFound, isSupplierFound = k.GetSupplier(ctx, addr) + + foundSupplier, isSupplierFound = k.GetSupplier(ctx, supplierAddr) require.True(t, isSupplierFound) - require.Equal(t, int64(200), supplierFound.Stake.Amount.Int64()) - require.Len(t, supplierFound.Services, 1) - require.Equal(t, "svcId2", supplierFound.Services[0].Service.Id) - require.Len(t, supplierFound.Services[0].Endpoints, 1) - require.Equal(t, "http://localhost:8082", supplierFound.Services[0].Endpoints[0].Url) + require.Equal(t, int64(200), foundSupplier.Stake.Amount.Int64()) + require.Len(t, foundSupplier.Services, 1) + require.Equal(t, "svcId2", foundSupplier.Services[0].Service.Id) + require.Len(t, foundSupplier.Services[0].Endpoints, 1) + require.Equal(t, "http://localhost:8082", foundSupplier.Services[0].Endpoints[0].Url) } func TestMsgServer_StakeSupplier_FailRestakingDueToInvalidServices(t *testing.T) { @@ -177,9 +177,9 @@ func TestMsgServer_StakeSupplier_FailLoweringStake(t *testing.T) { srv := keeper.NewMsgServerImpl(k) // Prepare the supplier - addr := sample.AccAddress() + supplierAddr := sample.AccAddress() stakeMsg := &types.MsgStakeSupplier{ - Address: addr, + Address: supplierAddr, Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{ { @@ -200,12 +200,13 @@ func TestMsgServer_StakeSupplier_FailLoweringStake(t *testing.T) { // Stake the supplier & verify that the supplier exists _, err := srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) - _, isSupplierFound := k.GetSupplier(ctx, addr) + + _, isSupplierFound := k.GetSupplier(ctx, supplierAddr) require.True(t, isSupplierFound) // Prepare an updated supplier with a lower stake updateMsg := &types.MsgStakeSupplier{ - Address: addr, + Address: supplierAddr, Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(50)}, Services: []*sharedtypes.SupplierServiceConfig{ { @@ -228,7 +229,7 @@ func TestMsgServer_StakeSupplier_FailLoweringStake(t *testing.T) { require.Error(t, err) // Verify that the supplier stake is unchanged - supplierFound, isSupplierFound := k.GetSupplier(ctx, addr) + supplierFound, isSupplierFound := k.GetSupplier(ctx, supplierAddr) require.True(t, isSupplierFound) require.Equal(t, int64(100), supplierFound.Stake.Amount.Int64()) require.Len(t, supplierFound.Services, 1) diff --git a/x/supplier/keeper/msg_server_test.go b/x/supplier/keeper/msg_server_test.go index 480dd0262..e9ef42753 100644 --- a/x/supplier/keeper/msg_server_test.go +++ b/x/supplier/keeper/msg_server_test.go @@ -12,11 +12,15 @@ import ( ) func setupMsgServer(t testing.TB) (keeper.Keeper, types.MsgServer, context.Context) { + t.Helper() + k, ctx := keepertest.SupplierKeeper(t) return k, keeper.NewMsgServerImpl(k), ctx } func TestMsgServer(t *testing.T) { + t.Helper() + k, ms, ctx := setupMsgServer(t) require.NotNil(t, ms) require.NotNil(t, ctx) diff --git a/x/supplier/keeper/msg_server_unstake_supplier.go b/x/supplier/keeper/msg_server_unstake_supplier.go index 41f3de736..cb9c6230c 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier.go +++ b/x/supplier/keeper/msg_server_unstake_supplier.go @@ -9,12 +9,11 @@ import ( "github.com/pokt-network/poktroll/x/supplier/types" ) +// TODO(#73): Determine if an application needs an unbonding period after unstaking. func (k msgServer) UnstakeSupplier( - goCtx context.Context, + ctx context.Context, msg *types.MsgUnstakeSupplier, ) (*types.MsgUnstakeSupplierResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - logger := k.Logger().With("method", "UnstakeSupplier") logger.Info(fmt.Sprintf("About to unstake supplier with msg: %v", msg)) diff --git a/x/supplier/keeper/msg_server_unstake_supplier_test.go b/x/supplier/keeper/msg_server_unstake_supplier_test.go index c3b9d9144..fc601f9d9 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier_test.go +++ b/x/supplier/keeper/msg_server_unstake_supplier_test.go @@ -19,16 +19,16 @@ func TestMsgServer_UnstakeSupplier_Success(t *testing.T) { srv := keeper.NewMsgServerImpl(k) // Generate an address for the supplier - addr := sample.AccAddress() + supplierAddr := sample.AccAddress() // Verify that the supplier does not exist yet - _, isSupplierFound := k.GetSupplier(ctx, addr) + _, isSupplierFound := k.GetSupplier(ctx, supplierAddr) require.False(t, isSupplierFound) // Prepare the supplier initialStake := sdk.NewCoin("upokt", math.NewInt(100)) stakeMsg := &types.MsgStakeSupplier{ - Address: addr, + Address: supplierAddr, Stake: &initialStake, Services: []*sharedtypes.SupplierServiceConfig{ { @@ -51,19 +51,19 @@ func TestMsgServer_UnstakeSupplier_Success(t *testing.T) { require.NoError(t, err) // Verify that the supplier exists - foundSupplier, isSupplierFound := k.GetSupplier(ctx, addr) + foundSupplier, isSupplierFound := k.GetSupplier(ctx, supplierAddr) require.True(t, isSupplierFound) - require.Equal(t, addr, foundSupplier.Address) + require.Equal(t, supplierAddr, foundSupplier.Address) require.Equal(t, initialStake.Amount, foundSupplier.Stake.Amount) require.Len(t, foundSupplier.Services, 1) // Unstake the supplier - unstakeMsg := &types.MsgUnstakeSupplier{Address: addr} + unstakeMsg := &types.MsgUnstakeSupplier{Address: supplierAddr} _, err = srv.UnstakeSupplier(ctx, unstakeMsg) require.NoError(t, err) // Make sure the supplier can no longer be found after unstaking - _, isSupplierFound = k.GetSupplier(ctx, addr) + _, isSupplierFound = k.GetSupplier(ctx, supplierAddr) require.False(t, isSupplierFound) } @@ -72,18 +72,18 @@ func TestMsgServer_UnstakeSupplier_FailIfNotStaked(t *testing.T) { srv := keeper.NewMsgServerImpl(k) // Generate an address for the supplier - addr := sample.AccAddress() + supplierAddr := sample.AccAddress() // Verify that the supplier does not exist yet - _, isSupplierFound := k.GetSupplier(ctx, addr) + _, isSupplierFound := k.GetSupplier(ctx, supplierAddr) require.False(t, isSupplierFound) // Unstake the supplier - unstakeMsg := &types.MsgUnstakeSupplier{Address: addr} + unstakeMsg := &types.MsgUnstakeSupplier{Address: supplierAddr} _, err := srv.UnstakeSupplier(ctx, unstakeMsg) require.Error(t, err) require.ErrorIs(t, err, types.ErrSupplierNotFound) - _, isSupplierFound = k.GetSupplier(ctx, addr) + _, isSupplierFound = k.GetSupplier(ctx, supplierAddr) require.False(t, isSupplierFound) } diff --git a/x/supplier/keeper/msg_update_params.go b/x/supplier/keeper/msg_update_params.go index 01aaace7c..dbec01545 100644 --- a/x/supplier/keeper/msg_update_params.go +++ b/x/supplier/keeper/msg_update_params.go @@ -3,18 +3,17 @@ package keeper import ( "context" - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/pokt-network/poktroll/x/supplier/types" ) -func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { +func (k msgServer) UpdateParams( + ctx context.Context, + req *types.MsgUpdateParams, +) (*types.MsgUpdateParamsResponse, error) { if k.GetAuthority() != req.Authority { - return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) + return nil, types.ErrSupplierInvalidSigner.Wrapf("invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) } - ctx := sdk.UnwrapSDKContext(goCtx) if err := k.SetParams(ctx, req.Params); err != nil { return nil, err } diff --git a/x/supplier/keeper/msg_update_params_test.go b/x/supplier/keeper/msg_update_params_test.go index 2e179b220..ccbb6ef2e 100644 --- a/x/supplier/keeper/msg_update_params_test.go +++ b/x/supplier/keeper/msg_update_params_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" "github.com/pokt-network/poktroll/x/supplier/types" @@ -13,49 +12,48 @@ func TestMsgUpdateParams(t *testing.T) { k, ms, ctx := setupMsgServer(t) params := types.DefaultParams() require.NoError(t, k.SetParams(ctx, params)) - wctx := sdk.UnwrapSDKContext(ctx) // default params - testCases := []struct { - name string - input *types.MsgUpdateParams - expErr bool - expErrMsg string + tests := []struct { + desc string + params *types.MsgUpdateParams + shouldError bool + expectedErrMsg string }{ { - name: "invalid authority", - input: &types.MsgUpdateParams{ + desc: "invalid authority", + params: &types.MsgUpdateParams{ Authority: "invalid", Params: params, }, - expErr: true, - expErrMsg: "invalid authority", + shouldError: true, + expectedErrMsg: "invalid authority", }, { - name: "send enabled param", - input: &types.MsgUpdateParams{ + desc: "send enabled param", + params: &types.MsgUpdateParams{ Authority: k.GetAuthority(), Params: types.Params{}, }, - expErr: false, + shouldError: false, }, { - name: "all good", - input: &types.MsgUpdateParams{ + desc: "all good", + params: &types.MsgUpdateParams{ Authority: k.GetAuthority(), Params: params, }, - expErr: false, + shouldError: false, }, } - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - _, err := ms.UpdateParams(wctx, tc.input) + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + _, err := ms.UpdateParams(ctx, test.params) - if tc.expErr { + if test.shouldError { require.Error(t, err) - require.Contains(t, err.Error(), tc.expErrMsg) + require.Contains(t, err.Error(), test.expectedErrMsg) } else { require.NoError(t, err) } diff --git a/x/supplier/keeper/params.go b/x/supplier/keeper/params.go index 6e3162e05..4e7dab63d 100644 --- a/x/supplier/keeper/params.go +++ b/x/supplier/keeper/params.go @@ -11,23 +11,23 @@ import ( // GetParams get all parameters as types.Params func (k Keeper) GetParams(ctx context.Context) (params types.Params) { store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - bz := store.Get(types.ParamsKey) - if bz == nil { + paramsBz := store.Get(types.ParamsKey) + if paramsBz == nil { return params } - k.cdc.MustUnmarshal(bz, ¶ms) + k.cdc.MustUnmarshal(paramsBz, ¶ms) return params } // SetParams set the params func (k Keeper) SetParams(ctx context.Context, params types.Params) error { store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - bz, err := k.cdc.Marshal(¶ms) + paramsBz, err := k.cdc.Marshal(¶ms) if err != nil { return err } - store.Set(types.ParamsKey, bz) + store.Set(types.ParamsKey, paramsBz) return nil } diff --git a/x/supplier/keeper/query.go b/x/supplier/keeper/query.go index 2d1d5c18e..ff0dc934d 100644 --- a/x/supplier/keeper/query.go +++ b/x/supplier/keeper/query.go @@ -1,7 +1,5 @@ package keeper -import ( - "github.com/pokt-network/poktroll/x/supplier/types" -) +import "github.com/pokt-network/poktroll/x/supplier/types" var _ types.QueryServer = Keeper{} diff --git a/x/supplier/keeper/query_params.go b/x/supplier/keeper/query_params.go index 67e2a17f4..234f4c50b 100644 --- a/x/supplier/keeper/query_params.go +++ b/x/supplier/keeper/query_params.go @@ -3,18 +3,19 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/pokt-network/poktroll/x/supplier/types" ) -func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { +func (k Keeper) Params( + ctx context.Context, + req *types.QueryParamsRequest, +) (*types.QueryParamsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } - ctx := sdk.UnwrapSDKContext(goCtx) return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil } diff --git a/x/supplier/keeper/query_supplier.go b/x/supplier/keeper/query_supplier.go index d364ede93..f1f5f21c8 100644 --- a/x/supplier/keeper/query_supplier.go +++ b/x/supplier/keeper/query_supplier.go @@ -14,7 +14,10 @@ import ( "github.com/pokt-network/poktroll/x/supplier/types" ) -func (k Keeper) AllSuppliers(ctx context.Context, req *types.QueryAllSuppliersRequest) (*types.QueryAllSuppliersResponse, error) { +func (k Keeper) AllSuppliers( + ctx context.Context, + req *types.QueryAllSuppliersRequest, +) (*types.QueryAllSuppliersResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -24,15 +27,19 @@ func (k Keeper) AllSuppliers(ctx context.Context, req *types.QueryAllSuppliersRe store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) supplierStore := prefix.NewStore(store, types.KeyPrefix(types.SupplierKeyPrefix)) - pageRes, err := query.Paginate(supplierStore, req.Pagination, func(key []byte, value []byte) error { - var supplier sharedtypes.Supplier - if err := k.cdc.Unmarshal(value, &supplier); err != nil { - return err - } + pageRes, err := query.Paginate( + supplierStore, + req.Pagination, + func(key []byte, value []byte) error { + var supplier sharedtypes.Supplier + if err := k.cdc.Unmarshal(value, &supplier); err != nil { + return err + } - suppliers = append(suppliers, supplier) - return nil - }) + suppliers = append(suppliers, supplier) + return nil + }, + ) if err != nil { return nil, status.Error(codes.Internal, err.Error()) @@ -41,17 +48,17 @@ func (k Keeper) AllSuppliers(ctx context.Context, req *types.QueryAllSuppliersRe return &types.QueryAllSuppliersResponse{Supplier: suppliers, Pagination: pageRes}, nil } -func (k Keeper) Supplier(ctx context.Context, req *types.QueryGetSupplierRequest) (*types.QueryGetSupplierResponse, error) { +func (k Keeper) Supplier( + ctx context.Context, + req *types.QueryGetSupplierRequest, +) (*types.QueryGetSupplierResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } - supplier, found := k.GetSupplier( - ctx, - req.Address, - ) + supplier, found := k.GetSupplier(ctx, req.Address) if !found { - // TODO_TECHDEBT(#181): conform to logging conventions once established + // TODO_TECHDEBT(#384): conform to logging conventions once established msg := fmt.Sprintf("supplier with address %q", req.GetAddress()) return nil, status.Error(codes.NotFound, msg) } diff --git a/x/supplier/keeper/query_supplier_test.go b/x/supplier/keeper/query_supplier_test.go index ca80180c3..268390cf5 100644 --- a/x/supplier/keeper/query_supplier_test.go +++ b/x/supplier/keeper/query_supplier_test.go @@ -19,12 +19,12 @@ var _ = strconv.IntSize func TestSupplierQuerySingle(t *testing.T) { keeper, ctx := keepertest.SupplierKeeper(t) - suppliers := createNSupplier(keeper, ctx, 2) + suppliers := createNSuppliers(keeper, ctx, 2) tests := []struct { - desc string - request *types.QueryGetSupplierRequest - response *types.QueryGetSupplierResponse - err error + desc string + request *types.QueryGetSupplierRequest + response *types.QueryGetSupplierResponse + expectedErr error }{ { desc: "First", @@ -45,22 +45,22 @@ func TestSupplierQuerySingle(t *testing.T) { request: &types.QueryGetSupplierRequest{ Address: strconv.Itoa(100000), }, - err: status.Error(codes.NotFound, "supplier with address \"100000\""), + expectedErr: status.Error(codes.NotFound, "supplier with address \"100000\""), }, { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), + desc: "InvalidRequest", + expectedErr: status.Error(codes.InvalidArgument, "invalid request"), }, } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.Supplier(ctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + response, err := keeper.Supplier(ctx, test.request) + if test.expectedErr != nil { + require.ErrorIs(t, err, test.expectedErr) } else { require.NoError(t, err) require.Equal(t, - nullify.Fill(tc.response), + nullify.Fill(test.response), nullify.Fill(response), ) } @@ -70,7 +70,7 @@ func TestSupplierQuerySingle(t *testing.T) { func TestSupplierQueryPaginated(t *testing.T) { keeper, ctx := keepertest.SupplierKeeper(t) - msgs := createNSupplier(keeper, ctx, 5) + msgs := createNSuppliers(keeper, ctx, 5) request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllSuppliersRequest { return &types.QueryAllSuppliersRequest{ diff --git a/x/supplier/keeper/supplier.go b/x/supplier/keeper/supplier.go index 9f2ba9eb3..af9f8778b 100644 --- a/x/supplier/keeper/supplier.go +++ b/x/supplier/keeper/supplier.go @@ -24,15 +24,12 @@ func (k Keeper) SetSupplier(ctx context.Context, supplier sharedtypes.Supplier) // GetSupplier returns a supplier from its index func (k Keeper) GetSupplier( ctx context.Context, - address string, - + supplierAddr string, ) (supplier sharedtypes.Supplier, found bool) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) - supplierBz := store.Get(types.SupplierKey( - address, - )) + supplierBz := store.Get(types.SupplierKey(supplierAddr)) if supplierBz == nil { return supplier, false } @@ -42,20 +39,14 @@ func (k Keeper) GetSupplier( } // RemoveSupplier removes a supplier from the store -func (k Keeper) RemoveSupplier( - ctx context.Context, - address string, - -) { +func (k Keeper) RemoveSupplier(ctx context.Context, address string) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) - store.Delete(types.SupplierKey( - address, - )) + store.Delete(types.SupplierKey(address)) } -// GetAllSupplier returns all supplier -func (k Keeper) GetAllSupplier(ctx context.Context) (suppliers []sharedtypes.Supplier) { +// GetAllSuppliers returns all supplier +func (k Keeper) GetAllSuppliers(ctx context.Context) (suppliers []sharedtypes.Supplier) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) iterator := storetypes.KVStorePrefixIterator(store, []byte{}) @@ -70,3 +61,6 @@ func (k Keeper) GetAllSupplier(ctx context.Context) (suppliers []sharedtypes.Sup return } + +// TODO_OPTIMIZE: Index suppliers by service so we can easily query k.GetAllSuppliers(ctx, Service) +// func (k Keeper) GetAllSuppliers(ctx, sdkContext, serviceId string) (suppliers []sharedtypes.Supplier) {} diff --git a/x/supplier/keeper/supplier_test.go b/x/supplier/keeper/supplier_test.go index 28e324e07..c30d8a083 100644 --- a/x/supplier/keeper/supplier_test.go +++ b/x/supplier/keeper/supplier_test.go @@ -27,7 +27,7 @@ func init() { cmd.InitSDKConfig() } -func createNSupplier(keeper keeper.Keeper, ctx context.Context, n int) []sharedtypes.Supplier { +func createNSuppliers(keeper keeper.Keeper, ctx context.Context, n int) []sharedtypes.Supplier { suppliers := make([]sharedtypes.Supplier, n) for i := range suppliers { supplier := &suppliers[i] @@ -53,7 +53,7 @@ func createNSupplier(keeper keeper.Keeper, ctx context.Context, n int) []sharedt func TestSupplierGet(t *testing.T) { keeper, ctx := keepertest.SupplierKeeper(t) - suppliers := createNSupplier(keeper, ctx, 10) + suppliers := createNSuppliers(keeper, ctx, 10) for _, supplier := range suppliers { supplierFound, isSupplierFound := keeper.GetSupplier(ctx, supplier.Address, @@ -68,11 +68,9 @@ func TestSupplierGet(t *testing.T) { func TestSupplierRemove(t *testing.T) { keeper, ctx := keepertest.SupplierKeeper(t) - suppliers := createNSupplier(keeper, ctx, 10) + suppliers := createNSuppliers(keeper, ctx, 10) for _, supplier := range suppliers { - keeper.RemoveSupplier(ctx, - supplier.Address, - ) + keeper.RemoveSupplier(ctx, supplier.Address) _, isSupplierFound := keeper.GetSupplier(ctx, supplier.Address, ) @@ -82,10 +80,10 @@ func TestSupplierRemove(t *testing.T) { func TestSupplierGetAll(t *testing.T) { keeper, ctx := keepertest.SupplierKeeper(t) - suppliers := createNSupplier(keeper, ctx, 10) + suppliers := createNSuppliers(keeper, ctx, 10) require.ElementsMatch(t, nullify.Fill(suppliers), - nullify.Fill(keeper.GetAllSupplier(ctx)), + nullify.Fill(keeper.GetAllSuppliers(ctx)), ) } diff --git a/x/supplier/module/autocli.go b/x/supplier/module/autocli.go index ec75e7031..6a3afe3a9 100644 --- a/x/supplier/module/autocli.go +++ b/x/supplier/module/autocli.go @@ -10,47 +10,47 @@ import ( func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { return &autocliv1.ModuleOptions{ Query: &autocliv1.ServiceCommandDescriptor{ - Service: modulev1.Query_ServiceDesc.ServiceName, + Service: modulev1.Query_ServiceDesc.ServiceName, RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "Params", - Use: "params", - Short: "Shows the parameters of the module", - }, - { - RpcMethod: "AllSuppliers", - Use: "list-supplier", - Short: "List all supplier", - }, - { - RpcMethod: "Supplier", - Use: "show-supplier [id]", - Short: "Shows a supplier", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "index"}}, - }, + //{ + // RpcMethod: "Params", + // Use: "params", + // Short: "Shows the parameters of the module", + //}, + //{ + // RpcMethod: "AllSuppliers", + // Use: "list-supplier", + // Short: "List all supplier", + //}, + //{ + // RpcMethod: "Supplier", + // Use: "show-supplier [id]", + // Short: "Shows a supplier", + // PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "index"}}, + //}, // this line is used by ignite scaffolding # autocli/query }, }, Tx: &autocliv1.ServiceCommandDescriptor{ Service: modulev1.Msg_ServiceDesc.ServiceName, EnhanceCustomCommand: true, // only required if you want to use the custom command - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "UpdateParams", - Skip: true, // skipped because authority gated - }, - { - RpcMethod: "StakeSupplier", - Use: "stake-supplier [stake] [services]", - Short: "Send a stake-supplier tx", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "stake"}, {ProtoField: "services"}}, - }, - { - RpcMethod: "UnstakeSupplier", - Use: "unstake-supplier", - Short: "Send a unstake-supplier tx", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{}, - }, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + //{ + // RpcMethod: "UpdateParams", + // Skip: true, // skipped because authority gated + //}, + //{ + // RpcMethod: "StakeSupplier", + // Use: "stake-supplier [stake] [services]", + // Short: "Send a stake-supplier tx", + // PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "stake"}, {ProtoField: "services"}}, + //}, + //{ + // RpcMethod: "UnstakeSupplier", + // Use: "unstake-supplier", + // Short: "Send a unstake-supplier tx", + // PositionalArgs: []*autocliv1.PositionalArgDescriptor{}, + //}, // this line is used by ignite scaffolding # autocli/tx }, }, diff --git a/x/supplier/module/genesis.go b/x/supplier/module/genesis.go index f0a857fe4..d6d7d1b34 100644 --- a/x/supplier/module/genesis.go +++ b/x/supplier/module/genesis.go @@ -1,28 +1,30 @@ package supplier import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "context" "github.com/pokt-network/poktroll/x/supplier/keeper" "github.com/pokt-network/poktroll/x/supplier/types" ) // InitGenesis initializes the module's state from a provided genesis state. -func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { +func InitGenesis(ctx context.Context, k keeper.Keeper, genState types.GenesisState) { // Set all the supplier - for _, elem := range genState.SupplierList { - k.SetSupplier(ctx, elem) + for _, supplier := range genState.SupplierList { + k.SetSupplier(ctx, supplier) } // this line is used by starport scaffolding # genesis/module/init - k.SetParams(ctx, genState.Params) + if err := k.SetParams(ctx, genState.Params); err != nil { + panic(err) + } } // ExportGenesis returns the module's exported genesis. -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { +func ExportGenesis(ctx context.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - genesis.SupplierList = k.GetAllSupplier(ctx) + genesis.SupplierList = k.GetAllSuppliers(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/supplier/module/helpers_test.go b/x/supplier/module/helpers_test.go index 19f64b683..c31fd1839 100644 --- a/x/supplier/module/helpers_test.go +++ b/x/supplier/module/helpers_test.go @@ -18,7 +18,6 @@ var _ = strconv.IntSize // It returns the network and a slice of the created supplier objects. func networkWithSupplierObjects(t *testing.T, n int) (*network.Network, []sharedtypes.Supplier) { t.Helper() - cfg := network.DefaultConfig() supplierGenesisState := network.DefaultSupplierModuleGenesisState(t, n) buf, err := cfg.Codec.MarshalJSON(supplierGenesisState) diff --git a/x/supplier/module/module.go b/x/supplier/module/module.go index 6cb134ae6..8ac44e592 100644 --- a/x/supplier/module/module.go +++ b/x/supplier/module/module.go @@ -166,10 +166,7 @@ func (am AppModule) IsAppModule() {} // ---------------------------------------------------------------------------- func init() { - appmodule.Register( - &modulev1.Module{}, - appmodule.Provide(ProvideModule), - ) + appmodule.Register(&modulev1.Module{}, appmodule.Provide(ProvideModule)) } type ModuleInputs struct { diff --git a/x/supplier/module/query.go b/x/supplier/module/query.go index 5fbb0b8f9..b49ebf142 100644 --- a/x/supplier/module/query.go +++ b/x/supplier/module/query.go @@ -10,6 +10,7 @@ import ( ) // GetQueryCmd returns the cli query commands for this module +// TODO_TECHDEBT(#370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetQueryCmd() *cobra.Command { // Group supplier queries under a subcommand cmd := &cobra.Command{ @@ -21,7 +22,7 @@ func (am AppModule) GetQueryCmd() *cobra.Command { } cmd.AddCommand(CmdQueryParams()) - cmd.AddCommand(CmdListSupplier()) + cmd.AddCommand(CmdListSuppliers()) cmd.AddCommand(CmdShowSupplier()) // this line is used by starport scaffolding # 1 diff --git a/x/supplier/module/query_supplier.go b/x/supplier/module/query_supplier.go index 4ddaefabd..bf565e651 100644 --- a/x/supplier/module/query_supplier.go +++ b/x/supplier/module/query_supplier.go @@ -8,7 +8,7 @@ import ( "github.com/pokt-network/poktroll/x/supplier/types" ) -func CmdListSupplier() *cobra.Command { +func CmdListSuppliers() *cobra.Command { cmd := &cobra.Command{ Use: "list-supplier", Short: "list all supplier", diff --git a/x/supplier/module/query_supplier_test.go b/x/supplier/module/query_supplier_test.go index 1cca10675..6cb48bf5d 100644 --- a/x/supplier/module/query_supplier_test.go +++ b/x/supplier/module/query_supplier_test.go @@ -13,9 +13,8 @@ import ( "google.golang.org/grpc/status" "github.com/pokt-network/poktroll/testutil/nullify" - supplier "github.com/pokt-network/poktroll/x/supplier/module" - sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + supplier "github.com/pokt-network/poktroll/x/supplier/module" "github.com/pokt-network/poktroll/x/supplier/types" ) @@ -30,43 +29,43 @@ func TestShowSupplier(t *testing.T) { desc string idAddress string - args []string - err error - obj sharedtypes.Supplier + args []string + expectedErr error + supplier sharedtypes.Supplier }{ { desc: "supplier found", idAddress: suppliers[0].Address, - args: common, - obj: suppliers[0], + args: common, + supplier: suppliers[0], }, { desc: "supplier not found", idAddress: strconv.Itoa(100000), - args: common, - err: status.Error(codes.NotFound, "not found"), + args: common, + expectedErr: status.Error(codes.NotFound, "not found"), }, } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { args := []string{ - tc.idAddress, + test.idAddress, } - args = append(args, tc.args...) + args = append(args, test.args...) out, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdShowSupplier(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) + if test.expectedErr != nil { + stat, ok := status.FromError(test.expectedErr) require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) + require.ErrorIs(t, stat.Err(), test.expectedErr) } else { require.NoError(t, err) var resp types.QueryGetSupplierResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) require.NotNil(t, resp.Supplier) require.Equal(t, - nullify.Fill(&tc.obj), + nullify.Fill(&test.supplier), nullify.Fill(&resp.Supplier), ) } @@ -74,7 +73,7 @@ func TestShowSupplier(t *testing.T) { } } -func TestListSupplier(t *testing.T) { +func TestListSuppliers(t *testing.T) { net, suppliers := networkWithSupplierObjects(t, 5) ctx := net.Validators[0].ClientCtx @@ -97,7 +96,7 @@ func TestListSupplier(t *testing.T) { step := 2 for i := 0; i < len(suppliers); i += step { args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdListSupplier(), args) + out, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdListSuppliers(), args) require.NoError(t, err) var resp types.QueryAllSuppliersResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) @@ -113,7 +112,7 @@ func TestListSupplier(t *testing.T) { var next []byte for i := 0; i < len(suppliers); i += step { args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdListSupplier(), args) + out, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdListSuppliers(), args) require.NoError(t, err) var resp types.QueryAllSuppliersResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) @@ -127,7 +126,7 @@ func TestListSupplier(t *testing.T) { }) t.Run("Total", func(t *testing.T) { args := request(nil, 0, uint64(len(suppliers)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdListSupplier(), args) + out, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdListSuppliers(), args) require.NoError(t, err) var resp types.QueryAllSuppliersResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) diff --git a/x/supplier/module/tx.go b/x/supplier/module/tx.go index 86a9438ae..535cfa1f7 100644 --- a/x/supplier/module/tx.go +++ b/x/supplier/module/tx.go @@ -2,7 +2,6 @@ package supplier import ( "fmt" - "time" "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" @@ -10,16 +9,8 @@ import ( "github.com/pokt-network/poktroll/x/supplier/types" ) -var ( - DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) -) - -const ( - flagPacketTimeoutTimestamp = "packet-timeout-timestamp" - listSeparator = "," -) - // GetTxCmd returns the transaction commands for this module +// TODO_TECHDEBT(#370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/supplier/module/tx_stake_supplier.go b/x/supplier/module/tx_stake_supplier.go index 5923e06ec..a9dd920cf 100644 --- a/x/supplier/module/tx_stake_supplier.go +++ b/x/supplier/module/tx_stake_supplier.go @@ -27,7 +27,7 @@ func CmdStakeSupplier() *cobra.Command { will stake the tokens and associate them with the supplier specified by the 'from' address. Example: -$ poktrolld --home=$(POKTROLLD_HOME) tx supplier stake-supplier --config stake_config.yaml --keyring-backend test --from $(APP) --node $(POCKET_NODE)`, +$ poktrolld tx supplier stake-supplier --config stake_config.yaml --keyring-backend test --from $(APP) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, Args: cobra.ExactArgs(0), RunE: func(cmd *cobra.Command, _ []string) (err error) { diff --git a/x/supplier/module/tx_stake_supplier_test.go b/x/supplier/module/tx_stake_supplier_test.go index e7423b0d9..44b0c5122 100644 --- a/x/supplier/module/tx_stake_supplier_test.go +++ b/x/supplier/module/tx_stake_supplier_test.go @@ -5,7 +5,7 @@ import ( "testing" sdkerrors "cosmossdk.io/errors" - sdkmath "cosmossdk.io/math" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" @@ -29,6 +29,9 @@ func TestCLI_StakeSupplier(t *testing.T) { accounts := testutil.CreateKeyringAccounts(t, kr, 1) supplierAccount := accounts[0] + // Initialize the Supplier Account by sending it some funds from the validator account that is part of genesis + network.InitAccount(t, net, supplierAccount.Address) + // Update the context with the new keyring ctx = ctx.WithKeyring(kr) @@ -36,7 +39,7 @@ func TestCLI_StakeSupplier(t *testing.T) { commonArgs := []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdkmath.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, math.NewInt(10))).String()), } defaultConfig := ` @@ -49,10 +52,10 @@ func TestCLI_StakeSupplier(t *testing.T) { ` tests := []struct { - desc string - address string - config string - err *sdkerrors.Error + desc string + address string + config string + expectedErr *sdkerrors.Error }{ // Happy Paths { @@ -65,21 +68,21 @@ func TestCLI_StakeSupplier(t *testing.T) { { desc: "stake supplier: missing address", // address: "explicitly missing", - err: types.ErrSupplierInvalidAddress, - config: defaultConfig, + expectedErr: types.ErrSupplierInvalidAddress, + config: defaultConfig, }, { - desc: "stake supplier: invalid address", - address: "invalid", - err: types.ErrSupplierInvalidAddress, - config: defaultConfig, + desc: "stake supplier: invalid address", + address: "invalid", + expectedErr: types.ErrSupplierInvalidAddress, + config: defaultConfig, }, // Error Paths - Stake Related { - desc: "stake supplier: missing stake", - address: supplierAccount.Address.String(), - err: types.ErrSupplierInvalidStake, + desc: "stake supplier: missing stake", + address: supplierAccount.Address.String(), + expectedErr: types.ErrSupplierInvalidStake, config: ` # explicitly omitted stake services: @@ -90,9 +93,9 @@ func TestCLI_StakeSupplier(t *testing.T) { `, }, { - desc: "stake supplier: invalid stake denom", - address: supplierAccount.Address.String(), - err: types.ErrSupplierInvalidStake, + desc: "stake supplier: invalid stake denom", + address: supplierAccount.Address.String(), + expectedErr: types.ErrSupplierInvalidStake, config: ` stake_amount: 1000invalid services: @@ -103,9 +106,9 @@ func TestCLI_StakeSupplier(t *testing.T) { `, }, { - desc: "stake supplier: invalid stake amount (zero)", - address: supplierAccount.Address.String(), - err: types.ErrSupplierInvalidStake, + desc: "stake supplier: invalid stake amount (zero)", + address: supplierAccount.Address.String(), + expectedErr: types.ErrSupplierInvalidStake, config: ` stake_amount: 0upokt services: @@ -116,9 +119,9 @@ func TestCLI_StakeSupplier(t *testing.T) { `, }, { - desc: "stake supplier: invalid stake amount (negative)", - address: supplierAccount.Address.String(), - err: types.ErrSupplierInvalidStake, + desc: "stake supplier: invalid stake amount (negative)", + address: supplierAccount.Address.String(), + expectedErr: types.ErrSupplierInvalidStake, config: ` stake_amount: -1000upokt services: @@ -185,27 +188,27 @@ func TestCLI_StakeSupplier(t *testing.T) { // Error Paths - Service Related { - desc: "services_test: invalid services (missing argument)", - address: supplierAccount.Address.String(), - err: types.ErrSupplierInvalidServiceConfig, - // servicesString: "explicitly omitted", + desc: "services_test: invalid services (missing argument)", + address: supplierAccount.Address.String(), + expectedErr: types.ErrSupplierInvalidServiceConfig, + // servicesString explicitly omitted config: ` stake_amount: 1000upokt `, }, { - desc: "services_test: invalid services (empty string)", - address: supplierAccount.Address.String(), - err: types.ErrSupplierInvalidServiceConfig, + desc: "services_test: invalid services (empty string)", + address: supplierAccount.Address.String(), + expectedErr: types.ErrSupplierInvalidServiceConfig, config: ` stake_amount: 1000upokt services: `, }, { - desc: "services_test: invalid URL", - address: supplierAccount.Address.String(), - err: types.ErrSupplierInvalidServiceConfig, + desc: "services_test: invalid URL", + address: supplierAccount.Address.String(), + expectedErr: types.ErrSupplierInvalidServiceConfig, config: ` stake_amount: 1000upokt services: @@ -216,9 +219,9 @@ func TestCLI_StakeSupplier(t *testing.T) { `, }, { - desc: "services_test: missing URLs", - address: supplierAccount.Address.String(), - err: types.ErrSupplierInvalidServiceConfig, + desc: "services_test: missing URLs", + address: supplierAccount.Address.String(), + expectedErr: types.ErrSupplierInvalidServiceConfig, config: ` stake_amount: 1000upokt services: @@ -227,9 +230,9 @@ func TestCLI_StakeSupplier(t *testing.T) { `, }, { - desc: "services_test: missing service IDs", - address: supplierAccount.Address.String(), - err: types.ErrSupplierInvalidServiceConfig, + desc: "services_test: missing service IDs", + address: supplierAccount.Address.String(), + expectedErr: types.ErrSupplierInvalidServiceConfig, config: ` stake_amount: 1000upokt services: @@ -242,9 +245,9 @@ func TestCLI_StakeSupplier(t *testing.T) { `, }, { - desc: "services_test: missing rpc type", - address: supplierAccount.Address.String(), - err: types.ErrSupplierInvalidServiceConfig, + desc: "services_test: missing rpc type", + address: supplierAccount.Address.String(), + expectedErr: types.ErrSupplierInvalidServiceConfig, config: ` stake_amount: 1000upokt services: @@ -255,22 +258,19 @@ func TestCLI_StakeSupplier(t *testing.T) { }, } - // Initialize the Supplier Account by sending it some funds from the validator account that is part of genesis - network.InitAccount(t, net, supplierAccount.Address) - // Run the tests - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { // Wait for a new block to be committed require.NoError(t, net.WaitForNextBlock()) // write the stake config to a file - configPath := testutil.WriteToNewTempFile(t, yaml.NormalizeYAMLIndentation(tt.config)).Name() + configPath := testutil.WriteToNewTempFile(t, yaml.NormalizeYAMLIndentation(test.config)).Name() // Prepare the arguments for the CLI command args := []string{ fmt.Sprintf("--config=%s", configPath), - fmt.Sprintf("--%s=%s", flags.FlagFrom, tt.address), + fmt.Sprintf("--%s=%s", flags.FlagFrom, test.address), } args = append(args, commonArgs...) @@ -278,15 +278,16 @@ func TestCLI_StakeSupplier(t *testing.T) { outStake, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdStakeSupplier(), args) // Validate the error if one is expected - if tt.err != nil { - stat, ok := status.FromError(tt.err) + if test.expectedErr != nil { + stat, ok := status.FromError(test.expectedErr) require.True(t, ok) - require.Contains(t, stat.Message(), tt.err.Error()) + require.Contains(t, stat.Message(), test.expectedErr.Error()) return } require.NoError(t, err) - // Check the response + // Check the response, this test only asserts CLI command success and not + // the actual supplier module state. var resp sdk.TxResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(outStake.Bytes(), &resp)) require.NotNil(t, resp) diff --git a/x/supplier/module/tx_unstake_supplier_test.go b/x/supplier/module/tx_unstake_supplier_test.go index 75644f58f..2d13d8797 100644 --- a/x/supplier/module/tx_unstake_supplier_test.go +++ b/x/supplier/module/tx_unstake_supplier_test.go @@ -5,7 +5,7 @@ import ( "testing" sdkerrors "cosmossdk.io/errors" - sdkmath "cosmossdk.io/math" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" @@ -28,6 +28,9 @@ func TestCLI_UnstakeSupplier(t *testing.T) { accounts := testutil.CreateKeyringAccounts(t, kr, 1) supplierAccount := accounts[0] + // Initialize the Supplier Account by sending it some funds from the validator account that is part of genesis + network.InitAccount(t, net, supplierAccount.Address) + // Update the context with the new keyring ctx = ctx.WithKeyring(kr) @@ -35,13 +38,13 @@ func TestCLI_UnstakeSupplier(t *testing.T) { commonArgs := []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, sdkmath.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(net.Config.BondDenom, math.NewInt(10))).String()), } tests := []struct { - desc string - address string - err *sdkerrors.Error + desc string + address string + expectedErr *sdkerrors.Error }{ { desc: "unstake supplier: valid", @@ -50,27 +53,24 @@ func TestCLI_UnstakeSupplier(t *testing.T) { { desc: "unstake supplier: missing address", // address: supplierAccount.Address.String(), - err: types.ErrSupplierInvalidAddress, + expectedErr: types.ErrSupplierInvalidAddress, }, { - desc: "unstake supplier: invalid address", - address: "invalid", - err: types.ErrSupplierInvalidAddress, + desc: "unstake supplier: invalid address", + address: "invalid", + expectedErr: types.ErrSupplierInvalidAddress, }, } - // Initialize the Supplier Account by sending it some funds from the validator account that is part of genesis - network.InitAccount(t, net, supplierAccount.Address) - // Run the tests - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { // Wait for a new block to be committed require.NoError(t, net.WaitForNextBlock()) // Prepare the arguments for the CLI command args := []string{ - fmt.Sprintf("--%s=%s", flags.FlagFrom, tt.address), + fmt.Sprintf("--%s=%s", flags.FlagFrom, test.address), } args = append(args, commonArgs...) @@ -78,15 +78,16 @@ func TestCLI_UnstakeSupplier(t *testing.T) { outUnstake, err := clitestutil.ExecTestCLICmd(ctx, supplier.CmdUnstakeSupplier(), args) // Validate the error if one is expected - if tt.err != nil { - stat, ok := status.FromError(tt.err) + if test.expectedErr != nil { + stat, ok := status.FromError(test.expectedErr) require.True(t, ok) - require.Contains(t, stat.Message(), tt.err.Error()) + require.Contains(t, stat.Message(), test.expectedErr.Error()) return } require.NoError(t, err) - // Check the response + // Check the response, this test only asserts CLI command success and not + // the actual supplier module state. var resp sdk.TxResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(outUnstake.Bytes(), &resp)) require.NotNil(t, resp) diff --git a/x/supplier/simulation/stake_supplier.go b/x/supplier/simulation/stake_supplier.go index a6f79739c..29acc1fd4 100644 --- a/x/supplier/simulation/stake_supplier.go +++ b/x/supplier/simulation/stake_supplier.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/pokt-network/poktroll/x/supplier/keeper" "github.com/pokt-network/poktroll/x/supplier/types" ) @@ -20,6 +21,7 @@ func SimulateMsgStakeSupplier( simAccount, _ := simtypes.RandomAcc(r, accs) msg := &types.MsgStakeSupplier{ Address: simAccount.Address.String(), + // TODO: Update all stake message fields } // TODO: Handling the StakeSupplier simulation diff --git a/x/supplier/simulation/unstake_supplier.go b/x/supplier/simulation/unstake_supplier.go index 377b74176..06a2a38c3 100644 --- a/x/supplier/simulation/unstake_supplier.go +++ b/x/supplier/simulation/unstake_supplier.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/pokt-network/poktroll/x/supplier/keeper" "github.com/pokt-network/poktroll/x/supplier/types" ) diff --git a/x/supplier/types/errors.go b/x/supplier/types/errors.go index b6424cc9f..c89c13e39 100644 --- a/x/supplier/types/errors.go +++ b/x/supplier/types/errors.go @@ -2,26 +2,18 @@ package types // DONTCOVER -import ( - sdkerrors "cosmossdk.io/errors" -) +import sdkerrors "cosmossdk.io/errors" // x/supplier module sentinel errors var ( - ErrSupplierInvalidStake = sdkerrors.Register(ModuleName, 1, "invalid supplier stake") - ErrSupplierInvalidAddress = sdkerrors.Register(ModuleName, 2, "invalid address") - ErrSupplierUnauthorized = sdkerrors.Register(ModuleName, 3, "unauthorized supplier signer") - ErrSupplierNotFound = sdkerrors.Register(ModuleName, 4, "supplier not found") - ErrSupplierInvalidServiceConfig = sdkerrors.Register(ModuleName, 5, "invalid service config") - ErrSupplierInvalidSessionStartHeight = sdkerrors.Register(ModuleName, 6, "invalid session start height") - ErrSupplierInvalidSessionId = sdkerrors.Register(ModuleName, 7, "invalid session ID") - ErrSupplierInvalidService = sdkerrors.Register(ModuleName, 8, "invalid service in supplier") - ErrSupplierInvalidClaimRootHash = sdkerrors.Register(ModuleName, 9, "invalid root hash") - ErrSupplierInvalidSessionEndHeight = sdkerrors.Register(ModuleName, 10, "invalid session ending height") - ErrSupplierInvalidQueryRequest = sdkerrors.Register(ModuleName, 11, "invalid query request") - ErrSupplierClaimNotFound = sdkerrors.Register(ModuleName, 12, "claim not found") - ErrSupplierProofNotFound = sdkerrors.Register(ModuleName, 13, "proof not found") - ErrSupplierInvalidProof = sdkerrors.Register(ModuleName, 14, "invalid proof") - ErrSupplierInvalidClosestMerkleProof = sdkerrors.Register(ModuleName, 15, "invalid closest merkle proof") - ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrSupplierInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrSupplierInvalidStake = sdkerrors.Register(ModuleName, 1101, "invalid supplier stake") + ErrSupplierInvalidAddress = sdkerrors.Register(ModuleName, 1102, "invalid address") + ErrSupplierUnauthorized = sdkerrors.Register(ModuleName, 1103, "unauthorized supplier signer") + ErrSupplierNotFound = sdkerrors.Register(ModuleName, 1104, "supplier not found") + ErrSupplierInvalidServiceConfig = sdkerrors.Register(ModuleName, 1105, "invalid service config") + ErrSupplierInvalidSessionStartHeight = sdkerrors.Register(ModuleName, 1106, "invalid session start height") + ErrSupplierInvalidSessionId = sdkerrors.Register(ModuleName, 1107, "invalid session ID") + ErrSupplierInvalidService = sdkerrors.Register(ModuleName, 1108, "invalid service in supplier") + ErrSupplierInvalidSessionEndHeight = sdkerrors.Register(ModuleName, 1109, "invalid session ending height") ) diff --git a/x/supplier/types/expected_keepers.go b/x/supplier/types/expected_keepers.go index 6680b26e0..c0d57d5d4 100644 --- a/x/supplier/types/expected_keepers.go +++ b/x/supplier/types/expected_keepers.go @@ -19,9 +19,3 @@ type BankKeeper interface { DelegateCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error } - -// ParamSubspace defines the expected Subspace interface for parameters. -type ParamSubspace interface { - Get(context.Context, []byte, interface{}) - Set(context.Context, []byte, interface{}) -} diff --git a/x/supplier/types/genesis.go b/x/supplier/types/genesis.go index 9d06b42ff..d7d3a341a 100644 --- a/x/supplier/types/genesis.go +++ b/x/supplier/types/genesis.go @@ -3,16 +3,12 @@ package types import ( "fmt" - sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" servicehelpers "github.com/pokt-network/poktroll/x/shared/helpers" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) -// DefaultIndex is the default global index -const DefaultIndex uint64 = 1 - // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ @@ -26,13 +22,13 @@ func DefaultGenesis() *GenesisState { // failure. func (gs GenesisState) Validate() error { // Check for duplicated index in supplier - supplierIndexMap := make(map[string]struct{}) + supplierAddrMap := make(map[string]struct{}) for _, supplier := range gs.SupplierList { - index := string(SupplierKey(supplier.Address)) - if _, ok := supplierIndexMap[index]; ok { + supplierAddr := string(SupplierKey(supplier.Address)) + if _, ok := supplierAddrMap[supplierAddr]; ok { return fmt.Errorf("duplicated index for supplier") } - supplierIndexMap[index] = struct{}{} + supplierAddrMap[supplierAddr] = struct{}{} } // Check that the stake value for the suppliers is valid @@ -40,25 +36,25 @@ func (gs GenesisState) Validate() error { // TODO_TECHDEBT: Consider creating shared helpers across the board for stake validation, // similar to how we have `ValidateAppServiceConfigs` below if supplier.Stake == nil { - return sdkerrors.Wrapf(ErrSupplierInvalidStake, "nil stake amount for supplier") + return ErrSupplierInvalidStake.Wrapf("nil stake amount for supplier") } stake, err := sdk.ParseCoinNormalized(supplier.Stake.String()) if !stake.IsValid() { - return sdkerrors.Wrapf(ErrSupplierInvalidStake, "invalid stake amount for supplier %v; (%v)", supplier.Stake, stake.Validate()) + return ErrSupplierInvalidStake.Wrapf("invalid stake amount for supplier %v; (%v)", supplier.Stake, stake.Validate()) } if err != nil { - return sdkerrors.Wrapf(ErrSupplierInvalidStake, "cannot parse stake amount for supplier %v; (%v)", supplier.Stake, err) + return ErrSupplierInvalidStake.Wrapf("cannot parse stake amount for supplier %v; (%v)", supplier.Stake, err) } if stake.IsZero() || stake.IsNegative() { - return sdkerrors.Wrapf(ErrSupplierInvalidStake, "invalid stake amount for supplier: %v <= 0", supplier.Stake) + return ErrSupplierInvalidStake.Wrapf("invalid stake amount for supplier: %v <= 0", supplier.Stake) } if stake.Denom != "upokt" { - return sdkerrors.Wrapf(ErrSupplierInvalidStake, "invalid stake amount denom for supplier %v", supplier.Stake) + return ErrSupplierInvalidStake.Wrapf("invalid stake amount denom for supplier %v", supplier.Stake) } // Validate the application service configs if err := servicehelpers.ValidateSupplierServiceConfigs(supplier.Services); err != nil { - return sdkerrors.Wrapf(ErrSupplierInvalidServiceConfig, err.Error()) + return ErrSupplierInvalidServiceConfig.Wrapf(err.Error()) } } // this line is used by starport scaffolding # genesis/types/validate diff --git a/x/supplier/types/genesis_test.go b/x/supplier/types/genesis_test.go index 282c2b01d..23b16b327 100644 --- a/x/supplier/types/genesis_test.go +++ b/x/supplier/types/genesis_test.go @@ -48,12 +48,12 @@ func TestGenesisState_Validate(t *testing.T) { tests := []struct { desc string genState *types.GenesisState - valid bool + isValid bool }{ { desc: "default is valid", genState: types.DefaultGenesis(), - valid: true, + isValid: true, }, { desc: "valid genesis state", @@ -73,7 +73,7 @@ func TestGenesisState_Validate(t *testing.T) { }, // this line is used by starport scaffolding # types/genesis/validField }, - valid: true, + isValid: true, }, { desc: "invalid - zero supplier stake", @@ -91,7 +91,7 @@ func TestGenesisState_Validate(t *testing.T) { }, }, }, - valid: false, + isValid: false, }, { desc: "invalid - negative supplier stake", @@ -109,7 +109,7 @@ func TestGenesisState_Validate(t *testing.T) { }, }, }, - valid: false, + isValid: false, }, { desc: "invalid - wrong stake denom", @@ -127,7 +127,7 @@ func TestGenesisState_Validate(t *testing.T) { }, }, }, - valid: false, + isValid: false, }, { desc: "invalid - missing denom", @@ -145,7 +145,7 @@ func TestGenesisState_Validate(t *testing.T) { }, }, }, - valid: false, + isValid: false, }, { desc: "invalid - due to duplicated supplier address", @@ -163,7 +163,7 @@ func TestGenesisState_Validate(t *testing.T) { }, }, }, - valid: false, + isValid: false, }, { desc: "invalid - due to nil supplier stake", @@ -181,7 +181,7 @@ func TestGenesisState_Validate(t *testing.T) { }, }, }, - valid: false, + isValid: false, }, { desc: "invalid - due to missing supplier stake", @@ -194,12 +194,12 @@ func TestGenesisState_Validate(t *testing.T) { }, { Address: addr2, - // Explicitly missing stake + // Stake explicitly omitted Services: serviceList2, }, }, }, - valid: false, + isValid: false, }, { desc: "invalid - missing services list", @@ -213,11 +213,11 @@ func TestGenesisState_Validate(t *testing.T) { { Address: addr2, Stake: &stake2, - // Services: intentionally omitted + // Services explicitly omitted }, }, }, - valid: false, + isValid: false, }, { desc: "invalid - empty services list", @@ -235,7 +235,7 @@ func TestGenesisState_Validate(t *testing.T) { }, }, }, - valid: false, + isValid: false, }, { desc: "invalid - invalid URL", @@ -266,7 +266,7 @@ func TestGenesisState_Validate(t *testing.T) { }, }, }, - valid: false, + isValid: false, }, { desc: "invalid - invalid RPC Type", @@ -297,14 +297,14 @@ func TestGenesisState_Validate(t *testing.T) { }, }, }, - valid: false, + isValid: false, }, // this line is used by starport scaffolding # types/genesis/testcase } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - err := tc.genState.Validate() - if tc.valid { + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + err := test.genState.Validate() + if test.isValid { require.NoError(t, err) } else { require.Error(t, err) diff --git a/x/supplier/types/key_supplier.go b/x/supplier/types/key_supplier.go index e91fd76e4..b23c0ec8b 100644 --- a/x/supplier/types/key_supplier.go +++ b/x/supplier/types/key_supplier.go @@ -6,17 +6,15 @@ var _ binary.ByteOrder const ( // SupplierKeyPrefix is the prefix to retrieve all Supplier - SupplierKeyPrefix = "Supplier/value/" + SupplierKeyPrefix = "Supplier/address/" ) // SupplierKey returns the store key to retrieve a Supplier from the index fields -func SupplierKey( - index string, -) []byte { +func SupplierKey(supplierAddr string) []byte { var key []byte - indexBytes := []byte(index) - key = append(key, indexBytes...) + supplierAddrBz := []byte(supplierAddr) + key = append(key, supplierAddrBz...) key = append(key, []byte("/")...) return key diff --git a/x/supplier/types/keys.go b/x/supplier/types/keys.go index fe2ebecc7..4c3838de8 100644 --- a/x/supplier/types/keys.go +++ b/x/supplier/types/keys.go @@ -11,10 +11,6 @@ const ( MemStoreKey = "mem_supplier" ) -var ( - ParamsKey = []byte("p_supplier") -) +var ParamsKey = []byte("p_supplier") -func KeyPrefix(p string) []byte { - return []byte(p) -} +func KeyPrefix(p string) []byte { return []byte(p) } diff --git a/x/supplier/types/message_stake_supplier.go b/x/supplier/types/message_stake_supplier.go index 44589187d..535fa0d57 100644 --- a/x/supplier/types/message_stake_supplier.go +++ b/x/supplier/types/message_stake_supplier.go @@ -9,7 +9,7 @@ import ( const TypeMsgStakeSupplier = "stake_supplier" -var _ sdk.Msg = &MsgStakeSupplier{} +var _ sdk.Msg = (*MsgStakeSupplier)(nil) func NewMsgStakeSupplier( address string, diff --git a/x/supplier/types/message_stake_supplier_test.go b/x/supplier/types/message_stake_supplier_test.go index 76798c98a..1a340fae8 100644 --- a/x/supplier/types/message_stake_supplier_test.go +++ b/x/supplier/types/message_stake_supplier_test.go @@ -5,13 +5,15 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" "github.com/pokt-network/poktroll/testutil/sample" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - - "github.com/stretchr/testify/require" ) +// TODO_CLEANUP: This test has a lot of copy-pasted code from test to test. +// It can be simplified by splitting it into smaller tests where the common +// fields don't need to be explicitly specified from test to test. func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { defaultServicesList := []*sharedtypes.SupplierServiceConfig{ { @@ -28,74 +30,74 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { }} tests := []struct { - name string - msg MsgStakeSupplier - err error + desc string + msg MsgStakeSupplier + expectedErr error }{ // address related tests { - name: "invalid address - nil stake", + desc: "invalid address - nil stake", msg: MsgStakeSupplier{ Address: "invalid_address", - // Stake explicitly nil + // Stake explicitly omitted Services: defaultServicesList, }, - err: ErrSupplierInvalidAddress, + expectedErr: ErrSupplierInvalidAddress, }, // stake related tests { - name: "valid address - nil stake", + desc: "valid address - nil stake", msg: MsgStakeSupplier{ Address: sample.AccAddress(), - // Stake explicitly nil + // Stake explicitly omitted Services: defaultServicesList, }, - err: ErrSupplierInvalidStake, + expectedErr: ErrSupplierInvalidStake, }, { - name: "valid address - valid stake", + desc: "valid address - valid stake", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, Services: defaultServicesList, }, }, { - name: "valid address - zero stake", + desc: "valid address - zero stake", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(0)}, Services: defaultServicesList, }, - err: ErrSupplierInvalidStake, + expectedErr: ErrSupplierInvalidStake, }, { - name: "valid address - negative stake", + desc: "valid address - negative stake", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(-100)}, Services: defaultServicesList, }, - err: ErrSupplierInvalidStake, + expectedErr: ErrSupplierInvalidStake, }, { - name: "valid address - invalid stake denom", + desc: "valid address - invalid stake denom", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "invalid", Amount: math.NewInt(100)}, Services: defaultServicesList, }, - err: ErrSupplierInvalidStake, + expectedErr: ErrSupplierInvalidStake, }, { - name: "valid address - invalid stake missing denom", + desc: "valid address - invalid stake missing denom", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "", Amount: math.NewInt(100)}, Services: defaultServicesList, }, - err: ErrSupplierInvalidStake, + expectedErr: ErrSupplierInvalidStake, }, // service related tests { - name: "valid service configs - multiple services", + desc: "valid service configs - multiple services", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, @@ -128,25 +130,25 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { }, }, { - name: "invalid service configs - omitted", + desc: "invalid service configs - omitted", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, - // Services: intentionally omitted + // Services explicitly omitted }, - err: ErrSupplierInvalidServiceConfig, + expectedErr: ErrSupplierInvalidServiceConfig, }, { - name: "invalid service configs - empty", + desc: "invalid service configs - empty", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{}, }, - err: ErrSupplierInvalidServiceConfig, + expectedErr: ErrSupplierInvalidServiceConfig, }, { - name: "invalid service configs - invalid service ID that's too long", + desc: "invalid service configs - invalid service ID that's too long", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, @@ -165,10 +167,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { }, }, }, - err: ErrSupplierInvalidServiceConfig, + expectedErr: ErrSupplierInvalidServiceConfig, }, { - name: "invalid service configs - invalid service Name that's too long", + desc: "invalid service configs - invalid service Name that's too long", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, @@ -188,10 +190,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { }, }, }, - err: ErrSupplierInvalidServiceConfig, + expectedErr: ErrSupplierInvalidServiceConfig, }, { - name: "invalid service configs - invalid service ID that contains invalid characters", + desc: "invalid service configs - invalid service ID that contains invalid characters", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, @@ -210,10 +212,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { }, }, }, - err: ErrSupplierInvalidServiceConfig, + expectedErr: ErrSupplierInvalidServiceConfig, }, { - name: "invalid service configs - missing url", + desc: "invalid service configs - missing url", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, @@ -225,7 +227,7 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { }, Endpoints: []*sharedtypes.SupplierEndpoint{ { - // Url: intentionally omitted + // Url explicitly omitted RpcType: sharedtypes.RPCType_JSON_RPC, Configs: make([]*sharedtypes.ConfigOption, 0), }, @@ -233,10 +235,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { }, }, }, - err: ErrSupplierInvalidServiceConfig, + expectedErr: ErrSupplierInvalidServiceConfig, }, { - name: "invalid service configs - invalid url", + desc: "invalid service configs - invalid url", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, @@ -256,10 +258,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { }, }, }, - err: ErrSupplierInvalidServiceConfig, + expectedErr: ErrSupplierInvalidServiceConfig, }, { - name: "invalid service configs - missing rpc type", + desc: "invalid service configs - missing rpc type", msg: MsgStakeSupplier{ Address: sample.AccAddress(), Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, @@ -272,23 +274,23 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { Endpoints: []*sharedtypes.SupplierEndpoint{ { Url: "http://localhost:8080", - // RpcType: intentionally omitted, + // RpcType explicitly omitted, Configs: make([]*sharedtypes.ConfigOption, 0), }, }, }, }, }, - err: ErrSupplierInvalidServiceConfig, + expectedErr: ErrSupplierInvalidServiceConfig, }, // TODO_TEST: Need to add more tests around config types } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := tt.msg.ValidateBasic() - if tt.err != nil { - require.ErrorIs(t, err, tt.err) + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + err := test.msg.ValidateBasic() + if test.expectedErr != nil { + require.ErrorIs(t, err, test.expectedErr) return } require.NoError(t, err) diff --git a/x/supplier/types/message_unstake_supplier.go b/x/supplier/types/message_unstake_supplier.go index 4a5226ee5..245317ebf 100644 --- a/x/supplier/types/message_unstake_supplier.go +++ b/x/supplier/types/message_unstake_supplier.go @@ -1,12 +1,10 @@ package types -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) +import sdk "github.com/cosmos/cosmos-sdk/types" const TypeMsgUnstakeSupplier = "unstake_supplier" -var _ sdk.Msg = &MsgUnstakeSupplier{} +var _ sdk.Msg = (*MsgUnstakeSupplier)(nil) func NewMsgUnstakeSupplier(address string) *MsgUnstakeSupplier { return &MsgUnstakeSupplier{ diff --git a/x/supplier/types/message_unstake_supplier_test.go b/x/supplier/types/message_unstake_supplier_test.go index b447397ed..b99a9186e 100644 --- a/x/supplier/types/message_unstake_supplier_test.go +++ b/x/supplier/types/message_unstake_supplier_test.go @@ -10,32 +10,32 @@ import ( func TestMsgUnstakeSupplier_ValidateBasic(t *testing.T) { tests := []struct { - name string - msg MsgUnstakeSupplier - err error + desc string + msg MsgUnstakeSupplier + expectedErr error }{ { - name: "invalid address", + desc: "invalid address", msg: MsgUnstakeSupplier{ Address: "invalid_address", }, - err: ErrSupplierInvalidAddress, + expectedErr: ErrSupplierInvalidAddress, }, { - name: "missing address", - msg: MsgUnstakeSupplier{}, - err: ErrSupplierInvalidAddress, + desc: "missing address", + msg: MsgUnstakeSupplier{}, + expectedErr: ErrSupplierInvalidAddress, }, { - name: "valid address", + desc: "valid address", msg: MsgUnstakeSupplier{ Address: sample.AccAddress(), }, }, } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := tt.msg.ValidateBasic() - if tt.err != nil { - require.ErrorIs(t, err, tt.err) + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + err := test.msg.ValidateBasic() + if test.expectedErr != nil { + require.ErrorIs(t, err, test.expectedErr) return } require.NoError(t, err) diff --git a/x/supplier/types/msg_update_params.go b/x/supplier/types/message_update_params.go similarity index 91% rename from x/supplier/types/msg_update_params.go rename to x/supplier/types/message_update_params.go index e36d023de..aeed4a633 100644 --- a/x/supplier/types/msg_update_params.go +++ b/x/supplier/types/message_update_params.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -var _ sdk.Msg = &MsgUpdateParams{} +var _ sdk.Msg = (*MsgUpdateParams)(nil) // ValidateBasic does a sanity check on the provided data. func (m *MsgUpdateParams) ValidateBasic() error { diff --git a/x/supplier/types/params.go b/x/supplier/types/params.go index 4f3215e35..95b0cf8a2 100644 --- a/x/supplier/types/params.go +++ b/x/supplier/types/params.go @@ -1,8 +1,6 @@ package types -import ( - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) +import paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" var _ paramtypes.ParamSet = (*Params)(nil) diff --git a/x/supplier/types/types.go b/x/supplier/types/types.go index ab1254f4c..78d9ec9f9 100644 --- a/x/supplier/types/types.go +++ b/x/supplier/types/types.go @@ -1 +1,3 @@ package types + +// This file is in place to declare the package for dynamically generated protobufs