laconicd/api/cerc/registry/v1/query_grpc.pb.go
Prathamesh Musale ec6e2f3776
All checks were successful
Integration Tests / test-integration (push) Successful in 2m40s
E2E Tests / test-e2e (push) Successful in 3m59s
Unit Tests / test-unit (push) Successful in 2m8s
Publish on release / Run docker build and publish (release) Successful in 2m51s
SDK Tests / sdk_tests_nameservice_expiry (push) Successful in 8m38s
SDK Tests / sdk_tests (push) Successful in 8m37s
SDK Tests / sdk_tests_auctions (push) Successful in 13m48s
Add a query to list authorities (#42)
Part of [Add a CLI query to list all authorities with owner filter](#41)

Usage:
```bash
$ laconicd query registry list-authorities -h
List authorities (optionally by owner)
Usage:
  laconicd query registry list-authorities [flags]
Flags:
      --grpc-addr string   the gRPC endpoint to use for this chain
      --grpc-insecure      allow gRPC over insecure channels, if not the server must use TLS
      --height int         Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help               help for list-authorities
      --no-indent          Do not indent JSON output
      --node string        <host>:<port> to CometBFT RPC interface for this chain (default "tcp://localhost:26657")
  -o, --output string      Output format (text|json) (default "text")
      --owner string       Owner to get the authorities for
```

Example:
```bash
# Without owner filter
$ laconicd query registry list-authorities
authorities:
- entry:
    expiry_time: "2024-07-26T06:54:28.491158167Z"
    height: "247"
    owner_address: laconic1e23vfttpvk045pqeydr4mujmlemx8hf9zjm7h2
    owner_public_key: A6RlTGLIpyA8nnEQN4V3sz3uaLMY0fHtB7aS7u1zTOdD
    status: active
  name: cerc
- entry:
    expiry_time: "2024-07-26T06:47:58.971429925Z"
    height: "118"
    owner_address: laconic10ztdu07xn7rracvzvehelgwvsytqlrvj6pvput
    owner_public_key: AvBxGIXBFmWCF+OHFwydqEtp2bfP+aimObO3teunbve7
    status: active
  name: laconic

# With owner filter
$ laconicd query registry list-authorities --owner laconic1e23vfttpvk045pqeydr4mujmlemx8hf9zjm7h2
authorities:
- entry:
    expiry_time: "2024-07-26T06:54:28.491158167Z"
    height: "247"
    owner_address: laconic1e23vfttpvk045pqeydr4mujmlemx8hf9zjm7h2
    owner_public_key: A6RlTGLIpyA8nnEQN4V3sz3uaLMY0fHtB7aS7u1zTOdD
    status: active
  name: cerc
```

Reviewed-on: #42
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-07-24 09:14:39 +00:00

463 lines
18 KiB
Go

// 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_LookupLrn_FullMethodName = "/cerc.registry.v1.Query/LookupLrn"
Query_ResolveLrn_FullMethodName = "/cerc.registry.v1.Query/ResolveLrn"
Query_GetRegistryModuleBalance_FullMethodName = "/cerc.registry.v1.Query/GetRegistryModuleBalance"
Query_Authorities_FullMethodName = "/cerc.registry.v1.Query/Authorities"
)
// 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 *QueryGetRecordRequest, opts ...grpc.CallOption) (*QueryGetRecordResponse, error)
// Get records by bond id
GetRecordsByBondId(ctx context.Context, in *QueryGetRecordsByBondIdRequest, opts ...grpc.CallOption) (*QueryGetRecordsByBondIdResponse, 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)
// LookupLrn
LookupLrn(ctx context.Context, in *QueryLookupLrnRequest, opts ...grpc.CallOption) (*QueryLookupLrnResponse, error)
// ResolveLrn
ResolveLrn(ctx context.Context, in *QueryResolveLrnRequest, opts ...grpc.CallOption) (*QueryResolveLrnResponse, error)
// Get registry module balance
GetRegistryModuleBalance(ctx context.Context, in *QueryGetRegistryModuleBalanceRequest, opts ...grpc.CallOption) (*QueryGetRegistryModuleBalanceResponse, error)
// Authorities queries all authorities
Authorities(ctx context.Context, in *QueryAuthoritiesRequest, opts ...grpc.CallOption) (*QueryAuthoritiesResponse, 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 *QueryGetRecordRequest, opts ...grpc.CallOption) (*QueryGetRecordResponse, error) {
out := new(QueryGetRecordResponse)
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 *QueryGetRecordsByBondIdRequest, opts ...grpc.CallOption) (*QueryGetRecordsByBondIdResponse, error) {
out := new(QueryGetRecordsByBondIdResponse)
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) LookupLrn(ctx context.Context, in *QueryLookupLrnRequest, opts ...grpc.CallOption) (*QueryLookupLrnResponse, error) {
out := new(QueryLookupLrnResponse)
err := c.cc.Invoke(ctx, Query_LookupLrn_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) ResolveLrn(ctx context.Context, in *QueryResolveLrnRequest, opts ...grpc.CallOption) (*QueryResolveLrnResponse, error) {
out := new(QueryResolveLrnResponse)
err := c.cc.Invoke(ctx, Query_ResolveLrn_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
}
func (c *queryClient) Authorities(ctx context.Context, in *QueryAuthoritiesRequest, opts ...grpc.CallOption) (*QueryAuthoritiesResponse, error) {
out := new(QueryAuthoritiesResponse)
err := c.cc.Invoke(ctx, Query_Authorities_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, *QueryGetRecordRequest) (*QueryGetRecordResponse, error)
// Get records by bond id
GetRecordsByBondId(context.Context, *QueryGetRecordsByBondIdRequest) (*QueryGetRecordsByBondIdResponse, 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)
// LookupLrn
LookupLrn(context.Context, *QueryLookupLrnRequest) (*QueryLookupLrnResponse, error)
// ResolveLrn
ResolveLrn(context.Context, *QueryResolveLrnRequest) (*QueryResolveLrnResponse, error)
// Get registry module balance
GetRegistryModuleBalance(context.Context, *QueryGetRegistryModuleBalanceRequest) (*QueryGetRegistryModuleBalanceResponse, error)
// Authorities queries all authorities
Authorities(context.Context, *QueryAuthoritiesRequest) (*QueryAuthoritiesResponse, 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, *QueryGetRecordRequest) (*QueryGetRecordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRecord not implemented")
}
func (UnimplementedQueryServer) GetRecordsByBondId(context.Context, *QueryGetRecordsByBondIdRequest) (*QueryGetRecordsByBondIdResponse, 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) LookupLrn(context.Context, *QueryLookupLrnRequest) (*QueryLookupLrnResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LookupLrn not implemented")
}
func (UnimplementedQueryServer) ResolveLrn(context.Context, *QueryResolveLrnRequest) (*QueryResolveLrnResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResolveLrn not implemented")
}
func (UnimplementedQueryServer) GetRegistryModuleBalance(context.Context, *QueryGetRegistryModuleBalanceRequest) (*QueryGetRegistryModuleBalanceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRegistryModuleBalance not implemented")
}
func (UnimplementedQueryServer) Authorities(context.Context, *QueryAuthoritiesRequest) (*QueryAuthoritiesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Authorities 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(QueryGetRecordRequest)
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.(*QueryGetRecordRequest))
}
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(QueryGetRecordsByBondIdRequest)
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.(*QueryGetRecordsByBondIdRequest))
}
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_LookupLrn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryLookupLrnRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).LookupLrn(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_LookupLrn_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).LookupLrn(ctx, req.(*QueryLookupLrnRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_ResolveLrn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryResolveLrnRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).ResolveLrn(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_ResolveLrn_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).ResolveLrn(ctx, req.(*QueryResolveLrnRequest))
}
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)
}
func _Query_Authorities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryAuthoritiesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Authorities(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Authorities_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Authorities(ctx, req.(*QueryAuthoritiesRequest))
}
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: "LookupLrn",
Handler: _Query_LookupLrn_Handler,
},
{
MethodName: "ResolveLrn",
Handler: _Query_ResolveLrn_Handler,
},
{
MethodName: "GetRegistryModuleBalance",
Handler: _Query_GetRegistryModuleBalance_Handler,
},
{
MethodName: "Authorities",
Handler: _Query_Authorities_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "cerc/registry/v1/query.proto",
}