// Code generated by protoc-gen-go. DO NOT EDIT.
// source: rpc.proto

package rpc

import (
	context "context"
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	math "math"
)

// 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.ProtoPackageIsVersion3 // please upgrade the proto package

func init() { proto.RegisterFile("rpc.proto", fileDescriptor_77a6da22d6a3feb1) }

var fileDescriptor_77a6da22d6a3feb1 = []byte{
	// 334 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xcd, 0x4e, 0xf2, 0x40,
	0x14, 0x86, 0x21, 0x7c, 0xf9, 0xa2, 0x63, 0x08, 0x38, 0x26, 0x2a, 0xc5, 0x15, 0x71, 0xe1, 0xc6,
	0xe2, 0xcf, 0xca, 0xa5, 0x60, 0x84, 0x98, 0xa0, 0x15, 0x5c, 0xb9, 0x1b, 0x86, 0x93, 0xa1, 0x11,
	0x66, 0xc6, 0x33, 0xd3, 0x98, 0xde, 0x9b, 0x17, 0x67, 0x3a, 0xfd, 0x09, 0xb5, 0xdd, 0xb9, 0x6a,
	0xfa, 0x9c, 0xf3, 0x3e, 0x79, 0xd3, 0x1e, 0xb2, 0x8f, 0x9a, 0xfb, 0x1a, 0x95, 0x55, 0xb4, 0x85,
	0x9a, 0x7b, 0xed, 0x2d, 0x18, 0xc3, 0x04, 0xa4, 0xec, 0xe6, 0xfb, 0x1f, 0x69, 0xcd, 0x35, 0xa7,
	0x53, 0xd2, 0x9e, 0x80, 0x0d, 0x58, 0x3c, 0x0d, 0x8d, 0x55, 0x18, 0xd3, 0x9e, 0x9f, 0x04, 0x4b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fd, 0x5c, 0x84, 0x76, 0x1d, 0x2d, 0x7d, 0xae, 0xb6, 0x43,
	0xb7, 0x71, 0x99, 0xe5, 0x86, 0x42, 0xb9, 0x4e, 0x43, 0xd4, 0x7c, 0xf9, 0xdf, 0x1d, 0xe5, 0xed,
	0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5e, 0xea, 0xed, 0x80, 0xb5, 0x02, 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

// RpcClient is the client API for Rpc service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type RpcClient interface {
	GetPayHistory(ctx context.Context, in *GetPayHistoryRequest, opts ...grpc.CallOption) (*GetPayHistoryResponse, error)
	QueryDelegation(ctx context.Context, in *QueryDelegationRequest, opts ...grpc.CallOption) (*QueryDelegationResponse, error)
	RequestDelegation(ctx context.Context, in *DelegationRequest, opts ...grpc.CallOption) (*DelegationResponse, error)
	CelerOpenChannel(ctx context.Context, in *OpenChannelRequest, opts ...grpc.CallOption) (*OpenChannelResponse, error)
	CelerOpenTcbChannel(ctx context.Context, in *OpenChannelRequest, opts ...grpc.CallOption) (*OpenChannelResponse, error)
	CelerGetPeerStatus(ctx context.Context, in *PeerAddress, opts ...grpc.CallOption) (*PeerStatus, error)
	// unified offchain bidi streaming rpc and msg definition
	CelerStream(ctx context.Context, opts ...grpc.CallOption) (Rpc_CelerStreamClient, error)
	CelerMigrateChannel(ctx context.Context, in *MigrateChannelRequest, opts ...grpc.CallOption) (*MigrateChannelResponse, error)
}

type rpcClient struct {
	cc *grpc.ClientConn
}

func NewRpcClient(cc *grpc.ClientConn) RpcClient {
	return &rpcClient{cc}
}

