Setup and plumbing for registry module (#4)

Reviewed-on: deep-stack/laconic2d#4
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
Prathamesh Musale 2024-02-15 07:08:32 +00:00 committed by ashwin
parent a36063aba6
commit de489a4d21
41 changed files with 56671 additions and 29 deletions

View File

@ -0,0 +1,505 @@
// 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_cerc_registry_module_v1_module_proto_init()
md_Module = File_cerc_registry_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_cerc_registry_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: cerc.registry.module.v1.Module"))
}
panic(fmt.Errorf("message cerc.registry.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: cerc.registry.module.v1.Module"))
}
panic(fmt.Errorf("message cerc.registry.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: cerc.registry.module.v1.Module"))
}
panic(fmt.Errorf("message cerc.registry.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: cerc.registry.module.v1.Module"))
}
panic(fmt.Errorf("message cerc.registry.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: cerc.registry.module.v1.Module"))
}
panic(fmt.Errorf("message cerc.registry.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: cerc.registry.module.v1.Module"))
}
panic(fmt.Errorf("message cerc.registry.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 cerc.registry.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: cerc/registry/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_cerc_registry_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_cerc_registry_module_v1_module_proto_rawDescGZIP(), []int{0}
}
var File_cerc_registry_module_v1_module_proto protoreflect.FileDescriptor
var file_cerc_registry_module_v1_module_proto_rawDesc = []byte{
0x0a, 0x24, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f,
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x72, 0x65, 0x67,
0x69, 0x73, 0x74, 0x72, 0x79, 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, 0x39, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x2f, 0xba, 0xc0, 0x96,
0xda, 0x01, 0x29, 0x0a, 0x27, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f,
0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x32,
0x64, 0x2f, 0x78, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x42, 0xec, 0x01, 0x0a,
0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74,
0x72, 0x79, 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, 0x41, 0x67, 0x69, 0x74,
0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f,
0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x32, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65,
0x72, 0x63, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x6d, 0x6f, 0x64, 0x75,
0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02,
0x03, 0x43, 0x52, 0x4d, 0xaa, 0x02, 0x17, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x52, 0x65, 0x67, 0x69,
0x73, 0x74, 0x72, 0x79, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02,
0x17, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x4d,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x65, 0x72, 0x63, 0x5c,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c,
0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
0x1a, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a,
0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_cerc_registry_module_v1_module_proto_rawDescOnce sync.Once
file_cerc_registry_module_v1_module_proto_rawDescData = file_cerc_registry_module_v1_module_proto_rawDesc
)
func file_cerc_registry_module_v1_module_proto_rawDescGZIP() []byte {
file_cerc_registry_module_v1_module_proto_rawDescOnce.Do(func() {
file_cerc_registry_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cerc_registry_module_v1_module_proto_rawDescData)
})
return file_cerc_registry_module_v1_module_proto_rawDescData
}
var file_cerc_registry_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_cerc_registry_module_v1_module_proto_goTypes = []interface{}{
(*Module)(nil), // 0: cerc.registry.module.v1.Module
}
var file_cerc_registry_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_cerc_registry_module_v1_module_proto_init() }
func file_cerc_registry_module_v1_module_proto_init() {
if File_cerc_registry_module_v1_module_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_cerc_registry_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_cerc_registry_module_v1_module_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_cerc_registry_module_v1_module_proto_goTypes,
DependencyIndexes: file_cerc_registry_module_v1_module_proto_depIdxs,
MessageInfos: file_cerc_registry_module_v1_module_proto_msgTypes,
}.Build()
File_cerc_registry_module_v1_module_proto = out.File
file_cerc_registry_module_v1_module_proto_rawDesc = nil
file_cerc_registry_module_v1_module_proto_goTypes = nil
file_cerc_registry_module_v1_module_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,501 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: cerc/registry/v1/query.proto
package registryv1
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 = "/cerc.registry.v1.Query/Params"
Query_Records_FullMethodName = "/cerc.registry.v1.Query/Records"
Query_GetRecord_FullMethodName = "/cerc.registry.v1.Query/GetRecord"
Query_GetRecordsByBondId_FullMethodName = "/cerc.registry.v1.Query/GetRecordsByBondId"
Query_NameRecords_FullMethodName = "/cerc.registry.v1.Query/NameRecords"
Query_Whois_FullMethodName = "/cerc.registry.v1.Query/Whois"
Query_LookupCrn_FullMethodName = "/cerc.registry.v1.Query/LookupCrn"
Query_ResolveCrn_FullMethodName = "/cerc.registry.v1.Query/ResolveCrn"
Query_GetRecordExpiryQueue_FullMethodName = "/cerc.registry.v1.Query/GetRecordExpiryQueue"
Query_GetAuthorityExpiryQueue_FullMethodName = "/cerc.registry.v1.Query/GetAuthorityExpiryQueue"
Query_GetRegistryModuleBalance_FullMethodName = "/cerc.registry.v1.Query/GetRegistryModuleBalance"
)
// 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 the registry module params.
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// Records queries all records
Records(ctx context.Context, in *QueryRecordsRequest, opts ...grpc.CallOption) (*QueryRecordsResponse, error)
// Get record by id
GetRecord(ctx context.Context, in *QueryRecordByIdRequest, opts ...grpc.CallOption) (*QueryRecordByIdResponse, error)
// Get records by bond id
GetRecordsByBondId(ctx context.Context, in *QueryRecordsByBondIdRequest, opts ...grpc.CallOption) (*QueryRecordsByBondIdResponse, error)
// NameRecords queries all name records
NameRecords(ctx context.Context, in *QueryNameRecordsRequest, opts ...grpc.CallOption) (*QueryNameRecordsResponse, error)
// Whois method retrieve the name authority info
Whois(ctx context.Context, in *QueryWhoisRequest, opts ...grpc.CallOption) (*QueryWhoisResponse, error)
// LookupCrn
LookupCrn(ctx context.Context, in *QueryLookupCrnRequest, opts ...grpc.CallOption) (*QueryLookupCrnResponse, error)
// ResolveCrn
ResolveCrn(ctx context.Context, in *QueryResolveCrnRequest, opts ...grpc.CallOption) (*QueryResolveCrnResponse, error)
// GetRecordExpiryQueue
GetRecordExpiryQueue(ctx context.Context, in *QueryGetRecordExpiryQueueRequest, opts ...grpc.CallOption) (*QueryGetRecordExpiryQueueResponse, error)
// GetAuthorityExpiryQueue
GetAuthorityExpiryQueue(ctx context.Context, in *QueryGetAuthorityExpiryQueueRequest, opts ...grpc.CallOption) (*QueryGetAuthorityExpiryQueueResponse, error)
// Get registry module balance
GetRegistryModuleBalance(ctx context.Context, in *QueryGetRegistryModuleBalanceRequest, opts ...grpc.CallOption) (*QueryGetRegistryModuleBalanceResponse, 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
}
func (c *queryClient) Records(ctx context.Context, in *QueryRecordsRequest, opts ...grpc.CallOption) (*QueryRecordsResponse, error) {
out := new(QueryRecordsResponse)
err := c.cc.Invoke(ctx, Query_Records_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) GetRecord(ctx context.Context, in *QueryRecordByIdRequest, opts ...grpc.CallOption) (*QueryRecordByIdResponse, error) {
out := new(QueryRecordByIdResponse)
err := c.cc.Invoke(ctx, Query_GetRecord_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) GetRecordsByBondId(ctx context.Context, in *QueryRecordsByBondIdRequest, opts ...grpc.CallOption) (*QueryRecordsByBondIdResponse, error) {
out := new(QueryRecordsByBondIdResponse)
err := c.cc.Invoke(ctx, Query_GetRecordsByBondId_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) NameRecords(ctx context.Context, in *QueryNameRecordsRequest, opts ...grpc.CallOption) (*QueryNameRecordsResponse, error) {
out := new(QueryNameRecordsResponse)
err := c.cc.Invoke(ctx, Query_NameRecords_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Whois(ctx context.Context, in *QueryWhoisRequest, opts ...grpc.CallOption) (*QueryWhoisResponse, error) {
out := new(QueryWhoisResponse)
err := c.cc.Invoke(ctx, Query_Whois_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) LookupCrn(ctx context.Context, in *QueryLookupCrnRequest, opts ...grpc.CallOption) (*QueryLookupCrnResponse, error) {
out := new(QueryLookupCrnResponse)
err := c.cc.Invoke(ctx, Query_LookupCrn_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) ResolveCrn(ctx context.Context, in *QueryResolveCrnRequest, opts ...grpc.CallOption) (*QueryResolveCrnResponse, error) {
out := new(QueryResolveCrnResponse)
err := c.cc.Invoke(ctx, Query_ResolveCrn_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) GetRecordExpiryQueue(ctx context.Context, in *QueryGetRecordExpiryQueueRequest, opts ...grpc.CallOption) (*QueryGetRecordExpiryQueueResponse, error) {
out := new(QueryGetRecordExpiryQueueResponse)
err := c.cc.Invoke(ctx, Query_GetRecordExpiryQueue_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) GetAuthorityExpiryQueue(ctx context.Context, in *QueryGetAuthorityExpiryQueueRequest, opts ...grpc.CallOption) (*QueryGetAuthorityExpiryQueueResponse, error) {
out := new(QueryGetAuthorityExpiryQueueResponse)
err := c.cc.Invoke(ctx, Query_GetAuthorityExpiryQueue_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) GetRegistryModuleBalance(ctx context.Context, in *QueryGetRegistryModuleBalanceRequest, opts ...grpc.CallOption) (*QueryGetRegistryModuleBalanceResponse, error) {
out := new(QueryGetRegistryModuleBalanceResponse)
err := c.cc.Invoke(ctx, Query_GetRegistryModuleBalance_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 the registry module params.
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
// Records queries all records
Records(context.Context, *QueryRecordsRequest) (*QueryRecordsResponse, error)
// Get record by id
GetRecord(context.Context, *QueryRecordByIdRequest) (*QueryRecordByIdResponse, error)
// Get records by bond id
GetRecordsByBondId(context.Context, *QueryRecordsByBondIdRequest) (*QueryRecordsByBondIdResponse, error)
// NameRecords queries all name records
NameRecords(context.Context, *QueryNameRecordsRequest) (*QueryNameRecordsResponse, error)
// Whois method retrieve the name authority info
Whois(context.Context, *QueryWhoisRequest) (*QueryWhoisResponse, error)
// LookupCrn
LookupCrn(context.Context, *QueryLookupCrnRequest) (*QueryLookupCrnResponse, error)
// ResolveCrn
ResolveCrn(context.Context, *QueryResolveCrnRequest) (*QueryResolveCrnResponse, error)
// GetRecordExpiryQueue
GetRecordExpiryQueue(context.Context, *QueryGetRecordExpiryQueueRequest) (*QueryGetRecordExpiryQueueResponse, error)
// GetAuthorityExpiryQueue
GetAuthorityExpiryQueue(context.Context, *QueryGetAuthorityExpiryQueueRequest) (*QueryGetAuthorityExpiryQueueResponse, error)
// Get registry module balance
GetRegistryModuleBalance(context.Context, *QueryGetRegistryModuleBalanceRequest) (*QueryGetRegistryModuleBalanceResponse, 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) Records(context.Context, *QueryRecordsRequest) (*QueryRecordsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Records not implemented")
}
func (UnimplementedQueryServer) GetRecord(context.Context, *QueryRecordByIdRequest) (*QueryRecordByIdResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRecord not implemented")
}
func (UnimplementedQueryServer) GetRecordsByBondId(context.Context, *QueryRecordsByBondIdRequest) (*QueryRecordsByBondIdResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRecordsByBondId not implemented")
}
func (UnimplementedQueryServer) NameRecords(context.Context, *QueryNameRecordsRequest) (*QueryNameRecordsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method NameRecords not implemented")
}
func (UnimplementedQueryServer) Whois(context.Context, *QueryWhoisRequest) (*QueryWhoisResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Whois not implemented")
}
func (UnimplementedQueryServer) LookupCrn(context.Context, *QueryLookupCrnRequest) (*QueryLookupCrnResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LookupCrn not implemented")
}
func (UnimplementedQueryServer) ResolveCrn(context.Context, *QueryResolveCrnRequest) (*QueryResolveCrnResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResolveCrn not implemented")
}
func (UnimplementedQueryServer) GetRecordExpiryQueue(context.Context, *QueryGetRecordExpiryQueueRequest) (*QueryGetRecordExpiryQueueResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRecordExpiryQueue not implemented")
}
func (UnimplementedQueryServer) GetAuthorityExpiryQueue(context.Context, *QueryGetAuthorityExpiryQueueRequest) (*QueryGetAuthorityExpiryQueueResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetAuthorityExpiryQueue not implemented")
}
func (UnimplementedQueryServer) GetRegistryModuleBalance(context.Context, *QueryGetRegistryModuleBalanceRequest) (*QueryGetRegistryModuleBalanceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRegistryModuleBalance 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)
}
func _Query_Records_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryRecordsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Records(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Records_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Records(ctx, req.(*QueryRecordsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_GetRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryRecordByIdRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetRecord(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetRecord_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetRecord(ctx, req.(*QueryRecordByIdRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_GetRecordsByBondId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryRecordsByBondIdRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetRecordsByBondId(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetRecordsByBondId_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetRecordsByBondId(ctx, req.(*QueryRecordsByBondIdRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_NameRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryNameRecordsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).NameRecords(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_NameRecords_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).NameRecords(ctx, req.(*QueryNameRecordsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Whois_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryWhoisRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Whois(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Whois_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Whois(ctx, req.(*QueryWhoisRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_LookupCrn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryLookupCrnRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).LookupCrn(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_LookupCrn_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).LookupCrn(ctx, req.(*QueryLookupCrnRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_ResolveCrn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryResolveCrnRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).ResolveCrn(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_ResolveCrn_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).ResolveCrn(ctx, req.(*QueryResolveCrnRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_GetRecordExpiryQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetRecordExpiryQueueRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetRecordExpiryQueue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetRecordExpiryQueue_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetRecordExpiryQueue(ctx, req.(*QueryGetRecordExpiryQueueRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_GetAuthorityExpiryQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetAuthorityExpiryQueueRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetAuthorityExpiryQueue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetAuthorityExpiryQueue_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetAuthorityExpiryQueue(ctx, req.(*QueryGetAuthorityExpiryQueueRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_GetRegistryModuleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetRegistryModuleBalanceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetRegistryModuleBalance(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetRegistryModuleBalance_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetRegistryModuleBalance(ctx, req.(*QueryGetRegistryModuleBalanceRequest))
}
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: "cerc.registry.v1.Query",
HandlerType: (*QueryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Params",
Handler: _Query_Params_Handler,
},
{
MethodName: "Records",
Handler: _Query_Records_Handler,
},
{
MethodName: "GetRecord",
Handler: _Query_GetRecord_Handler,
},
{
MethodName: "GetRecordsByBondId",
Handler: _Query_GetRecordsByBondId_Handler,
},
{
MethodName: "NameRecords",
Handler: _Query_NameRecords_Handler,
},
{
MethodName: "Whois",
Handler: _Query_Whois_Handler,
},
{
MethodName: "LookupCrn",
Handler: _Query_LookupCrn_Handler,
},
{
MethodName: "ResolveCrn",
Handler: _Query_ResolveCrn_Handler,
},
{
MethodName: "GetRecordExpiryQueue",
Handler: _Query_GetRecordExpiryQueue_Handler,
},
{
MethodName: "GetAuthorityExpiryQueue",
Handler: _Query_GetAuthorityExpiryQueue_Handler,
},
{
MethodName: "GetRegistryModuleBalance",
Handler: _Query_GetRegistryModuleBalance_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cerc/registry/v1/query.proto",
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,462 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: cerc/registry/v1/tx.proto
package registryv1
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_SetRecord_FullMethodName = "/cerc.registry.v1.Msg/SetRecord"
Msg_RenewRecord_FullMethodName = "/cerc.registry.v1.Msg/RenewRecord"
Msg_AssociateBond_FullMethodName = "/cerc.registry.v1.Msg/AssociateBond"
Msg_DissociateBond_FullMethodName = "/cerc.registry.v1.Msg/DissociateBond"
Msg_DissociateRecords_FullMethodName = "/cerc.registry.v1.Msg/DissociateRecords"
Msg_ReAssociateRecords_FullMethodName = "/cerc.registry.v1.Msg/ReAssociateRecords"
Msg_SetName_FullMethodName = "/cerc.registry.v1.Msg/SetName"
Msg_ReserveName_FullMethodName = "/cerc.registry.v1.Msg/ReserveName"
Msg_DeleteName_FullMethodName = "/cerc.registry.v1.Msg/DeleteName"
Msg_SetAuthorityBond_FullMethodName = "/cerc.registry.v1.Msg/SetAuthorityBond"
)
// 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 {
// SetRecord records a new record with given payload and bond id
SetRecord(ctx context.Context, in *MsgSetRecord, opts ...grpc.CallOption) (*MsgSetRecordResponse, error)
// Renew Record renews an expired record
RenewRecord(ctx context.Context, in *MsgRenewRecord, opts ...grpc.CallOption) (*MsgRenewRecordResponse, error)
// AssociateBond
AssociateBond(ctx context.Context, in *MsgAssociateBond, opts ...grpc.CallOption) (*MsgAssociateBondResponse, error)
// DissociateBond
DissociateBond(ctx context.Context, in *MsgDissociateBond, opts ...grpc.CallOption) (*MsgDissociateBondResponse, error)
// DissociateRecords
DissociateRecords(ctx context.Context, in *MsgDissociateRecords, opts ...grpc.CallOption) (*MsgDissociateRecordsResponse, error)
// ReAssociateRecords
ReAssociateRecords(ctx context.Context, in *MsgReAssociateRecords, opts ...grpc.CallOption) (*MsgReAssociateRecordsResponse, error)
// SetName will store the name with given crn and name
SetName(ctx context.Context, in *MsgSetName, opts ...grpc.CallOption) (*MsgSetNameResponse, error)
// Reserve name
ReserveName(ctx context.Context, in *MsgReserveAuthority, opts ...grpc.CallOption) (*MsgReserveAuthorityResponse, error)
// Delete Name method will remove authority name
DeleteName(ctx context.Context, in *MsgDeleteNameAuthority, opts ...grpc.CallOption) (*MsgDeleteNameAuthorityResponse, error)
// SetAuthorityBond
SetAuthorityBond(ctx context.Context, in *MsgSetAuthorityBond, opts ...grpc.CallOption) (*MsgSetAuthorityBondResponse, error)
}
type msgClient struct {
cc grpc.ClientConnInterface
}
func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
return &msgClient{cc}
}
func (c *msgClient) SetRecord(ctx context.Context, in *MsgSetRecord, opts ...grpc.CallOption) (*MsgSetRecordResponse, error) {
out := new(MsgSetRecordResponse)
err := c.cc.Invoke(ctx, Msg_SetRecord_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) RenewRecord(ctx context.Context, in *MsgRenewRecord, opts ...grpc.CallOption) (*MsgRenewRecordResponse, error) {
out := new(MsgRenewRecordResponse)
err := c.cc.Invoke(ctx, Msg_RenewRecord_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) AssociateBond(ctx context.Context, in *MsgAssociateBond, opts ...grpc.CallOption) (*MsgAssociateBondResponse, error) {
out := new(MsgAssociateBondResponse)
err := c.cc.Invoke(ctx, Msg_AssociateBond_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) DissociateBond(ctx context.Context, in *MsgDissociateBond, opts ...grpc.CallOption) (*MsgDissociateBondResponse, error) {
out := new(MsgDissociateBondResponse)
err := c.cc.Invoke(ctx, Msg_DissociateBond_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) DissociateRecords(ctx context.Context, in *MsgDissociateRecords, opts ...grpc.CallOption) (*MsgDissociateRecordsResponse, error) {
out := new(MsgDissociateRecordsResponse)
err := c.cc.Invoke(ctx, Msg_DissociateRecords_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) ReAssociateRecords(ctx context.Context, in *MsgReAssociateRecords, opts ...grpc.CallOption) (*MsgReAssociateRecordsResponse, error) {
out := new(MsgReAssociateRecordsResponse)
err := c.cc.Invoke(ctx, Msg_ReAssociateRecords_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) SetName(ctx context.Context, in *MsgSetName, opts ...grpc.CallOption) (*MsgSetNameResponse, error) {
out := new(MsgSetNameResponse)
err := c.cc.Invoke(ctx, Msg_SetName_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) ReserveName(ctx context.Context, in *MsgReserveAuthority, opts ...grpc.CallOption) (*MsgReserveAuthorityResponse, error) {
out := new(MsgReserveAuthorityResponse)
err := c.cc.Invoke(ctx, Msg_ReserveName_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) DeleteName(ctx context.Context, in *MsgDeleteNameAuthority, opts ...grpc.CallOption) (*MsgDeleteNameAuthorityResponse, error) {
out := new(MsgDeleteNameAuthorityResponse)
err := c.cc.Invoke(ctx, Msg_DeleteName_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) SetAuthorityBond(ctx context.Context, in *MsgSetAuthorityBond, opts ...grpc.CallOption) (*MsgSetAuthorityBondResponse, error) {
out := new(MsgSetAuthorityBondResponse)
err := c.cc.Invoke(ctx, Msg_SetAuthorityBond_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 {
// SetRecord records a new record with given payload and bond id
SetRecord(context.Context, *MsgSetRecord) (*MsgSetRecordResponse, error)
// Renew Record renews an expired record
RenewRecord(context.Context, *MsgRenewRecord) (*MsgRenewRecordResponse, error)
// AssociateBond
AssociateBond(context.Context, *MsgAssociateBond) (*MsgAssociateBondResponse, error)
// DissociateBond
DissociateBond(context.Context, *MsgDissociateBond) (*MsgDissociateBondResponse, error)
// DissociateRecords
DissociateRecords(context.Context, *MsgDissociateRecords) (*MsgDissociateRecordsResponse, error)
// ReAssociateRecords
ReAssociateRecords(context.Context, *MsgReAssociateRecords) (*MsgReAssociateRecordsResponse, error)
// SetName will store the name with given crn and name
SetName(context.Context, *MsgSetName) (*MsgSetNameResponse, error)
// Reserve name
ReserveName(context.Context, *MsgReserveAuthority) (*MsgReserveAuthorityResponse, error)
// Delete Name method will remove authority name
DeleteName(context.Context, *MsgDeleteNameAuthority) (*MsgDeleteNameAuthorityResponse, error)
// SetAuthorityBond
SetAuthorityBond(context.Context, *MsgSetAuthorityBond) (*MsgSetAuthorityBondResponse, error)
mustEmbedUnimplementedMsgServer()
}
// UnimplementedMsgServer must be embedded to have forward compatible implementations.
type UnimplementedMsgServer struct {
}
func (UnimplementedMsgServer) SetRecord(context.Context, *MsgSetRecord) (*MsgSetRecordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetRecord not implemented")
}
func (UnimplementedMsgServer) RenewRecord(context.Context, *MsgRenewRecord) (*MsgRenewRecordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RenewRecord not implemented")
}
func (UnimplementedMsgServer) AssociateBond(context.Context, *MsgAssociateBond) (*MsgAssociateBondResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AssociateBond not implemented")
}
func (UnimplementedMsgServer) DissociateBond(context.Context, *MsgDissociateBond) (*MsgDissociateBondResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DissociateBond not implemented")
}
func (UnimplementedMsgServer) DissociateRecords(context.Context, *MsgDissociateRecords) (*MsgDissociateRecordsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DissociateRecords not implemented")
}
func (UnimplementedMsgServer) ReAssociateRecords(context.Context, *MsgReAssociateRecords) (*MsgReAssociateRecordsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReAssociateRecords not implemented")
}
func (UnimplementedMsgServer) SetName(context.Context, *MsgSetName) (*MsgSetNameResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetName not implemented")
}
func (UnimplementedMsgServer) ReserveName(context.Context, *MsgReserveAuthority) (*MsgReserveAuthorityResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReserveName not implemented")
}
func (UnimplementedMsgServer) DeleteName(context.Context, *MsgDeleteNameAuthority) (*MsgDeleteNameAuthorityResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteName not implemented")
}
func (UnimplementedMsgServer) SetAuthorityBond(context.Context, *MsgSetAuthorityBond) (*MsgSetAuthorityBondResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetAuthorityBond 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_SetRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgSetRecord)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).SetRecord(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_SetRecord_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).SetRecord(ctx, req.(*MsgSetRecord))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_RenewRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgRenewRecord)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).RenewRecord(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_RenewRecord_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).RenewRecord(ctx, req.(*MsgRenewRecord))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_AssociateBond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgAssociateBond)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).AssociateBond(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_AssociateBond_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).AssociateBond(ctx, req.(*MsgAssociateBond))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_DissociateBond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgDissociateBond)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).DissociateBond(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_DissociateBond_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).DissociateBond(ctx, req.(*MsgDissociateBond))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_DissociateRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgDissociateRecords)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).DissociateRecords(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_DissociateRecords_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).DissociateRecords(ctx, req.(*MsgDissociateRecords))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_ReAssociateRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgReAssociateRecords)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).ReAssociateRecords(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_ReAssociateRecords_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).ReAssociateRecords(ctx, req.(*MsgReAssociateRecords))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_SetName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgSetName)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).SetName(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_SetName_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).SetName(ctx, req.(*MsgSetName))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_ReserveName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgReserveAuthority)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).ReserveName(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_ReserveName_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).ReserveName(ctx, req.(*MsgReserveAuthority))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_DeleteName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgDeleteNameAuthority)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).DeleteName(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_DeleteName_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).DeleteName(ctx, req.(*MsgDeleteNameAuthority))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_SetAuthorityBond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgSetAuthorityBond)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).SetAuthorityBond(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_SetAuthorityBond_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).SetAuthorityBond(ctx, req.(*MsgSetAuthorityBond))
}
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: "cerc.registry.v1.Msg",
HandlerType: (*MsgServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SetRecord",
Handler: _Msg_SetRecord_Handler,
},
{
MethodName: "RenewRecord",
Handler: _Msg_RenewRecord_Handler,
},
{
MethodName: "AssociateBond",
Handler: _Msg_AssociateBond_Handler,
},
{
MethodName: "DissociateBond",
Handler: _Msg_DissociateBond_Handler,
},
{
MethodName: "DissociateRecords",
Handler: _Msg_DissociateRecords_Handler,
},
{
MethodName: "ReAssociateRecords",
Handler: _Msg_ReAssociateRecords_Handler,
},
{
MethodName: "SetName",
Handler: _Msg_SetName_Handler,
},
{
MethodName: "ReserveName",
Handler: _Msg_ReserveName_Handler,
},
{
MethodName: "DeleteName",
Handler: _Msg_DeleteName_Handler,
},
{
MethodName: "SetAuthorityBond",
Handler: _Msg_SetAuthorityBond_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cerc/registry/v1/tx.proto",
}

View File

@ -15,6 +15,7 @@ import (
auctionkeeper "git.vdb.to/cerc-io/laconic2d/x/auction/keeper"
bondkeeper "git.vdb.to/cerc-io/laconic2d/x/bond/keeper"
registrykeeper "git.vdb.to/cerc-io/laconic2d/x/registry/keeper"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
@ -33,16 +34,17 @@ import (
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
_ "cosmossdk.io/api/cosmos/tx/config/v1" // import for side-effects
_ "git.vdb.to/cerc-io/laconic2d/x/auction/module" // import for side-effects
_ "git.vdb.to/cerc-io/laconic2d/x/bond/module" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/auth" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/bank" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/consensus" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/distribution" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects
_ "cosmossdk.io/api/cosmos/tx/config/v1" // import for side-effects
_ "git.vdb.to/cerc-io/laconic2d/x/auction/module" // import for side-effects
_ "git.vdb.to/cerc-io/laconic2d/x/bond/module" // import for side-effects
_ "git.vdb.to/cerc-io/laconic2d/x/registry/module" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/auth" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/bank" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/consensus" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/distribution" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects
_ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects
)
// DefaultNodeHome default home directories for the application daemon
@ -74,9 +76,9 @@ type LaconicApp struct {
ConsensusParamsKeeper consensuskeeper.Keeper
// laconic keepers
AuctionKeeper auctionkeeper.Keeper
BondKeeper bondkeeper.Keeper
// RegistryKeeper registrykeeper.Keeper
AuctionKeeper auctionkeeper.Keeper
BondKeeper bondkeeper.Keeper
RegistryKeeper registrykeeper.Keeper
// RegistryRecordKeeper registrykeeper.RecordKeeper
// simulation manager
@ -139,6 +141,8 @@ func NewLaconicApp(
&app.ConsensusParamsKeeper,
&app.AuctionKeeper,
&app.BondKeeper,
// &app.RegistryRecordKeeper,
&app.RegistryKeeper,
); err != nil {
return nil, err
}

View File

@ -7,10 +7,10 @@ modules:
# there is nothing left over in the validator fee pool, so as to keep the CanWithdrawInvariant invariant.
# NOTE: staking module is required if HistoricalEntries param > 0
begin_blockers: [distribution, staking]
end_blockers: [staking, auction]
end_blockers: [staking, auction, registry]
# NOTE: The genutils module must occur after staking so that pools are properly initialized with tokens from genesis accounts.
# NOTE: The genutils module must also occur after auth so that it can access the params from auth.
init_genesis: [auth, bank, distribution, staking, genutil, auction, bond]
init_genesis: [auth, bank, distribution, staking, genutil, auction, bond, registry]
override_store_keys:
- module_name: auth
kv_store_key: acc
@ -28,6 +28,9 @@ modules:
- account: auction
- account: auction_burn
- account: bond
- account: registry
- account: record_rent
- account: authority_rent
- name: bank
config:
"@type": cosmos.bank.module.v1.Module
@ -54,3 +57,6 @@ modules:
- name: auction
config:
"@type": cerc.auction.module.v1.Module
- name: registry
config:
"@type": cerc.registry.module.v1.Module

View File

@ -2,13 +2,14 @@ syntax = "proto3";
package cerc.auction.v1;
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "cosmos/base/v1beta1/coin.proto";
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
// Params defines the auction module parameters
message Params {
// Write custom stringer method

View File

@ -2,14 +2,14 @@ syntax = "proto3";
package cerc.auction.v1;
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cerc/auction/v1/auction.proto";
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
// Query defines the gRPC querier interface for the auction module
service Query {
// Params queries auction module params

View File

@ -2,8 +2,6 @@ syntax = "proto3";
package cerc.auction.v1;
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
import "cosmos/msg/v1/msg.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
@ -11,6 +9,8 @@ import "google/protobuf/duration.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cerc/auction/v1/auction.proto";
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
// Tx defines the gRPC tx interface
service Msg {
option (cosmos.msg.v1.service) = true;

View File

@ -2,11 +2,11 @@ syntax = "proto3";
package cerc.bond.v1;
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
// Params defines the parameters of the bond module.
message Params {
// max_bond_amount is maximum amount to bond

View File

@ -2,11 +2,11 @@ syntax = "proto3";
package cerc.bond.v1;
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
import "gogoproto/gogo.proto";
import "cerc/bond/v1/bond.proto";
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
// GenesisState defines the bond module's genesis state.
message GenesisState {
// params defines all the parameters of the module.

View File

@ -2,8 +2,6 @@ syntax = "proto3";
package cerc.bond.v1;
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
@ -11,6 +9,8 @@ import "cosmos/base/v1beta1/coin.proto";
import "cerc/bond/v1/bond.proto";
// import "cosmos/query/v1/query.proto";
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
// Query defines the gRPC querier service for bond module
service Query {
// Params queries bonds module params.

View File

@ -2,13 +2,13 @@ syntax = "proto3";
package cerc.bond.v1;
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
import "cosmos/msg/v1/msg.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/v1beta1/coin.proto";
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
// Msg defines the bond Msg service.
service Msg {
option (cosmos.msg.v1.service) = true;

View File

@ -0,0 +1,13 @@
syntax = "proto3";
package cerc.registry.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 : "git.vdb.to/cerc-io/laconic2d/x/registry"
};
}

View File

@ -0,0 +1,32 @@
syntax = "proto3";
package cerc.registry.v1;
import "gogoproto/gogo.proto";
import "cerc/registry/v1/registry.proto";
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
// GenesisState defines the registry module's genesis state.
message GenesisState {
// params defines all the params of registry module.
Params params = 1 [(gogoproto.nullable) = false];
// records
repeated Record records = 2 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"records\" yaml:\"records\""
];
// authorities
repeated AuthorityEntry authorities = 3 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authorities\" yaml:\"authorities\""
];
// names
repeated NameEntry names = 4 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"names\" yaml:\"names\""
];
}

View File

@ -0,0 +1,242 @@
syntax = "proto3";
package cerc.registry.v1;
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cerc/registry/v1/registry.proto";
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
// Query defines the gRPC querier service for registry module
service Query {
// Params queries the registry module params.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/cerc/registry/v1/params";
}
// Records queries all records
rpc Records(QueryRecordsRequest) returns (QueryRecordsResponse) {
option (google.api.http).get = "/cerc/registry/v1/records";
}
// Get record by id
rpc GetRecord(QueryRecordByIdRequest) returns (QueryRecordByIdResponse) {
option (google.api.http).get = "/cerc/registry/v1/records/{id}";
}
// Get records by bond id
rpc GetRecordsByBondId(QueryRecordsByBondIdRequest) returns (QueryRecordsByBondIdResponse) {
option (google.api.http).get = "/cerc/registry/v1/records-by-bond-id/{id}";
}
// NameRecords queries all name records
rpc NameRecords(QueryNameRecordsRequest) returns (QueryNameRecordsResponse) {
option (google.api.http).get = "/cerc/registry/v1/names";
}
// Whois method retrieve the name authority info
rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse) {
option (google.api.http).get = "/cerc/registry/v1/whois/{name}";
}
// LookupCrn
rpc LookupCrn(QueryLookupCrnRequest) returns (QueryLookupCrnResponse) {
option (google.api.http).get = "/cerc/registry/v1/lookup";
}
// ResolveCrn
rpc ResolveCrn(QueryResolveCrnRequest) returns (QueryResolveCrnResponse) {
option (google.api.http).get = "/cerc/registry/v1/resolve";
}
// GetRecordExpiryQueue
rpc GetRecordExpiryQueue(QueryGetRecordExpiryQueueRequest) returns (QueryGetRecordExpiryQueueResponse) {
option (google.api.http).get = "/cerc/registry/v1/record-expiry";
}
// GetAuthorityExpiryQueue
rpc GetAuthorityExpiryQueue(QueryGetAuthorityExpiryQueueRequest) returns (QueryGetAuthorityExpiryQueueResponse) {
option (google.api.http).get = "/cerc/registry/v1/authority-expiry";
}
// Get registry module balance
rpc GetRegistryModuleBalance(QueryGetRegistryModuleBalanceRequest) returns (QueryGetRegistryModuleBalanceResponse) {
option (google.api.http).get = "/cerc/registry/v1/balance";
}
}
// QueryParamsRequest is request type for registry params
message QueryParamsRequest {}
// QueryParamsResponse is response type for registry params
message QueryParamsResponse {
Params params = 1;
}
// QueryRecordsRequest is request type for registry records list
message QueryRecordsRequest {
// TODO: Unused, check
// message LinkInput {
// string id = 1;
// }
message ArrayInput {
repeated ValueInput values = 1;
}
message MapInput {
map<string, ValueInput> values = 1;
}
message ValueInput {
// Type of record attribute value
oneof value {
string string = 1;
int64 int = 2;
double float = 3;
bool boolean = 4;
string link = 5;
ArrayInput array = 6;
MapInput map = 7;
}
}
message KeyValueInput {
string key = 1;
ValueInput value = 2;
}
repeated KeyValueInput attributes = 1;
bool all = 2;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 3;
}
// QueryRecordsResponse is response type for registry records list
message QueryRecordsResponse {
repeated Record records = 1 [(gogoproto.nullable) = false];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryRecordByIdRequest is request type for registry records by id
message QueryRecordByIdRequest {
string id = 1;
}
// QueryRecordByIdResponse is response type for registry records by id
message QueryRecordByIdResponse {
Record record = 1 [(gogoproto.nullable) = false];
}
// QueryRecordsByBondIdRequest is request type for get the records by bond-id
message QueryRecordsByBondIdRequest {
string id = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryRecordsByBondIdResponse is response type for records list by bond-id
message QueryRecordsByBondIdResponse {
repeated Record records = 1 [(gogoproto.nullable) = false];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryNameRecordsRequest is request type for registry names records
message QueryNameRecordsRequest {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryNameRecordsResponse is response type for registry names records
message QueryNameRecordsResponse {
repeated NameEntry names = 1 [(gogoproto.nullable) = false];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryWhoisRequest is request type for Get NameAuthority
message QueryWhoisRequest {
string name = 1;
}
// QueryWhoisResponse is response type for whois request
message QueryWhoisResponse {
NameAuthority name_authority = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"name_authority\" yaml:\"name_authority\""
];
}
// QueryLookupCrnRequest is request type for LookupCrn
message QueryLookupCrnRequest {
string crn = 1;
}
// QueryLookupCrnResponse is response type for QueryLookupCrnRequest
message QueryLookupCrnResponse {
NameRecord name = 1;
}
// QueryResolveCrnRequest is request type for ResolveCrn
message QueryResolveCrnRequest {
string crn = 1;
}
// QueryResolveCrnResponse is response type for QueryResolveCrnRequest
message QueryResolveCrnResponse {
Record record = 1;
}
// QueryGetRecordExpiryQueueRequest
message QueryGetRecordExpiryQueueRequest {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryGetRecordExpiryQueueResponse
message QueryGetRecordExpiryQueueResponse {
repeated ExpiryQueueRecord records = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// ExpiryQueueRecord
message ExpiryQueueRecord {
string id = 1;
repeated string value = 2;
}
// QueryGetAuthorityExpiryQueueRequest
message QueryGetAuthorityExpiryQueueRequest {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryGetAuthorityExpiryQueueResponse
message QueryGetAuthorityExpiryQueueResponse {
repeated ExpiryQueueRecord authorities = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryGetRegistryModuleBalanceRequest is request type for registry module accounts balance
message QueryGetRegistryModuleBalanceRequest {}
// QueryGetRegistryModuleBalanceResponse is response type for registry module accounts balance
message QueryGetRegistryModuleBalanceResponse {
repeated AccountBalance balances = 1;
}
// AccountBalance is registry module account balance
message AccountBalance {
string account_name = 1 [(gogoproto.moretags) = "json:\"account_name\" yaml:\"account_name\""];
repeated cosmos.base.v1beta1.Coin balance = 3 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "json:\"balance\" yaml:\"balance\""
];
}

View File

@ -0,0 +1,148 @@
syntax = "proto3";
package cerc.registry.v1;
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
// Params defines the registry module parameters
message Params {
cosmos.base.v1beta1.Coin record_rent = 1[
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"record_rent\" yaml:\"record_rent\""
];
google.protobuf.Duration record_rent_duration = 2 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"record_rent_duration\" yaml:\"record_rent_duration\""
];
cosmos.base.v1beta1.Coin authority_rent = 3 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authority_rent\" yaml:\"authority_rent\""
];
google.protobuf.Duration authority_rent_duration = 4 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"authority_rent_duration\" yaml:\"authority_rent_duration\""
];
google.protobuf.Duration authority_grace_period = 5 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"authority_grace_period\" yaml:\"authority_grace_period\""
];
bool authority_auction_enabled = 6 [(gogoproto.moretags) = "json:\"authority_auction_enabled\" yaml:\"authority_auction_enabled\""];
google.protobuf.Duration authority_auction_commits_duration = 7 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"authority_auction_commits_duration\" yaml:\"authority_auction_commits_duration\""
];
google.protobuf.Duration authority_auction_reveals_duration = 8 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"authority_auction_reveals_duration\" yaml:\"authority_auction_reveals_duration\""
];
cosmos.base.v1beta1.Coin authority_auction_commit_fee = 9 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authority_auction_commit_fee\" yaml:\"authority_auction_commit_fee\""
];
cosmos.base.v1beta1.Coin authority_auction_reveal_fee = 10 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authority_auction_reveal_fee\" yaml:\"authority_auction_reveal_fee\""
];
cosmos.base.v1beta1.Coin authority_auction_minimum_bid = 11 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authority_auction_minimum_bid\" yaml:\"authority_auction_minimum_bid\""
];
}
// Record defines a registry record
message Record {
string id = 1 [(gogoproto.moretags) = "json:\"id\" yaml:\"id\""];
string bond_id = 2 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
string create_time = 3 [(gogoproto.moretags) = "json:\"create_time\" yaml:\"create_time\""];
string expiry_time = 4 [(gogoproto.moretags) = "json:\"expiry_time\" yaml:\"expiry_time\""];
bool deleted = 5;
repeated string owners = 6 [(gogoproto.moretags) = "json:\"owners\" yaml:\"owners\""];
bytes attributes = 7 [(gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\""];
repeated string names = 8 [(gogoproto.moretags) = "json:\"names\" yaml:\"names\""];
string type = 9 [(gogoproto.moretags) = "json:\"types\" yaml:\"types\""];
}
// AuthorityEntry defines a registry authority
message AuthorityEntry {
string name = 1;
NameAuthority entry = 2;
}
// NameAuthority
message NameAuthority {
// Owner public key.
string owner_public_key = 1 [(gogoproto.moretags) = "json:\"owner_public_key\" yaml:\"owner_public_key\""];
// Owner address.
string owner_address = 2 [(gogoproto.moretags) = "json:\"owner_address\" yaml:\"owner_address\""];
// height at which name/authority was created.
uint64 height = 3;
string status = 4;
string auction_id = 5 [(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""];
string bond_id = 6 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
google.protobuf.Timestamp expiry_time = 7 [
(gogoproto.nullable) = false,
(gogoproto.stdtime) = true,
(gogoproto.moretags) = "json:\"expiry_time\" yaml:\"expiry_time\""
];
}
// NameEntry
message NameEntry {
string name = 1;
NameRecord entry = 2;
}
// NameRecord defines a versioned name record
message NameRecord {
NameRecordEntry latest = 1;
repeated NameRecordEntry history = 2;
}
// NameRecordEntry
message NameRecordEntry {
string id = 1;
uint64 height = 2;
}
// Signature
message Signature {
string sig = 1 [(gogoproto.moretags) = "json:\"sig\" yaml:\"sig\""];
string pub_key = 2 [(gogoproto.moretags) = "json:\"pub_key\" yaml:\"pub_key\""];
}
// BlockChangeSet
message BlockChangeSet {
int64 height = 1;
repeated string records = 2;
repeated string auctions = 3;
repeated AuctionBidInfo auction_bids = 4 [(gogoproto.moretags) = "json:\"auction_bids\" yaml:\"auction_bids\""];
repeated string authorities = 5;
repeated string names = 6;
}
// AuctionBidInfo
message AuctionBidInfo {
string auction_id = 1 [(gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\""];
string bidder_address = 2 [(gogoproto.moretags) = "json:\"bidder_address\" yaml:\"bidder_address\""];
}

View File

@ -0,0 +1,194 @@
syntax = "proto3";
package cerc.registry.v1;
import "google/api/annotations.proto";
import "gogoproto/gogo.proto";
import "cosmos/msg/v1/msg.proto";
import "cerc/registry/v1/registry.proto";
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
// Msg is a service which exposes the registry functionality
service Msg {
option (cosmos.msg.v1.service) = true;
// SetRecord records a new record with given payload and bond id
rpc SetRecord(MsgSetRecord) returns (MsgSetRecordResponse) {
option (google.api.http).post = "/cerc/registry/v1/set_record";
}
// Renew Record renews an expired record
rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse) {
option (google.api.http).post = "/cerc/registry/v1/renew_record";
}
// AssociateBond
rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse) {
option (google.api.http).post = "/cerc/registry/v1/associate_bond";
}
// DissociateBond
rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse) {
option (google.api.http).post = "/cerc/registry/v1/dissociate_bond";
}
// DissociateRecords
rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse) {
option (google.api.http).post = "/cerc/registry/v1/dissociate_records";
}
// ReAssociateRecords
rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse) {
option (google.api.http).post = "/cerc/registry/v1/reassociate_records";
}
// SetName will store the name with given crn and name
rpc SetName(MsgSetName) returns (MsgSetNameResponse) {
option (google.api.http).post = "/cerc/registry/v1/set_name";
}
// Reserve name
rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse) {
option (google.api.http).post = "/cerc/registry/v1/reserve_name";
}
// Delete Name method will remove authority name
rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse) {
option (google.api.http).post = "/cerc/registry/v1/delete_name";
}
// SetAuthorityBond
rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse) {
option (google.api.http).post = "/cerc/registry/v1/set_authority_bond";
}
}
// MsgSetRecord
message MsgSetRecord {
option (cosmos.msg.v1.signer) = "signer";
string bond_id = 1 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
string signer = 2;
Payload payload = 3 [(gogoproto.nullable) = false];
}
// MsgSetRecordResponse
message MsgSetRecordResponse {
string id = 1;
}
// Payload
message Payload {
Record record = 1;
repeated Signature signatures = 2 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\""
];
}
// MsgSetName
message MsgSetName {
option (cosmos.msg.v1.signer) = "signer";
string crn = 1;
string cid = 2;
string signer = 3;
}
// MsgSetNameResponse
message MsgSetNameResponse {}
// MsgReserveName
message MsgReserveAuthority {
option (cosmos.msg.v1.signer) = "signer";
string name = 1;
string signer = 2;
// if creating a sub-authority.
string owner = 3;
}
// MsgReserveNameResponse
message MsgReserveAuthorityResponse {}
// MsgSetAuthorityBond
message MsgSetAuthorityBond {
option (cosmos.msg.v1.signer) = "signer";
string name = 1;
string bond_id = 2 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
string signer = 3;
}
// MsgSetAuthorityBondResponse
message MsgSetAuthorityBondResponse {}
// MsgDeleteNameAuthority
message MsgDeleteNameAuthority {
option (cosmos.msg.v1.signer) = "signer";
string crn = 1;
string signer = 2;
}
// MsgDeleteNameAuthorityResponse
message MsgDeleteNameAuthorityResponse {}
// MsgRenewRecord
message MsgRenewRecord {
option (cosmos.msg.v1.signer) = "signer";
string record_id = 1 [(gogoproto.moretags) = "json:\"record_id\" yaml:\"record_id\""];
string signer = 2;
}
// MsgRenewRecordResponse
message MsgRenewRecordResponse {}
// MsgAssociateBond
message MsgAssociateBond {
option (cosmos.msg.v1.signer) = "signer";
string record_id = 1 [(gogoproto.moretags) = "json:\"record_id\" yaml:\"record_id\""];
string bond_id = 2 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
string signer = 3;
}
// MsgAssociateBondResponse
message MsgAssociateBondResponse {}
// MsgDissociateBond
message MsgDissociateBond {
option (cosmos.msg.v1.signer) = "signer";
string record_id = 1 [(gogoproto.moretags) = "json:\"record_id\" yaml:\"record_id\""];
string signer = 2;
}
// MsgDissociateBondResponse
message MsgDissociateBondResponse {}
// MsgDissociateRecords
message MsgDissociateRecords {
option (cosmos.msg.v1.signer) = "signer";
string bond_id = 1 [(gogoproto.moretags) = "json:\"bond_id\" yaml:\"bond_id\""];
string signer = 2;
}
// MsgDissociateRecordsResponse
message MsgDissociateRecordsResponse {}
// MsgReAssociateRecords
message MsgReAssociateRecords {
option (cosmos.msg.v1.signer) = "signer";
string new_bond_id = 1 [(gogoproto.moretags) = "json:\"new_bond_id\" yaml:\"new_bond_id\""];
string old_bond_id = 2 [(gogoproto.moretags) = "json:\"old_bond_id\" yaml:\"old_bond_id\""];
string signer = 3;
}
// MsgReAssociateRecordsResponse
message MsgReAssociateRecordsResponse {}

View File

@ -1,8 +1,9 @@
package keeper
import (
"git.vdb.to/cerc-io/laconic2d/x/auction"
sdk "github.com/cosmos/cosmos-sdk/types"
"git.vdb.to/cerc-io/laconic2d/x/auction"
)
// InitGenesis initializes the module state from a genesis state.

23
x/registry/codec.go Normal file
View File

@ -0,0 +1,23 @@
package registry
import (
"github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
)
func RegisterInterfaces(registry types.InterfaceRegistry) {
registry.RegisterImplementations((*sdk.Msg)(nil)) // &MsgSetName{},
// &MsgReserveAuthority{},
// &MsgDeleteNameAuthority{},
// &MsgSetAuthorityBond{},
// &MsgSetRecord{},
// &MsgRenewRecord{},
// &MsgAssociateBond{},
// &MsgDissociateBond{},
// &MsgDissociateRecords{},
// &MsgReAssociateRecords{},
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}

30
x/registry/genesis.go Normal file
View File

@ -0,0 +1,30 @@
package registry
// DefaultGenesisState sets default evm genesis state with empty accounts and default params and
// chain config values.
func DefaultGenesisState() *GenesisState {
return &GenesisState{
Params: DefaultParams(),
Records: []Record{},
Authorities: []AuthorityEntry{},
Names: []NameEntry{},
}
}
func NewGenesisState(params Params, records []Record, authorities []AuthorityEntry, names []NameEntry) GenesisState {
return GenesisState{
Params: params,
Records: records,
Authorities: authorities,
Names: names,
}
}
// Validate performs basic genesis state validation returning an error upon any
func (gs *GenesisState) Validate() error {
if err := gs.Params.Validate(); err != nil {
return err
}
return nil
}

519
x/registry/genesis.pb.go Normal file
View File

@ -0,0 +1,519 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cerc/registry/v1/genesis.proto
package registry
import (
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// GenesisState defines the registry module's genesis state.
type GenesisState struct {
// params defines all the params of registry module.
Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
// records
Records []Record `protobuf:"bytes,2,rep,name=records,proto3" json:"records" json:"records" yaml:"records"`
// authorities
Authorities []AuthorityEntry `protobuf:"bytes,3,rep,name=authorities,proto3" json:"authorities" json:"authorities" yaml:"authorities"`
// names
Names []NameEntry `protobuf:"bytes,4,rep,name=names,proto3" json:"names" json:"names" yaml:"names"`
}
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_6554596e454ab97d, []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{}
}
func (m *GenesisState) GetRecords() []Record {
if m != nil {
return m.Records
}
return nil
}
func (m *GenesisState) GetAuthorities() []AuthorityEntry {
if m != nil {
return m.Authorities
}
return nil
}
func (m *GenesisState) GetNames() []NameEntry {
if m != nil {
return m.Names
}
return nil
}
func init() {
proto.RegisterType((*GenesisState)(nil), "cerc.registry.v1.GenesisState")
}
func init() { proto.RegisterFile("cerc/registry/v1/genesis.proto", fileDescriptor_6554596e454ab97d) }
var fileDescriptor_6554596e454ab97d = []byte{
// 328 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xb1, 0x4e, 0xc2, 0x40,
0x1c, 0xc6, 0x5b, 0x40, 0x4c, 0x0e, 0x07, 0xd3, 0x38, 0x54, 0x8c, 0x47, 0x25, 0x21, 0xba, 0x70,
0x17, 0x30, 0x71, 0x70, 0xa3, 0x89, 0x71, 0x33, 0xa6, 0xba, 0xe8, 0x76, 0x94, 0x4b, 0x3d, 0x43,
0x7b, 0x78, 0x77, 0x12, 0xfb, 0x16, 0x3e, 0x16, 0x23, 0xa3, 0x13, 0x31, 0xb0, 0x39, 0xfa, 0x04,
0xa6, 0x77, 0x2d, 0x36, 0xd6, 0xad, 0xd7, 0xef, 0xfb, 0x7e, 0xbf, 0xe1, 0x0f, 0x60, 0x48, 0x45,
0x88, 0x05, 0x8d, 0x98, 0x54, 0x22, 0xc5, 0xf3, 0x01, 0x8e, 0x68, 0x42, 0x25, 0x93, 0x68, 0x26,
0xb8, 0xe2, 0xce, 0x7e, 0x96, 0xa3, 0x22, 0x47, 0xf3, 0x41, 0xfb, 0x20, 0xe2, 0x11, 0xd7, 0x21,
0xce, 0xbe, 0x4c, 0xaf, 0xdd, 0xa9, 0x70, 0xb6, 0x1b, 0x5d, 0xe8, 0x7e, 0xd5, 0xc0, 0xde, 0xb5,
0x41, 0xdf, 0x29, 0xa2, 0xa8, 0x73, 0x01, 0x9a, 0x33, 0x22, 0x48, 0x2c, 0x5d, 0xdb, 0xb3, 0xcf,
0x5a, 0x43, 0x17, 0xfd, 0x55, 0xa1, 0x5b, 0x9d, 0xfb, 0x8d, 0xc5, 0xaa, 0x63, 0x05, 0x79, 0xdb,
0x79, 0x00, 0xbb, 0x82, 0x86, 0x5c, 0x4c, 0xa4, 0x5b, 0xf3, 0xea, 0xff, 0x0f, 0x03, 0x5d, 0xf0,
0x7b, 0xd9, 0xf0, 0x7b, 0xd5, 0x39, 0x7e, 0x96, 0x3c, 0xb9, 0xec, 0xe6, 0xb3, 0xae, 0x97, 0x92,
0x78, 0xfa, 0xfb, 0x0c, 0x0a, 0x9e, 0xf3, 0x02, 0x5a, 0xe4, 0x55, 0x3d, 0x71, 0xc1, 0x14, 0xa3,
0xd2, 0xad, 0x6b, 0xbc, 0x57, 0xc5, 0x8f, 0xf2, 0x52, 0x7a, 0x95, 0x28, 0x91, 0xfa, 0xfd, 0x5c,
0xd3, 0x33, 0x9a, 0x12, 0xa2, 0x50, 0x95, 0x7f, 0x05, 0x65, 0x87, 0x73, 0x0f, 0x76, 0x12, 0x12,
0x53, 0xe9, 0x36, 0xb4, 0xec, 0xa8, 0x2a, 0xbb, 0x21, 0x31, 0x35, 0x9e, 0x93, 0xdc, 0x73, 0x68,
0x3c, 0x7a, 0x57, 0x18, 0xcc, 0x23, 0x30, 0x30, 0x7f, 0xb4, 0x58, 0x43, 0x7b, 0xb9, 0x86, 0xf6,
0xe7, 0x1a, 0xda, 0xef, 0x1b, 0x68, 0x2d, 0x37, 0xd0, 0xfa, 0xd8, 0x40, 0xeb, 0xf1, 0x34, 0x62,
0x0a, 0xcd, 0x27, 0x63, 0xa4, 0x38, 0xce, 0x54, 0x7d, 0xc6, 0xf1, 0x94, 0x84, 0x3c, 0x61, 0xe1,
0x70, 0x82, 0xdf, 0xb6, 0x57, 0x1b, 0x37, 0xf5, 0xd9, 0xce, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff,
0x21, 0x03, 0x93, 0x91, 0x21, 0x02, 0x00, 0x00,
}
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Names) > 0 {
for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Names[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x22
}
}
if len(m.Authorities) > 0 {
for iNdEx := len(m.Authorities) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Authorities[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
}
}
if len(m.Records) > 0 {
for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Records[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
}
}
{
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 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))
if len(m.Records) > 0 {
for _, e := range m.Records {
l = e.Size()
n += 1 + l + sovGenesis(uint64(l))
}
}
if len(m.Authorities) > 0 {
for _, e := range m.Authorities {
l = e.Size()
n += 1 + l + sovGenesis(uint64(l))
}
}
if len(m.Names) > 0 {
for _, e := range m.Names {
l = e.Size()
n += 1 + l + sovGenesis(uint64(l))
}
}
return n
}
func sovGenesis(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozGenesis(x uint64) (n int) {
return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *GenesisState) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: GenesisState: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field 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
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Records = append(m.Records, Record{})
if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Authorities", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Authorities = append(m.Authorities, AuthorityEntry{})
if err := m.Authorities[len(m.Authorities)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Names = append(m.Names, NameEntry{})
if err := m.Names[len(m.Names)-1].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 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")
)

View File

@ -0,0 +1,80 @@
package keeper
import (
"context"
"git.vdb.to/cerc-io/laconic2d/x/registry"
)
// InitGenesis initializes the module state from a genesis state.
func (k *Keeper) InitGenesis(ctx context.Context, data *registry.GenesisState) error {
if err := k.Params.Set(ctx, data.Params); err != nil {
return err
}
// for _, record := range data.Records {
// keeper.PutRecord(ctx, record)
// // Add to record expiry queue if expiry time is in the future.
// expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime)
// if err != nil {
// panic(err)
// }
// if expiryTime.After(ctx.BlockTime()) {
// keeper.InsertRecordExpiryQueue(ctx, record)
// }
// // Note: Bond genesis runs first, so bonds will already be present.
// if record.BondId != "" {
// keeper.AddBondToRecordIndexEntry(ctx, record.BondId, record.Id)
// }
// }
// for _, authority := range data.Authorities {
// // Only import authorities that are marked active.
// if authority.Entry.Status == types.AuthorityActive {
// keeper.SetNameAuthority(ctx, authority.Name, authority.Entry)
// // Add authority name to expiry queue.
// keeper.InsertAuthorityExpiryQueue(ctx, authority.Name, authority.Entry.ExpiryTime)
// // Note: Bond genesis runs first, so bonds will already be present.
// if authority.Entry.BondId != "" {
// keeper.AddBondToAuthorityIndexEntry(ctx, authority.Entry.BondId, authority.Name)
// }
// }
// }
// for _, nameEntry := range data.Names {
// keeper.SetNameRecord(ctx, nameEntry.Name, nameEntry.Entry.Latest.Id)
// }
return nil
}
// ExportGenesis exports the module state to a genesis state.
func (k *Keeper) ExportGenesis(ctx context.Context) (*registry.GenesisState, error) {
params, err := k.Params.Get(ctx)
if err != nil {
return nil, err
}
// records := keeper.ListRecords(ctx)
// authorities := keeper.ListNameAuthorityRecords(ctx)
// authorityEntries := []types.AuthorityEntry{}
// // #nosec G705
// for name, record := range authorities {
// authorityEntries = append(authorityEntries, types.AuthorityEntry{
// Name: name,
// Entry: &record, //nolint: all
// }) // #nosec G601
// }
// names := keeper.ListNameRecords(ctx)
return &registry.GenesisState{
Params: params,
}, nil
}

View File

@ -0,0 +1,55 @@
package keeper
import (
"cosmossdk.io/collections"
storetypes "cosmossdk.io/core/store"
"github.com/cosmos/cosmos-sdk/codec"
auth "github.com/cosmos/cosmos-sdk/x/auth/keeper"
bank "github.com/cosmos/cosmos-sdk/x/bank/keeper"
auctionkeeper "git.vdb.to/cerc-io/laconic2d/x/auction/keeper"
bondkeeper "git.vdb.to/cerc-io/laconic2d/x/bond/keeper"
registrytypes "git.vdb.to/cerc-io/laconic2d/x/registry"
)
// TODO: Add required methods
type Keeper struct {
cdc codec.BinaryCodec
accountKeeper auth.AccountKeeper
bankKeeper bank.Keeper
recordKeeper RecordKeeper
bondKeeper bondkeeper.Keeper
auctionKeeper auctionkeeper.Keeper
// state management
Schema collections.Schema
Params collections.Item[registrytypes.Params]
}
// NewKeeper creates a new Keeper instance
func NewKeeper(
cdc codec.BinaryCodec,
storeService storetypes.KVStoreService,
accountKeeper auth.AccountKeeper,
bankKeeper bank.Keeper,
recordKeeper RecordKeeper,
bondKeeper bondkeeper.Keeper,
auctionKeeper auctionkeeper.Keeper,
) Keeper {
sb := collections.NewSchemaBuilder(storeService)
k := Keeper{
cdc: cdc,
Params: collections.NewItem(sb, registrytypes.ParamsPrefix, "params", codec.CollValue[registrytypes.Params](cdc)),
}
schema, err := sb.Build()
if err != nil {
panic(err)
}
k.Schema = schema
return k
}

View File

@ -0,0 +1,14 @@
package keeper
// import "git.vdb.to/cerc-io/laconic2d/x/registry"
// var _ registry.MsgServer = msgServer{}
type msgServer struct {
k Keeper
}
// // NewMsgServerImpl returns an implementation of the module MsgServer interface.
// func NewMsgServerImpl(keeper Keeper) registry.MsgServer {
// return &msgServer{k: keeper}
// }

View File

@ -0,0 +1,16 @@
package keeper
// import (
// registrytypes "git.vdb.to/cerc-io/laconic2d/x/registry"
// )
// var _ registrytypes.QueryServer = queryServer{}
type queryServer struct {
k Keeper
}
// // NewQueryServerImpl returns an implementation of the module QueryServer.
// func NewQueryServerImpl(k Keeper) registrytypes.QueryServer {
// return queryServer{k}
// }

View File

@ -0,0 +1,16 @@
package keeper
import (
"github.com/cosmos/cosmos-sdk/codec"
auctionkeeper "git.vdb.to/cerc-io/laconic2d/x/auction/keeper"
)
// TODO: Add methods
// RecordKeeper exposes the bare minimal read-only API for other modules.
type RecordKeeper struct {
cdc codec.BinaryCodec // The wire codec for binary encoding/decoding.
auctionKeeper auctionkeeper.Keeper
// storeKey storetypes.StoreKey // Unexposed key to access store from sdk.Context
}

20
x/registry/keys.go Normal file
View File

@ -0,0 +1,20 @@
package registry
import "cosmossdk.io/collections"
const (
// ModuleName is the name of the registry module
ModuleName = "registry"
// RecordRentModuleAccountName is the name of the module account that keeps track of record rents paid.
RecordRentModuleAccountName = "record_rent"
// AuthorityRentModuleAccountName is the name of the module account that keeps track of authority rents paid.
AuthorityRentModuleAccountName = "authority_rent"
)
// Store prefixes
var (
// ParamsKey is the prefix for params key
ParamsPrefix = collections.NewPrefix(0)
)

17
x/registry/module/abci.go Normal file
View File

@ -0,0 +1,17 @@
package module
import (
"context"
"git.vdb.to/cerc-io/laconic2d/x/registry/keeper"
)
// EndBlocker is called every block
func EndBlocker(ctx context.Context, k keeper.Keeper) error {
// TODO: Implement
// k.ProcessRecordExpiryQueue(ctx)
// k.ProcessAuthorityExpiryQueue(ctx)
return nil
}

View File

@ -0,0 +1,17 @@
package module
import (
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
"cosmossdk.io/client/v2/autocli"
// registryv1 "git.vdb.to/cerc-io/laconic2d/api/cerc/registry/v1"
)
var _ autocli.HasAutoCLIConfig = AppModule{}
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
return &autocliv1.ModuleOptions{
Query: nil,
Tx: nil,
}
}

View File

@ -0,0 +1,66 @@
package module
import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
"github.com/cosmos/cosmos-sdk/codec"
auth "github.com/cosmos/cosmos-sdk/x/auth/keeper"
bank "github.com/cosmos/cosmos-sdk/x/bank/keeper"
modulev1 "git.vdb.to/cerc-io/laconic2d/api/cerc/registry/module/v1"
auctionkeeper "git.vdb.to/cerc-io/laconic2d/x/auction/keeper"
bondkeeper "git.vdb.to/cerc-io/laconic2d/x/bond/keeper"
"git.vdb.to/cerc-io/laconic2d/x/registry/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
AccountKeeper auth.AccountKeeper
BankKeeper bank.Keeper
BondKeeper bondkeeper.Keeper
AuctionKeeper auctionkeeper.Keeper
}
type ModuleOutputs struct {
depinject.Out
Keeper keeper.Keeper
Module appmodule.AppModule
}
func ProvideModule(in ModuleInputs) ModuleOutputs {
k := keeper.NewKeeper(
in.Cdc,
in.StoreService,
in.AccountKeeper,
in.BankKeeper,
keeper.RecordKeeper{},
in.BondKeeper,
in.AuctionKeeper,
)
m := NewAppModule(in.Cdc, k)
return ModuleOutputs{Module: m, Keeper: k}
}

126
x/registry/module/module.go Normal file
View File

@ -0,0 +1,126 @@
package module
import (
"context"
"encoding/json"
"fmt"
"cosmossdk.io/core/appmodule"
gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
"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"
registrytypes "git.vdb.to/cerc-io/laconic2d/x/registry"
"git.vdb.to/cerc-io/laconic2d/x/registry/keeper"
)
var (
_ module.AppModuleBasic = AppModule{}
_ appmodule.AppModule = AppModule{}
_ module.HasGenesis = AppModule{}
_ module.HasServices = AppModule{}
_ module.HasConsensusVersion = AppModule{}
_ appmodule.HasEndBlocker = AppModule{}
)
// ConsensusVersion defines the current module consensus version.
const ConsensusVersion = 1
type AppModule struct {
cdc codec.Codec
keeper keeper.Keeper
}
// NewAppModule creates a new AppModule object
func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule {
return AppModule{
cdc: cdc,
keeper: keeper,
}
}
func NewAppModuleBasic(m AppModule) module.AppModuleBasic {
return module.CoreAppModuleBasicAdaptor(m.Name(), m)
}
// module.AppModuleBasic
// Name returns the checkers module's name.
func (AppModule) Name() string { return registrytypes.ModuleName }
// RegisterLegacyAminoCodec registers the checkers module's types on the LegacyAmino codec.
// New modules do not need to support Amino.
func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {}
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the checkers module.
func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) {
if err := registrytypes.RegisterQueryHandlerClient(context.Background(), mux, registrytypes.NewQueryClient(clientCtx)); err != nil {
panic(err)
}
}
// RegisterInterfaces registers interfaces and implementations of the checkers module.
func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registrytypes.RegisterInterfaces(registry)
}
// ConsensusVersion implements AppModule/ConsensusVersion.
func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion }
// module.HasGenesis
// DefaultGenesis returns default genesis state as raw bytes for the module.
func (AppModule) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
return cdc.MustMarshalJSON(registrytypes.DefaultGenesisState())
}
// ValidateGenesis performs genesis state validation for the circuit module.
func (AppModule) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error {
var data registrytypes.GenesisState
if err := cdc.UnmarshalJSON(bz, &data); err != nil {
return fmt.Errorf("failed to unmarshal %s genesis state: %w", registrytypes.ModuleName, err)
}
return data.Validate()
}
// InitGenesis performs genesis initialization for the checkers module.
// It returns no validator updates.
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) {
var genesisState registrytypes.GenesisState
cdc.MustUnmarshalJSON(data, &genesisState)
if err := am.keeper.InitGenesis(ctx, &genesisState); err != nil {
panic(fmt.Sprintf("failed to initialize %s genesis state: %v", registrytypes.ModuleName, err))
}
}
// ExportGenesis returns the exported genesis state as raw bytes for the circuit
// module.
func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {
gs, err := am.keeper.ExportGenesis(ctx)
if err != nil {
panic(fmt.Sprintf("failed to export %s genesis state: %v", registrytypes.ModuleName, err))
}
return cdc.MustMarshalJSON(gs)
}
// module.HasServices
// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries.
func (am AppModule) RegisterServices(cfg module.Configurator) {
// Register servers
// registrytypes.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
// registrytypes.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServerImpl(am.keeper))
}
// appmodule.HasEndBlocker
func (am AppModule) EndBlock(ctx context.Context) error {
return EndBlocker(ctx, am.keeper)
}

195
x/registry/params.go Normal file
View File

@ -0,0 +1,195 @@
package registry
import (
fmt "fmt"
time "time"
sdkmath "cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// Default parameter values.
var (
// DefaultRecordRent is the default record rent for 1 time period (see expiry time).
DefaultRecordRent = sdkmath.NewInt(1000000)
// DefaultRecordExpiryTime is the default record expiry time (1 year).
DefaultRecordExpiryTime = time.Hour * 24 * 365
DefaultAuthorityRent = sdkmath.NewInt(1000000)
DefaultAuthorityExpiryTime = time.Hour * 24 * 365
DefaultAuthorityGracePeriod = time.Hour * 24 * 2
DefaultAuthorityAuctionEnabled = false
DefaultCommitsDuration = time.Hour * 24
DefaultRevealsDuration = time.Hour * 24
DefaultCommitFee = sdkmath.NewInt(1000000)
DefaultRevealFee = sdkmath.NewInt(1000000)
DefaultMinimumBid = sdkmath.NewInt(5000000)
)
// NewParams creates a new Params instance
func NewParams(
recordRent sdk.Coin,
recordRentDuration time.Duration,
authorityRent sdk.Coin,
authorityRentDuration time.Duration,
authorityGracePeriod time.Duration,
authorityAuctionEnabled bool,
commitsDuration time.Duration, revealsDuration time.Duration,
commitFee sdk.Coin, revealFee sdk.Coin,
minimumBid sdk.Coin,
) Params {
return Params{
RecordRent: recordRent,
RecordRentDuration: recordRentDuration,
AuthorityRent: authorityRent,
AuthorityRentDuration: authorityRentDuration,
AuthorityGracePeriod: authorityGracePeriod,
AuthorityAuctionEnabled: authorityAuctionEnabled,
AuthorityAuctionCommitsDuration: commitsDuration,
AuthorityAuctionRevealsDuration: revealsDuration,
AuthorityAuctionCommitFee: commitFee,
AuthorityAuctionRevealFee: revealFee,
AuthorityAuctionMinimumBid: minimumBid,
}
}
// DefaultParams returns a default set of parameters.
func DefaultParams() Params {
return NewParams(
sdk.NewCoin(sdk.DefaultBondDenom, DefaultRecordRent), DefaultRecordExpiryTime,
sdk.NewCoin(sdk.DefaultBondDenom, DefaultAuthorityRent),
DefaultAuthorityExpiryTime, DefaultAuthorityGracePeriod, DefaultAuthorityAuctionEnabled, DefaultCommitsDuration,
DefaultRevealsDuration,
sdk.NewCoin(sdk.DefaultBondDenom, DefaultCommitFee),
sdk.NewCoin(sdk.DefaultBondDenom, DefaultRevealFee),
sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinimumBid),
)
}
// Validate a set of params.
func (p Params) Validate() error {
if err := validateRecordRent(p.RecordRent); err != nil {
return err
}
if err := validateRecordRentDuration(p.RecordRentDuration); err != nil {
return err
}
if err := validateAuthorityRent(p.AuthorityRent); err != nil {
return err
}
if err := validateAuthorityRentDuration(p.AuthorityRentDuration); err != nil {
return err
}
if err := validateAuthorityGracePeriod(p.AuthorityGracePeriod); err != nil {
return err
}
if err := validateAuthorityAuctionEnabled(p.AuthorityAuctionEnabled); err != nil {
return err
}
if err := validateCommitsDuration(p.AuthorityAuctionCommitsDuration); err != nil {
return err
}
if err := validateRevealsDuration(p.AuthorityAuctionRevealsDuration); err != nil {
return err
}
if err := validateCommitFee(p.AuthorityAuctionCommitFee); err != nil {
return err
}
if err := validateRevealFee(p.AuthorityAuctionRevealFee); err != nil {
return err
}
if err := validateMinimumBid(p.AuthorityAuctionMinimumBid); err != nil {
return err
}
return nil
}
func validateRecordRent(i interface{}) error {
return validateAmount("RecordRent", i)
}
func validateRecordRentDuration(i interface{}) error {
return validateDuration("RecordRentDuration", i)
}
func validateAuthorityRent(i interface{}) error {
return validateAmount("AuthorityRent", i)
}
func validateAuthorityRentDuration(i interface{}) error {
return validateDuration("AuthorityRentDuration", i)
}
func validateAuthorityGracePeriod(i interface{}) error {
return validateDuration("AuthorityGracePeriod", i)
}
func validateAuthorityAuctionEnabled(i interface{}) error {
_, ok := i.(bool)
if !ok {
return fmt.Errorf("%s invalid parameter type: %T", "AuthorityAuctionEnabled", i)
}
return nil
}
func validateCommitsDuration(i interface{}) error {
return validateDuration("AuthorityCommitsDuration", i)
}
func validateRevealsDuration(i interface{}) error {
return validateDuration("AuthorityRevealsDuration", i)
}
func validateCommitFee(i interface{}) error {
return validateAmount("AuthorityCommitFee", i)
}
func validateRevealFee(i interface{}) error {
return validateAmount("AuthorityRevealFee", i)
}
func validateMinimumBid(i interface{}) error {
return validateAmount("AuthorityMinimumBid", i)
}
func validateAmount(name string, i interface{}) error {
v, ok := i.(sdk.Coin)
if !ok {
return fmt.Errorf("%s invalid parameter type: %T", name, i)
}
if v.Amount.IsNegative() {
return fmt.Errorf("%s can't be negative", name)
}
return nil
}
func validateDuration(name string, i interface{}) error {
v, ok := i.(time.Duration)
if !ok {
return fmt.Errorf("%s invalid parameter type: %T", name, i)
}
if v <= 0 {
return fmt.Errorf("%s must be a positive integer", name)
}
return nil
}

6746
x/registry/query.pb.go Normal file

File diff suppressed because it is too large Load Diff

1037
x/registry/query.pb.gw.go Normal file

File diff suppressed because it is too large Load Diff

3740
x/registry/registry.pb.go Normal file

File diff suppressed because it is too large Load Diff

4653
x/registry/tx.pb.go Normal file

File diff suppressed because it is too large Load Diff

918
x/registry/tx.pb.gw.go Normal file
View File

@ -0,0 +1,918 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: cerc/registry/v1/tx.proto
/*
Package registry is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package registry
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
var (
filter_Msg_SetRecord_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Msg_SetRecord_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgSetRecord
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_SetRecord_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.SetRecord(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Msg_SetRecord_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgSetRecord
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_SetRecord_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.SetRecord(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_Msg_RenewRecord_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Msg_RenewRecord_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgRenewRecord
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_RenewRecord_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.RenewRecord(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Msg_RenewRecord_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgRenewRecord
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_RenewRecord_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.RenewRecord(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_Msg_AssociateBond_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Msg_AssociateBond_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgAssociateBond
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_AssociateBond_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.AssociateBond(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Msg_AssociateBond_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgAssociateBond
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_AssociateBond_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.AssociateBond(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_Msg_DissociateBond_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Msg_DissociateBond_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgDissociateBond
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_DissociateBond_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.DissociateBond(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Msg_DissociateBond_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgDissociateBond
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_DissociateBond_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.DissociateBond(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_Msg_DissociateRecords_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Msg_DissociateRecords_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgDissociateRecords
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_DissociateRecords_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.DissociateRecords(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Msg_DissociateRecords_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgDissociateRecords
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_DissociateRecords_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.DissociateRecords(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_Msg_ReAssociateRecords_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Msg_ReAssociateRecords_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgReAssociateRecords
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_ReAssociateRecords_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ReAssociateRecords(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Msg_ReAssociateRecords_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgReAssociateRecords
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_ReAssociateRecords_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ReAssociateRecords(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_Msg_SetName_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Msg_SetName_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgSetName
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_SetName_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.SetName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Msg_SetName_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgSetName
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_SetName_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.SetName(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_Msg_ReserveName_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Msg_ReserveName_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgReserveAuthority
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_ReserveName_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ReserveName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Msg_ReserveName_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgReserveAuthority
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_ReserveName_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ReserveName(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_Msg_DeleteName_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Msg_DeleteName_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgDeleteNameAuthority
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_DeleteName_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.DeleteName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Msg_DeleteName_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgDeleteNameAuthority
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_DeleteName_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.DeleteName(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_Msg_SetAuthorityBond_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Msg_SetAuthorityBond_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgSetAuthorityBond
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_SetAuthorityBond_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.SetAuthorityBond(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Msg_SetAuthorityBond_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MsgSetAuthorityBond
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_SetAuthorityBond_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.SetAuthorityBond(ctx, &protoReq)
return msg, metadata, err
}
// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux".
// UnaryRPC :call MsgServer 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 RegisterMsgHandlerFromEndpoint instead.
func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error {
mux.Handle("POST", pattern_Msg_SetRecord_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_Msg_SetRecord_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_Msg_SetRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_RenewRecord_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_Msg_RenewRecord_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_Msg_RenewRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_AssociateBond_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_Msg_AssociateBond_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_Msg_AssociateBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_DissociateBond_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_Msg_DissociateBond_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_Msg_DissociateBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_DissociateRecords_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_Msg_DissociateRecords_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_Msg_DissociateRecords_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_ReAssociateRecords_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_Msg_ReAssociateRecords_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_Msg_ReAssociateRecords_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_SetName_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_Msg_SetName_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_Msg_SetName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_ReserveName_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_Msg_ReserveName_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_Msg_ReserveName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_DeleteName_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_Msg_DeleteName_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_Msg_DeleteName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_SetAuthorityBond_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_Msg_SetAuthorityBond_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_Msg_SetAuthorityBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterMsgHandlerFromEndpoint(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 RegisterMsgHandler(ctx, mux, conn)
}
// RegisterMsgHandler registers the http handlers for service Msg to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn))
}
// RegisterMsgHandlerClient registers the http handlers for service Msg
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "MsgClient" to call the correct interceptors.
func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error {
mux.Handle("POST", pattern_Msg_SetRecord_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_Msg_SetRecord_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Msg_SetRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_RenewRecord_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_Msg_RenewRecord_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Msg_RenewRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_AssociateBond_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_Msg_AssociateBond_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Msg_AssociateBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_DissociateBond_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_Msg_DissociateBond_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Msg_DissociateBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_DissociateRecords_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_Msg_DissociateRecords_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Msg_DissociateRecords_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_ReAssociateRecords_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_Msg_ReAssociateRecords_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Msg_ReAssociateRecords_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_SetName_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_Msg_SetName_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Msg_SetName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_ReserveName_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_Msg_ReserveName_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Msg_ReserveName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_DeleteName_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_Msg_DeleteName_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Msg_DeleteName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Msg_SetAuthorityBond_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_Msg_SetAuthorityBond_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Msg_SetAuthorityBond_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_Msg_SetRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "registry", "v1", "set_record"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Msg_RenewRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "registry", "v1", "renew_record"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Msg_AssociateBond_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "registry", "v1", "associate_bond"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Msg_DissociateBond_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "registry", "v1", "dissociate_bond"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Msg_DissociateRecords_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "registry", "v1", "dissociate_records"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Msg_ReAssociateRecords_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "registry", "v1", "reassociate_records"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Msg_SetName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "registry", "v1", "set_name"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Msg_ReserveName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "registry", "v1", "reserve_name"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Msg_DeleteName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "registry", "v1", "delete_name"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Msg_SetAuthorityBond_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "registry", "v1", "set_authority_bond"}, "", runtime.AssumeColonVerbOpt(false)))
)
var (
forward_Msg_SetRecord_0 = runtime.ForwardResponseMessage
forward_Msg_RenewRecord_0 = runtime.ForwardResponseMessage
forward_Msg_AssociateBond_0 = runtime.ForwardResponseMessage
forward_Msg_DissociateBond_0 = runtime.ForwardResponseMessage
forward_Msg_DissociateRecords_0 = runtime.ForwardResponseMessage
forward_Msg_ReAssociateRecords_0 = runtime.ForwardResponseMessage
forward_Msg_SetName_0 = runtime.ForwardResponseMessage
forward_Msg_ReserveName_0 = runtime.ForwardResponseMessage
forward_Msg_DeleteName_0 = runtime.ForwardResponseMessage
forward_Msg_SetAuthorityBond_0 = runtime.ForwardResponseMessage
)