// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: v1/test.proto

package v1

import (
	context "context"
	fmt "fmt"
	_ "github.com/gogo/protobuf/gogoproto"
	proto "github.com/gogo/protobuf/proto"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	io "io"
	math "math"
	math_bits "math/bits"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package

type TestProposalRequest struct {
	Headers *ProposalRequestHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"`
}

func (m *TestProposalRequest) Reset()         { *m = TestProposalRequest{} }
func (m *TestProposalRequest) String() string { return proto.CompactTextString(m) }
func (*TestProposalRequest) ProtoMessage()    {}
func (*TestProposalRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_9164e87288ef5e21, []int{0}
}
func (m *TestProposalRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *TestProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_TestProposalRequest.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 *TestProposalRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_TestProposalRequest.Merge(m, src)
}
func (m *TestProposalRequest) XXX_Size() int {
	return m.Size()
}
func (m *TestProposalRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_TestProposalRequest.DiscardUnknown(m)
}

var xxx_messageInfo_TestProposalRequest proto.InternalMessageInfo

func (m *TestProposalRequest) GetHeaders() *ProposalRequestHeaders {
	if m != nil {
		return m.Headers
	}
	return nil
}

type TestProposalResponse struct {
	Headers *ProposalResponseHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"`
}

func (m *TestProposalResponse) Reset()         { *m = TestProposalResponse{} }
func (m *TestProposalResponse) String() string { return proto.CompactTextString(m) }
func (*TestProposalResponse) ProtoMessage()    {}
func (*TestProposalResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_9164e87288ef5e21, []int{1}
}
func (m *TestProposalResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *TestProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_TestProposalResponse.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 *TestProposalResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_TestProposalResponse.Merge(m, src)
}
func (m *TestProposalResponse) XXX_Size() int {
	return m.Size()
}
func (m *TestProposalResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_TestProposalResponse.DiscardUnknown(m)
}

var xxx_messageInfo_TestProposalResponse proto.InternalMessageInfo

func (m *TestProposalResponse) GetHeaders() *ProposalResponseHeaders {
	if m != nil {
		return m.Headers
	}
	return nil
}

type TestQueryRequest struct {
	Headers *QueryRequestHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"`
}

func (m *TestQueryRequest) Reset()         { *m = TestQueryRequest{} }
func (m *TestQueryRequest) String() string { return proto.CompactTextString(m) }
func (*TestQueryRequest) ProtoMessage()    {}
func (*TestQueryRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_9164e87288ef5e21, []int{2}
}
func (m *TestQueryRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *TestQueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_TestQueryRequest.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 *TestQueryRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_TestQueryRequest.Merge(m, src)
}
func (m *TestQueryRequest) XXX_Size() int {
	return m.Size()
}
func (m *TestQueryRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_TestQueryRequest.DiscardUnknown(m)
}

var xxx_messageInfo_TestQueryRequest proto.InternalMessageInfo

func (m *TestQueryRequest) GetHeaders() *QueryRequestHeaders {
	if m != nil {
		return m.Headers
	}
	return nil
}

type TestQueryResponse struct {
	Headers *QueryResponseHeaders `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"`
}

func (m *TestQueryResponse) Reset()         { *m = TestQueryResponse{} }
func (m *TestQueryResponse) String() string { return proto.CompactTextString(m) }
func (*TestQueryResponse) ProtoMessage()    {}
func (*TestQueryResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_9164e87288ef5e21, []int{3}
}
func (m *TestQueryResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *TestQueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_TestQueryResponse.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 *TestQueryResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_TestQueryResponse.Merge(m, src)
}
func (m *TestQueryResponse) XXX_Size() int {
	return m.Size()
}
func (m *TestQueryResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_TestQueryResponse.DiscardUnknown(m)
}

var xxx_messageInfo_TestQueryResponse proto.InternalMessageInfo

func (m *TestQueryResponse) GetHeaders() *QueryResponseHeaders {
	if m != nil {
		return m.Headers
	}
	return nil
}

func init() {
	proto.RegisterType((*TestProposalRequest)(nil), "atomix.protocols.rsm.v1.TestProposalRequest")
	proto.RegisterType((*TestProposalResponse)(nil), "atomix.protocols.rsm.v1.TestProposalResponse")
	proto.RegisterType((*TestQueryRequest)(nil), "atomix.protocols.rsm.v1.TestQueryRequest")
	proto.RegisterType((*TestQueryResponse)(nil), "atomix.protocols.rsm.v1.TestQueryResponse")
}

func init() { proto.RegisterFile("v1/test.proto", fileDescriptor_9164e87288ef5e21) }

var fileDescriptor_9164e87288ef5e21 = []byte{
	// 303 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2d, 0x33, 0xd4, 0x2f,
	0x49, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4f, 0x2c, 0xc9, 0xcf, 0xcd,
	0xac, 0x80, 0xf0, 0x92, 0xf3, 0x73, 0x8a, 0xf5, 0x8a, 0x8a, 0x73, 0xf5, 0xca, 0x0c, 0xa5, 0x04,
	0xca, 0x0c, 0xf5, 0x33, 0x52, 0x13, 0x53, 0x52, 0x8b, 0x8a, 0x21, 0x92, 0x52, 0x22, 0xe9, 0xf9,
	0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11, 0x55, 0x4a, 0xe0, 0x12, 0x0e, 0x49, 0x2d, 0x2e,
	0x09, 0x28, 0xca, 0x2f, 0xc8, 0x2f, 0x4e, 0xcc, 0x09, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11,
	0xf2, 0xe4, 0x62, 0x87, 0xea, 0x96, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0xd2, 0xd7, 0xc3, 0x61,
	0x93, 0x1e, 0x9a, 0x56, 0x0f, 0x88, 0xb6, 0x20, 0x98, 0x7e, 0xa5, 0x24, 0x2e, 0x11, 0x54, 0x1b,
	0x8a, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0xbc, 0xd0, 0xad, 0x30, 0x20, 0xc2, 0x0a, 0x88, 0x5e,
	0x0c, 0x3b, 0xa2, 0xb8, 0x04, 0x40, 0x76, 0x04, 0x96, 0xa6, 0x16, 0x55, 0xc2, 0xbc, 0xe0, 0x86,
	0x6e, 0xbe, 0x0e, 0x4e, 0xf3, 0x91, 0xf5, 0x61, 0x98, 0x1d, 0xc3, 0x25, 0x88, 0x64, 0x36, 0xd4,
	0xf1, 0xee, 0xe8, 0x86, 0xeb, 0x12, 0x32, 0x1c, 0xbb, 0xcb, 0x8d, 0xb6, 0x31, 0x73, 0xb1, 0x80,
	0x8c, 0x17, 0xca, 0xe2, 0xe2, 0x46, 0x04, 0x53, 0xaa, 0x10, 0x6e, 0xc7, 0x62, 0x89, 0x2e, 0x29,
	0x5d, 0x22, 0x55, 0x43, 0x5d, 0x5f, 0x04, 0xf1, 0x52, 0x70, 0x49, 0x51, 0x6a, 0x62, 0x2e, 0x3d,
	0x6c, 0x34, 0x60, 0x14, 0x4a, 0xe2, 0xe2, 0x84, 0x07, 0xa3, 0x90, 0x26, 0x5e, 0xdd, 0xc8, 0xd1,
	0x21, 0xa5, 0x45, 0x8c, 0x52, 0xa8, 0xbf, 0xb2, 0xb8, 0xf8, 0x11, 0xfe, 0xa2, 0xa5, 0x4d, 0x06,
	0x8c, 0x4e, 0x12, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3,
	0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x90, 0xc4, 0x06, 0xd6,
	0x6f, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xa8, 0xfb, 0x9a, 0xab, 0x03, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// TestClient is the client API for Test service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type TestClient interface {
	TestPropose(ctx context.Context, in *TestProposalRequest, opts ...grpc.CallOption) (*TestProposalResponse, error)
	TestStreamPropose(ctx context.Context, in *TestProposalRequest, opts ...grpc.CallOption) (Test_TestStreamProposeClient, error)
	TestQuery(ctx context.Context, in *TestQueryRequest, opts ...grpc.CallOption) (*TestQueryResponse, error)
	TestStreamQuery(ctx context.Context, in *TestQueryRequest, opts ...grpc.CallOption) (Test_TestStreamQueryClient, error)
}

type testClient struct {
	cc *grpc.ClientConn
}

func NewTestClient(cc *grpc.ClientConn) TestClient {
	return &testClient{cc}
}

func (c *testClient) TestPropose(ctx context.Context, in *TestProposalRequest, opts ...grpc.CallOption) (*TestProposalResponse, error) {
	out := new(TestProposalResponse)
	err := c.cc.Invoke(ctx, "/atomix.protocols.rsm.v1.Test/TestPropose", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *testClient) TestStreamPropose(ctx context.Context, in *TestProposalRequest, opts ...grpc.CallOption) (Test_TestStreamProposeClient, error) {
	stream, err := c.cc.NewStream(ctx, &_Test_serviceDesc.Streams[0], "/atomix.protocols.rsm.v1.Test/TestStreamPropose", opts...)
	if err != nil {
		return nil, err
	}
	x := &testTestStreamProposeClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type Test_TestStreamProposeClient interface {
	Recv() (*TestProposalResponse, error)
	grpc.ClientStream
}

type testTestStreamProposeClient struct {
	grpc.ClientStream
}

func (x *testTestStreamProposeClient) Recv() (*TestProposalResponse, error) {
	m := new(TestProposalResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *testClient) TestQuery(ctx context.Context, in *TestQueryRequest, opts ...grpc.CallOption) (*TestQueryResponse, error) {
	out := new(TestQueryResponse)
	err := c.cc.Invoke(ctx, "/atomix.protocols.rsm.v1.Test/TestQuery", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *testClient) TestStreamQuery(ctx context.Context, in *TestQueryRequest, opts ...grpc.CallOption) (Test_TestStreamQueryClient, error) {
	stream, err := c.cc.NewStream(ctx, &_Test_serviceDesc.Streams[1], "/atomix.protocols.rsm.v1.Test/TestStreamQuery", opts...)
	if err != nil {
		return nil, err
	}
	x := &testTestStreamQueryClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type Test_TestStreamQueryClient interface {
	Recv() (*TestQueryResponse, error)
	grpc.ClientStream
}

type testTestStreamQueryClient struct {
	grpc.ClientStream
}

func (x *testTestStreamQueryClient) Recv() (*TestQueryResponse, error) {
	m := new(TestQueryResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// TestServer is the server API for Test service.
type TestServer interface {
	TestPropose(context.Context, *TestProposalRequest) (*TestProposalResponse, error)
	TestStreamPropose(*TestProposalRequest, Test_TestStreamProposeServer) error
	TestQuery(context.Context, *TestQueryRequest) (*TestQueryResponse, error)
	TestStreamQuery(*TestQueryRequest, Test_TestStreamQueryServer) error
}

// UnimplementedTestServer can be embedded to have forward compatible implementations.
type UnimplementedTestServer struct {
}

func (*UnimplementedTestServer) TestPropose(ctx context.Context, req *TestProposalRequest) (*TestProposalResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method TestPropose not implemented")
}
func (*UnimplementedTestServer) TestStreamPropose(req *TestProposalRequest, srv Test_TestStreamProposeServer) error {
	return status.Errorf(codes.Unimplemented, "method TestStreamPropose not implemented")
}
func (*UnimplementedTestServer) TestQuery(ctx context.Context, req *TestQueryRequest) (*TestQueryResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method TestQuery not implemented")
}
func (*UnimplementedTestServer) TestStreamQuery(req *TestQueryRequest, srv Test_TestStreamQueryServer) error {
	return status.Errorf(codes.Unimplemented, "method TestStreamQuery not implemented")
}

func RegisterTestServer(s *grpc.Server, srv TestServer) {
	s.RegisterService(&_Test_serviceDesc, srv)
}

func _Test_TestPropose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TestProposalRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TestServer).TestPropose(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.protocols.rsm.v1.Test/TestPropose",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TestServer).TestPropose(ctx, req.(*TestProposalRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Test_TestStreamPropose_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(TestProposalRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(TestServer).TestStreamPropose(m, &testTestStreamProposeServer{stream})
}

type Test_TestStreamProposeServer interface {
	Send(*TestProposalResponse) error
	grpc.ServerStream
}

type testTestStreamProposeServer struct {
	grpc.ServerStream
}

func (x *testTestStreamProposeServer) Send(m *TestProposalResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _Test_TestQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TestQueryRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TestServer).TestQuery(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/atomix.protocols.rsm.v1.Test/TestQuery",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TestServer).TestQuery(ctx, req.(*TestQueryRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Test_TestStreamQuery_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(TestQueryRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(TestServer).TestStreamQuery(m, &testTestStreamQueryServer{stream})
}

type Test_TestStreamQueryServer interface {
	Send(*TestQueryResponse) error
	grpc.ServerStream
}

type testTestStreamQueryServer struct {
	grpc.ServerStream
}

func (x *testTestStreamQueryServer) Send(m *TestQueryResponse) error {
	return x.ServerStream.SendMsg(m)
}

var _Test_serviceDesc = grpc.ServiceDesc{
	ServiceName: "atomix.protocols.rsm.v1.Test",
	HandlerType: (*TestServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "TestPropose",
			Handler:    _Test_TestPropose_Handler,
		},
		{
			MethodName: "TestQuery",
			Handler:    _Test_TestQuery_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "TestStreamPropose",
			Handler:       _Test_TestStreamPropose_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "TestStreamQuery",
			Handler:       _Test_TestStreamQuery_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "v1/test.proto",
}

func (m *TestProposalRequest) 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 *TestProposalRequest) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *TestProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Headers != nil {
		{
			size, err := m.Headers.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintTest(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *TestProposalResponse) 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 *TestProposalResponse) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *TestProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Headers != nil {
		{
			size, err := m.Headers.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintTest(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *TestQueryRequest) 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 *TestQueryRequest) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *TestQueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Headers != nil {
		{
			size, err := m.Headers.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintTest(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *TestQueryResponse) 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 *TestQueryResponse) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *TestQueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Headers != nil {
		{
			size, err := m.Headers.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintTest(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func encodeVarintTest(dAtA []byte, offset int, v uint64) int {
	offset -= sovTest(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *TestProposalRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Headers != nil {
		l = m.Headers.Size()
		n += 1 + l + sovTest(uint64(l))
	}
	return n
}

func (m *TestProposalResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Headers != nil {
		l = m.Headers.Size()
		n += 1 + l + sovTest(uint64(l))
	}
	return n
}

func (m *TestQueryRequest) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Headers != nil {
		l = m.Headers.Size()
		n += 1 + l + sovTest(uint64(l))
	}
	return n
}

func (m *TestQueryResponse) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Headers != nil {
		l = m.Headers.Size()
		n += 1 + l + sovTest(uint64(l))
	}
	return n
}

func sovTest(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozTest(x uint64) (n int) {
	return sovTest(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *TestProposalRequest) 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 ErrIntOverflowTest
			}
			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: TestProposalRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: TestProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowTest
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthTest
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthTest
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Headers == nil {
				m.Headers = &ProposalRequestHeaders{}
			}
			if err := m.Headers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipTest(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthTest
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *TestProposalResponse) 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 ErrIntOverflowTest
			}
			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: TestProposalResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: TestProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowTest
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthTest
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthTest
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Headers == nil {
				m.Headers = &ProposalResponseHeaders{}
			}
			if err := m.Headers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipTest(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthTest
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *TestQueryRequest) 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 ErrIntOverflowTest
			}
			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: TestQueryRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: TestQueryRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowTest
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthTest
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthTest
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Headers == nil {
				m.Headers = &QueryRequestHeaders{}
			}
			if err := m.Headers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipTest(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthTest
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *TestQueryResponse) 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 ErrIntOverflowTest
			}
			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: TestQueryResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: TestQueryResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowTest
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthTest
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthTest
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Headers == nil {
				m.Headers = &QueryResponseHeaders{}
			}
			if err := m.Headers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipTest(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthTest
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipTest(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, ErrIntOverflowTest
			}
			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, ErrIntOverflowTest
				}
				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, ErrIntOverflowTest
				}
				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, ErrInvalidLengthTest
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupTest
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthTest
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthTest        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTest          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTest = fmt.Errorf("proto: unexpected end of group")
)
