mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 13:07:09 +00:00
feature/proxied registration (#26)
* chore: ignore mprocs configuration files * feat(macaroon): add macaroon module * chore: update module dependencies
This commit is contained in:
parent
5ef00c3910
commit
779a45121b
@ -10,7 +10,7 @@ exclude_file = []
|
|||||||
exclude_regex = ["_test.go"]
|
exclude_regex = ["_test.go"]
|
||||||
exclude_unchanged = true
|
exclude_unchanged = true
|
||||||
follow_symlink = false
|
follow_symlink = false
|
||||||
full_bin = "bunx wrangler -c ./cmd/motr/wrangler.toml dev"
|
full_bin = "make start-proxy"
|
||||||
include_dir = ["cmd/dwn", "cmd/motr", "internal", "models", "pkl"]
|
include_dir = ["cmd/dwn", "cmd/motr", "internal", "models", "pkl"]
|
||||||
include_ext = ["go", "templ", "html", "pkl", "js", "mjs"]
|
include_ext = ["go", "templ", "html", "pkl", "js", "mjs"]
|
||||||
include_file = [
|
include_file = [
|
||||||
@ -21,15 +21,15 @@ include_file = [
|
|||||||
"devbox.json",
|
"devbox.json",
|
||||||
".air.toml",
|
".air.toml",
|
||||||
]
|
]
|
||||||
kill_delay = "2s"
|
kill_delay = "10s"
|
||||||
log = "build-errors.log"
|
log = "build-errors.log"
|
||||||
poll = false
|
poll = false
|
||||||
poll_interval = 0
|
poll_interval = 0
|
||||||
post_cmd = []
|
post_cmd = []
|
||||||
pre_cmd = ["templ generate"]
|
pre_cmd = ["templ generate"]
|
||||||
rerun = false
|
rerun = false
|
||||||
rerun_delay = 500
|
rerun_delay = 1000
|
||||||
send_interrupt = false
|
send_interrupt = true
|
||||||
stop_on_error = false
|
stop_on_error = false
|
||||||
|
|
||||||
[color]
|
[color]
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -79,5 +79,7 @@ x/.DS_Store
|
|||||||
buildenv*
|
buildenv*
|
||||||
nebula/node_modules
|
nebula/node_modules
|
||||||
|
|
||||||
|
mprocs.yaml
|
||||||
|
|
||||||
!devbox.lock
|
!devbox.lock
|
||||||
!motr/build
|
!motr/build
|
||||||
|
501
api/macaroon/module/v1/module.pulsar.go
Normal file
501
api/macaroon/module/v1/module.pulsar.go
Normal file
@ -0,0 +1,501 @@
|
|||||||
|
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
||||||
|
package modulev1
|
||||||
|
|
||||||
|
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
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
file_macaroon_module_v1_module_proto_init()
|
||||||
|
md_Module = File_macaroon_module_v1_module_proto.Messages().ByName("Module")
|
||||||
|
}
|
||||||
|
|
||||||
|
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_macaroon_module_v1_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) {
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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() {
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.module.v1.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() {
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.module.v1.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() {
|
||||||
|
default:
|
||||||
|
if descriptor.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.module.v1.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() {
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.module.v1.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() {
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.module.v1.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() {
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.module.v1.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 macaroon.module.v1.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
|
||||||
|
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 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 {
|
||||||
|
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: macaroon/module/v1/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 app config object of the module.
|
||||||
|
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||||
|
type Module struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Module) Reset() {
|
||||||
|
*x = Module{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_macaroon_module_v1_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_macaroon_module_v1_module_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_macaroon_module_v1_module_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_macaroon_module_v1_module_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x1f, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c,
|
||||||
|
0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
|
0x6f, 0x12, 0x12, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75,
|
||||||
|
0x6c, 0x65, 0x2e, 0x76, 0x31, 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, 0x28, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
||||||
|
0x65, 0x3a, 0x1e, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x18, 0x0a, 0x16, 0x67, 0x69, 0x74, 0x68, 0x75,
|
||||||
|
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e,
|
||||||
|
0x72, 0x42, 0xc7, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f,
|
||||||
|
0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f,
|
||||||
|
0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74,
|
||||||
|
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73,
|
||||||
|
0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e,
|
||||||
|
0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c,
|
||||||
|
0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x4d, 0x61, 0x63, 0x61,
|
||||||
|
0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02,
|
||||||
|
0x12, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
|
||||||
|
0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x4d,
|
||||||
|
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
|
||||||
|
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a,
|
||||||
|
0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_macaroon_module_v1_module_proto_rawDescOnce sync.Once
|
||||||
|
file_macaroon_module_v1_module_proto_rawDescData = file_macaroon_module_v1_module_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_macaroon_module_v1_module_proto_rawDescGZIP() []byte {
|
||||||
|
file_macaroon_module_v1_module_proto_rawDescOnce.Do(func() {
|
||||||
|
file_macaroon_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_macaroon_module_v1_module_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_macaroon_module_v1_module_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_macaroon_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_macaroon_module_v1_module_proto_goTypes = []interface{}{
|
||||||
|
(*Module)(nil), // 0: macaroon.module.v1.Module
|
||||||
|
}
|
||||||
|
var file_macaroon_module_v1_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_macaroon_module_v1_module_proto_init() }
|
||||||
|
func file_macaroon_module_v1_module_proto_init() {
|
||||||
|
if File_macaroon_module_v1_module_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_macaroon_module_v1_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_macaroon_module_v1_module_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_macaroon_module_v1_module_proto_goTypes,
|
||||||
|
DependencyIndexes: file_macaroon_module_v1_module_proto_depIdxs,
|
||||||
|
MessageInfos: file_macaroon_module_v1_module_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_macaroon_module_v1_module_proto = out.File
|
||||||
|
file_macaroon_module_v1_module_proto_rawDesc = nil
|
||||||
|
file_macaroon_module_v1_module_proto_goTypes = nil
|
||||||
|
file_macaroon_module_v1_module_proto_depIdxs = nil
|
||||||
|
}
|
1053
api/macaroon/v1/genesis.pulsar.go
Normal file
1053
api/macaroon/v1/genesis.pulsar.go
Normal file
File diff suppressed because it is too large
Load Diff
998
api/macaroon/v1/query.pulsar.go
Normal file
998
api/macaroon/v1/query.pulsar.go
Normal file
@ -0,0 +1,998 @@
|
|||||||
|
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
||||||
|
package macaroonv1
|
||||||
|
|
||||||
|
import (
|
||||||
|
fmt "fmt"
|
||||||
|
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||||
|
_ "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_macaroon_v1_query_proto_init()
|
||||||
|
md_QueryParamsRequest = File_macaroon_v1_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_macaroon_v1_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: macaroon.v1.QueryParamsRequest"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.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: macaroon.v1.QueryParamsRequest"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.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: macaroon.v1.QueryParamsRequest"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.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: macaroon.v1.QueryParamsRequest"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.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: macaroon.v1.QueryParamsRequest"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.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: macaroon.v1.QueryParamsRequest"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.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 macaroon.v1.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_macaroon_v1_query_proto_init()
|
||||||
|
md_QueryParamsResponse = File_macaroon_v1_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_macaroon_v1_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 "macaroon.v1.QueryParamsResponse.params":
|
||||||
|
return x.Params != nil
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.QueryParamsResponse"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.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 "macaroon.v1.QueryParamsResponse.params":
|
||||||
|
x.Params = nil
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.QueryParamsResponse"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.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 "macaroon.v1.QueryParamsResponse.params":
|
||||||
|
value := x.Params
|
||||||
|
return protoreflect.ValueOfMessage(value.ProtoReflect())
|
||||||
|
default:
|
||||||
|
if descriptor.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.QueryParamsResponse"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.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 "macaroon.v1.QueryParamsResponse.params":
|
||||||
|
x.Params = value.Message().Interface().(*Params)
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.QueryParamsResponse"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.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 "macaroon.v1.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: macaroon.v1.QueryParamsResponse"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.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 "macaroon.v1.QueryParamsResponse.params":
|
||||||
|
m := new(Params)
|
||||||
|
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.QueryParamsResponse"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.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 macaroon.v1.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: macaroon/v1/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 the 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_macaroon_v1_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_macaroon_v1_query_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
||||||
|
type QueryParamsResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
// params defines the parameters of the module.
|
||||||
|
Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *QueryParamsResponse) Reset() {
|
||||||
|
*x = QueryParamsResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_macaroon_v1_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_macaroon_v1_query_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *QueryParamsResponse) GetParams() *Params {
|
||||||
|
if x != nil {
|
||||||
|
return x.Params
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_macaroon_v1_query_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_macaroon_v1_query_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x17, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75,
|
||||||
|
0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6d, 0x61, 0x63, 0x61, 0x72,
|
||||||
|
0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 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, 0x19, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x76,
|
||||||
|
0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 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, 0x42, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61,
|
||||||
|
0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x06,
|
||||||
|
0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d,
|
||||||
|
0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||||
|
0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x71, 0x0a, 0x05, 0x51, 0x75, 0x65,
|
||||||
|
0x72, 0x79, 0x12, 0x68, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x6d,
|
||||||
|
0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79,
|
||||||
|
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e,
|
||||||
|
0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72,
|
||||||
|
0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||||
|
0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f,
|
||||||
|
0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x9d, 0x01, 0x0a,
|
||||||
|
0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31,
|
||||||
|
0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31,
|
||||||
|
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e,
|
||||||
|
0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63, 0x61, 0x72,
|
||||||
|
0x6f, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x76,
|
||||||
|
0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f,
|
||||||
|
0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e,
|
||||||
|
0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56,
|
||||||
|
0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c,
|
||||||
|
0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72,
|
||||||
|
0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_macaroon_v1_query_proto_rawDescOnce sync.Once
|
||||||
|
file_macaroon_v1_query_proto_rawDescData = file_macaroon_v1_query_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_macaroon_v1_query_proto_rawDescGZIP() []byte {
|
||||||
|
file_macaroon_v1_query_proto_rawDescOnce.Do(func() {
|
||||||
|
file_macaroon_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_macaroon_v1_query_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_macaroon_v1_query_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_macaroon_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
|
var file_macaroon_v1_query_proto_goTypes = []interface{}{
|
||||||
|
(*QueryParamsRequest)(nil), // 0: macaroon.v1.QueryParamsRequest
|
||||||
|
(*QueryParamsResponse)(nil), // 1: macaroon.v1.QueryParamsResponse
|
||||||
|
(*Params)(nil), // 2: macaroon.v1.Params
|
||||||
|
}
|
||||||
|
var file_macaroon_v1_query_proto_depIdxs = []int32{
|
||||||
|
2, // 0: macaroon.v1.QueryParamsResponse.params:type_name -> macaroon.v1.Params
|
||||||
|
0, // 1: macaroon.v1.Query.Params:input_type -> macaroon.v1.QueryParamsRequest
|
||||||
|
1, // 2: macaroon.v1.Query.Params:output_type -> macaroon.v1.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_macaroon_v1_query_proto_init() }
|
||||||
|
func file_macaroon_v1_query_proto_init() {
|
||||||
|
if File_macaroon_v1_query_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
file_macaroon_v1_genesis_proto_init()
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_macaroon_v1_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_macaroon_v1_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_macaroon_v1_query_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 2,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_macaroon_v1_query_proto_goTypes,
|
||||||
|
DependencyIndexes: file_macaroon_v1_query_proto_depIdxs,
|
||||||
|
MessageInfos: file_macaroon_v1_query_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_macaroon_v1_query_proto = out.File
|
||||||
|
file_macaroon_v1_query_proto_rawDesc = nil
|
||||||
|
file_macaroon_v1_query_proto_goTypes = nil
|
||||||
|
file_macaroon_v1_query_proto_depIdxs = nil
|
||||||
|
}
|
111
api/macaroon/v1/query_grpc.pb.go
Normal file
111
api/macaroon/v1/query_grpc.pb.go
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
|
// - protoc (unknown)
|
||||||
|
// source: macaroon/v1/query.proto
|
||||||
|
|
||||||
|
package macaroonv1
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
const (
|
||||||
|
Query_Params_FullMethodName = "/macaroon.v1.Query/Params"
|
||||||
|
)
|
||||||
|
|
||||||
|
// QueryClient is the client API for Query service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type QueryClient interface {
|
||||||
|
// Params queries all parameters of the module.
|
||||||
|
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type queryClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
|
||||||
|
return &queryClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
||||||
|
out := new(QueryParamsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryServer is the server API for Query service.
|
||||||
|
// All implementations must embed UnimplementedQueryServer
|
||||||
|
// for forward compatibility
|
||||||
|
type QueryServer interface {
|
||||||
|
// Params queries all parameters of the module.
|
||||||
|
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||||
|
mustEmbedUnimplementedQueryServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedQueryServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedQueryServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
||||||
|
|
||||||
|
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to QueryServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeQueryServer interface {
|
||||||
|
mustEmbedUnimplementedQueryServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
|
||||||
|
s.RegisterService(&Query_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(QueryParamsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(QueryServer).Params(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: Query_Params_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Query_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "macaroon.v1.Query",
|
||||||
|
HandlerType: (*QueryServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Params",
|
||||||
|
Handler: _Query_Params_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "macaroon/v1/query.proto",
|
||||||
|
}
|
166
api/macaroon/v1/state.cosmos_orm.go
Normal file
166
api/macaroon/v1/state.cosmos_orm.go
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT.
|
||||||
|
|
||||||
|
package macaroonv1
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
ormlist "cosmossdk.io/orm/model/ormlist"
|
||||||
|
ormtable "cosmossdk.io/orm/model/ormtable"
|
||||||
|
ormerrors "cosmossdk.io/orm/types/ormerrors"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ExampleDataTable interface {
|
||||||
|
Insert(ctx context.Context, exampleData *ExampleData) error
|
||||||
|
Update(ctx context.Context, exampleData *ExampleData) error
|
||||||
|
Save(ctx context.Context, exampleData *ExampleData) error
|
||||||
|
Delete(ctx context.Context, exampleData *ExampleData) error
|
||||||
|
Has(ctx context.Context, account []byte) (found bool, err error)
|
||||||
|
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||||
|
Get(ctx context.Context, account []byte) (*ExampleData, error)
|
||||||
|
List(ctx context.Context, prefixKey ExampleDataIndexKey, opts ...ormlist.Option) (ExampleDataIterator, error)
|
||||||
|
ListRange(ctx context.Context, from, to ExampleDataIndexKey, opts ...ormlist.Option) (ExampleDataIterator, error)
|
||||||
|
DeleteBy(ctx context.Context, prefixKey ExampleDataIndexKey) error
|
||||||
|
DeleteRange(ctx context.Context, from, to ExampleDataIndexKey) error
|
||||||
|
|
||||||
|
doNotImplement()
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExampleDataIterator struct {
|
||||||
|
ormtable.Iterator
|
||||||
|
}
|
||||||
|
|
||||||
|
func (i ExampleDataIterator) Value() (*ExampleData, error) {
|
||||||
|
var exampleData ExampleData
|
||||||
|
err := i.UnmarshalMessage(&exampleData)
|
||||||
|
return &exampleData, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExampleDataIndexKey interface {
|
||||||
|
id() uint32
|
||||||
|
values() []interface{}
|
||||||
|
exampleDataIndexKey()
|
||||||
|
}
|
||||||
|
|
||||||
|
// primary key starting index..
|
||||||
|
type ExampleDataPrimaryKey = ExampleDataAccountIndexKey
|
||||||
|
|
||||||
|
type ExampleDataAccountIndexKey struct {
|
||||||
|
vs []interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x ExampleDataAccountIndexKey) id() uint32 { return 0 }
|
||||||
|
func (x ExampleDataAccountIndexKey) values() []interface{} { return x.vs }
|
||||||
|
func (x ExampleDataAccountIndexKey) exampleDataIndexKey() {}
|
||||||
|
|
||||||
|
func (this ExampleDataAccountIndexKey) WithAccount(account []byte) ExampleDataAccountIndexKey {
|
||||||
|
this.vs = []interface{}{account}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExampleDataAmountIndexKey struct {
|
||||||
|
vs []interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x ExampleDataAmountIndexKey) id() uint32 { return 1 }
|
||||||
|
func (x ExampleDataAmountIndexKey) values() []interface{} { return x.vs }
|
||||||
|
func (x ExampleDataAmountIndexKey) exampleDataIndexKey() {}
|
||||||
|
|
||||||
|
func (this ExampleDataAmountIndexKey) WithAmount(amount uint64) ExampleDataAmountIndexKey {
|
||||||
|
this.vs = []interface{}{amount}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
type exampleDataTable struct {
|
||||||
|
table ormtable.Table
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) Insert(ctx context.Context, exampleData *ExampleData) error {
|
||||||
|
return this.table.Insert(ctx, exampleData)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) Update(ctx context.Context, exampleData *ExampleData) error {
|
||||||
|
return this.table.Update(ctx, exampleData)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) Save(ctx context.Context, exampleData *ExampleData) error {
|
||||||
|
return this.table.Save(ctx, exampleData)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) Delete(ctx context.Context, exampleData *ExampleData) error {
|
||||||
|
return this.table.Delete(ctx, exampleData)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) Has(ctx context.Context, account []byte) (found bool, err error) {
|
||||||
|
return this.table.PrimaryKey().Has(ctx, account)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) Get(ctx context.Context, account []byte) (*ExampleData, error) {
|
||||||
|
var exampleData ExampleData
|
||||||
|
found, err := this.table.PrimaryKey().Get(ctx, &exampleData, account)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
return nil, ormerrors.NotFound
|
||||||
|
}
|
||||||
|
return &exampleData, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) List(ctx context.Context, prefixKey ExampleDataIndexKey, opts ...ormlist.Option) (ExampleDataIterator, error) {
|
||||||
|
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||||
|
return ExampleDataIterator{it}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) ListRange(ctx context.Context, from, to ExampleDataIndexKey, opts ...ormlist.Option) (ExampleDataIterator, error) {
|
||||||
|
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||||
|
return ExampleDataIterator{it}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) DeleteBy(ctx context.Context, prefixKey ExampleDataIndexKey) error {
|
||||||
|
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) DeleteRange(ctx context.Context, from, to ExampleDataIndexKey) error {
|
||||||
|
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) doNotImplement() {}
|
||||||
|
|
||||||
|
var _ ExampleDataTable = exampleDataTable{}
|
||||||
|
|
||||||
|
func NewExampleDataTable(db ormtable.Schema) (ExampleDataTable, error) {
|
||||||
|
table := db.GetTable(&ExampleData{})
|
||||||
|
if table == nil {
|
||||||
|
return nil, ormerrors.TableNotFound.Wrap(string((&ExampleData{}).ProtoReflect().Descriptor().FullName()))
|
||||||
|
}
|
||||||
|
return exampleDataTable{table}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type StateStore interface {
|
||||||
|
ExampleDataTable() ExampleDataTable
|
||||||
|
|
||||||
|
doNotImplement()
|
||||||
|
}
|
||||||
|
|
||||||
|
type stateStore struct {
|
||||||
|
exampleData ExampleDataTable
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x stateStore) ExampleDataTable() ExampleDataTable {
|
||||||
|
return x.exampleData
|
||||||
|
}
|
||||||
|
|
||||||
|
func (stateStore) doNotImplement() {}
|
||||||
|
|
||||||
|
var _ StateStore = stateStore{}
|
||||||
|
|
||||||
|
func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
||||||
|
exampleDataTable, err := NewExampleDataTable(db)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return stateStore{
|
||||||
|
exampleDataTable,
|
||||||
|
}, nil
|
||||||
|
}
|
629
api/macaroon/v1/state.pulsar.go
Normal file
629
api/macaroon/v1/state.pulsar.go
Normal file
@ -0,0 +1,629 @@
|
|||||||
|
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
||||||
|
package macaroonv1
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "cosmossdk.io/api/cosmos/orm/v1"
|
||||||
|
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_ExampleData protoreflect.MessageDescriptor
|
||||||
|
fd_ExampleData_account protoreflect.FieldDescriptor
|
||||||
|
fd_ExampleData_amount protoreflect.FieldDescriptor
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
file_macaroon_v1_state_proto_init()
|
||||||
|
md_ExampleData = File_macaroon_v1_state_proto.Messages().ByName("ExampleData")
|
||||||
|
fd_ExampleData_account = md_ExampleData.Fields().ByName("account")
|
||||||
|
fd_ExampleData_amount = md_ExampleData.Fields().ByName("amount")
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ protoreflect.Message = (*fastReflection_ExampleData)(nil)
|
||||||
|
|
||||||
|
type fastReflection_ExampleData ExampleData
|
||||||
|
|
||||||
|
func (x *ExampleData) ProtoReflect() protoreflect.Message {
|
||||||
|
return (*fastReflection_ExampleData)(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExampleData) slowProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_macaroon_v1_state_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_ExampleData_messageType fastReflection_ExampleData_messageType
|
||||||
|
var _ protoreflect.MessageType = fastReflection_ExampleData_messageType{}
|
||||||
|
|
||||||
|
type fastReflection_ExampleData_messageType struct{}
|
||||||
|
|
||||||
|
func (x fastReflection_ExampleData_messageType) Zero() protoreflect.Message {
|
||||||
|
return (*fastReflection_ExampleData)(nil)
|
||||||
|
}
|
||||||
|
func (x fastReflection_ExampleData_messageType) New() protoreflect.Message {
|
||||||
|
return new(fastReflection_ExampleData)
|
||||||
|
}
|
||||||
|
func (x fastReflection_ExampleData_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||||
|
return md_ExampleData
|
||||||
|
}
|
||||||
|
|
||||||
|
// Descriptor returns message descriptor, which contains only the protobuf
|
||||||
|
// type information for the message.
|
||||||
|
func (x *fastReflection_ExampleData) Descriptor() protoreflect.MessageDescriptor {
|
||||||
|
return md_ExampleData
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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_ExampleData) Type() protoreflect.MessageType {
|
||||||
|
return _fastReflection_ExampleData_messageType
|
||||||
|
}
|
||||||
|
|
||||||
|
// New returns a newly allocated and mutable empty message.
|
||||||
|
func (x *fastReflection_ExampleData) New() protoreflect.Message {
|
||||||
|
return new(fastReflection_ExampleData)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Interface unwraps the message reflection interface and
|
||||||
|
// returns the underlying ProtoMessage interface.
|
||||||
|
func (x *fastReflection_ExampleData) Interface() protoreflect.ProtoMessage {
|
||||||
|
return (*ExampleData)(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_ExampleData) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||||
|
if len(x.Account) != 0 {
|
||||||
|
value := protoreflect.ValueOfBytes(x.Account)
|
||||||
|
if !f(fd_ExampleData_account, value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if x.Amount != uint64(0) {
|
||||||
|
value := protoreflect.ValueOfUint64(x.Amount)
|
||||||
|
if !f(fd_ExampleData_amount, 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_ExampleData) Has(fd protoreflect.FieldDescriptor) bool {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.ExampleData.account":
|
||||||
|
return len(x.Account) != 0
|
||||||
|
case "macaroon.v1.ExampleData.amount":
|
||||||
|
return x.Amount != uint64(0)
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.ExampleData"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.ExampleData 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_ExampleData) Clear(fd protoreflect.FieldDescriptor) {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.ExampleData.account":
|
||||||
|
x.Account = nil
|
||||||
|
case "macaroon.v1.ExampleData.amount":
|
||||||
|
x.Amount = uint64(0)
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.ExampleData"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.ExampleData 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_ExampleData) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch descriptor.FullName() {
|
||||||
|
case "macaroon.v1.ExampleData.account":
|
||||||
|
value := x.Account
|
||||||
|
return protoreflect.ValueOfBytes(value)
|
||||||
|
case "macaroon.v1.ExampleData.amount":
|
||||||
|
value := x.Amount
|
||||||
|
return protoreflect.ValueOfUint64(value)
|
||||||
|
default:
|
||||||
|
if descriptor.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.ExampleData"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.ExampleData 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_ExampleData) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.ExampleData.account":
|
||||||
|
x.Account = value.Bytes()
|
||||||
|
case "macaroon.v1.ExampleData.amount":
|
||||||
|
x.Amount = value.Uint()
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.ExampleData"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.ExampleData 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_ExampleData) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.ExampleData.account":
|
||||||
|
panic(fmt.Errorf("field account of message macaroon.v1.ExampleData is not mutable"))
|
||||||
|
case "macaroon.v1.ExampleData.amount":
|
||||||
|
panic(fmt.Errorf("field amount of message macaroon.v1.ExampleData is not mutable"))
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.ExampleData"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.ExampleData 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_ExampleData) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "macaroon.v1.ExampleData.account":
|
||||||
|
return protoreflect.ValueOfBytes(nil)
|
||||||
|
case "macaroon.v1.ExampleData.amount":
|
||||||
|
return protoreflect.ValueOfUint64(uint64(0))
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.ExampleData"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message macaroon.v1.ExampleData 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_ExampleData) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||||
|
switch d.FullName() {
|
||||||
|
default:
|
||||||
|
panic(fmt.Errorf("%s is not a oneof field in macaroon.v1.ExampleData", 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_ExampleData) 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_ExampleData) 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_ExampleData) 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_ExampleData) ProtoMethods() *protoiface.Methods {
|
||||||
|
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||||
|
x := input.Message.Interface().(*ExampleData)
|
||||||
|
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.Account)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
|
if x.Amount != 0 {
|
||||||
|
n += 1 + runtime.Sov(uint64(x.Amount))
|
||||||
|
}
|
||||||
|
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().(*ExampleData)
|
||||||
|
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.Amount != 0 {
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(x.Amount))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x10
|
||||||
|
}
|
||||||
|
if len(x.Account) > 0 {
|
||||||
|
i -= len(x.Account)
|
||||||
|
copy(dAtA[i:], x.Account)
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Account)))
|
||||||
|
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().(*ExampleData)
|
||||||
|
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: ExampleData: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExampleData: 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 Account", wireType)
|
||||||
|
}
|
||||||
|
var byteLen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
byteLen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if byteLen < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + byteLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
x.Account = append(x.Account[:0], dAtA[iNdEx:postIndex]...)
|
||||||
|
if x.Account == nil {
|
||||||
|
x.Account = []byte{}
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
|
||||||
|
}
|
||||||
|
x.Amount = 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.Amount |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if !options.DiscardUnknown {
|
||||||
|
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
||||||
|
}
|
||||||
|
return &protoiface.Methods{
|
||||||
|
NoUnkeyedLiterals: struct{}{},
|
||||||
|
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
||||||
|
Size: size,
|
||||||
|
Marshal: marshal,
|
||||||
|
Unmarshal: unmarshal,
|
||||||
|
Merge: nil,
|
||||||
|
CheckInitialized: nil,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.27.0
|
||||||
|
// protoc (unknown)
|
||||||
|
// source: macaroon/v1/state.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 ExampleData struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
|
||||||
|
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExampleData) Reset() {
|
||||||
|
*x = ExampleData{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_macaroon_v1_state_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExampleData) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ExampleData) ProtoMessage() {}
|
||||||
|
|
||||||
|
// Deprecated: Use ExampleData.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ExampleData) Descriptor() ([]byte, []int) {
|
||||||
|
return file_macaroon_v1_state_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExampleData) GetAccount() []byte {
|
||||||
|
if x != nil {
|
||||||
|
return x.Account
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExampleData) GetAmount() uint64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Amount
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_macaroon_v1_state_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_macaroon_v1_state_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x17, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74,
|
||||||
|
0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6d, 0x61, 0x63, 0x61, 0x72,
|
||||||
|
0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f,
|
||||||
|
0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||||
|
0x60, 0x0a, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18,
|
||||||
|
0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52,
|
||||||
|
0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75,
|
||||||
|
0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
|
||||||
|
0x3a, 0x1f, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x19, 0x0a, 0x09, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f,
|
||||||
|
0x75, 0x6e, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0x01, 0x18,
|
||||||
|
0x01, 0x42, 0x9d, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f,
|
||||||
|
0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74,
|
||||||
|
0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||||
|
0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f,
|
||||||
|
0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x61,
|
||||||
|
0x72, 0x6f, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4d,
|
||||||
|
0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, 0x63,
|
||||||
|
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4d, 0x61, 0x63, 0x61, 0x72,
|
||||||
|
0x6f, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
|
||||||
|
0x74, 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x56,
|
||||||
|
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_macaroon_v1_state_proto_rawDescOnce sync.Once
|
||||||
|
file_macaroon_v1_state_proto_rawDescData = file_macaroon_v1_state_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_macaroon_v1_state_proto_rawDescGZIP() []byte {
|
||||||
|
file_macaroon_v1_state_proto_rawDescOnce.Do(func() {
|
||||||
|
file_macaroon_v1_state_proto_rawDescData = protoimpl.X.CompressGZIP(file_macaroon_v1_state_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_macaroon_v1_state_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_macaroon_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_macaroon_v1_state_proto_goTypes = []interface{}{
|
||||||
|
(*ExampleData)(nil), // 0: macaroon.v1.ExampleData
|
||||||
|
}
|
||||||
|
var file_macaroon_v1_state_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_macaroon_v1_state_proto_init() }
|
||||||
|
func file_macaroon_v1_state_proto_init() {
|
||||||
|
if File_macaroon_v1_state_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_macaroon_v1_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*ExampleData); 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_macaroon_v1_state_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_macaroon_v1_state_proto_goTypes,
|
||||||
|
DependencyIndexes: file_macaroon_v1_state_proto_depIdxs,
|
||||||
|
MessageInfos: file_macaroon_v1_state_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_macaroon_v1_state_proto = out.File
|
||||||
|
file_macaroon_v1_state_proto_rawDesc = nil
|
||||||
|
file_macaroon_v1_state_proto_goTypes = nil
|
||||||
|
file_macaroon_v1_state_proto_depIdxs = nil
|
||||||
|
}
|
1086
api/macaroon/v1/tx.pulsar.go
Normal file
1086
api/macaroon/v1/tx.pulsar.go
Normal file
File diff suppressed because it is too large
Load Diff
115
api/macaroon/v1/tx_grpc.pb.go
Normal file
115
api/macaroon/v1/tx_grpc.pb.go
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
|
// - protoc (unknown)
|
||||||
|
// source: macaroon/v1/tx.proto
|
||||||
|
|
||||||
|
package macaroonv1
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
const (
|
||||||
|
Msg_UpdateParams_FullMethodName = "/macaroon.v1.Msg/UpdateParams"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MsgClient is the client API for Msg service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type MsgClient interface {
|
||||||
|
// UpdateParams defines a governance operation for updating the parameters.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type msgClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
|
||||||
|
return &msgClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||||
|
out := new(MsgUpdateParamsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgServer is the server API for Msg service.
|
||||||
|
// All implementations must embed UnimplementedMsgServer
|
||||||
|
// for forward compatibility
|
||||||
|
type MsgServer interface {
|
||||||
|
// UpdateParams defines a governance operation for updating the parameters.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||||
|
mustEmbedUnimplementedMsgServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedMsgServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedMsgServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||||
|
|
||||||
|
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to MsgServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeMsgServer interface {
|
||||||
|
mustEmbedUnimplementedMsgServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
|
||||||
|
s.RegisterService(&Msg_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MsgUpdateParams)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: Msg_UpdateParams_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Msg_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "macaroon.v1.Msg",
|
||||||
|
HandlerType: (*MsgServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "UpdateParams",
|
||||||
|
Handler: _Msg_UpdateParams_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "macaroon/v1/tx.proto",
|
||||||
|
}
|
500
api/service/module/v1/module.pulsar.go
Normal file
500
api/service/module/v1/module.pulsar.go
Normal file
@ -0,0 +1,500 @@
|
|||||||
|
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
||||||
|
package modulev1
|
||||||
|
|
||||||
|
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
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
file_service_module_v1_module_proto_init()
|
||||||
|
md_Module = File_service_module_v1_module_proto.Messages().ByName("Module")
|
||||||
|
}
|
||||||
|
|
||||||
|
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_service_module_v1_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) {
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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() {
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.module.v1.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() {
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.module.v1.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() {
|
||||||
|
default:
|
||||||
|
if descriptor.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.module.v1.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() {
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.module.v1.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() {
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.module.v1.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() {
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.module.v1.Module"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.module.v1.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 service.module.v1.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
|
||||||
|
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 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 {
|
||||||
|
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: service/module/v1/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 app config object of the module.
|
||||||
|
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||||
|
type Module struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Module) Reset() {
|
||||||
|
*x = Module{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_service_module_v1_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_service_module_v1_module_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_service_module_v1_module_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_service_module_v1_module_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x1e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
|
||||||
|
0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
|
0x12, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
|
||||||
|
0x2e, 0x76, 0x31, 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, 0x28, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a,
|
||||||
|
0x1e, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x18, 0x0a, 0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||||
|
0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42,
|
||||||
|
0xc1, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e,
|
||||||
|
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
|
||||||
|
0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||||
|
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72,
|
||||||
|
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6d, 0x6f, 0x64,
|
||||||
|
0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2,
|
||||||
|
0x02, 0x03, 0x53, 0x4d, 0x58, 0xaa, 0x02, 0x11, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e,
|
||||||
|
0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x53, 0x65, 0x72, 0x76,
|
||||||
|
0x69, 0x63, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d,
|
||||||
|
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56,
|
||||||
|
0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13,
|
||||||
|
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a,
|
||||||
|
0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_service_module_v1_module_proto_rawDescOnce sync.Once
|
||||||
|
file_service_module_v1_module_proto_rawDescData = file_service_module_v1_module_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_service_module_v1_module_proto_rawDescGZIP() []byte {
|
||||||
|
file_service_module_v1_module_proto_rawDescOnce.Do(func() {
|
||||||
|
file_service_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_module_v1_module_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_service_module_v1_module_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_service_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_service_module_v1_module_proto_goTypes = []interface{}{
|
||||||
|
(*Module)(nil), // 0: service.module.v1.Module
|
||||||
|
}
|
||||||
|
var file_service_module_v1_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_service_module_v1_module_proto_init() }
|
||||||
|
func file_service_module_v1_module_proto_init() {
|
||||||
|
if File_service_module_v1_module_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_service_module_v1_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_service_module_v1_module_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_service_module_v1_module_proto_goTypes,
|
||||||
|
DependencyIndexes: file_service_module_v1_module_proto_depIdxs,
|
||||||
|
MessageInfos: file_service_module_v1_module_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_service_module_v1_module_proto = out.File
|
||||||
|
file_service_module_v1_module_proto_rawDesc = nil
|
||||||
|
file_service_module_v1_module_proto_goTypes = nil
|
||||||
|
file_service_module_v1_module_proto_depIdxs = nil
|
||||||
|
}
|
1052
api/service/v1/genesis.pulsar.go
Normal file
1052
api/service/v1/genesis.pulsar.go
Normal file
File diff suppressed because it is too large
Load Diff
997
api/service/v1/query.pulsar.go
Normal file
997
api/service/v1/query.pulsar.go
Normal file
@ -0,0 +1,997 @@
|
|||||||
|
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
||||||
|
package servicev1
|
||||||
|
|
||||||
|
import (
|
||||||
|
fmt "fmt"
|
||||||
|
runtime "github.com/cosmos/cosmos-proto/runtime"
|
||||||
|
_ "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_service_v1_query_proto_init()
|
||||||
|
md_QueryParamsRequest = File_service_v1_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_service_v1_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: service.v1.QueryParamsRequest"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.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: service.v1.QueryParamsRequest"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.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: service.v1.QueryParamsRequest"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.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: service.v1.QueryParamsRequest"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.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: service.v1.QueryParamsRequest"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.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: service.v1.QueryParamsRequest"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.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 service.v1.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_service_v1_query_proto_init()
|
||||||
|
md_QueryParamsResponse = File_service_v1_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_service_v1_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 "service.v1.QueryParamsResponse.params":
|
||||||
|
return x.Params != nil
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.QueryParamsResponse"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.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 "service.v1.QueryParamsResponse.params":
|
||||||
|
x.Params = nil
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.QueryParamsResponse"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.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 "service.v1.QueryParamsResponse.params":
|
||||||
|
value := x.Params
|
||||||
|
return protoreflect.ValueOfMessage(value.ProtoReflect())
|
||||||
|
default:
|
||||||
|
if descriptor.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.QueryParamsResponse"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.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 "service.v1.QueryParamsResponse.params":
|
||||||
|
x.Params = value.Message().Interface().(*Params)
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.QueryParamsResponse"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.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 "service.v1.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: service.v1.QueryParamsResponse"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.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 "service.v1.QueryParamsResponse.params":
|
||||||
|
m := new(Params)
|
||||||
|
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.QueryParamsResponse"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.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 service.v1.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: service/v1/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 the 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_service_v1_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_service_v1_query_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
||||||
|
type QueryParamsResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
// params defines the parameters of the module.
|
||||||
|
Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *QueryParamsResponse) Reset() {
|
||||||
|
*x = QueryParamsResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_service_v1_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_service_v1_query_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *QueryParamsResponse) GetParams() *Params {
|
||||||
|
if x != nil {
|
||||||
|
return x.Params
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_service_v1_query_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_service_v1_query_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x16, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65,
|
||||||
|
0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||||
|
0x65, 0x2e, 0x76, 0x31, 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, 0x18, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67,
|
||||||
|
0x65, 0x6e, 0x65, 0x73, 0x69, 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, 0x41, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||||
|
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x61, 0x72,
|
||||||
|
0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76,
|
||||||
|
0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70,
|
||||||
|
0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x6e, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x65,
|
||||||
|
0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||||
|
0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||||
|
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||||
|
0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||||
|
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02,
|
||||||
|
0x14, 0x12, 0x12, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70,
|
||||||
|
0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x96, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65,
|
||||||
|
0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50,
|
||||||
|
0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
|
||||||
|
0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61,
|
||||||
|
0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65,
|
||||||
|
0x72, 0x76, 0x69, 0x63, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x0a,
|
||||||
|
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x53, 0x65, 0x72,
|
||||||
|
0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||||
|
0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
|
||||||
|
0xea, 0x02, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06,
|
||||||
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_service_v1_query_proto_rawDescOnce sync.Once
|
||||||
|
file_service_v1_query_proto_rawDescData = file_service_v1_query_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_service_v1_query_proto_rawDescGZIP() []byte {
|
||||||
|
file_service_v1_query_proto_rawDescOnce.Do(func() {
|
||||||
|
file_service_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_v1_query_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_service_v1_query_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_service_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
|
var file_service_v1_query_proto_goTypes = []interface{}{
|
||||||
|
(*QueryParamsRequest)(nil), // 0: service.v1.QueryParamsRequest
|
||||||
|
(*QueryParamsResponse)(nil), // 1: service.v1.QueryParamsResponse
|
||||||
|
(*Params)(nil), // 2: service.v1.Params
|
||||||
|
}
|
||||||
|
var file_service_v1_query_proto_depIdxs = []int32{
|
||||||
|
2, // 0: service.v1.QueryParamsResponse.params:type_name -> service.v1.Params
|
||||||
|
0, // 1: service.v1.Query.Params:input_type -> service.v1.QueryParamsRequest
|
||||||
|
1, // 2: service.v1.Query.Params:output_type -> service.v1.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_service_v1_query_proto_init() }
|
||||||
|
func file_service_v1_query_proto_init() {
|
||||||
|
if File_service_v1_query_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
file_service_v1_genesis_proto_init()
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_service_v1_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_service_v1_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_service_v1_query_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 2,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_service_v1_query_proto_goTypes,
|
||||||
|
DependencyIndexes: file_service_v1_query_proto_depIdxs,
|
||||||
|
MessageInfos: file_service_v1_query_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_service_v1_query_proto = out.File
|
||||||
|
file_service_v1_query_proto_rawDesc = nil
|
||||||
|
file_service_v1_query_proto_goTypes = nil
|
||||||
|
file_service_v1_query_proto_depIdxs = nil
|
||||||
|
}
|
111
api/service/v1/query_grpc.pb.go
Normal file
111
api/service/v1/query_grpc.pb.go
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
|
// - protoc (unknown)
|
||||||
|
// source: service/v1/query.proto
|
||||||
|
|
||||||
|
package servicev1
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
const (
|
||||||
|
Query_Params_FullMethodName = "/service.v1.Query/Params"
|
||||||
|
)
|
||||||
|
|
||||||
|
// QueryClient is the client API for Query service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type QueryClient interface {
|
||||||
|
// Params queries all parameters of the module.
|
||||||
|
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type queryClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
|
||||||
|
return &queryClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
||||||
|
out := new(QueryParamsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryServer is the server API for Query service.
|
||||||
|
// All implementations must embed UnimplementedQueryServer
|
||||||
|
// for forward compatibility
|
||||||
|
type QueryServer interface {
|
||||||
|
// Params queries all parameters of the module.
|
||||||
|
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||||
|
mustEmbedUnimplementedQueryServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedQueryServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedQueryServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
||||||
|
|
||||||
|
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to QueryServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeQueryServer interface {
|
||||||
|
mustEmbedUnimplementedQueryServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
|
||||||
|
s.RegisterService(&Query_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(QueryParamsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(QueryServer).Params(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: Query_Params_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Query_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "service.v1.Query",
|
||||||
|
HandlerType: (*QueryServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Params",
|
||||||
|
Handler: _Query_Params_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "service/v1/query.proto",
|
||||||
|
}
|
166
api/service/v1/state.cosmos_orm.go
Normal file
166
api/service/v1/state.cosmos_orm.go
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT.
|
||||||
|
|
||||||
|
package servicev1
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
ormlist "cosmossdk.io/orm/model/ormlist"
|
||||||
|
ormtable "cosmossdk.io/orm/model/ormtable"
|
||||||
|
ormerrors "cosmossdk.io/orm/types/ormerrors"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ExampleDataTable interface {
|
||||||
|
Insert(ctx context.Context, exampleData *ExampleData) error
|
||||||
|
Update(ctx context.Context, exampleData *ExampleData) error
|
||||||
|
Save(ctx context.Context, exampleData *ExampleData) error
|
||||||
|
Delete(ctx context.Context, exampleData *ExampleData) error
|
||||||
|
Has(ctx context.Context, account []byte) (found bool, err error)
|
||||||
|
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||||
|
Get(ctx context.Context, account []byte) (*ExampleData, error)
|
||||||
|
List(ctx context.Context, prefixKey ExampleDataIndexKey, opts ...ormlist.Option) (ExampleDataIterator, error)
|
||||||
|
ListRange(ctx context.Context, from, to ExampleDataIndexKey, opts ...ormlist.Option) (ExampleDataIterator, error)
|
||||||
|
DeleteBy(ctx context.Context, prefixKey ExampleDataIndexKey) error
|
||||||
|
DeleteRange(ctx context.Context, from, to ExampleDataIndexKey) error
|
||||||
|
|
||||||
|
doNotImplement()
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExampleDataIterator struct {
|
||||||
|
ormtable.Iterator
|
||||||
|
}
|
||||||
|
|
||||||
|
func (i ExampleDataIterator) Value() (*ExampleData, error) {
|
||||||
|
var exampleData ExampleData
|
||||||
|
err := i.UnmarshalMessage(&exampleData)
|
||||||
|
return &exampleData, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExampleDataIndexKey interface {
|
||||||
|
id() uint32
|
||||||
|
values() []interface{}
|
||||||
|
exampleDataIndexKey()
|
||||||
|
}
|
||||||
|
|
||||||
|
// primary key starting index..
|
||||||
|
type ExampleDataPrimaryKey = ExampleDataAccountIndexKey
|
||||||
|
|
||||||
|
type ExampleDataAccountIndexKey struct {
|
||||||
|
vs []interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x ExampleDataAccountIndexKey) id() uint32 { return 0 }
|
||||||
|
func (x ExampleDataAccountIndexKey) values() []interface{} { return x.vs }
|
||||||
|
func (x ExampleDataAccountIndexKey) exampleDataIndexKey() {}
|
||||||
|
|
||||||
|
func (this ExampleDataAccountIndexKey) WithAccount(account []byte) ExampleDataAccountIndexKey {
|
||||||
|
this.vs = []interface{}{account}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExampleDataAmountIndexKey struct {
|
||||||
|
vs []interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x ExampleDataAmountIndexKey) id() uint32 { return 1 }
|
||||||
|
func (x ExampleDataAmountIndexKey) values() []interface{} { return x.vs }
|
||||||
|
func (x ExampleDataAmountIndexKey) exampleDataIndexKey() {}
|
||||||
|
|
||||||
|
func (this ExampleDataAmountIndexKey) WithAmount(amount uint64) ExampleDataAmountIndexKey {
|
||||||
|
this.vs = []interface{}{amount}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
type exampleDataTable struct {
|
||||||
|
table ormtable.Table
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) Insert(ctx context.Context, exampleData *ExampleData) error {
|
||||||
|
return this.table.Insert(ctx, exampleData)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) Update(ctx context.Context, exampleData *ExampleData) error {
|
||||||
|
return this.table.Update(ctx, exampleData)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) Save(ctx context.Context, exampleData *ExampleData) error {
|
||||||
|
return this.table.Save(ctx, exampleData)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) Delete(ctx context.Context, exampleData *ExampleData) error {
|
||||||
|
return this.table.Delete(ctx, exampleData)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) Has(ctx context.Context, account []byte) (found bool, err error) {
|
||||||
|
return this.table.PrimaryKey().Has(ctx, account)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) Get(ctx context.Context, account []byte) (*ExampleData, error) {
|
||||||
|
var exampleData ExampleData
|
||||||
|
found, err := this.table.PrimaryKey().Get(ctx, &exampleData, account)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
return nil, ormerrors.NotFound
|
||||||
|
}
|
||||||
|
return &exampleData, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) List(ctx context.Context, prefixKey ExampleDataIndexKey, opts ...ormlist.Option) (ExampleDataIterator, error) {
|
||||||
|
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||||
|
return ExampleDataIterator{it}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) ListRange(ctx context.Context, from, to ExampleDataIndexKey, opts ...ormlist.Option) (ExampleDataIterator, error) {
|
||||||
|
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||||
|
return ExampleDataIterator{it}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) DeleteBy(ctx context.Context, prefixKey ExampleDataIndexKey) error {
|
||||||
|
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) DeleteRange(ctx context.Context, from, to ExampleDataIndexKey) error {
|
||||||
|
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this exampleDataTable) doNotImplement() {}
|
||||||
|
|
||||||
|
var _ ExampleDataTable = exampleDataTable{}
|
||||||
|
|
||||||
|
func NewExampleDataTable(db ormtable.Schema) (ExampleDataTable, error) {
|
||||||
|
table := db.GetTable(&ExampleData{})
|
||||||
|
if table == nil {
|
||||||
|
return nil, ormerrors.TableNotFound.Wrap(string((&ExampleData{}).ProtoReflect().Descriptor().FullName()))
|
||||||
|
}
|
||||||
|
return exampleDataTable{table}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type StateStore interface {
|
||||||
|
ExampleDataTable() ExampleDataTable
|
||||||
|
|
||||||
|
doNotImplement()
|
||||||
|
}
|
||||||
|
|
||||||
|
type stateStore struct {
|
||||||
|
exampleData ExampleDataTable
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x stateStore) ExampleDataTable() ExampleDataTable {
|
||||||
|
return x.exampleData
|
||||||
|
}
|
||||||
|
|
||||||
|
func (stateStore) doNotImplement() {}
|
||||||
|
|
||||||
|
var _ StateStore = stateStore{}
|
||||||
|
|
||||||
|
func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
||||||
|
exampleDataTable, err := NewExampleDataTable(db)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return stateStore{
|
||||||
|
exampleDataTable,
|
||||||
|
}, nil
|
||||||
|
}
|
628
api/service/v1/state.pulsar.go
Normal file
628
api/service/v1/state.pulsar.go
Normal file
@ -0,0 +1,628 @@
|
|||||||
|
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
||||||
|
package servicev1
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "cosmossdk.io/api/cosmos/orm/v1"
|
||||||
|
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_ExampleData protoreflect.MessageDescriptor
|
||||||
|
fd_ExampleData_account protoreflect.FieldDescriptor
|
||||||
|
fd_ExampleData_amount protoreflect.FieldDescriptor
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
file_service_v1_state_proto_init()
|
||||||
|
md_ExampleData = File_service_v1_state_proto.Messages().ByName("ExampleData")
|
||||||
|
fd_ExampleData_account = md_ExampleData.Fields().ByName("account")
|
||||||
|
fd_ExampleData_amount = md_ExampleData.Fields().ByName("amount")
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ protoreflect.Message = (*fastReflection_ExampleData)(nil)
|
||||||
|
|
||||||
|
type fastReflection_ExampleData ExampleData
|
||||||
|
|
||||||
|
func (x *ExampleData) ProtoReflect() protoreflect.Message {
|
||||||
|
return (*fastReflection_ExampleData)(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExampleData) slowProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_service_v1_state_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_ExampleData_messageType fastReflection_ExampleData_messageType
|
||||||
|
var _ protoreflect.MessageType = fastReflection_ExampleData_messageType{}
|
||||||
|
|
||||||
|
type fastReflection_ExampleData_messageType struct{}
|
||||||
|
|
||||||
|
func (x fastReflection_ExampleData_messageType) Zero() protoreflect.Message {
|
||||||
|
return (*fastReflection_ExampleData)(nil)
|
||||||
|
}
|
||||||
|
func (x fastReflection_ExampleData_messageType) New() protoreflect.Message {
|
||||||
|
return new(fastReflection_ExampleData)
|
||||||
|
}
|
||||||
|
func (x fastReflection_ExampleData_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||||
|
return md_ExampleData
|
||||||
|
}
|
||||||
|
|
||||||
|
// Descriptor returns message descriptor, which contains only the protobuf
|
||||||
|
// type information for the message.
|
||||||
|
func (x *fastReflection_ExampleData) Descriptor() protoreflect.MessageDescriptor {
|
||||||
|
return md_ExampleData
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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_ExampleData) Type() protoreflect.MessageType {
|
||||||
|
return _fastReflection_ExampleData_messageType
|
||||||
|
}
|
||||||
|
|
||||||
|
// New returns a newly allocated and mutable empty message.
|
||||||
|
func (x *fastReflection_ExampleData) New() protoreflect.Message {
|
||||||
|
return new(fastReflection_ExampleData)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Interface unwraps the message reflection interface and
|
||||||
|
// returns the underlying ProtoMessage interface.
|
||||||
|
func (x *fastReflection_ExampleData) Interface() protoreflect.ProtoMessage {
|
||||||
|
return (*ExampleData)(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_ExampleData) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||||
|
if len(x.Account) != 0 {
|
||||||
|
value := protoreflect.ValueOfBytes(x.Account)
|
||||||
|
if !f(fd_ExampleData_account, value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if x.Amount != uint64(0) {
|
||||||
|
value := protoreflect.ValueOfUint64(x.Amount)
|
||||||
|
if !f(fd_ExampleData_amount, 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_ExampleData) Has(fd protoreflect.FieldDescriptor) bool {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "service.v1.ExampleData.account":
|
||||||
|
return len(x.Account) != 0
|
||||||
|
case "service.v1.ExampleData.amount":
|
||||||
|
return x.Amount != uint64(0)
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.ExampleData"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.ExampleData 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_ExampleData) Clear(fd protoreflect.FieldDescriptor) {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "service.v1.ExampleData.account":
|
||||||
|
x.Account = nil
|
||||||
|
case "service.v1.ExampleData.amount":
|
||||||
|
x.Amount = uint64(0)
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.ExampleData"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.ExampleData 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_ExampleData) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch descriptor.FullName() {
|
||||||
|
case "service.v1.ExampleData.account":
|
||||||
|
value := x.Account
|
||||||
|
return protoreflect.ValueOfBytes(value)
|
||||||
|
case "service.v1.ExampleData.amount":
|
||||||
|
value := x.Amount
|
||||||
|
return protoreflect.ValueOfUint64(value)
|
||||||
|
default:
|
||||||
|
if descriptor.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.ExampleData"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.ExampleData 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_ExampleData) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "service.v1.ExampleData.account":
|
||||||
|
x.Account = value.Bytes()
|
||||||
|
case "service.v1.ExampleData.amount":
|
||||||
|
x.Amount = value.Uint()
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.ExampleData"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.ExampleData 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_ExampleData) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "service.v1.ExampleData.account":
|
||||||
|
panic(fmt.Errorf("field account of message service.v1.ExampleData is not mutable"))
|
||||||
|
case "service.v1.ExampleData.amount":
|
||||||
|
panic(fmt.Errorf("field amount of message service.v1.ExampleData is not mutable"))
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.ExampleData"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.ExampleData 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_ExampleData) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||||
|
switch fd.FullName() {
|
||||||
|
case "service.v1.ExampleData.account":
|
||||||
|
return protoreflect.ValueOfBytes(nil)
|
||||||
|
case "service.v1.ExampleData.amount":
|
||||||
|
return protoreflect.ValueOfUint64(uint64(0))
|
||||||
|
default:
|
||||||
|
if fd.IsExtension() {
|
||||||
|
panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.ExampleData"))
|
||||||
|
}
|
||||||
|
panic(fmt.Errorf("message service.v1.ExampleData 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_ExampleData) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||||
|
switch d.FullName() {
|
||||||
|
default:
|
||||||
|
panic(fmt.Errorf("%s is not a oneof field in service.v1.ExampleData", 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_ExampleData) 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_ExampleData) 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_ExampleData) 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_ExampleData) ProtoMethods() *protoiface.Methods {
|
||||||
|
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||||
|
x := input.Message.Interface().(*ExampleData)
|
||||||
|
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.Account)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + runtime.Sov(uint64(l))
|
||||||
|
}
|
||||||
|
if x.Amount != 0 {
|
||||||
|
n += 1 + runtime.Sov(uint64(x.Amount))
|
||||||
|
}
|
||||||
|
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().(*ExampleData)
|
||||||
|
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.Amount != 0 {
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(x.Amount))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x10
|
||||||
|
}
|
||||||
|
if len(x.Account) > 0 {
|
||||||
|
i -= len(x.Account)
|
||||||
|
copy(dAtA[i:], x.Account)
|
||||||
|
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Account)))
|
||||||
|
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().(*ExampleData)
|
||||||
|
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: ExampleData: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExampleData: 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 Account", wireType)
|
||||||
|
}
|
||||||
|
var byteLen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
byteLen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if byteLen < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + byteLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
x.Account = append(x.Account[:0], dAtA[iNdEx:postIndex]...)
|
||||||
|
if x.Account == nil {
|
||||||
|
x.Account = []byte{}
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
|
||||||
|
}
|
||||||
|
x.Amount = 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.Amount |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if !options.DiscardUnknown {
|
||||||
|
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
||||||
|
}
|
||||||
|
return &protoiface.Methods{
|
||||||
|
NoUnkeyedLiterals: struct{}{},
|
||||||
|
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
||||||
|
Size: size,
|
||||||
|
Marshal: marshal,
|
||||||
|
Unmarshal: unmarshal,
|
||||||
|
Merge: nil,
|
||||||
|
CheckInitialized: nil,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.27.0
|
||||||
|
// protoc (unknown)
|
||||||
|
// source: service/v1/state.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 ExampleData struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
|
||||||
|
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExampleData) Reset() {
|
||||||
|
*x = ExampleData{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_service_v1_state_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExampleData) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ExampleData) ProtoMessage() {}
|
||||||
|
|
||||||
|
// Deprecated: Use ExampleData.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ExampleData) Descriptor() ([]byte, []int) {
|
||||||
|
return file_service_v1_state_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExampleData) GetAccount() []byte {
|
||||||
|
if x != nil {
|
||||||
|
return x.Account
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ExampleData) GetAmount() uint64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Amount
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_service_v1_state_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_service_v1_state_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x16, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61,
|
||||||
|
0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||||
|
0x65, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d,
|
||||||
|
0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x60, 0x0a,
|
||||||
|
0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07,
|
||||||
|
0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61,
|
||||||
|
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
|
||||||
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x1f,
|
||||||
|
0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x19, 0x0a, 0x09, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
|
||||||
|
0x74, 0x12, 0x0a, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0x01, 0x18, 0x01, 0x42,
|
||||||
|
0x96, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e,
|
||||||
|
0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
|
||||||
|
0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73,
|
||||||
|
0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72,
|
||||||
|
0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x76,
|
||||||
|
0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||||
|
0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56,
|
||||||
|
0x31, 0xe2, 0x02, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47,
|
||||||
|
0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x53, 0x65, 0x72,
|
||||||
|
0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_service_v1_state_proto_rawDescOnce sync.Once
|
||||||
|
file_service_v1_state_proto_rawDescData = file_service_v1_state_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_service_v1_state_proto_rawDescGZIP() []byte {
|
||||||
|
file_service_v1_state_proto_rawDescOnce.Do(func() {
|
||||||
|
file_service_v1_state_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_v1_state_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_service_v1_state_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_service_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_service_v1_state_proto_goTypes = []interface{}{
|
||||||
|
(*ExampleData)(nil), // 0: service.v1.ExampleData
|
||||||
|
}
|
||||||
|
var file_service_v1_state_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_service_v1_state_proto_init() }
|
||||||
|
func file_service_v1_state_proto_init() {
|
||||||
|
if File_service_v1_state_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_service_v1_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*ExampleData); 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_service_v1_state_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_service_v1_state_proto_goTypes,
|
||||||
|
DependencyIndexes: file_service_v1_state_proto_depIdxs,
|
||||||
|
MessageInfos: file_service_v1_state_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_service_v1_state_proto = out.File
|
||||||
|
file_service_v1_state_proto_rawDesc = nil
|
||||||
|
file_service_v1_state_proto_goTypes = nil
|
||||||
|
file_service_v1_state_proto_depIdxs = nil
|
||||||
|
}
|
1085
api/service/v1/tx.pulsar.go
Normal file
1085
api/service/v1/tx.pulsar.go
Normal file
File diff suppressed because it is too large
Load Diff
115
api/service/v1/tx_grpc.pb.go
Normal file
115
api/service/v1/tx_grpc.pb.go
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
|
// - protoc (unknown)
|
||||||
|
// source: service/v1/tx.proto
|
||||||
|
|
||||||
|
package servicev1
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
const (
|
||||||
|
Msg_UpdateParams_FullMethodName = "/service.v1.Msg/UpdateParams"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MsgClient is the client API for Msg service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type MsgClient interface {
|
||||||
|
// UpdateParams defines a governance operation for updating the parameters.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type msgClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
|
||||||
|
return &msgClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||||
|
out := new(MsgUpdateParamsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgServer is the server API for Msg service.
|
||||||
|
// All implementations must embed UnimplementedMsgServer
|
||||||
|
// for forward compatibility
|
||||||
|
type MsgServer interface {
|
||||||
|
// UpdateParams defines a governance operation for updating the parameters.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||||
|
mustEmbedUnimplementedMsgServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedMsgServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedMsgServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||||
|
|
||||||
|
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to MsgServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeMsgServer interface {
|
||||||
|
mustEmbedUnimplementedMsgServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
|
||||||
|
s.RegisterService(&Msg_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MsgUpdateParams)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: Msg_UpdateParams_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Msg_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "service.v1.Msg",
|
||||||
|
HandlerType: (*MsgServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "UpdateParams",
|
||||||
|
Handler: _Msg_UpdateParams_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "service/v1/tx.proto",
|
||||||
|
}
|
38
app/app.go
38
app/app.go
@ -32,6 +32,7 @@ import (
|
|||||||
"cosmossdk.io/x/upgrade"
|
"cosmossdk.io/x/upgrade"
|
||||||
upgradekeeper "cosmossdk.io/x/upgrade/keeper"
|
upgradekeeper "cosmossdk.io/x/upgrade/keeper"
|
||||||
upgradetypes "cosmossdk.io/x/upgrade/types"
|
upgradetypes "cosmossdk.io/x/upgrade/types"
|
||||||
|
|
||||||
abci "github.com/cometbft/cometbft/abci/types"
|
abci "github.com/cometbft/cometbft/abci/types"
|
||||||
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||||
dbm "github.com/cosmos/cosmos-db"
|
dbm "github.com/cosmos/cosmos-db"
|
||||||
@ -137,6 +138,12 @@ import (
|
|||||||
did "github.com/onsonr/sonr/x/did"
|
did "github.com/onsonr/sonr/x/did"
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||||
didtypes "github.com/onsonr/sonr/x/did/types"
|
didtypes "github.com/onsonr/sonr/x/did/types"
|
||||||
|
macaroon "github.com/onsonr/sonr/x/macaroon"
|
||||||
|
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
||||||
|
macaroontypes "github.com/onsonr/sonr/x/macaroon/types"
|
||||||
|
service "github.com/onsonr/sonr/x/service"
|
||||||
|
servicekeeper "github.com/onsonr/sonr/x/service/keeper"
|
||||||
|
servicetypes "github.com/onsonr/sonr/x/service/types"
|
||||||
vault "github.com/onsonr/sonr/x/vault"
|
vault "github.com/onsonr/sonr/x/vault"
|
||||||
vaultkeeper "github.com/onsonr/sonr/x/vault/keeper"
|
vaultkeeper "github.com/onsonr/sonr/x/vault/keeper"
|
||||||
vaulttypes "github.com/onsonr/sonr/x/vault/types"
|
vaulttypes "github.com/onsonr/sonr/x/vault/types"
|
||||||
@ -229,6 +236,8 @@ type SonrApp struct {
|
|||||||
UpgradeKeeper *upgradekeeper.Keeper
|
UpgradeKeeper *upgradekeeper.Keeper
|
||||||
legacyAmino *codec.LegacyAmino
|
legacyAmino *codec.LegacyAmino
|
||||||
VaultKeeper vaultkeeper.Keeper
|
VaultKeeper vaultkeeper.Keeper
|
||||||
|
MacaroonKeeper macaroonkeeper.Keeper
|
||||||
|
ServiceKeeper servicekeeper.Keeper
|
||||||
sm *module.SimulationManager
|
sm *module.SimulationManager
|
||||||
BasicModuleManager module.BasicManager
|
BasicModuleManager module.BasicManager
|
||||||
ModuleManager *module.Manager
|
ModuleManager *module.Manager
|
||||||
@ -362,6 +371,8 @@ func NewChainApp(
|
|||||||
packetforwardtypes.StoreKey,
|
packetforwardtypes.StoreKey,
|
||||||
didtypes.StoreKey,
|
didtypes.StoreKey,
|
||||||
vaulttypes.StoreKey,
|
vaulttypes.StoreKey,
|
||||||
|
macaroontypes.StoreKey,
|
||||||
|
servicetypes.StoreKey,
|
||||||
)
|
)
|
||||||
|
|
||||||
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
|
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
|
||||||
@ -610,6 +621,22 @@ func NewChainApp(
|
|||||||
// If evidence needs to be handled for the app, set routes in router here and seal
|
// If evidence needs to be handled for the app, set routes in router here and seal
|
||||||
app.EvidenceKeeper = *evidenceKeeper
|
app.EvidenceKeeper = *evidenceKeeper
|
||||||
|
|
||||||
|
// Create the service Keeper
|
||||||
|
app.ServiceKeeper = servicekeeper.NewKeeper(
|
||||||
|
appCodec,
|
||||||
|
sdkruntime.NewKVStoreService(keys[servicetypes.StoreKey]),
|
||||||
|
logger,
|
||||||
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||||
|
)
|
||||||
|
|
||||||
|
// Create the macaroon Keeper
|
||||||
|
app.MacaroonKeeper = macaroonkeeper.NewKeeper(
|
||||||
|
appCodec,
|
||||||
|
sdkruntime.NewKVStoreService(keys[macaroontypes.StoreKey]),
|
||||||
|
logger,
|
||||||
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||||
|
)
|
||||||
|
|
||||||
// Create the vault Keeper
|
// Create the vault Keeper
|
||||||
app.VaultKeeper = vaultkeeper.NewKeeper(
|
app.VaultKeeper = vaultkeeper.NewKeeper(
|
||||||
appCodec,
|
appCodec,
|
||||||
@ -888,6 +915,9 @@ func NewChainApp(
|
|||||||
|
|
||||||
did.NewAppModule(appCodec, app.DidKeeper, app.NFTKeeper),
|
did.NewAppModule(appCodec, app.DidKeeper, app.NFTKeeper),
|
||||||
vault.NewAppModule(appCodec, app.VaultKeeper),
|
vault.NewAppModule(appCodec, app.VaultKeeper),
|
||||||
|
macaroon.NewAppModule(appCodec, app.MacaroonKeeper),
|
||||||
|
|
||||||
|
service.NewAppModule(appCodec, app.ServiceKeeper),
|
||||||
)
|
)
|
||||||
|
|
||||||
// BasicModuleManager defines the module BasicManager is in charge of setting up basic,
|
// BasicModuleManager defines the module BasicManager is in charge of setting up basic,
|
||||||
@ -937,6 +967,8 @@ func NewChainApp(
|
|||||||
packetforwardtypes.ModuleName,
|
packetforwardtypes.ModuleName,
|
||||||
didtypes.ModuleName,
|
didtypes.ModuleName,
|
||||||
vaulttypes.ModuleName,
|
vaulttypes.ModuleName,
|
||||||
|
macaroontypes.ModuleName,
|
||||||
|
servicetypes.ModuleName,
|
||||||
)
|
)
|
||||||
|
|
||||||
app.ModuleManager.SetOrderEndBlockers(
|
app.ModuleManager.SetOrderEndBlockers(
|
||||||
@ -957,6 +989,8 @@ func NewChainApp(
|
|||||||
packetforwardtypes.ModuleName,
|
packetforwardtypes.ModuleName,
|
||||||
didtypes.ModuleName,
|
didtypes.ModuleName,
|
||||||
vaulttypes.ModuleName,
|
vaulttypes.ModuleName,
|
||||||
|
macaroontypes.ModuleName,
|
||||||
|
servicetypes.ModuleName,
|
||||||
)
|
)
|
||||||
|
|
||||||
// NOTE: The genutils module must occur after staking so that pools are
|
// NOTE: The genutils module must occur after staking so that pools are
|
||||||
@ -986,6 +1020,8 @@ func NewChainApp(
|
|||||||
packetforwardtypes.ModuleName,
|
packetforwardtypes.ModuleName,
|
||||||
didtypes.ModuleName,
|
didtypes.ModuleName,
|
||||||
vaulttypes.ModuleName,
|
vaulttypes.ModuleName,
|
||||||
|
macaroontypes.ModuleName,
|
||||||
|
servicetypes.ModuleName,
|
||||||
}
|
}
|
||||||
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
|
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
|
||||||
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
|
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
|
||||||
@ -1446,6 +1482,8 @@ func initParamsKeeper(
|
|||||||
WithKeyTable(packetforwardtypes.ParamKeyTable())
|
WithKeyTable(packetforwardtypes.ParamKeyTable())
|
||||||
paramsKeeper.Subspace(didtypes.ModuleName)
|
paramsKeeper.Subspace(didtypes.ModuleName)
|
||||||
paramsKeeper.Subspace(vaulttypes.ModuleName)
|
paramsKeeper.Subspace(vaulttypes.ModuleName)
|
||||||
|
paramsKeeper.Subspace(macaroontypes.ModuleName)
|
||||||
|
paramsKeeper.Subspace(servicetypes.ModuleName)
|
||||||
|
|
||||||
return paramsKeeper
|
return paramsKeeper
|
||||||
}
|
}
|
||||||
|
@ -38,9 +38,6 @@
|
|||||||
"build:sonrd": [
|
"build:sonrd": [
|
||||||
"make build"
|
"make build"
|
||||||
],
|
],
|
||||||
"build:xcaddy": [
|
|
||||||
"sh scripts/build_xcaddy.sh"
|
|
||||||
],
|
|
||||||
"gen:proto": [
|
"gen:proto": [
|
||||||
"make proto-gen"
|
"make proto-gen"
|
||||||
],
|
],
|
||||||
|
@ -17,15 +17,6 @@ processes:
|
|||||||
depends:
|
depends:
|
||||||
- ipfs
|
- ipfs
|
||||||
|
|
||||||
motr:
|
|
||||||
namespace: testnet
|
|
||||||
command: "make start-proxy"
|
|
||||||
restart: on_failure
|
|
||||||
max_restarts: 1
|
|
||||||
depends:
|
|
||||||
- sonr
|
|
||||||
- ipfs
|
|
||||||
|
|
||||||
tunnel:
|
tunnel:
|
||||||
namespace: public
|
namespace: public
|
||||||
command: "devbox run start:tunnel"
|
command: "devbox run start:tunnel"
|
||||||
|
13
proto/macaroon/module/v1/module.proto
Normal file
13
proto/macaroon/module/v1/module.proto
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package macaroon.module.v1;
|
||||||
|
|
||||||
|
import "cosmos/app/v1alpha1/module.proto";
|
||||||
|
|
||||||
|
// Module is the app config object of the module.
|
||||||
|
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||||
|
message Module {
|
||||||
|
option (cosmos.app.v1alpha1.module) = {
|
||||||
|
go_import : "github.com/onsonr/sonr"
|
||||||
|
};
|
||||||
|
}
|
22
proto/macaroon/v1/genesis.proto
Normal file
22
proto/macaroon/v1/genesis.proto
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package macaroon.v1;
|
||||||
|
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "amino/amino.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/onsonr/sonr/x/macaroon/types";
|
||||||
|
|
||||||
|
// GenesisState defines the module genesis state
|
||||||
|
message GenesisState {
|
||||||
|
// Params defines all the parameters of the module.
|
||||||
|
Params params = 1 [(gogoproto.nullable) = false];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Params defines the set of module parameters.
|
||||||
|
message Params {
|
||||||
|
option (amino.name) = "macaroon/params";
|
||||||
|
option (gogoproto.equal) = true;
|
||||||
|
option (gogoproto.goproto_stringer) = false;
|
||||||
|
|
||||||
|
bool some_value = 2;
|
||||||
|
}
|
24
proto/macaroon/v1/query.proto
Normal file
24
proto/macaroon/v1/query.proto
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package macaroon.v1;
|
||||||
|
|
||||||
|
import "google/api/annotations.proto";
|
||||||
|
import "macaroon/v1/genesis.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/onsonr/sonr/x/macaroon/types";
|
||||||
|
|
||||||
|
// Query provides defines the gRPC querier service.
|
||||||
|
service Query {
|
||||||
|
// Params queries all parameters of the module.
|
||||||
|
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||||
|
option (google.api.http).get = "/macaroon/v1/params";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
||||||
|
message QueryParamsRequest {}
|
||||||
|
|
||||||
|
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
||||||
|
message QueryParamsResponse {
|
||||||
|
// params defines the parameters of the module.
|
||||||
|
Params params = 1;
|
||||||
|
}
|
19
proto/macaroon/v1/state.proto
Normal file
19
proto/macaroon/v1/state.proto
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package macaroon.v1;
|
||||||
|
|
||||||
|
import "cosmos/orm/v1/orm.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/onsonr/sonr/x/macaroon/types";
|
||||||
|
|
||||||
|
// https://github.com/cosmos/cosmos-sdk/blob/main/orm/README.md
|
||||||
|
|
||||||
|
message ExampleData {
|
||||||
|
option (cosmos.orm.v1.table) = {
|
||||||
|
id: 1;
|
||||||
|
primary_key: { fields: "account" }
|
||||||
|
index: { id: 1 fields: "amount" }
|
||||||
|
};
|
||||||
|
|
||||||
|
bytes account = 1;
|
||||||
|
uint64 amount = 2;
|
||||||
|
}
|
40
proto/macaroon/v1/tx.proto
Normal file
40
proto/macaroon/v1/tx.proto
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package macaroon.v1;
|
||||||
|
|
||||||
|
import "cosmos/msg/v1/msg.proto";
|
||||||
|
import "macaroon/v1/genesis.proto";
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "cosmos_proto/cosmos.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/onsonr/sonr/x/macaroon/types";
|
||||||
|
|
||||||
|
// Msg defines the Msg service.
|
||||||
|
service Msg {
|
||||||
|
option (cosmos.msg.v1.service) = true;
|
||||||
|
|
||||||
|
// UpdateParams defines a governance operation for updating the parameters.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgUpdateParams is the Msg/UpdateParams request type.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
message MsgUpdateParams {
|
||||||
|
option (cosmos.msg.v1.signer) = "authority";
|
||||||
|
|
||||||
|
// authority is the address of the governance account.
|
||||||
|
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||||
|
|
||||||
|
// params defines the parameters to update.
|
||||||
|
//
|
||||||
|
// NOTE: All parameters must be supplied.
|
||||||
|
Params params = 2 [(gogoproto.nullable) = false];
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||||
|
// MsgUpdateParams message.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
message MsgUpdateParamsResponse {}
|
13
proto/service/module/v1/module.proto
Normal file
13
proto/service/module/v1/module.proto
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package service.module.v1;
|
||||||
|
|
||||||
|
import "cosmos/app/v1alpha1/module.proto";
|
||||||
|
|
||||||
|
// Module is the app config object of the module.
|
||||||
|
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||||
|
message Module {
|
||||||
|
option (cosmos.app.v1alpha1.module) = {
|
||||||
|
go_import : "github.com/onsonr/sonr"
|
||||||
|
};
|
||||||
|
}
|
22
proto/service/v1/genesis.proto
Normal file
22
proto/service/v1/genesis.proto
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package service.v1;
|
||||||
|
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "amino/amino.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/onsonr/sonr/x/service/types";
|
||||||
|
|
||||||
|
// GenesisState defines the module genesis state
|
||||||
|
message GenesisState {
|
||||||
|
// Params defines all the parameters of the module.
|
||||||
|
Params params = 1 [(gogoproto.nullable) = false];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Params defines the set of module parameters.
|
||||||
|
message Params {
|
||||||
|
option (amino.name) = "service/params";
|
||||||
|
option (gogoproto.equal) = true;
|
||||||
|
option (gogoproto.goproto_stringer) = false;
|
||||||
|
|
||||||
|
bool some_value = 2;
|
||||||
|
}
|
24
proto/service/v1/query.proto
Normal file
24
proto/service/v1/query.proto
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package service.v1;
|
||||||
|
|
||||||
|
import "google/api/annotations.proto";
|
||||||
|
import "service/v1/genesis.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/onsonr/sonr/x/service/types";
|
||||||
|
|
||||||
|
// Query provides defines the gRPC querier service.
|
||||||
|
service Query {
|
||||||
|
// Params queries all parameters of the module.
|
||||||
|
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||||
|
option (google.api.http).get = "/service/v1/params";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
||||||
|
message QueryParamsRequest {}
|
||||||
|
|
||||||
|
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
||||||
|
message QueryParamsResponse {
|
||||||
|
// params defines the parameters of the module.
|
||||||
|
Params params = 1;
|
||||||
|
}
|
19
proto/service/v1/state.proto
Normal file
19
proto/service/v1/state.proto
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package service.v1;
|
||||||
|
|
||||||
|
import "cosmos/orm/v1/orm.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/onsonr/sonr/x/service/types";
|
||||||
|
|
||||||
|
// https://github.com/cosmos/cosmos-sdk/blob/main/orm/README.md
|
||||||
|
|
||||||
|
message ExampleData {
|
||||||
|
option (cosmos.orm.v1.table) = {
|
||||||
|
id: 1;
|
||||||
|
primary_key: { fields: "account" }
|
||||||
|
index: { id: 1 fields: "amount" }
|
||||||
|
};
|
||||||
|
|
||||||
|
bytes account = 1;
|
||||||
|
uint64 amount = 2;
|
||||||
|
}
|
40
proto/service/v1/tx.proto
Normal file
40
proto/service/v1/tx.proto
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package service.v1;
|
||||||
|
|
||||||
|
import "cosmos/msg/v1/msg.proto";
|
||||||
|
import "service/v1/genesis.proto";
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "cosmos_proto/cosmos.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/onsonr/sonr/x/service/types";
|
||||||
|
|
||||||
|
// Msg defines the Msg service.
|
||||||
|
service Msg {
|
||||||
|
option (cosmos.msg.v1.service) = true;
|
||||||
|
|
||||||
|
// UpdateParams defines a governance operation for updating the parameters.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgUpdateParams is the Msg/UpdateParams request type.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
message MsgUpdateParams {
|
||||||
|
option (cosmos.msg.v1.signer) = "authority";
|
||||||
|
|
||||||
|
// authority is the address of the governance account.
|
||||||
|
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||||
|
|
||||||
|
// params defines the parameters to update.
|
||||||
|
//
|
||||||
|
// NOTE: All parameters must be supplied.
|
||||||
|
Params params = 2 [(gogoproto.nullable) = false];
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||||
|
// MsgUpdateParams message.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
message MsgUpdateParamsResponse {}
|
@ -1,53 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Exit immediately if a command exits with a non-zero status.
|
rm -rf ~/.ipfs
|
||||||
set -e
|
|
||||||
|
|
||||||
function setup_ipfs() {
|
# Initialize IPFS
|
||||||
# Install IPFS
|
ipfs init
|
||||||
ipfs init
|
|
||||||
|
|
||||||
# Optimize local discovery and connectivity
|
# Set up the Cloudflare IPFS gateway peers
|
||||||
ipfs config --json Discovery.MDNS.Enabled true
|
ipfs config --json Peering.Peers '[
|
||||||
ipfs config --json Routing.Type "dhtclient"
|
{"ID": "QmcFf2FH3CEgTNHeMRGhN7HNHU1EXAxoEk6EFuSyXCsvRE", "Addrs": ["/dnsaddr/node-1.ingress.cloudflare-ipfs.com"]},
|
||||||
ipfs config --json Swarm.ConnMgr.LowWater 200
|
{"ID": "QmcFmLd5ySfk2WZuJ1mfSWLDjdmHZq7rSAua4GoeSQfs1z", "Addrs": ["/dnsaddr/node-2.ingress.cloudflare-ipfs.com"]},
|
||||||
ipfs config --json Swarm.ConnMgr.HighWater 500
|
{"ID": "QmcfFmzSDVbwexQ9Au2pt5YEXHK5xajwgaU6PpkbLWerMa", "Addrs": ["/dnsaddr/node-3.ingress.cloudflare-ipfs.com"]},
|
||||||
|
{"ID": "QmcfJeB3Js1FG7T8YaZATEiaHqNKVdQfybYYkbT1knUswx", "Addrs": ["/dnsaddr/node-4.ingress.cloudflare-ipfs.com"]},
|
||||||
# Set up the Cloudflare IPFS gateway peers
|
{"ID": "QmcfVvzK4tMdFmpJjEKDUoqRgP4W9FnmJoziYX5GXJJ8eZ", "Addrs": ["/dnsaddr/node-5.ingress.cloudflare-ipfs.com"]},
|
||||||
ipfs config --json Peering.Peers '[
|
{"ID": "QmcfZD3VKrUxyP9BbyUnZDpbqDnT7cQ4WjPP8TRLXaoE7G", "Addrs": ["/dnsaddr/node-6.ingress.cloudflare-ipfs.com"]},
|
||||||
{"ID": "QmcFf2FH3CEgTNHeMRGhN7HNHU1EXAxoEk6EFuSyXCsvRE", "Addrs": ["/dnsaddr/node-1.ingress.cloudflare-ipfs.com"]},
|
{"ID": "QmcfZP2LuW4jxviTeG8fi28qjnZScACb8PEgHAc17ZEri3", "Addrs": ["/dnsaddr/node-7.ingress.cloudflare-ipfs.com"]},
|
||||||
{"ID": "QmcFmLd5ySfk2WZuJ1mfSWLDjdmHZq7rSAua4GoeSQfs1z", "Addrs": ["/dnsaddr/node-2.ingress.cloudflare-ipfs.com"]},
|
{"ID": "QmcfgsJsMtx6qJb74akCw1M24X1zFwgGo11h1cuhwQjtJP", "Addrs": ["/dnsaddr/node-8.ingress.cloudflare-ipfs.com"]},
|
||||||
{"ID": "QmcfFmzSDVbwexQ9Au2pt5YEXHK5xajwgaU6PpkbLWerMa", "Addrs": ["/dnsaddr/node-3.ingress.cloudflare-ipfs.com"]},
|
{"ID": "Qmcfr2FC7pFzJbTSDfYaSy1J8Uuy8ccGLeLyqJCKJvTHMi", "Addrs": ["/dnsaddr/node-9.ingress.cloudflare-ipfs.com"]},
|
||||||
{"ID": "QmcfJeB3Js1FG7T8YaZATEiaHqNKVdQfybYYkbT1knUswx", "Addrs": ["/dnsaddr/node-4.ingress.cloudflare-ipfs.com"]},
|
{"ID": "QmcfR3V5YAtHBzxVACWCzXTt26SyEkxdwhGJ6875A8BuWx", "Addrs": ["/dnsaddr/node-10.ingress.cloudflare-ipfs.com"]},
|
||||||
{"ID": "QmcfVvzK4tMdFmpJjEKDUoqRgP4W9FnmJoziYX5GXJJ8eZ", "Addrs": ["/dnsaddr/node-5.ingress.cloudflare-ipfs.com"]},
|
{"ID": "Qmcfuo1TM9uUiJp6dTbm915Rf1aTqm3a3dnmCdDQLHgvL5", "Addrs": ["/dnsaddr/node-11.ingress.cloudflare-ipfs.com"]},
|
||||||
{"ID": "QmcfZD3VKrUxyP9BbyUnZDpbqDnT7cQ4WjPP8TRLXaoE7G", "Addrs": ["/dnsaddr/node-6.ingress.cloudflare-ipfs.com"]},
|
{"ID": "QmcfV2sg9zaq7UUHVCGuSvT2M2rnLBAPsiE79vVyK3Cuev", "Addrs": ["/dnsaddr/node-12.ingress.cloudflare-ipfs.com"]}
|
||||||
{"ID": "QmcfZP2LuW4jxviTeG8fi28qjnZScACb8PEgHAc17ZEri3", "Addrs": ["/dnsaddr/node-7.ingress.cloudflare-ipfs.com"]},
|
]'
|
||||||
{"ID": "QmcfgsJsMtx6qJb74akCw1M24X1zFwgGo11h1cuhwQjtJP", "Addrs": ["/dnsaddr/node-8.ingress.cloudflare-ipfs.com"]},
|
|
||||||
{"ID": "Qmcfr2FC7pFzJbTSDfYaSy1J8Uuy8ccGLeLyqJCKJvTHMi", "Addrs": ["/dnsaddr/node-9.ingress.cloudflare-ipfs.com"]},
|
|
||||||
{"ID": "QmcfR3V5YAtHBzxVACWCzXTt26SyEkxdwhGJ6875A8BuWx", "Addrs": ["/dnsaddr/node-10.ingress.cloudflare-ipfs.com"]},
|
|
||||||
{"ID": "Qmcfuo1TM9uUiJp6dTbm915Rf1aTqm3a3dnmCdDQLHgvL5", "Addrs": ["/dnsaddr/node-11.ingress.cloudflare-ipfs.com"]},
|
|
||||||
{"ID": "QmcfV2sg9zaq7UUHVCGuSvT2M2rnLBAPsiE79vVyK3Cuev", "Addrs": ["/dnsaddr/node-12.ingress.cloudflare-ipfs.com"]}
|
|
||||||
]'
|
|
||||||
|
|
||||||
# Configure API and Gateway addresses to listen on localhost only
|
|
||||||
ipfs config Addresses.API /ip4/127.0.0.1/tcp/5001
|
|
||||||
ipfs config Addresses.Gateway /ip4/127.0.0.1/tcp/8080
|
|
||||||
|
|
||||||
# Enable experimental features
|
|
||||||
ipfs config --json Experimental.FilestoreEnabled true
|
|
||||||
ipfs config --json Experimental.UrlstoreEnabled true
|
|
||||||
}
|
|
||||||
|
|
||||||
function start_ipfs() {
|
|
||||||
# Start the IPFS daemon with additional options for better performance and compatibility
|
|
||||||
ipfs daemon --enable-gc --migrate --enable-pubsub-experiment --enable-namesys-pubsub
|
|
||||||
}
|
|
||||||
|
|
||||||
# check if ~/.ipfs exists, if not create it
|
|
||||||
if [ ! -d ~/.ipfs ]; then
|
|
||||||
setup_ipfs
|
|
||||||
start_ipfs
|
|
||||||
else
|
|
||||||
start_ipfs
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
ipfs daemon
|
||||||
|
3
x/macaroon/README.md
Normal file
3
x/macaroon/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Example Module
|
||||||
|
|
||||||
|
This is a module base generated with [`spawn`](https://github.com/rollchains/spawn).
|
31
x/macaroon/autocli.go
Normal file
31
x/macaroon/autocli.go
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package module
|
||||||
|
|
||||||
|
import (
|
||||||
|
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||||
|
modulev1 "github.com/onsonr/sonr/api/macaroon/v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 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: "Query the current consensus parameters",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Tx: &autocliv1.ServiceCommandDescriptor{
|
||||||
|
Service: modulev1.Msg_ServiceDesc.ServiceName,
|
||||||
|
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||||
|
{
|
||||||
|
RpcMethod: "UpdateParams",
|
||||||
|
Skip: false, // set to true if authority gated
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
50
x/macaroon/client/cli/query.go
Normal file
50
x/macaroon/client/cli/query.go
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package cli
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
||||||
|
|
||||||
|
func GetQueryCmd() *cobra.Command {
|
||||||
|
queryCmd := &cobra.Command{
|
||||||
|
Use: types.ModuleName,
|
||||||
|
Short: "Querying commands for " + types.ModuleName,
|
||||||
|
DisableFlagParsing: true,
|
||||||
|
SuggestionsMinimumDistance: 2,
|
||||||
|
RunE: client.ValidateCmd,
|
||||||
|
}
|
||||||
|
queryCmd.AddCommand(
|
||||||
|
GetCmdParams(),
|
||||||
|
)
|
||||||
|
return queryCmd
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetCmdParams() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{
|
||||||
|
Use: "params",
|
||||||
|
Short: "Show all module params",
|
||||||
|
Args: cobra.ExactArgs(0),
|
||||||
|
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
|
||||||
|
}
|
71
x/macaroon/client/cli/tx.go
Normal file
71
x/macaroon/client/cli/tx.go
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
package cli
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||||
|
"github.com/cosmos/cosmos-sdk/client/tx"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
||||||
|
|
||||||
|
// NewTxCmd returns a root CLI command handler for certain modules
|
||||||
|
// transaction commands.
|
||||||
|
func NewTxCmd() *cobra.Command {
|
||||||
|
txCmd := &cobra.Command{
|
||||||
|
Use: types.ModuleName,
|
||||||
|
Short: types.ModuleName + " subcommands.",
|
||||||
|
DisableFlagParsing: true,
|
||||||
|
SuggestionsMinimumDistance: 2,
|
||||||
|
RunE: client.ValidateCmd,
|
||||||
|
}
|
||||||
|
|
||||||
|
txCmd.AddCommand(
|
||||||
|
MsgUpdateParams(),
|
||||||
|
)
|
||||||
|
return txCmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns a CLI command handler for registering a
|
||||||
|
// contract for the module.
|
||||||
|
func MsgUpdateParams() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{
|
||||||
|
Use: "update-params [some-value]",
|
||||||
|
Short: "Update the params (must be submitted from the authority)",
|
||||||
|
Args: cobra.ExactArgs(1),
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
cliCtx, err := client.GetClientTxContext(cmd)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
senderAddress := cliCtx.GetFromAddress()
|
||||||
|
|
||||||
|
someValue, err := strconv.ParseBool(args[0])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
msg := &types.MsgUpdateParams{
|
||||||
|
Authority: senderAddress.String(),
|
||||||
|
Params: types.Params{
|
||||||
|
SomeValue: someValue,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := msg.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), msg)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
flags.AddTxFlagsToCmd(cmd)
|
||||||
|
return cmd
|
||||||
|
}
|
63
x/macaroon/depinject.go
Normal file
63
x/macaroon/depinject.go
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
package module
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
|
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||||
|
|
||||||
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||||
|
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||||
|
|
||||||
|
"cosmossdk.io/core/address"
|
||||||
|
"cosmossdk.io/core/appmodule"
|
||||||
|
"cosmossdk.io/core/store"
|
||||||
|
"cosmossdk.io/depinject"
|
||||||
|
"cosmossdk.io/log"
|
||||||
|
|
||||||
|
modulev1 "github.com/onsonr/sonr/api/macaroon/module/v1"
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/keeper"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ appmodule.AppModule = AppModule{}
|
||||||
|
|
||||||
|
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
|
||||||
|
func (am AppModule) IsOnePerModuleType() {}
|
||||||
|
|
||||||
|
// IsAppModule implements the appmodule.AppModule interface.
|
||||||
|
func (am AppModule) IsAppModule() {}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
appmodule.Register(
|
||||||
|
&modulev1.Module{},
|
||||||
|
appmodule.Provide(ProvideModule),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
type ModuleInputs struct {
|
||||||
|
depinject.In
|
||||||
|
|
||||||
|
Cdc codec.Codec
|
||||||
|
StoreService store.KVStoreService
|
||||||
|
AddressCodec address.Codec
|
||||||
|
|
||||||
|
StakingKeeper stakingkeeper.Keeper
|
||||||
|
SlashingKeeper slashingkeeper.Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
type ModuleOutputs struct {
|
||||||
|
depinject.Out
|
||||||
|
|
||||||
|
Module appmodule.AppModule
|
||||||
|
Keeper keeper.Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
||||||
|
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||||
|
|
||||||
|
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr)
|
||||||
|
m := NewAppModule(in.Cdc, k)
|
||||||
|
|
||||||
|
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
|
||||||
|
}
|
25
x/macaroon/keeper/genesis_test.go
Normal file
25
x/macaroon/keeper/genesis_test.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package keeper_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/types"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestGenesis(t *testing.T) {
|
||||||
|
f := SetupTest(t)
|
||||||
|
|
||||||
|
genesisState := &types.GenesisState{
|
||||||
|
Params: types.DefaultParams(),
|
||||||
|
|
||||||
|
// this line is used by starport scaffolding # genesis/test/state
|
||||||
|
}
|
||||||
|
|
||||||
|
f.k.InitGenesis(f.ctx, genesisState)
|
||||||
|
|
||||||
|
got := f.k.ExportGenesis(f.ctx)
|
||||||
|
require.NotNil(t, got)
|
||||||
|
|
||||||
|
// this line is used by starport scaffolding # genesis/test/assert
|
||||||
|
}
|
104
x/macaroon/keeper/keeper.go
Normal file
104
x/macaroon/keeper/keeper.go
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
package keeper
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
|
||||||
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||||
|
|
||||||
|
"cosmossdk.io/collections"
|
||||||
|
storetypes "cosmossdk.io/core/store"
|
||||||
|
"cosmossdk.io/log"
|
||||||
|
"cosmossdk.io/orm/model/ormdb"
|
||||||
|
|
||||||
|
apiv1 "github.com/onsonr/sonr/api/macaroon/v1"
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Keeper struct {
|
||||||
|
cdc codec.BinaryCodec
|
||||||
|
|
||||||
|
logger log.Logger
|
||||||
|
|
||||||
|
// state management
|
||||||
|
Schema collections.Schema
|
||||||
|
Params collections.Item[types.Params]
|
||||||
|
OrmDB apiv1.StateStore
|
||||||
|
|
||||||
|
authority string
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewKeeper creates a new Keeper instance
|
||||||
|
func NewKeeper(
|
||||||
|
cdc codec.BinaryCodec,
|
||||||
|
storeService storetypes.KVStoreService,
|
||||||
|
logger log.Logger,
|
||||||
|
authority string,
|
||||||
|
) Keeper {
|
||||||
|
logger = logger.With(log.ModuleKey, "x/"+types.ModuleName)
|
||||||
|
|
||||||
|
sb := collections.NewSchemaBuilder(storeService)
|
||||||
|
|
||||||
|
if authority == "" {
|
||||||
|
authority = authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||||
|
}
|
||||||
|
|
||||||
|
db, err := ormdb.NewModuleDB(&types.ORMModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService})
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
store, err := apiv1.NewStateStore(db)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
k := Keeper{
|
||||||
|
cdc: cdc,
|
||||||
|
logger: logger,
|
||||||
|
|
||||||
|
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
|
||||||
|
OrmDB: store,
|
||||||
|
|
||||||
|
authority: authority,
|
||||||
|
}
|
||||||
|
|
||||||
|
schema, err := sb.Build()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
k.Schema = schema
|
||||||
|
|
||||||
|
return k
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k Keeper) Logger() log.Logger {
|
||||||
|
return k.logger
|
||||||
|
}
|
||||||
|
|
||||||
|
// InitGenesis initializes the module's state from a genesis state.
|
||||||
|
func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error {
|
||||||
|
// this line is used by starport scaffolding # genesis/module/init
|
||||||
|
if err := data.Params.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return k.Params.Set(ctx, data.Params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExportGenesis exports the module's state to a genesis state.
|
||||||
|
func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState {
|
||||||
|
params, err := k.Params.Get(ctx)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// this line is used by starport scaffolding # genesis/module/export
|
||||||
|
|
||||||
|
return &types.GenesisState{
|
||||||
|
Params: params,
|
||||||
|
}
|
||||||
|
}
|
142
x/macaroon/keeper/keeper_test.go
Normal file
142
x/macaroon/keeper/keeper_test.go
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
package keeper_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
|
"cosmossdk.io/log"
|
||||||
|
storetypes "cosmossdk.io/store/types"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/runtime"
|
||||||
|
"github.com/cosmos/cosmos-sdk/testutil"
|
||||||
|
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
|
||||||
|
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
|
||||||
|
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||||
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
|
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||||
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||||
|
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
|
||||||
|
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||||
|
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||||
|
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||||
|
|
||||||
|
"cosmossdk.io/core/store"
|
||||||
|
|
||||||
|
module "github.com/onsonr/sonr/x/macaroon"
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/keeper"
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
var maccPerms = map[string][]string{
|
||||||
|
authtypes.FeeCollectorName: nil,
|
||||||
|
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
|
||||||
|
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
|
||||||
|
minttypes.ModuleName: {authtypes.Minter},
|
||||||
|
govtypes.ModuleName: {authtypes.Burner},
|
||||||
|
}
|
||||||
|
|
||||||
|
type testFixture struct {
|
||||||
|
suite.Suite
|
||||||
|
|
||||||
|
ctx sdk.Context
|
||||||
|
k keeper.Keeper
|
||||||
|
msgServer types.MsgServer
|
||||||
|
queryServer types.QueryServer
|
||||||
|
appModule *module.AppModule
|
||||||
|
|
||||||
|
accountkeeper authkeeper.AccountKeeper
|
||||||
|
bankkeeper bankkeeper.BaseKeeper
|
||||||
|
stakingKeeper *stakingkeeper.Keeper
|
||||||
|
mintkeeper mintkeeper.Keeper
|
||||||
|
|
||||||
|
addrs []sdk.AccAddress
|
||||||
|
govModAddr string
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetupTest(t *testing.T) *testFixture {
|
||||||
|
t.Helper()
|
||||||
|
f := new(testFixture)
|
||||||
|
require := require.New(t)
|
||||||
|
|
||||||
|
// Base setup
|
||||||
|
logger := log.NewTestLogger(t)
|
||||||
|
encCfg := moduletestutil.MakeTestEncodingConfig()
|
||||||
|
|
||||||
|
f.govModAddr = authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||||
|
f.addrs = simtestutil.CreateIncrementalAccounts(3)
|
||||||
|
|
||||||
|
key := storetypes.NewKVStoreKey(types.ModuleName)
|
||||||
|
storeService := runtime.NewKVStoreService(key)
|
||||||
|
testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test"))
|
||||||
|
|
||||||
|
f.ctx = testCtx.Ctx
|
||||||
|
|
||||||
|
// Register SDK modules.
|
||||||
|
registerBaseSDKModules(f, encCfg, storeService, logger, require)
|
||||||
|
|
||||||
|
// Setup Keeper.
|
||||||
|
f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr)
|
||||||
|
f.msgServer = keeper.NewMsgServerImpl(f.k)
|
||||||
|
f.queryServer = keeper.NewQuerier(f.k)
|
||||||
|
f.appModule = module.NewAppModule(encCfg.Codec, f.k)
|
||||||
|
|
||||||
|
return f
|
||||||
|
}
|
||||||
|
|
||||||
|
func registerModuleInterfaces(encCfg moduletestutil.TestEncodingConfig) {
|
||||||
|
authtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||||
|
stakingtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||||
|
|
||||||
|
types.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||||
|
}
|
||||||
|
|
||||||
|
func registerBaseSDKModules(
|
||||||
|
f *testFixture,
|
||||||
|
encCfg moduletestutil.TestEncodingConfig,
|
||||||
|
storeService store.KVStoreService,
|
||||||
|
logger log.Logger,
|
||||||
|
require *require.Assertions,
|
||||||
|
) {
|
||||||
|
registerModuleInterfaces(encCfg)
|
||||||
|
|
||||||
|
// Auth Keeper.
|
||||||
|
f.accountkeeper = authkeeper.NewAccountKeeper(
|
||||||
|
encCfg.Codec, storeService,
|
||||||
|
authtypes.ProtoBaseAccount,
|
||||||
|
maccPerms,
|
||||||
|
authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix,
|
||||||
|
f.govModAddr,
|
||||||
|
)
|
||||||
|
|
||||||
|
// Bank Keeper.
|
||||||
|
f.bankkeeper = bankkeeper.NewBaseKeeper(
|
||||||
|
encCfg.Codec, storeService,
|
||||||
|
f.accountkeeper,
|
||||||
|
nil,
|
||||||
|
f.govModAddr, logger,
|
||||||
|
)
|
||||||
|
|
||||||
|
// Staking Keeper.
|
||||||
|
f.stakingKeeper = stakingkeeper.NewKeeper(
|
||||||
|
encCfg.Codec, storeService,
|
||||||
|
f.accountkeeper, f.bankkeeper, f.govModAddr,
|
||||||
|
authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr),
|
||||||
|
authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr),
|
||||||
|
)
|
||||||
|
require.NoError(f.stakingKeeper.SetParams(f.ctx, stakingtypes.DefaultParams()))
|
||||||
|
f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetNotBondedPool(f.ctx))
|
||||||
|
f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetBondedPool(f.ctx))
|
||||||
|
|
||||||
|
// Mint Keeper.
|
||||||
|
f.mintkeeper = mintkeeper.NewKeeper(
|
||||||
|
encCfg.Codec, storeService,
|
||||||
|
f.stakingKeeper, f.accountkeeper, f.bankkeeper,
|
||||||
|
authtypes.FeeCollectorName, f.govModAddr,
|
||||||
|
)
|
||||||
|
f.accountkeeper.SetModuleAccount(f.ctx, f.accountkeeper.GetModuleAccount(f.ctx, minttypes.ModuleName))
|
||||||
|
f.mintkeeper.InitGenesis(f.ctx, f.accountkeeper, minttypes.DefaultGenesisState())
|
||||||
|
}
|
29
x/macaroon/keeper/msg_server.go
Normal file
29
x/macaroon/keeper/msg_server.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package keeper
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||||
|
|
||||||
|
"cosmossdk.io/errors"
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
type msgServer struct {
|
||||||
|
k Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ types.MsgServer = msgServer{}
|
||||||
|
|
||||||
|
// NewMsgServerImpl returns an implementation of the module MsgServer interface.
|
||||||
|
func NewMsgServerImpl(keeper Keeper) types.MsgServer {
|
||||||
|
return &msgServer{k: keeper}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
|
||||||
|
if ms.k.authority != msg.Authority {
|
||||||
|
return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, ms.k.Params.Set(ctx, msg.Params)
|
||||||
|
}
|
56
x/macaroon/keeper/msg_server_test.go
Normal file
56
x/macaroon/keeper/msg_server_test.go
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
package keeper_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestParams(t *testing.T) {
|
||||||
|
f := SetupTest(t)
|
||||||
|
require := require.New(t)
|
||||||
|
|
||||||
|
testCases := []struct {
|
||||||
|
name string
|
||||||
|
request *types.MsgUpdateParams
|
||||||
|
err bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "fail; invalid authority",
|
||||||
|
request: &types.MsgUpdateParams{
|
||||||
|
Authority: f.addrs[0].String(),
|
||||||
|
Params: types.DefaultParams(),
|
||||||
|
},
|
||||||
|
err: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "success",
|
||||||
|
request: &types.MsgUpdateParams{
|
||||||
|
Authority: f.govModAddr,
|
||||||
|
Params: types.DefaultParams(),
|
||||||
|
},
|
||||||
|
err: false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tc := range testCases {
|
||||||
|
tc := tc
|
||||||
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
_, err := f.msgServer.UpdateParams(f.ctx, tc.request)
|
||||||
|
|
||||||
|
if tc.err {
|
||||||
|
require.Error(err)
|
||||||
|
} else {
|
||||||
|
require.NoError(err)
|
||||||
|
|
||||||
|
r, err := f.queryServer.Params(f.ctx, &types.QueryParamsRequest{})
|
||||||
|
require.NoError(err)
|
||||||
|
|
||||||
|
require.EqualValues(&tc.request.Params, r.Params)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
31
x/macaroon/keeper/orm_test.go
Normal file
31
x/macaroon/keeper/orm_test.go
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package keeper_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
apiv1 "github.com/onsonr/sonr/api/macaroon/v1"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestORM(t *testing.T) {
|
||||||
|
f := SetupTest(t)
|
||||||
|
|
||||||
|
dt := f.k.OrmDB.ExampleDataTable()
|
||||||
|
acc := []byte("test_acc")
|
||||||
|
amt := uint64(7)
|
||||||
|
|
||||||
|
err := dt.Insert(f.ctx, &apiv1.ExampleData{
|
||||||
|
Account: acc,
|
||||||
|
Amount: amt,
|
||||||
|
})
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
d, err := dt.Has(f.ctx, []byte("test_acc"))
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.True(t, d)
|
||||||
|
|
||||||
|
res, err := dt.Get(f.ctx, []byte("test_acc"))
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.NotNil(t, res)
|
||||||
|
require.EqualValues(t, amt, res.Amount)
|
||||||
|
}
|
30
x/macaroon/keeper/query_server.go
Normal file
30
x/macaroon/keeper/query_server.go
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package keeper
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ types.QueryServer = Querier{}
|
||||||
|
|
||||||
|
type Querier struct {
|
||||||
|
Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewQuerier(keeper Keeper) Querier {
|
||||||
|
return Querier{Keeper: keeper}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
|
||||||
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
|
|
||||||
|
p, err := k.Keeper.Params.Get(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &types.QueryParamsResponse{Params: &p}, nil
|
||||||
|
}
|
149
x/macaroon/module.go
Normal file
149
x/macaroon/module.go
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
package module
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
|
||||||
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||||
|
|
||||||
|
abci "github.com/cometbft/cometbft/abci/types"
|
||||||
|
|
||||||
|
"cosmossdk.io/client/v2/autocli"
|
||||||
|
errorsmod "cosmossdk.io/errors"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/module"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/keeper"
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/types"
|
||||||
|
// this line is used by starport scaffolding # 1
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// ConsensusVersion defines the current x/macaroon module consensus version.
|
||||||
|
ConsensusVersion = 1
|
||||||
|
|
||||||
|
// this line is used by starport scaffolding # simapp/module/const
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_ module.AppModuleBasic = AppModuleBasic{}
|
||||||
|
_ module.AppModuleGenesis = AppModule{}
|
||||||
|
_ module.AppModule = AppModule{}
|
||||||
|
|
||||||
|
_ autocli.HasAutoCLIConfig = AppModule{}
|
||||||
|
)
|
||||||
|
|
||||||
|
// AppModuleBasic defines the basic application module used by the wasm module.
|
||||||
|
type AppModuleBasic struct {
|
||||||
|
cdc codec.Codec
|
||||||
|
}
|
||||||
|
|
||||||
|
type AppModule struct {
|
||||||
|
AppModuleBasic
|
||||||
|
|
||||||
|
keeper keeper.Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAppModule constructor
|
||||||
|
func NewAppModule(
|
||||||
|
cdc codec.Codec,
|
||||||
|
keeper keeper.Keeper,
|
||||||
|
) *AppModule {
|
||||||
|
return &AppModule{
|
||||||
|
AppModuleBasic: AppModuleBasic{cdc: cdc},
|
||||||
|
keeper: keeper,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) Name() string {
|
||||||
|
return types.ModuleName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
|
||||||
|
return cdc.MustMarshalJSON(&types.GenesisState{
|
||||||
|
Params: types.DefaultParams(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error {
|
||||||
|
var data types.GenesisState
|
||||||
|
err := marshaler.UnmarshalJSON(message, &data)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := data.Params.Validate(); err != nil {
|
||||||
|
return errorsmod.Wrap(err, "params")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
|
||||||
|
err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx))
|
||||||
|
if err != nil {
|
||||||
|
// same behavior as in cosmos-sdk
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable in favor of autocli.go. If you wish to use these, it will override AutoCLI methods.
|
||||||
|
/*
|
||||||
|
func (a AppModuleBasic) GetTxCmd() *cobra.Command {
|
||||||
|
return cli.NewTxCmd()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) GetQueryCmd() *cobra.Command {
|
||||||
|
return cli.GetQueryCmd()
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||||
|
types.RegisterLegacyAminoCodec(cdc)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) RegisterInterfaces(r codectypes.InterfaceRegistry) {
|
||||||
|
types.RegisterInterfaces(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate {
|
||||||
|
var genesisState types.GenesisState
|
||||||
|
marshaler.MustUnmarshalJSON(message, &genesisState)
|
||||||
|
|
||||||
|
if err := a.keeper.Params.Set(ctx, genesisState.Params); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage {
|
||||||
|
genState := a.keeper.ExportGenesis(ctx)
|
||||||
|
return marshaler.MustMarshalJSON(genState)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModule) QuerierRoute() string {
|
||||||
|
return types.QuerierRoute
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModule) RegisterServices(cfg module.Configurator) {
|
||||||
|
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(a.keeper))
|
||||||
|
types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQuerier(a.keeper))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 (a AppModule) ConsensusVersion() uint64 {
|
||||||
|
return ConsensusVersion
|
||||||
|
}
|
37
x/macaroon/types/codec.go
Normal file
37
x/macaroon/types/codec.go
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec/types"
|
||||||
|
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||||
|
// this line is used by starport scaffolding # 1
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
amino = codec.NewLegacyAmino()
|
||||||
|
AminoCdc = codec.NewAminoCodec(amino)
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
RegisterLegacyAminoCodec(amino)
|
||||||
|
cryptocodec.RegisterCrypto(amino)
|
||||||
|
sdk.RegisterLegacyAminoCodec(amino)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec
|
||||||
|
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||||
|
cdc.RegisterConcrete(&MsgUpdateParams{}, ModuleName+"/MsgUpdateParams", nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||||
|
// this line is used by starport scaffolding # 3
|
||||||
|
|
||||||
|
registry.RegisterImplementations(
|
||||||
|
(*sdk.Msg)(nil),
|
||||||
|
&MsgUpdateParams{},
|
||||||
|
)
|
||||||
|
|
||||||
|
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
||||||
|
}
|
22
x/macaroon/types/genesis.go
Normal file
22
x/macaroon/types/genesis.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
// 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()
|
||||||
|
}
|
510
x/macaroon/types/genesis.pb.go
Normal file
510
x/macaroon/types/genesis.pb.go
Normal file
@ -0,0 +1,510 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: macaroon/v1/genesis.proto
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
fmt "fmt"
|
||||||
|
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
|
||||||
|
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||||
|
proto "github.com/cosmos/gogoproto/proto"
|
||||||
|
io "io"
|
||||||
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
|
// GenesisState defines the module genesis state
|
||||||
|
type GenesisState struct {
|
||||||
|
// Params defines all the parameters of the module.
|
||||||
|
Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GenesisState) Reset() { *m = GenesisState{} }
|
||||||
|
func (m *GenesisState) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*GenesisState) ProtoMessage() {}
|
||||||
|
func (*GenesisState) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_06e0b5dfdf5e52ba, []int{0}
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_GenesisState.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_GenesisState.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_GenesisState proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *GenesisState) GetParams() Params {
|
||||||
|
if m != nil {
|
||||||
|
return m.Params
|
||||||
|
}
|
||||||
|
return Params{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Params defines the set of module parameters.
|
||||||
|
type Params struct {
|
||||||
|
SomeValue bool `protobuf:"varint,2,opt,name=some_value,json=someValue,proto3" json:"some_value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) Reset() { *m = Params{} }
|
||||||
|
func (*Params) ProtoMessage() {}
|
||||||
|
func (*Params) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_06e0b5dfdf5e52ba, []int{1}
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Params.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Params.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Params.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Params proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *Params) GetSomeValue() bool {
|
||||||
|
if m != nil {
|
||||||
|
return m.SomeValue
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*GenesisState)(nil), "macaroon.v1.GenesisState")
|
||||||
|
proto.RegisterType((*Params)(nil), "macaroon.v1.Params")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("macaroon/v1/genesis.proto", fileDescriptor_06e0b5dfdf5e52ba) }
|
||||||
|
|
||||||
|
var fileDescriptor_06e0b5dfdf5e52ba = []byte{
|
||||||
|
// 245 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0x4d, 0x4c, 0x4e,
|
||||||
|
0x2c, 0xca, 0xcf, 0xcf, 0xd3, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6,
|
||||||
|
0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x49, 0xe9, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7,
|
||||||
|
0xa7, 0xe7, 0x83, 0xc5, 0xf5, 0x41, 0x2c, 0x88, 0x12, 0x29, 0xc1, 0xc4, 0xdc, 0xcc, 0xbc, 0x7c,
|
||||||
|
0x7d, 0x30, 0x09, 0x11, 0x52, 0x72, 0xe4, 0xe2, 0x71, 0x87, 0x18, 0x13, 0x5c, 0x92, 0x58, 0x92,
|
||||||
|
0x2a, 0x64, 0xc8, 0xc5, 0x56, 0x90, 0x58, 0x94, 0x98, 0x5b, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1,
|
||||||
|
0x6d, 0x24, 0xac, 0x87, 0x64, 0xac, 0x5e, 0x00, 0x58, 0xca, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86,
|
||||||
|
0x20, 0xa8, 0x42, 0x25, 0x57, 0x2e, 0x36, 0x88, 0xb8, 0x90, 0x2c, 0x17, 0x57, 0x71, 0x7e, 0x6e,
|
||||||
|
0x6a, 0x7c, 0x59, 0x62, 0x4e, 0x69, 0xaa, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x27, 0x48,
|
||||||
|
0x24, 0x0c, 0x24, 0x60, 0x25, 0x33, 0x63, 0x81, 0x3c, 0xc3, 0x8b, 0x05, 0xf2, 0x8c, 0x5d, 0xcf,
|
||||||
|
0x37, 0x68, 0xf1, 0xc3, 0x7d, 0x02, 0x31, 0xc6, 0xc9, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f,
|
||||||
|
0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b,
|
||||||
|
0x8f, 0xe5, 0x18, 0xa2, 0xd4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5,
|
||||||
|
0xf3, 0xf3, 0x8a, 0xf3, 0xf3, 0x8a, 0xf4, 0xc1, 0x44, 0x85, 0x3e, 0xdc, 0x8c, 0x92, 0xca, 0x82,
|
||||||
|
0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x9f, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc2, 0xd2, 0x5a,
|
||||||
|
0x72, 0x26, 0x01, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Params) Equal(that interface{}) bool {
|
||||||
|
if that == nil {
|
||||||
|
return this == nil
|
||||||
|
}
|
||||||
|
|
||||||
|
that1, ok := that.(*Params)
|
||||||
|
if !ok {
|
||||||
|
that2, ok := that.(Params)
|
||||||
|
if ok {
|
||||||
|
that1 = &that2
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if that1 == nil {
|
||||||
|
return this == nil
|
||||||
|
} else if this == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if this.SomeValue != that1.SomeValue {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
{
|
||||||
|
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintGenesis(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.SomeValue {
|
||||||
|
i--
|
||||||
|
if m.SomeValue {
|
||||||
|
dAtA[i] = 1
|
||||||
|
} else {
|
||||||
|
dAtA[i] = 0
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x10
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovGenesis(v)
|
||||||
|
base := offset
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
|
v >>= 7
|
||||||
|
offset++
|
||||||
|
}
|
||||||
|
dAtA[offset] = uint8(v)
|
||||||
|
return base
|
||||||
|
}
|
||||||
|
func (m *GenesisState) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = m.Params.Size()
|
||||||
|
n += 1 + l + sovGenesis(uint64(l))
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.SomeValue {
|
||||||
|
n += 2
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func sovGenesis(x uint64) (n int) {
|
||||||
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
|
}
|
||||||
|
func sozGenesis(x uint64) (n int) {
|
||||||
|
return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
|
}
|
||||||
|
func (m *GenesisState) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: GenesisState: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipGenesis(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (m *Params) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: Params: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 2:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field SomeValue", wireType)
|
||||||
|
}
|
||||||
|
var v int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
v |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.SomeValue = bool(v != 0)
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipGenesis(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func skipGenesis(dAtA []byte) (n int, err error) {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
switch wireType {
|
||||||
|
case 0:
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx++
|
||||||
|
if dAtA[iNdEx-1] < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
iNdEx += 8
|
||||||
|
case 2:
|
||||||
|
var length int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
length |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length < 0 {
|
||||||
|
return 0, ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
iNdEx += length
|
||||||
|
case 3:
|
||||||
|
depth++
|
||||||
|
case 4:
|
||||||
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupGenesis
|
||||||
|
}
|
||||||
|
depth--
|
||||||
|
case 5:
|
||||||
|
iNdEx += 4
|
||||||
|
default:
|
||||||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
|
ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
|
||||||
|
)
|
42
x/macaroon/types/genesis_test.go
Normal file
42
x/macaroon/types/genesis_test.go
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package types_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/macaroon/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)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
27
x/macaroon/types/keys.go
Normal file
27
x/macaroon/types/keys.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"cosmossdk.io/collections"
|
||||||
|
|
||||||
|
ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
// ParamsKey saves the current module params.
|
||||||
|
ParamsKey = collections.NewPrefix(0)
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
ModuleName = "macaroon"
|
||||||
|
|
||||||
|
StoreKey = ModuleName
|
||||||
|
|
||||||
|
QuerierRoute = ModuleName
|
||||||
|
)
|
||||||
|
|
||||||
|
var ORMModuleSchema = ormv1alpha1.ModuleSchemaDescriptor{
|
||||||
|
SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{
|
||||||
|
{Id: 1, ProtoFileName: "macaroon/v1/state.proto"},
|
||||||
|
},
|
||||||
|
Prefix: []byte{0},
|
||||||
|
}
|
49
x/macaroon/types/msgs.go
Normal file
49
x/macaroon/types/msgs.go
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"cosmossdk.io/errors"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_ sdk.Msg = &MsgUpdateParams{}
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewMsgUpdateParams creates new instance of MsgUpdateParams
|
||||||
|
func NewMsgUpdateParams(
|
||||||
|
sender sdk.Address,
|
||||||
|
someValue bool,
|
||||||
|
) *MsgUpdateParams {
|
||||||
|
return &MsgUpdateParams{
|
||||||
|
Authority: sender.String(),
|
||||||
|
Params: Params{
|
||||||
|
SomeValue: someValue,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Route returns the name of the module
|
||||||
|
func (msg MsgUpdateParams) Route() string { return ModuleName }
|
||||||
|
|
||||||
|
// Type returns the the action
|
||||||
|
func (msg MsgUpdateParams) Type() string { return "update_params" }
|
||||||
|
|
||||||
|
// GetSignBytes implements the LegacyMsg interface.
|
||||||
|
func (msg MsgUpdateParams) GetSignBytes() []byte {
|
||||||
|
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg))
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSigners returns the expected signers for a MsgUpdateParams message.
|
||||||
|
func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress {
|
||||||
|
addr, _ := sdk.AccAddressFromBech32(msg.Authority)
|
||||||
|
return []sdk.AccAddress{addr}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidateBasic does a sanity check on the provided data.
|
||||||
|
func (msg *MsgUpdateParams) Validate() error {
|
||||||
|
if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil {
|
||||||
|
return errors.Wrap(err, "invalid authority address")
|
||||||
|
}
|
||||||
|
|
||||||
|
return msg.Params.Validate()
|
||||||
|
}
|
29
x/macaroon/types/params.go
Normal file
29
x/macaroon/types/params.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DefaultParams returns default module parameters.
|
||||||
|
func DefaultParams() Params {
|
||||||
|
// TODO:
|
||||||
|
return Params{
|
||||||
|
SomeValue: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stringer method for Params.
|
||||||
|
func (p Params) String() string {
|
||||||
|
bz, err := json.Marshal(p)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return string(bz)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate does the sanity check on the params.
|
||||||
|
func (p Params) Validate() error {
|
||||||
|
// TODO:
|
||||||
|
return nil
|
||||||
|
}
|
539
x/macaroon/types/query.pb.go
Normal file
539
x/macaroon/types/query.pb.go
Normal file
@ -0,0 +1,539 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: macaroon/v1/query.proto
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
fmt "fmt"
|
||||||
|
grpc1 "github.com/cosmos/gogoproto/grpc"
|
||||||
|
proto "github.com/cosmos/gogoproto/proto"
|
||||||
|
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
io "io"
|
||||||
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
|
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
||||||
|
type QueryParamsRequest struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} }
|
||||||
|
func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*QueryParamsRequest) ProtoMessage() {}
|
||||||
|
func (*QueryParamsRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_ce46a74a5956a389, []int{0}
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_QueryParamsRequest.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo
|
||||||
|
|
||||||
|
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
||||||
|
type QueryParamsResponse struct {
|
||||||
|
// params defines the parameters of the module.
|
||||||
|
Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} }
|
||||||
|
func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*QueryParamsResponse) ProtoMessage() {}
|
||||||
|
func (*QueryParamsResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_ce46a74a5956a389, []int{1}
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_QueryParamsResponse.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) GetParams() *Params {
|
||||||
|
if m != nil {
|
||||||
|
return m.Params
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*QueryParamsRequest)(nil), "macaroon.v1.QueryParamsRequest")
|
||||||
|
proto.RegisterType((*QueryParamsResponse)(nil), "macaroon.v1.QueryParamsResponse")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("macaroon/v1/query.proto", fileDescriptor_ce46a74a5956a389) }
|
||||||
|
|
||||||
|
var fileDescriptor_ce46a74a5956a389 = []byte{
|
||||||
|
// 253 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0x4d, 0x4c, 0x4e,
|
||||||
|
0x2c, 0xca, 0xcf, 0xcf, 0xd3, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28,
|
||||||
|
0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x49, 0xe8, 0x95, 0x19, 0x4a, 0xc9, 0xa4, 0xe7, 0xe7, 0xa7,
|
||||||
|
0xe7, 0xa4, 0xea, 0x27, 0x16, 0x64, 0xea, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6,
|
||||||
|
0xe7, 0x15, 0x43, 0x94, 0x4a, 0x49, 0x22, 0x9b, 0x91, 0x9e, 0x9a, 0x97, 0x5a, 0x9c, 0x09, 0x95,
|
||||||
|
0x52, 0x12, 0xe1, 0x12, 0x0a, 0x04, 0x19, 0x1a, 0x90, 0x58, 0x94, 0x98, 0x5b, 0x1c, 0x94, 0x5a,
|
||||||
|
0x58, 0x9a, 0x5a, 0x5c, 0xa2, 0xe4, 0xc4, 0x25, 0x8c, 0x22, 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c,
|
||||||
|
0x2a, 0xa4, 0xcd, 0xc5, 0x56, 0x00, 0x16, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x12, 0xd6,
|
||||||
|
0x43, 0x72, 0x83, 0x1e, 0x54, 0x31, 0x54, 0x89, 0x51, 0x21, 0x17, 0x2b, 0xd8, 0x0c, 0xa1, 0x0c,
|
||||||
|
0x2e, 0x36, 0x88, 0x94, 0x90, 0x3c, 0x8a, 0x7a, 0x4c, 0x7b, 0xa5, 0x14, 0x70, 0x2b, 0x80, 0x38,
|
||||||
|
0x41, 0x49, 0xba, 0xe9, 0xf2, 0x93, 0xc9, 0x4c, 0xa2, 0x42, 0xc2, 0xfa, 0xc8, 0x7e, 0x82, 0x58,
|
||||||
|
0xe9, 0xe4, 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e,
|
||||||
|
0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xea, 0xe9, 0x99,
|
||||||
|
0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xf9, 0x79, 0xc5, 0xf9, 0x79, 0x45, 0xfa,
|
||||||
|
0x60, 0xa2, 0x02, 0x61, 0x4c, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x58, 0x8c, 0x01,
|
||||||
|
0x01, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x6e, 0xa8, 0x57, 0x77, 0x01, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ context.Context
|
||||||
|
var _ grpc.ClientConn
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
const _ = grpc.SupportPackageIsVersion4
|
||||||
|
|
||||||
|
// QueryClient is the client API for Query service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||||
|
type QueryClient interface {
|
||||||
|
// Params queries all parameters of the module.
|
||||||
|
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type queryClient struct {
|
||||||
|
cc grpc1.ClientConn
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewQueryClient(cc grpc1.ClientConn) QueryClient {
|
||||||
|
return &queryClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
||||||
|
out := new(QueryParamsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/macaroon.v1.Query/Params", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryServer is the server API for Query service.
|
||||||
|
type QueryServer interface {
|
||||||
|
// Params queries all parameters of the module.
|
||||||
|
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedQueryServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
|
||||||
|
s.RegisterService(&_Query_serviceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(QueryParamsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(QueryServer).Params(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/macaroon.v1.Query/Params",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _Query_serviceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "macaroon.v1.Query",
|
||||||
|
HandlerType: (*QueryServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Params",
|
||||||
|
Handler: _Query_Params_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "macaroon/v1/query.proto",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.Params != nil {
|
||||||
|
{
|
||||||
|
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintQuery(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovQuery(v)
|
||||||
|
base := offset
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
|
v >>= 7
|
||||||
|
offset++
|
||||||
|
}
|
||||||
|
dAtA[offset] = uint8(v)
|
||||||
|
return base
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.Params != nil {
|
||||||
|
l = m.Params.Size()
|
||||||
|
n += 1 + l + sovQuery(uint64(l))
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func sovQuery(x uint64) (n int) {
|
||||||
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
|
}
|
||||||
|
func sozQuery(x uint64) (n int) {
|
||||||
|
return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if m.Params == nil {
|
||||||
|
m.Params = &Params{}
|
||||||
|
}
|
||||||
|
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func skipQuery(dAtA []byte) (n int, err error) {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
switch wireType {
|
||||||
|
case 0:
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx++
|
||||||
|
if dAtA[iNdEx-1] < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
iNdEx += 8
|
||||||
|
case 2:
|
||||||
|
var length int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
length |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length < 0 {
|
||||||
|
return 0, ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
iNdEx += length
|
||||||
|
case 3:
|
||||||
|
depth++
|
||||||
|
case 4:
|
||||||
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupQuery
|
||||||
|
}
|
||||||
|
depth--
|
||||||
|
case 5:
|
||||||
|
iNdEx += 4
|
||||||
|
default:
|
||||||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
|
ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
|
||||||
|
)
|
153
x/macaroon/types/query.pb.gw.go
Normal file
153
x/macaroon/types/query.pb.gw.go
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||||
|
// source: macaroon/v1/query.proto
|
||||||
|
|
||||||
|
/*
|
||||||
|
Package types is a reverse proxy.
|
||||||
|
|
||||||
|
It translates gRPC into RESTful JSON APIs.
|
||||||
|
*/
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/descriptor"
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||||
|
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
"google.golang.org/grpc/codes"
|
||||||
|
"google.golang.org/grpc/grpclog"
|
||||||
|
"google.golang.org/grpc/metadata"
|
||||||
|
"google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Suppress "imported and not used" errors
|
||||||
|
var _ codes.Code
|
||||||
|
var _ io.Reader
|
||||||
|
var _ status.Status
|
||||||
|
var _ = runtime.String
|
||||||
|
var _ = utilities.NewDoubleArray
|
||||||
|
var _ = descriptor.ForMessage
|
||||||
|
var _ = metadata.Join
|
||||||
|
|
||||||
|
func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq QueryParamsRequest
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq QueryParamsRequest
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
msg, err := server.Params(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
|
// UnaryRPC :call QueryServer directly.
|
||||||
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
|
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but
|
||||||
|
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||||
|
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||||
|
conn, err := grpc.Dial(endpoint, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
if err != nil {
|
||||||
|
if cerr := conn.Close(); cerr != nil {
|
||||||
|
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
go func() {
|
||||||
|
<-ctx.Done()
|
||||||
|
if cerr := conn.Close(); cerr != nil {
|
||||||
|
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}()
|
||||||
|
|
||||||
|
return RegisterQueryHandler(ctx, mux, conn)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterQueryHandler registers the http handlers for service Query to "mux".
|
||||||
|
// The handlers forward requests to the grpc endpoint over "conn".
|
||||||
|
func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||||
|
return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn))
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterQueryHandlerClient registers the http handlers for service Query
|
||||||
|
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient".
|
||||||
|
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient"
|
||||||
|
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||||
|
// "QueryClient" to call the correct interceptors.
|
||||||
|
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error {
|
||||||
|
|
||||||
|
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"macaroon", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
forward_Query_Params_0 = runtime.ForwardResponseMessage
|
||||||
|
)
|
356
x/macaroon/types/state.pb.go
Normal file
356
x/macaroon/types/state.pb.go
Normal file
@ -0,0 +1,356 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: macaroon/v1/state.proto
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "cosmossdk.io/orm"
|
||||||
|
fmt "fmt"
|
||||||
|
proto "github.com/cosmos/gogoproto/proto"
|
||||||
|
io "io"
|
||||||
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
|
type ExampleData struct {
|
||||||
|
Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
|
||||||
|
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ExampleData) Reset() { *m = ExampleData{} }
|
||||||
|
func (m *ExampleData) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*ExampleData) ProtoMessage() {}
|
||||||
|
func (*ExampleData) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_2ade56339acadfd8, []int{0}
|
||||||
|
}
|
||||||
|
func (m *ExampleData) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *ExampleData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_ExampleData.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *ExampleData) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_ExampleData.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *ExampleData) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *ExampleData) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_ExampleData.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_ExampleData proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *ExampleData) GetAccount() []byte {
|
||||||
|
if m != nil {
|
||||||
|
return m.Account
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ExampleData) GetAmount() uint64 {
|
||||||
|
if m != nil {
|
||||||
|
return m.Amount
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*ExampleData)(nil), "macaroon.v1.ExampleData")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("macaroon/v1/state.proto", fileDescriptor_2ade56339acadfd8) }
|
||||||
|
|
||||||
|
var fileDescriptor_2ade56339acadfd8 = []byte{
|
||||||
|
// 209 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0x4d, 0x4c, 0x4e,
|
||||||
|
0x2c, 0xca, 0xcf, 0xcf, 0xd3, 0x2f, 0x33, 0xd4, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28,
|
||||||
|
0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x49, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7,
|
||||||
|
0xe6, 0x17, 0xeb, 0xe7, 0x17, 0xe5, 0x82, 0xd4, 0xe5, 0x17, 0xe5, 0x42, 0x54, 0x29, 0x25, 0x70,
|
||||||
|
0x71, 0xbb, 0x56, 0x24, 0xe6, 0x16, 0xe4, 0xa4, 0xba, 0x24, 0x96, 0x24, 0x0a, 0x49, 0x70, 0xb1,
|
||||||
|
0x27, 0x26, 0x27, 0xe7, 0x97, 0xe6, 0x95, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x04, 0xc1, 0xb8,
|
||||||
|
0x42, 0x62, 0x5c, 0x6c, 0x89, 0xb9, 0x60, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x96, 0x20, 0x28, 0xcf,
|
||||||
|
0x4a, 0xfe, 0xd3, 0xbc, 0xcb, 0x7d, 0xcc, 0x92, 0x5c, 0x9c, 0x70, 0x9d, 0x42, 0x5c, 0x30, 0xa5,
|
||||||
|
0x02, 0x8c, 0x12, 0x8c, 0x4e, 0x8e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0,
|
||||||
|
0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10,
|
||||||
|
0xa5, 0x9e, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x9f, 0x57, 0x9c,
|
||||||
|
0x9f, 0x57, 0xa4, 0x0f, 0x26, 0x2a, 0xf4, 0xe1, 0x7e, 0x2a, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62,
|
||||||
|
0x03, 0xbb, 0xd5, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x37, 0x1a, 0xcb, 0x05, 0xec, 0x00, 0x00,
|
||||||
|
0x00,
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ExampleData) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ExampleData) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ExampleData) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.Amount != 0 {
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(m.Amount))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x10
|
||||||
|
}
|
||||||
|
if len(m.Account) > 0 {
|
||||||
|
i -= len(m.Account)
|
||||||
|
copy(dAtA[i:], m.Account)
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(len(m.Account)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeVarintState(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovState(v)
|
||||||
|
base := offset
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
|
v >>= 7
|
||||||
|
offset++
|
||||||
|
}
|
||||||
|
dAtA[offset] = uint8(v)
|
||||||
|
return base
|
||||||
|
}
|
||||||
|
func (m *ExampleData) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = len(m.Account)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovState(uint64(l))
|
||||||
|
}
|
||||||
|
if m.Amount != 0 {
|
||||||
|
n += 1 + sovState(uint64(m.Amount))
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func sovState(x uint64) (n int) {
|
||||||
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
|
}
|
||||||
|
func sozState(x uint64) (n int) {
|
||||||
|
return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
|
}
|
||||||
|
func (m *ExampleData) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: ExampleData: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: ExampleData: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType)
|
||||||
|
}
|
||||||
|
var byteLen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
byteLen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if byteLen < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + byteLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Account = append(m.Account[:0], dAtA[iNdEx:postIndex]...)
|
||||||
|
if m.Account == nil {
|
||||||
|
m.Account = []byte{}
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
|
||||||
|
}
|
||||||
|
m.Amount = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
m.Amount |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipState(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func skipState(dAtA []byte) (n int, err error) {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
switch wireType {
|
||||||
|
case 0:
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx++
|
||||||
|
if dAtA[iNdEx-1] < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
iNdEx += 8
|
||||||
|
case 2:
|
||||||
|
var length int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
length |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length < 0 {
|
||||||
|
return 0, ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
iNdEx += length
|
||||||
|
case 3:
|
||||||
|
depth++
|
||||||
|
case 4:
|
||||||
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupState
|
||||||
|
}
|
||||||
|
depth--
|
||||||
|
case 5:
|
||||||
|
iNdEx += 4
|
||||||
|
default:
|
||||||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
|
ErrIntOverflowState = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group")
|
||||||
|
)
|
601
x/macaroon/types/tx.pb.go
Normal file
601
x/macaroon/types/tx.pb.go
Normal file
@ -0,0 +1,601 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: macaroon/v1/tx.proto
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
fmt "fmt"
|
||||||
|
_ "github.com/cosmos/cosmos-proto"
|
||||||
|
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||||
|
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||||
|
grpc1 "github.com/cosmos/gogoproto/grpc"
|
||||||
|
proto "github.com/cosmos/gogoproto/proto"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
io "io"
|
||||||
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
|
// MsgUpdateParams is the Msg/UpdateParams request type.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
type MsgUpdateParams struct {
|
||||||
|
// authority is the address of the governance account.
|
||||||
|
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||||
|
// params defines the parameters to update.
|
||||||
|
//
|
||||||
|
// NOTE: All parameters must be supplied.
|
||||||
|
Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} }
|
||||||
|
func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*MsgUpdateParams) ProtoMessage() {}
|
||||||
|
func (*MsgUpdateParams) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_68f908349d9da51a, []int{0}
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_MsgUpdateParams.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *MsgUpdateParams) GetAuthority() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Authority
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParams) GetParams() Params {
|
||||||
|
if m != nil {
|
||||||
|
return m.Params
|
||||||
|
}
|
||||||
|
return Params{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||||
|
// MsgUpdateParams message.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
type MsgUpdateParamsResponse struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} }
|
||||||
|
func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*MsgUpdateParamsResponse) ProtoMessage() {}
|
||||||
|
func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_68f908349d9da51a, []int{1}
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParamsResponse) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*MsgUpdateParams)(nil), "macaroon.v1.MsgUpdateParams")
|
||||||
|
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "macaroon.v1.MsgUpdateParamsResponse")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("macaroon/v1/tx.proto", fileDescriptor_68f908349d9da51a) }
|
||||||
|
|
||||||
|
var fileDescriptor_68f908349d9da51a = []byte{
|
||||||
|
// 318 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc9, 0x4d, 0x4c, 0x4e,
|
||||||
|
0x2c, 0xca, 0xcf, 0xcf, 0xd3, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9,
|
||||||
|
0x17, 0xe2, 0x86, 0x89, 0xea, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb,
|
||||||
|
0xe7, 0x16, 0xa7, 0x83, 0x14, 0xe5, 0x16, 0xa7, 0x43, 0x54, 0x49, 0x49, 0x22, 0xeb, 0x4d, 0x4f,
|
||||||
|
0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0x86, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x99, 0xfa, 0x20,
|
||||||
|
0x16, 0x4c, 0x03, 0xc4, 0xa4, 0x78, 0x88, 0x04, 0x84, 0x03, 0x91, 0x52, 0xea, 0x61, 0xe4, 0xe2,
|
||||||
|
0xf7, 0x2d, 0x4e, 0x0f, 0x2d, 0x48, 0x49, 0x2c, 0x49, 0x0d, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0x16,
|
||||||
|
0x32, 0xe3, 0xe2, 0x4c, 0x2c, 0x2d, 0xc9, 0xc8, 0x2f, 0xca, 0x2c, 0xa9, 0x94, 0x60, 0x54, 0x60,
|
||||||
|
0xd4, 0xe0, 0x74, 0x92, 0xb8, 0xb4, 0x45, 0x57, 0x04, 0xaa, 0xd1, 0x31, 0x25, 0xa5, 0x28, 0xb5,
|
||||||
|
0xb8, 0x38, 0xb8, 0xa4, 0x28, 0x33, 0x2f, 0x3d, 0x08, 0xa1, 0x54, 0xc8, 0x90, 0x8b, 0xad, 0x00,
|
||||||
|
0x6c, 0x82, 0x04, 0x93, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0xb0, 0x1e, 0x92, 0x77, 0xf4, 0x20, 0x86,
|
||||||
|
0x3b, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, 0x55, 0x68, 0xc5, 0xd7, 0xf4, 0x7c, 0x83, 0x16,
|
||||||
|
0xc2, 0x08, 0x25, 0x49, 0x2e, 0x71, 0x34, 0xd7, 0x04, 0xa5, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7,
|
||||||
|
0x1a, 0x25, 0x70, 0x31, 0xfb, 0x16, 0xa7, 0x0b, 0x05, 0x71, 0xf1, 0xa0, 0x38, 0x56, 0x06, 0xc5,
|
||||||
|
0x12, 0x34, 0xcd, 0x52, 0x2a, 0xf8, 0x64, 0x61, 0x46, 0x4b, 0xb1, 0x36, 0x3c, 0xdf, 0xa0, 0xc5,
|
||||||
|
0xe8, 0xe4, 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e,
|
||||||
|
0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xea, 0xe9, 0x99,
|
||||||
|
0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xf9, 0x79, 0xc5, 0xf9, 0x79, 0x45, 0xfa,
|
||||||
|
0x60, 0xa2, 0x42, 0x1f, 0x1e, 0x15, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x50, 0x35,
|
||||||
|
0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x6f, 0xc5, 0x76, 0xac, 0xdf, 0x01, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ context.Context
|
||||||
|
var _ grpc.ClientConn
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
const _ = grpc.SupportPackageIsVersion4
|
||||||
|
|
||||||
|
// MsgClient is the client API for Msg service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||||
|
type MsgClient interface {
|
||||||
|
// UpdateParams defines a governance operation for updating the parameters.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type msgClient struct {
|
||||||
|
cc grpc1.ClientConn
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMsgClient(cc grpc1.ClientConn) MsgClient {
|
||||||
|
return &msgClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||||
|
out := new(MsgUpdateParamsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/macaroon.v1.Msg/UpdateParams", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgServer is the server API for Msg service.
|
||||||
|
type MsgServer interface {
|
||||||
|
// UpdateParams defines a governance operation for updating the parameters.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedMsgServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
|
||||||
|
s.RegisterService(&_Msg_serviceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MsgUpdateParams)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/macaroon.v1.Msg/UpdateParams",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "macaroon.v1.Msg",
|
||||||
|
HandlerType: (*MsgServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "UpdateParams",
|
||||||
|
Handler: _Msg_UpdateParams_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "macaroon/v1/tx.proto",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
{
|
||||||
|
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintTx(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
if len(m.Authority) > 0 {
|
||||||
|
i -= len(m.Authority)
|
||||||
|
copy(dAtA[i:], m.Authority)
|
||||||
|
i = encodeVarintTx(dAtA, i, uint64(len(m.Authority)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovTx(v)
|
||||||
|
base := offset
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
|
v >>= 7
|
||||||
|
offset++
|
||||||
|
}
|
||||||
|
dAtA[offset] = uint8(v)
|
||||||
|
return base
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = len(m.Authority)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovTx(uint64(l))
|
||||||
|
}
|
||||||
|
l = m.Params.Size()
|
||||||
|
n += 1 + l + sovTx(uint64(l))
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParamsResponse) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func sovTx(x uint64) (n int) {
|
||||||
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
|
}
|
||||||
|
func sozTx(x uint64) (n int) {
|
||||||
|
return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Authority = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipTx(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipTx(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func skipTx(dAtA []byte) (n int, err error) {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
switch wireType {
|
||||||
|
case 0:
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx++
|
||||||
|
if dAtA[iNdEx-1] < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
iNdEx += 8
|
||||||
|
case 2:
|
||||||
|
var length int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
length |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length < 0 {
|
||||||
|
return 0, ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
iNdEx += length
|
||||||
|
case 3:
|
||||||
|
depth++
|
||||||
|
case 4:
|
||||||
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupTx
|
||||||
|
}
|
||||||
|
depth--
|
||||||
|
case 5:
|
||||||
|
iNdEx += 4
|
||||||
|
default:
|
||||||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
|
ErrIntOverflowTx = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
|
||||||
|
)
|
3
x/service/README.md
Normal file
3
x/service/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Example Module
|
||||||
|
|
||||||
|
This is a module base generated with [`spawn`](https://github.com/rollchains/spawn).
|
31
x/service/autocli.go
Normal file
31
x/service/autocli.go
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package module
|
||||||
|
|
||||||
|
import (
|
||||||
|
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||||
|
modulev1 "github.com/onsonr/sonr/api/service/v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 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: "Query the current consensus parameters",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Tx: &autocliv1.ServiceCommandDescriptor{
|
||||||
|
Service: modulev1.Msg_ServiceDesc.ServiceName,
|
||||||
|
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||||
|
{
|
||||||
|
RpcMethod: "UpdateParams",
|
||||||
|
Skip: false, // set to true if authority gated
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
50
x/service/client/cli/query.go
Normal file
50
x/service/client/cli/query.go
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package cli
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/service/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
||||||
|
|
||||||
|
func GetQueryCmd() *cobra.Command {
|
||||||
|
queryCmd := &cobra.Command{
|
||||||
|
Use: types.ModuleName,
|
||||||
|
Short: "Querying commands for " + types.ModuleName,
|
||||||
|
DisableFlagParsing: true,
|
||||||
|
SuggestionsMinimumDistance: 2,
|
||||||
|
RunE: client.ValidateCmd,
|
||||||
|
}
|
||||||
|
queryCmd.AddCommand(
|
||||||
|
GetCmdParams(),
|
||||||
|
)
|
||||||
|
return queryCmd
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetCmdParams() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{
|
||||||
|
Use: "params",
|
||||||
|
Short: "Show all module params",
|
||||||
|
Args: cobra.ExactArgs(0),
|
||||||
|
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
|
||||||
|
}
|
71
x/service/client/cli/tx.go
Normal file
71
x/service/client/cli/tx.go
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
package cli
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||||
|
"github.com/cosmos/cosmos-sdk/client/tx"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/service/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
||||||
|
|
||||||
|
// NewTxCmd returns a root CLI command handler for certain modules
|
||||||
|
// transaction commands.
|
||||||
|
func NewTxCmd() *cobra.Command {
|
||||||
|
txCmd := &cobra.Command{
|
||||||
|
Use: types.ModuleName,
|
||||||
|
Short: types.ModuleName + " subcommands.",
|
||||||
|
DisableFlagParsing: true,
|
||||||
|
SuggestionsMinimumDistance: 2,
|
||||||
|
RunE: client.ValidateCmd,
|
||||||
|
}
|
||||||
|
|
||||||
|
txCmd.AddCommand(
|
||||||
|
MsgUpdateParams(),
|
||||||
|
)
|
||||||
|
return txCmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns a CLI command handler for registering a
|
||||||
|
// contract for the module.
|
||||||
|
func MsgUpdateParams() *cobra.Command {
|
||||||
|
cmd := &cobra.Command{
|
||||||
|
Use: "update-params [some-value]",
|
||||||
|
Short: "Update the params (must be submitted from the authority)",
|
||||||
|
Args: cobra.ExactArgs(1),
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
cliCtx, err := client.GetClientTxContext(cmd)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
senderAddress := cliCtx.GetFromAddress()
|
||||||
|
|
||||||
|
someValue, err := strconv.ParseBool(args[0])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
msg := &types.MsgUpdateParams{
|
||||||
|
Authority: senderAddress.String(),
|
||||||
|
Params: types.Params{
|
||||||
|
SomeValue: someValue,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := msg.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), msg)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
flags.AddTxFlagsToCmd(cmd)
|
||||||
|
return cmd
|
||||||
|
}
|
63
x/service/depinject.go
Normal file
63
x/service/depinject.go
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
package module
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
|
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||||
|
|
||||||
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||||
|
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||||
|
|
||||||
|
"cosmossdk.io/core/address"
|
||||||
|
"cosmossdk.io/core/appmodule"
|
||||||
|
"cosmossdk.io/core/store"
|
||||||
|
"cosmossdk.io/depinject"
|
||||||
|
"cosmossdk.io/log"
|
||||||
|
|
||||||
|
modulev1 "github.com/onsonr/sonr/api/service/module/v1"
|
||||||
|
"github.com/onsonr/sonr/x/service/keeper"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ appmodule.AppModule = AppModule{}
|
||||||
|
|
||||||
|
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
|
||||||
|
func (am AppModule) IsOnePerModuleType() {}
|
||||||
|
|
||||||
|
// IsAppModule implements the appmodule.AppModule interface.
|
||||||
|
func (am AppModule) IsAppModule() {}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
appmodule.Register(
|
||||||
|
&modulev1.Module{},
|
||||||
|
appmodule.Provide(ProvideModule),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
type ModuleInputs struct {
|
||||||
|
depinject.In
|
||||||
|
|
||||||
|
Cdc codec.Codec
|
||||||
|
StoreService store.KVStoreService
|
||||||
|
AddressCodec address.Codec
|
||||||
|
|
||||||
|
StakingKeeper stakingkeeper.Keeper
|
||||||
|
SlashingKeeper slashingkeeper.Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
type ModuleOutputs struct {
|
||||||
|
depinject.Out
|
||||||
|
|
||||||
|
Module appmodule.AppModule
|
||||||
|
Keeper keeper.Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
||||||
|
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||||
|
|
||||||
|
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr)
|
||||||
|
m := NewAppModule(in.Cdc, k)
|
||||||
|
|
||||||
|
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
|
||||||
|
}
|
25
x/service/keeper/genesis_test.go
Normal file
25
x/service/keeper/genesis_test.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package keeper_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/service/types"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestGenesis(t *testing.T) {
|
||||||
|
f := SetupTest(t)
|
||||||
|
|
||||||
|
genesisState := &types.GenesisState{
|
||||||
|
Params: types.DefaultParams(),
|
||||||
|
|
||||||
|
// this line is used by starport scaffolding # genesis/test/state
|
||||||
|
}
|
||||||
|
|
||||||
|
f.k.InitGenesis(f.ctx, genesisState)
|
||||||
|
|
||||||
|
got := f.k.ExportGenesis(f.ctx)
|
||||||
|
require.NotNil(t, got)
|
||||||
|
|
||||||
|
// this line is used by starport scaffolding # genesis/test/assert
|
||||||
|
}
|
104
x/service/keeper/keeper.go
Normal file
104
x/service/keeper/keeper.go
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
package keeper
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
|
||||||
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||||
|
|
||||||
|
"cosmossdk.io/collections"
|
||||||
|
storetypes "cosmossdk.io/core/store"
|
||||||
|
"cosmossdk.io/log"
|
||||||
|
"cosmossdk.io/orm/model/ormdb"
|
||||||
|
|
||||||
|
apiv1 "github.com/onsonr/sonr/api/service/v1"
|
||||||
|
"github.com/onsonr/sonr/x/service/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Keeper struct {
|
||||||
|
cdc codec.BinaryCodec
|
||||||
|
|
||||||
|
logger log.Logger
|
||||||
|
|
||||||
|
// state management
|
||||||
|
Schema collections.Schema
|
||||||
|
Params collections.Item[types.Params]
|
||||||
|
OrmDB apiv1.StateStore
|
||||||
|
|
||||||
|
authority string
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewKeeper creates a new Keeper instance
|
||||||
|
func NewKeeper(
|
||||||
|
cdc codec.BinaryCodec,
|
||||||
|
storeService storetypes.KVStoreService,
|
||||||
|
logger log.Logger,
|
||||||
|
authority string,
|
||||||
|
) Keeper {
|
||||||
|
logger = logger.With(log.ModuleKey, "x/"+types.ModuleName)
|
||||||
|
|
||||||
|
sb := collections.NewSchemaBuilder(storeService)
|
||||||
|
|
||||||
|
if authority == "" {
|
||||||
|
authority = authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||||
|
}
|
||||||
|
|
||||||
|
db, err := ormdb.NewModuleDB(&types.ORMModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService})
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
store, err := apiv1.NewStateStore(db)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
k := Keeper{
|
||||||
|
cdc: cdc,
|
||||||
|
logger: logger,
|
||||||
|
|
||||||
|
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
|
||||||
|
OrmDB: store,
|
||||||
|
|
||||||
|
authority: authority,
|
||||||
|
}
|
||||||
|
|
||||||
|
schema, err := sb.Build()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
k.Schema = schema
|
||||||
|
|
||||||
|
return k
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k Keeper) Logger() log.Logger {
|
||||||
|
return k.logger
|
||||||
|
}
|
||||||
|
|
||||||
|
// InitGenesis initializes the module's state from a genesis state.
|
||||||
|
func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error {
|
||||||
|
// this line is used by starport scaffolding # genesis/module/init
|
||||||
|
if err := data.Params.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return k.Params.Set(ctx, data.Params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExportGenesis exports the module's state to a genesis state.
|
||||||
|
func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState {
|
||||||
|
params, err := k.Params.Get(ctx)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// this line is used by starport scaffolding # genesis/module/export
|
||||||
|
|
||||||
|
return &types.GenesisState{
|
||||||
|
Params: params,
|
||||||
|
}
|
||||||
|
}
|
142
x/service/keeper/keeper_test.go
Normal file
142
x/service/keeper/keeper_test.go
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
package keeper_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
|
"cosmossdk.io/log"
|
||||||
|
storetypes "cosmossdk.io/store/types"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/runtime"
|
||||||
|
"github.com/cosmos/cosmos-sdk/testutil"
|
||||||
|
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
|
||||||
|
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
|
||||||
|
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||||
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
|
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||||
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||||
|
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
|
||||||
|
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||||
|
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||||
|
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||||
|
|
||||||
|
"cosmossdk.io/core/store"
|
||||||
|
|
||||||
|
module "github.com/onsonr/sonr/x/service"
|
||||||
|
"github.com/onsonr/sonr/x/service/keeper"
|
||||||
|
"github.com/onsonr/sonr/x/service/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
var maccPerms = map[string][]string{
|
||||||
|
authtypes.FeeCollectorName: nil,
|
||||||
|
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
|
||||||
|
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
|
||||||
|
minttypes.ModuleName: {authtypes.Minter},
|
||||||
|
govtypes.ModuleName: {authtypes.Burner},
|
||||||
|
}
|
||||||
|
|
||||||
|
type testFixture struct {
|
||||||
|
suite.Suite
|
||||||
|
|
||||||
|
ctx sdk.Context
|
||||||
|
k keeper.Keeper
|
||||||
|
msgServer types.MsgServer
|
||||||
|
queryServer types.QueryServer
|
||||||
|
appModule *module.AppModule
|
||||||
|
|
||||||
|
accountkeeper authkeeper.AccountKeeper
|
||||||
|
bankkeeper bankkeeper.BaseKeeper
|
||||||
|
stakingKeeper *stakingkeeper.Keeper
|
||||||
|
mintkeeper mintkeeper.Keeper
|
||||||
|
|
||||||
|
addrs []sdk.AccAddress
|
||||||
|
govModAddr string
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetupTest(t *testing.T) *testFixture {
|
||||||
|
t.Helper()
|
||||||
|
f := new(testFixture)
|
||||||
|
require := require.New(t)
|
||||||
|
|
||||||
|
// Base setup
|
||||||
|
logger := log.NewTestLogger(t)
|
||||||
|
encCfg := moduletestutil.MakeTestEncodingConfig()
|
||||||
|
|
||||||
|
f.govModAddr = authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||||
|
f.addrs = simtestutil.CreateIncrementalAccounts(3)
|
||||||
|
|
||||||
|
key := storetypes.NewKVStoreKey(types.ModuleName)
|
||||||
|
storeService := runtime.NewKVStoreService(key)
|
||||||
|
testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test"))
|
||||||
|
|
||||||
|
f.ctx = testCtx.Ctx
|
||||||
|
|
||||||
|
// Register SDK modules.
|
||||||
|
registerBaseSDKModules(f, encCfg, storeService, logger, require)
|
||||||
|
|
||||||
|
// Setup Keeper.
|
||||||
|
f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr)
|
||||||
|
f.msgServer = keeper.NewMsgServerImpl(f.k)
|
||||||
|
f.queryServer = keeper.NewQuerier(f.k)
|
||||||
|
f.appModule = module.NewAppModule(encCfg.Codec, f.k)
|
||||||
|
|
||||||
|
return f
|
||||||
|
}
|
||||||
|
|
||||||
|
func registerModuleInterfaces(encCfg moduletestutil.TestEncodingConfig) {
|
||||||
|
authtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||||
|
stakingtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||||
|
|
||||||
|
types.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||||
|
}
|
||||||
|
|
||||||
|
func registerBaseSDKModules(
|
||||||
|
f *testFixture,
|
||||||
|
encCfg moduletestutil.TestEncodingConfig,
|
||||||
|
storeService store.KVStoreService,
|
||||||
|
logger log.Logger,
|
||||||
|
require *require.Assertions,
|
||||||
|
) {
|
||||||
|
registerModuleInterfaces(encCfg)
|
||||||
|
|
||||||
|
// Auth Keeper.
|
||||||
|
f.accountkeeper = authkeeper.NewAccountKeeper(
|
||||||
|
encCfg.Codec, storeService,
|
||||||
|
authtypes.ProtoBaseAccount,
|
||||||
|
maccPerms,
|
||||||
|
authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix,
|
||||||
|
f.govModAddr,
|
||||||
|
)
|
||||||
|
|
||||||
|
// Bank Keeper.
|
||||||
|
f.bankkeeper = bankkeeper.NewBaseKeeper(
|
||||||
|
encCfg.Codec, storeService,
|
||||||
|
f.accountkeeper,
|
||||||
|
nil,
|
||||||
|
f.govModAddr, logger,
|
||||||
|
)
|
||||||
|
|
||||||
|
// Staking Keeper.
|
||||||
|
f.stakingKeeper = stakingkeeper.NewKeeper(
|
||||||
|
encCfg.Codec, storeService,
|
||||||
|
f.accountkeeper, f.bankkeeper, f.govModAddr,
|
||||||
|
authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr),
|
||||||
|
authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr),
|
||||||
|
)
|
||||||
|
require.NoError(f.stakingKeeper.SetParams(f.ctx, stakingtypes.DefaultParams()))
|
||||||
|
f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetNotBondedPool(f.ctx))
|
||||||
|
f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetBondedPool(f.ctx))
|
||||||
|
|
||||||
|
// Mint Keeper.
|
||||||
|
f.mintkeeper = mintkeeper.NewKeeper(
|
||||||
|
encCfg.Codec, storeService,
|
||||||
|
f.stakingKeeper, f.accountkeeper, f.bankkeeper,
|
||||||
|
authtypes.FeeCollectorName, f.govModAddr,
|
||||||
|
)
|
||||||
|
f.accountkeeper.SetModuleAccount(f.ctx, f.accountkeeper.GetModuleAccount(f.ctx, minttypes.ModuleName))
|
||||||
|
f.mintkeeper.InitGenesis(f.ctx, f.accountkeeper, minttypes.DefaultGenesisState())
|
||||||
|
}
|
29
x/service/keeper/msg_server.go
Normal file
29
x/service/keeper/msg_server.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package keeper
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||||
|
|
||||||
|
"cosmossdk.io/errors"
|
||||||
|
"github.com/onsonr/sonr/x/service/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
type msgServer struct {
|
||||||
|
k Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ types.MsgServer = msgServer{}
|
||||||
|
|
||||||
|
// NewMsgServerImpl returns an implementation of the module MsgServer interface.
|
||||||
|
func NewMsgServerImpl(keeper Keeper) types.MsgServer {
|
||||||
|
return &msgServer{k: keeper}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
|
||||||
|
if ms.k.authority != msg.Authority {
|
||||||
|
return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, ms.k.Params.Set(ctx, msg.Params)
|
||||||
|
}
|
56
x/service/keeper/msg_server_test.go
Normal file
56
x/service/keeper/msg_server_test.go
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
package keeper_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/service/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestParams(t *testing.T) {
|
||||||
|
f := SetupTest(t)
|
||||||
|
require := require.New(t)
|
||||||
|
|
||||||
|
testCases := []struct {
|
||||||
|
name string
|
||||||
|
request *types.MsgUpdateParams
|
||||||
|
err bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "fail; invalid authority",
|
||||||
|
request: &types.MsgUpdateParams{
|
||||||
|
Authority: f.addrs[0].String(),
|
||||||
|
Params: types.DefaultParams(),
|
||||||
|
},
|
||||||
|
err: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "success",
|
||||||
|
request: &types.MsgUpdateParams{
|
||||||
|
Authority: f.govModAddr,
|
||||||
|
Params: types.DefaultParams(),
|
||||||
|
},
|
||||||
|
err: false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tc := range testCases {
|
||||||
|
tc := tc
|
||||||
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
_, err := f.msgServer.UpdateParams(f.ctx, tc.request)
|
||||||
|
|
||||||
|
if tc.err {
|
||||||
|
require.Error(err)
|
||||||
|
} else {
|
||||||
|
require.NoError(err)
|
||||||
|
|
||||||
|
r, err := f.queryServer.Params(f.ctx, &types.QueryParamsRequest{})
|
||||||
|
require.NoError(err)
|
||||||
|
|
||||||
|
require.EqualValues(&tc.request.Params, r.Params)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
31
x/service/keeper/orm_test.go
Normal file
31
x/service/keeper/orm_test.go
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package keeper_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
apiv1 "github.com/onsonr/sonr/api/service/v1"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestORM(t *testing.T) {
|
||||||
|
f := SetupTest(t)
|
||||||
|
|
||||||
|
dt := f.k.OrmDB.ExampleDataTable()
|
||||||
|
acc := []byte("test_acc")
|
||||||
|
amt := uint64(7)
|
||||||
|
|
||||||
|
err := dt.Insert(f.ctx, &apiv1.ExampleData{
|
||||||
|
Account: acc,
|
||||||
|
Amount: amt,
|
||||||
|
})
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
d, err := dt.Has(f.ctx, []byte("test_acc"))
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.True(t, d)
|
||||||
|
|
||||||
|
res, err := dt.Get(f.ctx, []byte("test_acc"))
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.NotNil(t, res)
|
||||||
|
require.EqualValues(t, amt, res.Amount)
|
||||||
|
}
|
30
x/service/keeper/query_server.go
Normal file
30
x/service/keeper/query_server.go
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package keeper
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/service/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ types.QueryServer = Querier{}
|
||||||
|
|
||||||
|
type Querier struct {
|
||||||
|
Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewQuerier(keeper Keeper) Querier {
|
||||||
|
return Querier{Keeper: keeper}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
|
||||||
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
|
|
||||||
|
p, err := k.Keeper.Params.Get(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &types.QueryParamsResponse{Params: &p}, nil
|
||||||
|
}
|
149
x/service/module.go
Normal file
149
x/service/module.go
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
package module
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
|
||||||
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||||
|
|
||||||
|
abci "github.com/cometbft/cometbft/abci/types"
|
||||||
|
|
||||||
|
"cosmossdk.io/client/v2/autocli"
|
||||||
|
errorsmod "cosmossdk.io/errors"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/module"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/service/keeper"
|
||||||
|
"github.com/onsonr/sonr/x/service/types"
|
||||||
|
// this line is used by starport scaffolding # 1
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// ConsensusVersion defines the current x/service module consensus version.
|
||||||
|
ConsensusVersion = 1
|
||||||
|
|
||||||
|
// this line is used by starport scaffolding # simapp/module/const
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_ module.AppModuleBasic = AppModuleBasic{}
|
||||||
|
_ module.AppModuleGenesis = AppModule{}
|
||||||
|
_ module.AppModule = AppModule{}
|
||||||
|
|
||||||
|
_ autocli.HasAutoCLIConfig = AppModule{}
|
||||||
|
)
|
||||||
|
|
||||||
|
// AppModuleBasic defines the basic application module used by the wasm module.
|
||||||
|
type AppModuleBasic struct {
|
||||||
|
cdc codec.Codec
|
||||||
|
}
|
||||||
|
|
||||||
|
type AppModule struct {
|
||||||
|
AppModuleBasic
|
||||||
|
|
||||||
|
keeper keeper.Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAppModule constructor
|
||||||
|
func NewAppModule(
|
||||||
|
cdc codec.Codec,
|
||||||
|
keeper keeper.Keeper,
|
||||||
|
) *AppModule {
|
||||||
|
return &AppModule{
|
||||||
|
AppModuleBasic: AppModuleBasic{cdc: cdc},
|
||||||
|
keeper: keeper,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) Name() string {
|
||||||
|
return types.ModuleName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
|
||||||
|
return cdc.MustMarshalJSON(&types.GenesisState{
|
||||||
|
Params: types.DefaultParams(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error {
|
||||||
|
var data types.GenesisState
|
||||||
|
err := marshaler.UnmarshalJSON(message, &data)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := data.Params.Validate(); err != nil {
|
||||||
|
return errorsmod.Wrap(err, "params")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
|
||||||
|
err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx))
|
||||||
|
if err != nil {
|
||||||
|
// same behavior as in cosmos-sdk
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable in favor of autocli.go. If you wish to use these, it will override AutoCLI methods.
|
||||||
|
/*
|
||||||
|
func (a AppModuleBasic) GetTxCmd() *cobra.Command {
|
||||||
|
return cli.NewTxCmd()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) GetQueryCmd() *cobra.Command {
|
||||||
|
return cli.GetQueryCmd()
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||||
|
types.RegisterLegacyAminoCodec(cdc)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModuleBasic) RegisterInterfaces(r codectypes.InterfaceRegistry) {
|
||||||
|
types.RegisterInterfaces(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate {
|
||||||
|
var genesisState types.GenesisState
|
||||||
|
marshaler.MustUnmarshalJSON(message, &genesisState)
|
||||||
|
|
||||||
|
if err := a.keeper.Params.Set(ctx, genesisState.Params); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage {
|
||||||
|
genState := a.keeper.ExportGenesis(ctx)
|
||||||
|
return marshaler.MustMarshalJSON(genState)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModule) QuerierRoute() string {
|
||||||
|
return types.QuerierRoute
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a AppModule) RegisterServices(cfg module.Configurator) {
|
||||||
|
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(a.keeper))
|
||||||
|
types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQuerier(a.keeper))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 (a AppModule) ConsensusVersion() uint64 {
|
||||||
|
return ConsensusVersion
|
||||||
|
}
|
37
x/service/types/codec.go
Normal file
37
x/service/types/codec.go
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec/types"
|
||||||
|
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||||
|
// this line is used by starport scaffolding # 1
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
amino = codec.NewLegacyAmino()
|
||||||
|
AminoCdc = codec.NewAminoCodec(amino)
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
RegisterLegacyAminoCodec(amino)
|
||||||
|
cryptocodec.RegisterCrypto(amino)
|
||||||
|
sdk.RegisterLegacyAminoCodec(amino)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec
|
||||||
|
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||||
|
cdc.RegisterConcrete(&MsgUpdateParams{}, ModuleName+"/MsgUpdateParams", nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||||
|
// this line is used by starport scaffolding # 3
|
||||||
|
|
||||||
|
registry.RegisterImplementations(
|
||||||
|
(*sdk.Msg)(nil),
|
||||||
|
&MsgUpdateParams{},
|
||||||
|
)
|
||||||
|
|
||||||
|
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
||||||
|
}
|
22
x/service/types/genesis.go
Normal file
22
x/service/types/genesis.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
// 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()
|
||||||
|
}
|
510
x/service/types/genesis.pb.go
Normal file
510
x/service/types/genesis.pb.go
Normal file
@ -0,0 +1,510 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: service/v1/genesis.proto
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
fmt "fmt"
|
||||||
|
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
|
||||||
|
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||||
|
proto "github.com/cosmos/gogoproto/proto"
|
||||||
|
io "io"
|
||||||
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
|
// GenesisState defines the module genesis state
|
||||||
|
type GenesisState struct {
|
||||||
|
// Params defines all the parameters of the module.
|
||||||
|
Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GenesisState) Reset() { *m = GenesisState{} }
|
||||||
|
func (m *GenesisState) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*GenesisState) ProtoMessage() {}
|
||||||
|
func (*GenesisState) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_0ce55e499988823a, []int{0}
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_GenesisState.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *GenesisState) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_GenesisState.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_GenesisState proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *GenesisState) GetParams() Params {
|
||||||
|
if m != nil {
|
||||||
|
return m.Params
|
||||||
|
}
|
||||||
|
return Params{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Params defines the set of module parameters.
|
||||||
|
type Params struct {
|
||||||
|
SomeValue bool `protobuf:"varint,2,opt,name=some_value,json=someValue,proto3" json:"some_value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) Reset() { *m = Params{} }
|
||||||
|
func (*Params) ProtoMessage() {}
|
||||||
|
func (*Params) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_0ce55e499988823a, []int{1}
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Params.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Params.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Params) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Params.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Params proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *Params) GetSomeValue() bool {
|
||||||
|
if m != nil {
|
||||||
|
return m.SomeValue
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*GenesisState)(nil), "service.v1.GenesisState")
|
||||||
|
proto.RegisterType((*Params)(nil), "service.v1.Params")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("service/v1/genesis.proto", fileDescriptor_0ce55e499988823a) }
|
||||||
|
|
||||||
|
var fileDescriptor_0ce55e499988823a = []byte{
|
||||||
|
// 244 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x28, 0x4e, 0x2d, 0x2a,
|
||||||
|
0xcb, 0x4c, 0x4e, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b,
|
||||||
|
0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0xca, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7,
|
||||||
|
0xe7, 0x83, 0x85, 0xf5, 0x41, 0x2c, 0x88, 0x0a, 0x29, 0xc1, 0xc4, 0xdc, 0xcc, 0xbc, 0x7c, 0x7d,
|
||||||
|
0x30, 0x09, 0x11, 0x52, 0x72, 0xe0, 0xe2, 0x71, 0x87, 0x98, 0x12, 0x5c, 0x92, 0x58, 0x92, 0x2a,
|
||||||
|
0x64, 0xc0, 0xc5, 0x56, 0x90, 0x58, 0x94, 0x98, 0x5b, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d,
|
||||||
|
0x24, 0xa4, 0x87, 0x30, 0x55, 0x2f, 0x00, 0x2c, 0xe3, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10,
|
||||||
|
0x54, 0x9d, 0x92, 0x0b, 0x17, 0x1b, 0x44, 0x5c, 0x48, 0x96, 0x8b, 0xab, 0x38, 0x3f, 0x37, 0x35,
|
||||||
|
0xbe, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x49, 0x81, 0x51, 0x83, 0x23, 0x88, 0x13, 0x24, 0x12,
|
||||||
|
0x06, 0x12, 0xb0, 0x92, 0x9e, 0xb1, 0x40, 0x9e, 0xe1, 0xc5, 0x02, 0x79, 0xc6, 0xae, 0xe7, 0x1b,
|
||||||
|
0xb4, 0xf8, 0x60, 0xde, 0x80, 0x98, 0xe2, 0xe4, 0x70, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72,
|
||||||
|
0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7,
|
||||||
|
0x72, 0x0c, 0x51, 0x6a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xf9,
|
||||||
|
0x79, 0xc5, 0xf9, 0x79, 0x45, 0xfa, 0x60, 0xa2, 0x42, 0x1f, 0x66, 0x44, 0x49, 0x65, 0x41, 0x6a,
|
||||||
|
0x71, 0x12, 0x1b, 0xd8, 0x43, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd2, 0xe9, 0x1e, 0x39,
|
||||||
|
0x21, 0x01, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Params) Equal(that interface{}) bool {
|
||||||
|
if that == nil {
|
||||||
|
return this == nil
|
||||||
|
}
|
||||||
|
|
||||||
|
that1, ok := that.(*Params)
|
||||||
|
if !ok {
|
||||||
|
that2, ok := that.(Params)
|
||||||
|
if ok {
|
||||||
|
that1 = &that2
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if that1 == nil {
|
||||||
|
return this == nil
|
||||||
|
} else if this == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if this.SomeValue != that1.SomeValue {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
{
|
||||||
|
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintGenesis(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.SomeValue {
|
||||||
|
i--
|
||||||
|
if m.SomeValue {
|
||||||
|
dAtA[i] = 1
|
||||||
|
} else {
|
||||||
|
dAtA[i] = 0
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x10
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovGenesis(v)
|
||||||
|
base := offset
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
|
v >>= 7
|
||||||
|
offset++
|
||||||
|
}
|
||||||
|
dAtA[offset] = uint8(v)
|
||||||
|
return base
|
||||||
|
}
|
||||||
|
func (m *GenesisState) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = m.Params.Size()
|
||||||
|
n += 1 + l + sovGenesis(uint64(l))
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.SomeValue {
|
||||||
|
n += 2
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func sovGenesis(x uint64) (n int) {
|
||||||
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
|
}
|
||||||
|
func sozGenesis(x uint64) (n int) {
|
||||||
|
return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
|
}
|
||||||
|
func (m *GenesisState) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: GenesisState: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipGenesis(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (m *Params) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: Params: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 2:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field SomeValue", wireType)
|
||||||
|
}
|
||||||
|
var v int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
v |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.SomeValue = bool(v != 0)
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipGenesis(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func skipGenesis(dAtA []byte) (n int, err error) {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
switch wireType {
|
||||||
|
case 0:
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx++
|
||||||
|
if dAtA[iNdEx-1] < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
iNdEx += 8
|
||||||
|
case 2:
|
||||||
|
var length int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowGenesis
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
length |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length < 0 {
|
||||||
|
return 0, ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
iNdEx += length
|
||||||
|
case 3:
|
||||||
|
depth++
|
||||||
|
case 4:
|
||||||
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupGenesis
|
||||||
|
}
|
||||||
|
depth--
|
||||||
|
case 5:
|
||||||
|
iNdEx += 4
|
||||||
|
default:
|
||||||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthGenesis
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
|
ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
|
||||||
|
)
|
42
x/service/types/genesis_test.go
Normal file
42
x/service/types/genesis_test.go
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package types_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/onsonr/sonr/x/service/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)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
27
x/service/types/keys.go
Normal file
27
x/service/types/keys.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"cosmossdk.io/collections"
|
||||||
|
|
||||||
|
ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
// ParamsKey saves the current module params.
|
||||||
|
ParamsKey = collections.NewPrefix(0)
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
ModuleName = "service"
|
||||||
|
|
||||||
|
StoreKey = ModuleName
|
||||||
|
|
||||||
|
QuerierRoute = ModuleName
|
||||||
|
)
|
||||||
|
|
||||||
|
var ORMModuleSchema = ormv1alpha1.ModuleSchemaDescriptor{
|
||||||
|
SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{
|
||||||
|
{Id: 1, ProtoFileName: "service/v1/state.proto"},
|
||||||
|
},
|
||||||
|
Prefix: []byte{0},
|
||||||
|
}
|
49
x/service/types/msgs.go
Normal file
49
x/service/types/msgs.go
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"cosmossdk.io/errors"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_ sdk.Msg = &MsgUpdateParams{}
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewMsgUpdateParams creates new instance of MsgUpdateParams
|
||||||
|
func NewMsgUpdateParams(
|
||||||
|
sender sdk.Address,
|
||||||
|
someValue bool,
|
||||||
|
) *MsgUpdateParams {
|
||||||
|
return &MsgUpdateParams{
|
||||||
|
Authority: sender.String(),
|
||||||
|
Params: Params{
|
||||||
|
SomeValue: someValue,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Route returns the name of the module
|
||||||
|
func (msg MsgUpdateParams) Route() string { return ModuleName }
|
||||||
|
|
||||||
|
// Type returns the the action
|
||||||
|
func (msg MsgUpdateParams) Type() string { return "update_params" }
|
||||||
|
|
||||||
|
// GetSignBytes implements the LegacyMsg interface.
|
||||||
|
func (msg MsgUpdateParams) GetSignBytes() []byte {
|
||||||
|
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg))
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSigners returns the expected signers for a MsgUpdateParams message.
|
||||||
|
func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress {
|
||||||
|
addr, _ := sdk.AccAddressFromBech32(msg.Authority)
|
||||||
|
return []sdk.AccAddress{addr}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidateBasic does a sanity check on the provided data.
|
||||||
|
func (msg *MsgUpdateParams) Validate() error {
|
||||||
|
if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil {
|
||||||
|
return errors.Wrap(err, "invalid authority address")
|
||||||
|
}
|
||||||
|
|
||||||
|
return msg.Params.Validate()
|
||||||
|
}
|
29
x/service/types/params.go
Normal file
29
x/service/types/params.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DefaultParams returns default module parameters.
|
||||||
|
func DefaultParams() Params {
|
||||||
|
// TODO:
|
||||||
|
return Params{
|
||||||
|
SomeValue: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stringer method for Params.
|
||||||
|
func (p Params) String() string {
|
||||||
|
bz, err := json.Marshal(p)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return string(bz)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate does the sanity check on the params.
|
||||||
|
func (p Params) Validate() error {
|
||||||
|
// TODO:
|
||||||
|
return nil
|
||||||
|
}
|
539
x/service/types/query.pb.go
Normal file
539
x/service/types/query.pb.go
Normal file
@ -0,0 +1,539 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: service/v1/query.proto
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
fmt "fmt"
|
||||||
|
grpc1 "github.com/cosmos/gogoproto/grpc"
|
||||||
|
proto "github.com/cosmos/gogoproto/proto"
|
||||||
|
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
io "io"
|
||||||
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
|
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
||||||
|
type QueryParamsRequest struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} }
|
||||||
|
func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*QueryParamsRequest) ProtoMessage() {}
|
||||||
|
func (*QueryParamsRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_d0ed234bfe4ffc68, []int{0}
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_QueryParamsRequest.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo
|
||||||
|
|
||||||
|
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
||||||
|
type QueryParamsResponse struct {
|
||||||
|
// params defines the parameters of the module.
|
||||||
|
Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} }
|
||||||
|
func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*QueryParamsResponse) ProtoMessage() {}
|
||||||
|
func (*QueryParamsResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_d0ed234bfe4ffc68, []int{1}
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_QueryParamsResponse.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) GetParams() *Params {
|
||||||
|
if m != nil {
|
||||||
|
return m.Params
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*QueryParamsRequest)(nil), "service.v1.QueryParamsRequest")
|
||||||
|
proto.RegisterType((*QueryParamsResponse)(nil), "service.v1.QueryParamsResponse")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("service/v1/query.proto", fileDescriptor_d0ed234bfe4ffc68) }
|
||||||
|
|
||||||
|
var fileDescriptor_d0ed234bfe4ffc68 = []byte{
|
||||||
|
// 251 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2b, 0x4e, 0x2d, 0x2a,
|
||||||
|
0xcb, 0x4c, 0x4e, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca,
|
||||||
|
0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x8a, 0xeb, 0x95, 0x19, 0x4a, 0xc9, 0xa4, 0xe7, 0xe7, 0xa7, 0xe7,
|
||||||
|
0xa4, 0xea, 0x27, 0x16, 0x64, 0xea, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7,
|
||||||
|
0x15, 0x43, 0x54, 0x4a, 0x49, 0x20, 0x99, 0x90, 0x9e, 0x9a, 0x97, 0x5a, 0x9c, 0x09, 0x95, 0x51,
|
||||||
|
0x12, 0xe1, 0x12, 0x0a, 0x04, 0x19, 0x19, 0x90, 0x58, 0x94, 0x98, 0x5b, 0x1c, 0x94, 0x5a, 0x58,
|
||||||
|
0x9a, 0x5a, 0x5c, 0xa2, 0xe4, 0xc8, 0x25, 0x8c, 0x22, 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x2a,
|
||||||
|
0xa4, 0xc5, 0xc5, 0x56, 0x00, 0x16, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x12, 0xd2, 0x43,
|
||||||
|
0xb8, 0x40, 0x0f, 0xaa, 0x16, 0xaa, 0xc2, 0x28, 0x8f, 0x8b, 0x15, 0x6c, 0x84, 0x50, 0x2a, 0x17,
|
||||||
|
0x1b, 0x44, 0x4a, 0x48, 0x0e, 0x59, 0x39, 0xa6, 0xad, 0x52, 0xf2, 0x38, 0xe5, 0x21, 0xf6, 0x2b,
|
||||||
|
0x49, 0x35, 0x5d, 0x7e, 0x32, 0x99, 0x49, 0x44, 0x48, 0x48, 0x1f, 0xc9, 0x3f, 0x10, 0xfb, 0x9c,
|
||||||
|
0x1c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f,
|
||||||
|
0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x2d, 0x3d, 0xb3, 0x24,
|
||||||
|
0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x3f, 0xaf, 0x38, 0x3f, 0xaf, 0x48, 0x1f, 0x4c,
|
||||||
|
0x54, 0xc0, 0x4d, 0x29, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x87, 0x88, 0x31, 0x20, 0x00,
|
||||||
|
0x00, 0xff, 0xff, 0x3e, 0xda, 0x0a, 0xaf, 0x6f, 0x01, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ context.Context
|
||||||
|
var _ grpc.ClientConn
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
const _ = grpc.SupportPackageIsVersion4
|
||||||
|
|
||||||
|
// QueryClient is the client API for Query service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||||
|
type QueryClient interface {
|
||||||
|
// Params queries all parameters of the module.
|
||||||
|
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type queryClient struct {
|
||||||
|
cc grpc1.ClientConn
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewQueryClient(cc grpc1.ClientConn) QueryClient {
|
||||||
|
return &queryClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
||||||
|
out := new(QueryParamsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/service.v1.Query/Params", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryServer is the server API for Query service.
|
||||||
|
type QueryServer interface {
|
||||||
|
// Params queries all parameters of the module.
|
||||||
|
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedQueryServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
|
||||||
|
s.RegisterService(&_Query_serviceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(QueryParamsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(QueryServer).Params(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/service.v1.Query/Params",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _Query_serviceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "service.v1.Query",
|
||||||
|
HandlerType: (*QueryServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Params",
|
||||||
|
Handler: _Query_Params_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "service/v1/query.proto",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.Params != nil {
|
||||||
|
{
|
||||||
|
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintQuery(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovQuery(v)
|
||||||
|
base := offset
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
|
v >>= 7
|
||||||
|
offset++
|
||||||
|
}
|
||||||
|
dAtA[offset] = uint8(v)
|
||||||
|
return base
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.Params != nil {
|
||||||
|
l = m.Params.Size()
|
||||||
|
n += 1 + l + sovQuery(uint64(l))
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func sovQuery(x uint64) (n int) {
|
||||||
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
|
}
|
||||||
|
func sozQuery(x uint64) (n int) {
|
||||||
|
return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if m.Params == nil {
|
||||||
|
m.Params = &Params{}
|
||||||
|
}
|
||||||
|
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func skipQuery(dAtA []byte) (n int, err error) {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
switch wireType {
|
||||||
|
case 0:
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx++
|
||||||
|
if dAtA[iNdEx-1] < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
iNdEx += 8
|
||||||
|
case 2:
|
||||||
|
var length int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
length |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length < 0 {
|
||||||
|
return 0, ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
iNdEx += length
|
||||||
|
case 3:
|
||||||
|
depth++
|
||||||
|
case 4:
|
||||||
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupQuery
|
||||||
|
}
|
||||||
|
depth--
|
||||||
|
case 5:
|
||||||
|
iNdEx += 4
|
||||||
|
default:
|
||||||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
|
ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
|
||||||
|
)
|
153
x/service/types/query.pb.gw.go
Normal file
153
x/service/types/query.pb.gw.go
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||||
|
// source: service/v1/query.proto
|
||||||
|
|
||||||
|
/*
|
||||||
|
Package types is a reverse proxy.
|
||||||
|
|
||||||
|
It translates gRPC into RESTful JSON APIs.
|
||||||
|
*/
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/descriptor"
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||||
|
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
"google.golang.org/grpc/codes"
|
||||||
|
"google.golang.org/grpc/grpclog"
|
||||||
|
"google.golang.org/grpc/metadata"
|
||||||
|
"google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Suppress "imported and not used" errors
|
||||||
|
var _ codes.Code
|
||||||
|
var _ io.Reader
|
||||||
|
var _ status.Status
|
||||||
|
var _ = runtime.String
|
||||||
|
var _ = utilities.NewDoubleArray
|
||||||
|
var _ = descriptor.ForMessage
|
||||||
|
var _ = metadata.Join
|
||||||
|
|
||||||
|
func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq QueryParamsRequest
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq QueryParamsRequest
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
msg, err := server.Params(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
|
// UnaryRPC :call QueryServer directly.
|
||||||
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
|
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
var stream runtime.ServerTransportStream
|
||||||
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but
|
||||||
|
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||||
|
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||||
|
conn, err := grpc.Dial(endpoint, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
if err != nil {
|
||||||
|
if cerr := conn.Close(); cerr != nil {
|
||||||
|
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
go func() {
|
||||||
|
<-ctx.Done()
|
||||||
|
if cerr := conn.Close(); cerr != nil {
|
||||||
|
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}()
|
||||||
|
|
||||||
|
return RegisterQueryHandler(ctx, mux, conn)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterQueryHandler registers the http handlers for service Query to "mux".
|
||||||
|
// The handlers forward requests to the grpc endpoint over "conn".
|
||||||
|
func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||||
|
return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn))
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterQueryHandlerClient registers the http handlers for service Query
|
||||||
|
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient".
|
||||||
|
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient"
|
||||||
|
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||||
|
// "QueryClient" to call the correct interceptors.
|
||||||
|
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error {
|
||||||
|
|
||||||
|
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"service", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
forward_Query_Params_0 = runtime.ForwardResponseMessage
|
||||||
|
)
|
355
x/service/types/state.pb.go
Normal file
355
x/service/types/state.pb.go
Normal file
@ -0,0 +1,355 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: service/v1/state.proto
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "cosmossdk.io/orm"
|
||||||
|
fmt "fmt"
|
||||||
|
proto "github.com/cosmos/gogoproto/proto"
|
||||||
|
io "io"
|
||||||
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
|
type ExampleData struct {
|
||||||
|
Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
|
||||||
|
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ExampleData) Reset() { *m = ExampleData{} }
|
||||||
|
func (m *ExampleData) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*ExampleData) ProtoMessage() {}
|
||||||
|
func (*ExampleData) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_ab6e3654a2974847, []int{0}
|
||||||
|
}
|
||||||
|
func (m *ExampleData) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *ExampleData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_ExampleData.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *ExampleData) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_ExampleData.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *ExampleData) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *ExampleData) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_ExampleData.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_ExampleData proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *ExampleData) GetAccount() []byte {
|
||||||
|
if m != nil {
|
||||||
|
return m.Account
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ExampleData) GetAmount() uint64 {
|
||||||
|
if m != nil {
|
||||||
|
return m.Amount
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*ExampleData)(nil), "service.v1.ExampleData")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("service/v1/state.proto", fileDescriptor_ab6e3654a2974847) }
|
||||||
|
|
||||||
|
var fileDescriptor_ab6e3654a2974847 = []byte{
|
||||||
|
// 208 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2b, 0x4e, 0x2d, 0x2a,
|
||||||
|
0xcb, 0x4c, 0x4e, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca,
|
||||||
|
0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x8a, 0xeb, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7, 0xe6,
|
||||||
|
0x17, 0xeb, 0xe7, 0x17, 0xe5, 0x82, 0x94, 0xe5, 0x17, 0xe5, 0x42, 0x14, 0x29, 0x25, 0x70, 0x71,
|
||||||
|
0xbb, 0x56, 0x24, 0xe6, 0x16, 0xe4, 0xa4, 0xba, 0x24, 0x96, 0x24, 0x0a, 0x49, 0x70, 0xb1, 0x27,
|
||||||
|
0x26, 0x27, 0xe7, 0x97, 0xe6, 0x95, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x04, 0xc1, 0xb8, 0x42,
|
||||||
|
0x62, 0x5c, 0x6c, 0x89, 0xb9, 0x60, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x96, 0x20, 0x28, 0xcf, 0x4a,
|
||||||
|
0xfe, 0xd3, 0xbc, 0xcb, 0x7d, 0xcc, 0x92, 0x5c, 0x9c, 0x70, 0x9d, 0x42, 0x5c, 0x30, 0xa5, 0x02,
|
||||||
|
0x8c, 0x12, 0x8c, 0x4e, 0x0e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91,
|
||||||
|
0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5,
|
||||||
|
0x96, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x9f, 0x57, 0x9c, 0x9f,
|
||||||
|
0x57, 0xa4, 0x0f, 0x26, 0x2a, 0xf4, 0x61, 0x3e, 0x2a, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03,
|
||||||
|
0x3b, 0xd5, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x97, 0x09, 0x5f, 0xe9, 0x00, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ExampleData) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ExampleData) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ExampleData) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.Amount != 0 {
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(m.Amount))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x10
|
||||||
|
}
|
||||||
|
if len(m.Account) > 0 {
|
||||||
|
i -= len(m.Account)
|
||||||
|
copy(dAtA[i:], m.Account)
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(len(m.Account)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeVarintState(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovState(v)
|
||||||
|
base := offset
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
|
v >>= 7
|
||||||
|
offset++
|
||||||
|
}
|
||||||
|
dAtA[offset] = uint8(v)
|
||||||
|
return base
|
||||||
|
}
|
||||||
|
func (m *ExampleData) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = len(m.Account)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovState(uint64(l))
|
||||||
|
}
|
||||||
|
if m.Amount != 0 {
|
||||||
|
n += 1 + sovState(uint64(m.Amount))
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func sovState(x uint64) (n int) {
|
||||||
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
|
}
|
||||||
|
func sozState(x uint64) (n int) {
|
||||||
|
return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
|
}
|
||||||
|
func (m *ExampleData) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: ExampleData: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: ExampleData: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType)
|
||||||
|
}
|
||||||
|
var byteLen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
byteLen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if byteLen < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + byteLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Account = append(m.Account[:0], dAtA[iNdEx:postIndex]...)
|
||||||
|
if m.Account == nil {
|
||||||
|
m.Account = []byte{}
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
|
||||||
|
}
|
||||||
|
m.Amount = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
m.Amount |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipState(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func skipState(dAtA []byte) (n int, err error) {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
switch wireType {
|
||||||
|
case 0:
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx++
|
||||||
|
if dAtA[iNdEx-1] < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
iNdEx += 8
|
||||||
|
case 2:
|
||||||
|
var length int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
length |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length < 0 {
|
||||||
|
return 0, ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
iNdEx += length
|
||||||
|
case 3:
|
||||||
|
depth++
|
||||||
|
case 4:
|
||||||
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupState
|
||||||
|
}
|
||||||
|
depth--
|
||||||
|
case 5:
|
||||||
|
iNdEx += 4
|
||||||
|
default:
|
||||||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
|
ErrIntOverflowState = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group")
|
||||||
|
)
|
601
x/service/types/tx.pb.go
Normal file
601
x/service/types/tx.pb.go
Normal file
@ -0,0 +1,601 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: service/v1/tx.proto
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
fmt "fmt"
|
||||||
|
_ "github.com/cosmos/cosmos-proto"
|
||||||
|
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||||
|
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||||
|
grpc1 "github.com/cosmos/gogoproto/grpc"
|
||||||
|
proto "github.com/cosmos/gogoproto/proto"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
io "io"
|
||||||
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
|
// MsgUpdateParams is the Msg/UpdateParams request type.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
type MsgUpdateParams struct {
|
||||||
|
// authority is the address of the governance account.
|
||||||
|
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||||
|
// params defines the parameters to update.
|
||||||
|
//
|
||||||
|
// NOTE: All parameters must be supplied.
|
||||||
|
Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} }
|
||||||
|
func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*MsgUpdateParams) ProtoMessage() {}
|
||||||
|
func (*MsgUpdateParams) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_361c6b19b8fa4769, []int{0}
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_MsgUpdateParams.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *MsgUpdateParams) GetAuthority() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Authority
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParams) GetParams() Params {
|
||||||
|
if m != nil {
|
||||||
|
return m.Params
|
||||||
|
}
|
||||||
|
return Params{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||||
|
// MsgUpdateParams message.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
type MsgUpdateParamsResponse struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} }
|
||||||
|
func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*MsgUpdateParamsResponse) ProtoMessage() {}
|
||||||
|
func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_361c6b19b8fa4769, []int{1}
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParamsResponse) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*MsgUpdateParams)(nil), "service.v1.MsgUpdateParams")
|
||||||
|
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "service.v1.MsgUpdateParamsResponse")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("service/v1/tx.proto", fileDescriptor_361c6b19b8fa4769) }
|
||||||
|
|
||||||
|
var fileDescriptor_361c6b19b8fa4769 = []byte{
|
||||||
|
// 318 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2e, 0x4e, 0x2d, 0x2a,
|
||||||
|
0xcb, 0x4c, 0x4e, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
|
||||||
|
0xe2, 0x82, 0x0a, 0xea, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb, 0xe7,
|
||||||
|
0x16, 0xa7, 0x83, 0xd4, 0xe4, 0x16, 0xa7, 0x43, 0x14, 0x49, 0x49, 0x20, 0xe9, 0x4c, 0x4f, 0xcd,
|
||||||
|
0x4b, 0x2d, 0xce, 0x2c, 0x86, 0xca, 0x88, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x99, 0xfa, 0x20, 0x16,
|
||||||
|
0x54, 0x54, 0x12, 0x62, 0x50, 0x3c, 0x44, 0x02, 0xc2, 0x81, 0x48, 0x29, 0x75, 0x33, 0x72, 0xf1,
|
||||||
|
0xfb, 0x16, 0xa7, 0x87, 0x16, 0xa4, 0x24, 0x96, 0xa4, 0x06, 0x24, 0x16, 0x25, 0xe6, 0x16, 0x0b,
|
||||||
|
0x99, 0x71, 0x71, 0x26, 0x96, 0x96, 0x64, 0xe4, 0x17, 0x65, 0x96, 0x54, 0x4a, 0x30, 0x2a, 0x30,
|
||||||
|
0x6a, 0x70, 0x3a, 0x49, 0x5c, 0xda, 0xa2, 0x2b, 0x02, 0xd5, 0xe8, 0x98, 0x92, 0x52, 0x94, 0x5a,
|
||||||
|
0x5c, 0x1c, 0x5c, 0x52, 0x94, 0x99, 0x97, 0x1e, 0x84, 0x50, 0x2a, 0x64, 0xc0, 0xc5, 0x56, 0x00,
|
||||||
|
0x36, 0x41, 0x82, 0x49, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x48, 0x0f, 0xe1, 0x19, 0x3d, 0x88, 0xd9,
|
||||||
|
0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xd5, 0x59, 0xf1, 0x35, 0x3d, 0xdf, 0xa0, 0x85,
|
||||||
|
0x30, 0x41, 0x49, 0x92, 0x4b, 0x1c, 0xcd, 0x31, 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9,
|
||||||
|
0x46, 0x71, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, 0x01, 0x5c, 0x3c, 0x28, 0x6e, 0x95, 0x46, 0xb6,
|
||||||
|
0x03, 0x4d, 0xaf, 0x94, 0x32, 0x1e, 0x49, 0x98, 0xc1, 0x52, 0xac, 0x0d, 0xcf, 0x37, 0x68, 0x31,
|
||||||
|
0x3a, 0x39, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13,
|
||||||
|
0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x5a, 0x7a, 0x66,
|
||||||
|
0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x7e, 0x5e, 0x71, 0x7e, 0x5e, 0x91, 0x3e,
|
||||||
|
0x98, 0xa8, 0xd0, 0x87, 0x45, 0x43, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x44, 0x8d,
|
||||||
|
0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x93, 0xc5, 0x53, 0x9b, 0xd8, 0x01, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ context.Context
|
||||||
|
var _ grpc.ClientConn
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
const _ = grpc.SupportPackageIsVersion4
|
||||||
|
|
||||||
|
// MsgClient is the client API for Msg service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||||
|
type MsgClient interface {
|
||||||
|
// UpdateParams defines a governance operation for updating the parameters.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type msgClient struct {
|
||||||
|
cc grpc1.ClientConn
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMsgClient(cc grpc1.ClientConn) MsgClient {
|
||||||
|
return &msgClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||||
|
out := new(MsgUpdateParamsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/service.v1.Msg/UpdateParams", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgServer is the server API for Msg service.
|
||||||
|
type MsgServer interface {
|
||||||
|
// UpdateParams defines a governance operation for updating the parameters.
|
||||||
|
//
|
||||||
|
// Since: cosmos-sdk 0.47
|
||||||
|
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedMsgServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
|
||||||
|
s.RegisterService(&_Msg_serviceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MsgUpdateParams)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/service.v1.Msg/UpdateParams",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "service.v1.Msg",
|
||||||
|
HandlerType: (*MsgServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "UpdateParams",
|
||||||
|
Handler: _Msg_UpdateParams_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "service/v1/tx.proto",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
{
|
||||||
|
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintTx(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
if len(m.Authority) > 0 {
|
||||||
|
i -= len(m.Authority)
|
||||||
|
copy(dAtA[i:], m.Authority)
|
||||||
|
i = encodeVarintTx(dAtA, i, uint64(len(m.Authority)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovTx(v)
|
||||||
|
base := offset
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
|
v >>= 7
|
||||||
|
offset++
|
||||||
|
}
|
||||||
|
dAtA[offset] = uint8(v)
|
||||||
|
return base
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = len(m.Authority)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovTx(uint64(l))
|
||||||
|
}
|
||||||
|
l = m.Params.Size()
|
||||||
|
n += 1 + l + sovTx(uint64(l))
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgUpdateParamsResponse) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func sovTx(x uint64) (n int) {
|
||||||
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
|
}
|
||||||
|
func sozTx(x uint64) (n int) {
|
||||||
|
return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Authority = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipTx(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipTx(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func skipTx(dAtA []byte) (n int, err error) {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
switch wireType {
|
||||||
|
case 0:
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx++
|
||||||
|
if dAtA[iNdEx-1] < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
iNdEx += 8
|
||||||
|
case 2:
|
||||||
|
var length int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowTx
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
length |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length < 0 {
|
||||||
|
return 0, ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
iNdEx += length
|
||||||
|
case 3:
|
||||||
|
depth++
|
||||||
|
case 4:
|
||||||
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupTx
|
||||||
|
}
|
||||||
|
depth--
|
||||||
|
case 5:
|
||||||
|
iNdEx += 4
|
||||||
|
default:
|
||||||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthTx
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
|
ErrIntOverflowTx = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user