func (c *rpcClient) GetPayHistory(ctx context.Context, in *GetPayHistoryRequest, opts ...grpc.CallOption) (*GetPayHistoryResponse, error) {
	out := new(GetPayHistoryResponse)
	err := c.cc.Invoke(ctx, "/rpc.Rpc/GetPayHistory", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *rpcClient) QueryDelegation(ctx context.Context, in *QueryDelegationRequest, opts ...grpc.CallOption) (*QueryDelegationResponse, error) {
	out := new(QueryDelegationResponse)
	err := c.cc.Invoke(ctx, "/rpc.Rpc/QueryDelegation", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *rpcClient) RequestDelegation(ctx context.Context, in *DelegationRequest, opts ...grpc.CallOption) (*DelegationResponse, error) {
	out := new(DelegationResponse)
	err := c.cc.Invoke(ctx, "/rpc.Rpc/RequestDelegation", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *rpcClient) CelerOpenChannel(ctx context.Context, in *OpenChannelRequest, opts ...grpc.CallOption) (*OpenChannelResponse, error) {
	out := new(OpenChannelResponse)
	err := c.cc.Invoke(ctx, "/rpc.Rpc/CelerOpenChannel", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *rpcClient) CelerOpenTcbChannel(ctx context.Context, in *OpenChannelRequest, opts ...grpc.CallOption) (*OpenChannelResponse, error) {
	out := new(OpenChannelResponse)
	err := c.cc.Invoke(ctx, "/rpc.Rpc/CelerOpenTcbChannel", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *rpcClient) CelerGetPeerStatus(ctx context.Context, in *PeerAddress, opts ...grpc.CallOption) (*PeerStatus, error) {
	out := new(PeerStatus)
	err := c.cc.Invoke(ctx, "/rpc.Rpc/CelerGetPeerStatus", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *rpcClient) CelerStream(ctx context.Context, opts ...grpc.CallOption) (Rpc_CelerStreamClient, error) {
	stream, err := c.cc.NewStream(ctx, &_Rpc_serviceDesc.Streams[0], "/rpc.Rpc/CelerStream", opts...)
	if err != nil {
		return nil, err
	}
	x := &rpcCelerStreamClient{stream}
	return x, nil
}

type Rpc_CelerStreamClient interface {
	Send(*CelerMsg) error
	Recv() (*CelerMsg, error)
	grpc.ClientStream
}

type rpcCelerStreamClient struct {
	grpc.ClientStream
}

func (x *rpcCelerStreamClient) Send(m *CelerMsg) error {
	return x.ClientStream.SendMsg(m)
}

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

func (c *rpcClient) CelerMigrateChannel(ctx context.Context, in *MigrateChannelRequest, opts ...grpc.CallOption) (*MigrateChannelResponse, error) {
	out := new(MigrateChannelResponse)
	err := c.cc.Invoke(ctx, "/rpc.Rpc/CelerMigrateChannel", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// RpcServer is the server API for Rpc service.
type RpcServer interface {
	GetPayHistory(context.Context, *GetPayHistoryRequest) (*GetPayHistoryResponse, error)
	QueryDelegation(context.Context, *QueryDelegationRequest) (*QueryDelegationResponse, error)
	RequestDelegation(context.Context, *DelegationRequest) (*DelegationResponse, error)
	CelerOpenChannel(context.Context, *OpenChannelRequest) (*OpenChannelResponse, error)
	CelerOpenTcbChannel(context.Context, *OpenChannelRequest) (*OpenChannelResponse, error)
	CelerGetPeerStatus(context.Context, *PeerAddress) (*PeerStatus, error)
	// unified offchain bidi streaming rpc and msg definition
	CelerStream(Rpc_CelerStreamServer) error
	CelerMigrateChannel(context.Context, *MigrateChannelRequest) (*MigrateChannelResponse, error)
}

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

func (*UnimplementedRpcServer) GetPayHistory(ctx context.Context, req *GetPayHistoryRequest) (*GetPayHistoryResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetPayHistory not implemented")
}
func (*UnimplementedRpcServer) QueryDelegation(ctx context.Context, req *QueryDelegationRequest) (*QueryDelegationResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method QueryDelegation not implemented")
}
func (*UnimplementedRpcServer) RequestDelegation(ctx context.Context, req *DelegationRequest) (*DelegationResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RequestDelegation not implemented")
}
func (*UnimplementedRpcServer) CelerOpenChannel(ctx context.Context, req *OpenChannelRequest) (*OpenChannelResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CelerOpenChannel not implemented")
}
func (*UnimplementedRpcServer) CelerOpenTcbChannel(ctx context.Context, req *OpenChannelRequest) (*OpenChannelResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CelerOpenTcbChannel not implemented")
}
func (*UnimplementedRpcServer) CelerGetPeerStatus(ctx context.Context, req *PeerAddress) (*PeerStatus, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CelerGetPeerStatus not implemented")
}
func (*UnimplementedRpcServer) CelerStream(srv Rpc_CelerStreamServer) error {
	return status.Errorf(codes.Unimplemented, "method CelerStream not implemented")
}
func (*UnimplementedRpcServer) CelerMigrateChannel(ctx context.Context, req *MigrateChannelRequest) (*MigrateChannelResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CelerMigrateChannel not implemented")
}

func RegisterRpcServer(s *grpc.Server, srv RpcServer) {
	s.RegisterService(&_Rpc_serviceDesc, srv)
}

func _Rpc_GetPayHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetPayHistoryRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RpcServer).GetPayHistory(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Rpc/GetPayHistory",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RpcServer).GetPayHistory(ctx, req.(*GetPayHistoryRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Rpc_QueryDelegation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(QueryDelegationRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RpcServer).QueryDelegation(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Rpc/QueryDelegation",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RpcServer).QueryDelegation(ctx, req.(*QueryDelegationRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Rpc_RequestDelegation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DelegationRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RpcServer).RequestDelegation(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Rpc/RequestDelegation",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RpcServer).RequestDelegation(ctx, req.(*DelegationRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Rpc_CelerOpenChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OpenChannelRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RpcServer).CelerOpenChannel(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Rpc/CelerOpenChannel",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RpcServer).CelerOpenChannel(ctx, req.(*OpenChannelRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Rpc_CelerOpenTcbChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OpenChannelRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RpcServer).CelerOpenTcbChannel(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Rpc/CelerOpenTcbChannel",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RpcServer).CelerOpenTcbChannel(ctx, req.(*OpenChannelRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Rpc_CelerGetPeerStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PeerAddress)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RpcServer).CelerGetPeerStatus(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Rpc/CelerGetPeerStatus",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RpcServer).CelerGetPeerStatus(ctx, req.(*PeerAddress))
	}
	return interceptor(ctx, in, info, handler)
}

func _Rpc_CelerStream_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(RpcServer).CelerStream(&rpcCelerStreamServer{stream})
}

type Rpc_CelerStreamServer interface {
	Send(*CelerMsg) error
	Recv() (*CelerMsg, error)
	grpc.ServerStream
}

type rpcCelerStreamServer struct {
	grpc.ServerStream
}

func (x *rpcCelerStreamServer) Send(m *CelerMsg) error {
	return x.ServerStream.SendMsg(m)
}

func (x *rpcCelerStreamServer) Recv() (*CelerMsg, error) {
	m := new(CelerMsg)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _Rpc_CelerMigrateChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(MigrateChannelRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RpcServer).CelerMigrateChannel(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Rpc/CelerMigrateChannel",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RpcServer).CelerMigrateChannel(ctx, req.(*MigrateChannelRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Rpc_serviceDesc = grpc.ServiceDesc{
	ServiceName: "rpc.Rpc",
	HandlerType: (*RpcServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPayHistory",
			Handler:    _Rpc_GetPayHistory_Handler,
		},
		{
			MethodName: "QueryDelegation",
			Handler:    _Rpc_QueryDelegation_Handler,
		},
		{
			MethodName: "RequestDelegation",
			Handler:    _Rpc_RequestDelegation_Handler,
		},
		{
			MethodName: "CelerOpenChannel",
			Handler:    _Rpc_CelerOpenChannel_Handler,
		},
		{
			MethodName: "CelerOpenTcbChannel",
			Handler:    _Rpc_CelerOpenTcbChannel_Handler,
		},
		{
			MethodName: "CelerGetPeerStatus",
			Handler:    _Rpc_CelerGetPeerStatus_Handler,
		},
		{
			MethodName: "CelerMigrateChannel",
			Handler:    _Rpc_CelerMigrateChannel_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "CelerStream",
			Handler:       _Rpc_CelerStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "rpc.proto",
}
