feat: add PubKey fast reflection

This commit is contained in:
Prad Nukala
2024-10-08 16:43:59 -04:00
parent c3e8fcc3d3
commit f6879f1c12
31 changed files with 4605 additions and 14444 deletions
+1391 -29
View File
File diff suppressed because it is too large Load Diff
+44 -1406
View File
File diff suppressed because it is too large Load Diff
-6
View File
@@ -35,12 +35,6 @@ func (k Querier) Sync(goCtx context.Context, req *types.SyncRequest) (*types.Syn
return &types.SyncResponse{}, nil
}
// BuildTx implements types.QueryServer.
func (k Querier) BuildTx(goCtx context.Context, req *types.BuildTxRequest) (*types.BuildTxResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
return &types.BuildTxResponse{}, nil
}
// Schema implements types.QueryServer.
func (k Querier) Schema(goCtx context.Context, req *types.QuerySchemaRequest) (*types.QuerySchemaResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
+28 -789
View File
@@ -111,89 +111,6 @@ func (m *QueryParamsResponse) GetParams() *Params {
return nil
}
// QueryIPFSRequest is the request type for the Query/IPFS RPC method.
type QueryIPFSRequest struct {
}
func (m *QueryIPFSRequest) Reset() { *m = QueryIPFSRequest{} }
func (m *QueryIPFSRequest) String() string { return proto.CompactTextString(m) }
func (*QueryIPFSRequest) ProtoMessage() {}
func (*QueryIPFSRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_e6d49a2800ab3e4b, []int{2}
}
func (m *QueryIPFSRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *QueryIPFSRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryIPFSRequest.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 *QueryIPFSRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryIPFSRequest.Merge(m, src)
}
func (m *QueryIPFSRequest) XXX_Size() int {
return m.Size()
}
func (m *QueryIPFSRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryIPFSRequest.DiscardUnknown(m)
}
var xxx_messageInfo_QueryIPFSRequest proto.InternalMessageInfo
// QueryIPFSResponse is the response type for the Query/IPFS RPC method.
type QueryIPFSResponse struct {
// IPFS is the IPFS client status.
Ipfs bool `protobuf:"varint,1,opt,name=ipfs,proto3" json:"ipfs,omitempty"`
}
func (m *QueryIPFSResponse) Reset() { *m = QueryIPFSResponse{} }
func (m *QueryIPFSResponse) String() string { return proto.CompactTextString(m) }
func (*QueryIPFSResponse) ProtoMessage() {}
func (*QueryIPFSResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_e6d49a2800ab3e4b, []int{3}
}
func (m *QueryIPFSResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *QueryIPFSResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryIPFSResponse.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 *QueryIPFSResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryIPFSResponse.Merge(m, src)
}
func (m *QueryIPFSResponse) XXX_Size() int {
return m.Size()
}
func (m *QueryIPFSResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryIPFSResponse.DiscardUnknown(m)
}
var xxx_messageInfo_QueryIPFSResponse proto.InternalMessageInfo
func (m *QueryIPFSResponse) GetIpfs() bool {
if m != nil {
return m.Ipfs
}
return false
}
// QuerySchemaRequest is the request type for the Query/Schema RPC method.
type QuerySchemaRequest struct {
}
@@ -202,7 +119,7 @@ func (m *QuerySchemaRequest) Reset() { *m = QuerySchemaRequest{} }
func (m *QuerySchemaRequest) String() string { return proto.CompactTextString(m) }
func (*QuerySchemaRequest) ProtoMessage() {}
func (*QuerySchemaRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_e6d49a2800ab3e4b, []int{4}
return fileDescriptor_e6d49a2800ab3e4b, []int{2}
}
func (m *QuerySchemaRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -241,7 +158,7 @@ func (m *QuerySchemaResponse) Reset() { *m = QuerySchemaResponse{} }
func (m *QuerySchemaResponse) String() string { return proto.CompactTextString(m) }
func (*QuerySchemaResponse) ProtoMessage() {}
func (*QuerySchemaResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_e6d49a2800ab3e4b, []int{5}
return fileDescriptor_e6d49a2800ab3e4b, []int{3}
}
func (m *QuerySchemaResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -286,7 +203,7 @@ func (m *SyncRequest) Reset() { *m = SyncRequest{} }
func (m *SyncRequest) String() string { return proto.CompactTextString(m) }
func (*SyncRequest) ProtoMessage() {}
func (*SyncRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_e6d49a2800ab3e4b, []int{6}
return fileDescriptor_e6d49a2800ab3e4b, []int{4}
}
func (m *SyncRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -331,7 +248,7 @@ func (m *SyncResponse) Reset() { *m = SyncResponse{} }
func (m *SyncResponse) String() string { return proto.CompactTextString(m) }
func (*SyncResponse) ProtoMessage() {}
func (*SyncResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_e6d49a2800ab3e4b, []int{7}
return fileDescriptor_e6d49a2800ab3e4b, []int{5}
}
func (m *SyncResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -367,159 +284,42 @@ func (m *SyncResponse) GetSuccess() bool {
return false
}
// BuildTxRequest is the request type for the BuildTx RPC method.
type BuildTxRequest struct {
Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"`
Pkl string `protobuf:"bytes,2,opt,name=pkl,proto3" json:"pkl,omitempty"`
}
func (m *BuildTxRequest) Reset() { *m = BuildTxRequest{} }
func (m *BuildTxRequest) String() string { return proto.CompactTextString(m) }
func (*BuildTxRequest) ProtoMessage() {}
func (*BuildTxRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_e6d49a2800ab3e4b, []int{8}
}
func (m *BuildTxRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *BuildTxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_BuildTxRequest.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 *BuildTxRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_BuildTxRequest.Merge(m, src)
}
func (m *BuildTxRequest) XXX_Size() int {
return m.Size()
}
func (m *BuildTxRequest) XXX_DiscardUnknown() {
xxx_messageInfo_BuildTxRequest.DiscardUnknown(m)
}
var xxx_messageInfo_BuildTxRequest proto.InternalMessageInfo
func (m *BuildTxRequest) GetDid() string {
if m != nil {
return m.Did
}
return ""
}
func (m *BuildTxRequest) GetPkl() string {
if m != nil {
return m.Pkl
}
return ""
}
// BuildTxResponse is the response type for the BuildTx RPC method.
type BuildTxResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Tx string `protobuf:"bytes,2,opt,name=tx,proto3" json:"tx,omitempty"`
}
func (m *BuildTxResponse) Reset() { *m = BuildTxResponse{} }
func (m *BuildTxResponse) String() string { return proto.CompactTextString(m) }
func (*BuildTxResponse) ProtoMessage() {}
func (*BuildTxResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_e6d49a2800ab3e4b, []int{9}
}
func (m *BuildTxResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *BuildTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_BuildTxResponse.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 *BuildTxResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_BuildTxResponse.Merge(m, src)
}
func (m *BuildTxResponse) XXX_Size() int {
return m.Size()
}
func (m *BuildTxResponse) XXX_DiscardUnknown() {
xxx_messageInfo_BuildTxResponse.DiscardUnknown(m)
}
var xxx_messageInfo_BuildTxResponse proto.InternalMessageInfo
func (m *BuildTxResponse) GetSuccess() bool {
if m != nil {
return m.Success
}
return false
}
func (m *BuildTxResponse) GetTx() string {
if m != nil {
return m.Tx
}
return ""
}
func init() {
proto.RegisterType((*QueryParamsRequest)(nil), "vault.v1.QueryParamsRequest")
proto.RegisterType((*QueryParamsResponse)(nil), "vault.v1.QueryParamsResponse")
proto.RegisterType((*QueryIPFSRequest)(nil), "vault.v1.QueryIPFSRequest")
proto.RegisterType((*QueryIPFSResponse)(nil), "vault.v1.QueryIPFSResponse")
proto.RegisterType((*QuerySchemaRequest)(nil), "vault.v1.QuerySchemaRequest")
proto.RegisterType((*QuerySchemaResponse)(nil), "vault.v1.QuerySchemaResponse")
proto.RegisterType((*SyncRequest)(nil), "vault.v1.SyncRequest")
proto.RegisterType((*SyncResponse)(nil), "vault.v1.SyncResponse")
proto.RegisterType((*BuildTxRequest)(nil), "vault.v1.BuildTxRequest")
proto.RegisterType((*BuildTxResponse)(nil), "vault.v1.BuildTxResponse")
}
func init() { proto.RegisterFile("vault/v1/query.proto", fileDescriptor_e6d49a2800ab3e4b) }
var fileDescriptor_e6d49a2800ab3e4b = []byte{
// 466 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xc1, 0x6e, 0xd3, 0x30,
0x18, 0xc7, 0x9b, 0x30, 0xba, 0xf1, 0x0d, 0x95, 0xcc, 0x1b, 0x55, 0x16, 0x8d, 0x80, 0x2c, 0x24,
0x7a, 0x4a, 0xb4, 0xc1, 0x0d, 0x09, 0xa4, 0x1d, 0x90, 0x38, 0x20, 0x8d, 0x96, 0x0b, 0x5c,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0xe1, 0x5a, 0x2f, 0x4b, 0xb7, 0x34, 0x5f, 0xba, 0xa5,
0xcf, 0xa5, 0x5b, 0x7a, 0xb8, 0x08, 0x42, 0x39, 0x4a, 0x06, 0x3e, 0xe1, 0x13, 0xc4, 0x99, 0xe0,
0x2c, 0x46, 0xea, 0xf1, 0x64, 0x08, 0x32, 0x8d, 0xa8, 0x18, 0x54, 0xd4, 0xaf, 0x75, 0xf9, 0x13,
0x00, 0x00, 0xff, 0xff, 0x21, 0x69, 0x1c, 0x41, 0xb2, 0x02, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -536,8 +336,6 @@ const _ = grpc.SupportPackageIsVersion4
type QueryClient interface {
// Params queries all parameters of the module.
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// BuildTx builds an unsigned transaction message for the given PKL.
BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error)
// Schema queries the DID document by its id. And returns the required PKL
// information
Schema(ctx context.Context, in *QuerySchemaRequest, opts ...grpc.CallOption) (*QuerySchemaResponse, error)
@@ -563,15 +361,6 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
return out, nil
}
func (c *queryClient) BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error) {
out := new(BuildTxResponse)
err := c.cc.Invoke(ctx, "/vault.v1.Query/BuildTx", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Schema(ctx context.Context, in *QuerySchemaRequest, opts ...grpc.CallOption) (*QuerySchemaResponse, error) {
out := new(QuerySchemaResponse)
err := c.cc.Invoke(ctx, "/vault.v1.Query/Schema", in, out, opts...)
@@ -594,8 +383,6 @@ func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.Ca
type QueryServer interface {
// Params queries all parameters of the module.
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
// BuildTx builds an unsigned transaction message for the given PKL.
BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error)
// Schema queries the DID document by its id. And returns the required PKL
// information
Schema(context.Context, *QuerySchemaRequest) (*QuerySchemaResponse, error)
@@ -611,9 +398,6 @@ type UnimplementedQueryServer struct {
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
}
func (*UnimplementedQueryServer) BuildTx(ctx context.Context, req *BuildTxRequest) (*BuildTxResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BuildTx not implemented")
}
func (*UnimplementedQueryServer) Schema(ctx context.Context, req *QuerySchemaRequest) (*QuerySchemaResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Schema not implemented")
}
@@ -643,24 +427,6 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
return interceptor(ctx, in, info, handler)
}
func _Query_BuildTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BuildTxRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).BuildTx(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vault.v1.Query/BuildTx",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).BuildTx(ctx, req.(*BuildTxRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Schema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QuerySchemaRequest)
if err := dec(in); err != nil {
@@ -705,10 +471,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{
MethodName: "Params",
Handler: _Query_Params_Handler,
},
{
MethodName: "BuildTx",
Handler: _Query_BuildTx_Handler,
},
{
MethodName: "Schema",
Handler: _Query_Schema_Handler,
@@ -780,62 +542,6 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *QueryIPFSRequest) 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 *QueryIPFSRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryIPFSRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
return len(dAtA) - i, nil
}
func (m *QueryIPFSResponse) 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 *QueryIPFSResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryIPFSResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Ipfs {
i--
if m.Ipfs {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func (m *QuerySchemaRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -957,83 +663,6 @@ func (m *SyncResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *BuildTxRequest) 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 *BuildTxRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *BuildTxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Pkl) > 0 {
i -= len(m.Pkl)
copy(dAtA[i:], m.Pkl)
i = encodeVarintQuery(dAtA, i, uint64(len(m.Pkl)))
i--
dAtA[i] = 0x12
}
if len(m.Did) > 0 {
i -= len(m.Did)
copy(dAtA[i:], m.Did)
i = encodeVarintQuery(dAtA, i, uint64(len(m.Did)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *BuildTxResponse) 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 *BuildTxResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *BuildTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Tx) > 0 {
i -= len(m.Tx)
copy(dAtA[i:], m.Tx)
i = encodeVarintQuery(dAtA, i, uint64(len(m.Tx)))
i--
dAtA[i] = 0x12
}
if m.Success {
i--
if m.Success {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
offset -= sovQuery(v)
base := offset
@@ -1067,27 +696,6 @@ func (m *QueryParamsResponse) Size() (n int) {
return n
}
func (m *QueryIPFSRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
return n
}
func (m *QueryIPFSResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Ipfs {
n += 2
}
return n
}
func (m *QuerySchemaRequest) Size() (n int) {
if m == nil {
return 0
@@ -1135,39 +743,6 @@ func (m *SyncResponse) Size() (n int) {
return n
}
func (m *BuildTxRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Did)
if l > 0 {
n += 1 + l + sovQuery(uint64(l))
}
l = len(m.Pkl)
if l > 0 {
n += 1 + l + sovQuery(uint64(l))
}
return n
}
func (m *BuildTxResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Success {
n += 2
}
l = len(m.Tx)
if l > 0 {
n += 1 + l + sovQuery(uint64(l))
}
return n
}
func sovQuery(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -1310,126 +885,6 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *QueryIPFSRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: QueryIPFSRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: QueryIPFSRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *QueryIPFSResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: QueryIPFSResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: QueryIPFSResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Ipfs", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Ipfs = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *QuerySchemaRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1718,222 +1173,6 @@ func (m *SyncResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *BuildTxRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: BuildTxRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: BuildTxRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthQuery
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthQuery
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Did = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Pkl", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthQuery
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthQuery
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Pkl = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *BuildTxResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: BuildTxResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: BuildTxResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Success = bool(v != 0)
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthQuery
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthQuery
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Tx = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipQuery(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
-83
View File
@@ -51,42 +51,6 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
}
var (
filter_Query_BuildTx_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Query_BuildTx_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq BuildTxRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BuildTx_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.BuildTx(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Query_BuildTx_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq BuildTxRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BuildTx_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.BuildTx(ctx, &protoReq)
return msg, metadata, err
}
func request_Query_Schema_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QuerySchemaRequest
var metadata runtime.ServerMetadata
@@ -170,29 +134,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
})
mux.Handle("POST", pattern_Query_BuildTx_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Query_BuildTx_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_BuildTx_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_Schema_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -300,26 +241,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
})
mux.Handle("POST", pattern_Query_BuildTx_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Query_BuildTx_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_BuildTx_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_Schema_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -366,8 +287,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
var (
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_BuildTx_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "buildtx"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_Schema_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "schema"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_Sync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "sync"}, "", runtime.AssumeColonVerbOpt(false)))
@@ -376,8 +295,6 @@ var (
var (
forward_Query_Params_0 = runtime.ForwardResponseMessage
forward_Query_BuildTx_0 = runtime.ForwardResponseMessage
forward_Query_Schema_0 = runtime.ForwardResponseMessage
forward_Query_Sync_0 = runtime.ForwardResponseMessage