github.com/ledgerwatch/erigon-lib@v1.0.0/gointerfaces/txpool/txpool_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.3.0
     4  // - protoc             v4.24.2
     5  // source: txpool/txpool.proto
     6  
     7  package txpool
     8  
     9  import (
    10  	context "context"
    11  	types "github.com/ledgerwatch/erigon-lib/gointerfaces/types"
    12  	grpc "google.golang.org/grpc"
    13  	codes "google.golang.org/grpc/codes"
    14  	status "google.golang.org/grpc/status"
    15  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    16  )
    17  
    18  // This is a compile-time assertion to ensure that this generated file
    19  // is compatible with the grpc package it is being compiled against.
    20  // Requires gRPC-Go v1.32.0 or later.
    21  const _ = grpc.SupportPackageIsVersion7
    22  
    23  const (
    24  	Txpool_Version_FullMethodName      = "/txpool.Txpool/Version"
    25  	Txpool_FindUnknown_FullMethodName  = "/txpool.Txpool/FindUnknown"
    26  	Txpool_Add_FullMethodName          = "/txpool.Txpool/Add"
    27  	Txpool_Transactions_FullMethodName = "/txpool.Txpool/Transactions"
    28  	Txpool_All_FullMethodName          = "/txpool.Txpool/All"
    29  	Txpool_Pending_FullMethodName      = "/txpool.Txpool/Pending"
    30  	Txpool_OnAdd_FullMethodName        = "/txpool.Txpool/OnAdd"
    31  	Txpool_Status_FullMethodName       = "/txpool.Txpool/Status"
    32  	Txpool_Nonce_FullMethodName        = "/txpool.Txpool/Nonce"
    33  )
    34  
    35  // TxpoolClient is the client API for Txpool service.
    36  //
    37  // 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.
    38  type TxpoolClient interface {
    39  	// Version returns the service version number
    40  	Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.VersionReply, error)
    41  	// preserves incoming order, changes amount, unknown hashes will be omitted
    42  	FindUnknown(ctx context.Context, in *TxHashes, opts ...grpc.CallOption) (*TxHashes, error)
    43  	// Expecting signed transactions. Preserves incoming order and amount
    44  	// Adding txs as local (use P2P to add remote txs)
    45  	Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddReply, error)
    46  	// preserves incoming order and amount, if some transaction doesn't exists in pool - returns nil in this slot
    47  	Transactions(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (*TransactionsReply, error)
    48  	// returns all transactions from tx pool
    49  	All(ctx context.Context, in *AllRequest, opts ...grpc.CallOption) (*AllReply, error)
    50  	// Returns all pending (processable) transactions, in ready-for-mining order
    51  	Pending(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PendingReply, error)
    52  	// subscribe to new transactions add event
    53  	OnAdd(ctx context.Context, in *OnAddRequest, opts ...grpc.CallOption) (Txpool_OnAddClient, error)
    54  	// returns high level status
    55  	Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error)
    56  	// returns nonce for given account
    57  	Nonce(ctx context.Context, in *NonceRequest, opts ...grpc.CallOption) (*NonceReply, error)
    58  }
    59  
    60  type txpoolClient struct {
    61  	cc grpc.ClientConnInterface
    62  }
    63  
    64  func NewTxpoolClient(cc grpc.ClientConnInterface) TxpoolClient {
    65  	return &txpoolClient{cc}
    66  }
    67  
    68  func (c *txpoolClient) Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.VersionReply, error) {
    69  	out := new(types.VersionReply)
    70  	err := c.cc.Invoke(ctx, Txpool_Version_FullMethodName, in, out, opts...)
    71  	if err != nil {
    72  		return nil, err
    73  	}
    74  	return out, nil
    75  }
    76  
    77  func (c *txpoolClient) FindUnknown(ctx context.Context, in *TxHashes, opts ...grpc.CallOption) (*TxHashes, error) {
    78  	out := new(TxHashes)
    79  	err := c.cc.Invoke(ctx, Txpool_FindUnknown_FullMethodName, in, out, opts...)
    80  	if err != nil {
    81  		return nil, err
    82  	}
    83  	return out, nil
    84  }
    85  
    86  func (c *txpoolClient) Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddReply, error) {
    87  	out := new(AddReply)
    88  	err := c.cc.Invoke(ctx, Txpool_Add_FullMethodName, in, out, opts...)
    89  	if err != nil {
    90  		return nil, err
    91  	}
    92  	return out, nil
    93  }
    94  
    95  func (c *txpoolClient) Transactions(ctx context.Context, in *TransactionsRequest, opts ...grpc.CallOption) (*TransactionsReply, error) {
    96  	out := new(TransactionsReply)
    97  	err := c.cc.Invoke(ctx, Txpool_Transactions_FullMethodName, in, out, opts...)
    98  	if err != nil {
    99  		return nil, err
   100  	}
   101  	return out, nil
   102  }
   103  
   104  func (c *txpoolClient) All(ctx context.Context, in *AllRequest, opts ...grpc.CallOption) (*AllReply, error) {
   105  	out := new(AllReply)
   106  	err := c.cc.Invoke(ctx, Txpool_All_FullMethodName, in, out, opts...)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	return out, nil
   111  }
   112  
   113  func (c *txpoolClient) Pending(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PendingReply, error) {
   114  	out := new(PendingReply)
   115  	err := c.cc.Invoke(ctx, Txpool_Pending_FullMethodName, in, out, opts...)
   116  	if err != nil {
   117  		return nil, err
   118  	}
   119  	return out, nil
   120  }
   121  
   122  func (c *txpoolClient) OnAdd(ctx context.Context, in *OnAddRequest, opts ...grpc.CallOption) (Txpool_OnAddClient, error) {
   123  	stream, err := c.cc.NewStream(ctx, &Txpool_ServiceDesc.Streams[0], Txpool_OnAdd_FullMethodName, opts...)
   124  	if err != nil {
   125  		return nil, err
   126  	}
   127  	x := &txpoolOnAddClient{stream}
   128  	if err := x.ClientStream.SendMsg(in); err != nil {
   129  		return nil, err
   130  	}
   131  	if err := x.ClientStream.CloseSend(); err != nil {
   132  		return nil, err
   133  	}
   134  	return x, nil
   135  }
   136  
   137  type Txpool_OnAddClient interface {
   138  	Recv() (*OnAddReply, error)
   139  	grpc.ClientStream
   140  }
   141  
   142  type txpoolOnAddClient struct {
   143  	grpc.ClientStream
   144  }
   145  
   146  func (x *txpoolOnAddClient) Recv() (*OnAddReply, error) {
   147  	m := new(OnAddReply)
   148  	if err := x.ClientStream.RecvMsg(m); err != nil {
   149  		return nil, err
   150  	}
   151  	return m, nil
   152  }
   153  
   154  func (c *txpoolClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error) {
   155  	out := new(StatusReply)
   156  	err := c.cc.Invoke(ctx, Txpool_Status_FullMethodName, in, out, opts...)
   157  	if err != nil {
   158  		return nil, err
   159  	}
   160  	return out, nil
   161  }
   162  
   163  func (c *txpoolClient) Nonce(ctx context.Context, in *NonceRequest, opts ...grpc.CallOption) (*NonceReply, error) {
   164  	out := new(NonceReply)
   165  	err := c.cc.Invoke(ctx, Txpool_Nonce_FullMethodName, in, out, opts...)
   166  	if err != nil {
   167  		return nil, err
   168  	}
   169  	return out, nil
   170  }
   171  
   172  // TxpoolServer is the server API for Txpool service.
   173  // All implementations must embed UnimplementedTxpoolServer
   174  // for forward compatibility
   175  type TxpoolServer interface {
   176  	// Version returns the service version number
   177  	Version(context.Context, *emptypb.Empty) (*types.VersionReply, error)
   178  	// preserves incoming order, changes amount, unknown hashes will be omitted
   179  	FindUnknown(context.Context, *TxHashes) (*TxHashes, error)
   180  	// Expecting signed transactions. Preserves incoming order and amount
   181  	// Adding txs as local (use P2P to add remote txs)
   182  	Add(context.Context, *AddRequest) (*AddReply, error)
   183  	// preserves incoming order and amount, if some transaction doesn't exists in pool - returns nil in this slot
   184  	Transactions(context.Context, *TransactionsRequest) (*TransactionsReply, error)
   185  	// returns all transactions from tx pool
   186  	All(context.Context, *AllRequest) (*AllReply, error)
   187  	// Returns all pending (processable) transactions, in ready-for-mining order
   188  	Pending(context.Context, *emptypb.Empty) (*PendingReply, error)
   189  	// subscribe to new transactions add event
   190  	OnAdd(*OnAddRequest, Txpool_OnAddServer) error
   191  	// returns high level status
   192  	Status(context.Context, *StatusRequest) (*StatusReply, error)
   193  	// returns nonce for given account
   194  	Nonce(context.Context, *NonceRequest) (*NonceReply, error)
   195  	mustEmbedUnimplementedTxpoolServer()
   196  }
   197  
   198  // UnimplementedTxpoolServer must be embedded to have forward compatible implementations.
   199  type UnimplementedTxpoolServer struct {
   200  }
   201  
   202  func (UnimplementedTxpoolServer) Version(context.Context, *emptypb.Empty) (*types.VersionReply, error) {
   203  	return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
   204  }
   205  func (UnimplementedTxpoolServer) FindUnknown(context.Context, *TxHashes) (*TxHashes, error) {
   206  	return nil, status.Errorf(codes.Unimplemented, "method FindUnknown not implemented")
   207  }
   208  func (UnimplementedTxpoolServer) Add(context.Context, *AddRequest) (*AddReply, error) {
   209  	return nil, status.Errorf(codes.Unimplemented, "method Add not implemented")
   210  }
   211  func (UnimplementedTxpoolServer) Transactions(context.Context, *TransactionsRequest) (*TransactionsReply, error) {
   212  	return nil, status.Errorf(codes.Unimplemented, "method Transactions not implemented")
   213  }
   214  func (UnimplementedTxpoolServer) All(context.Context, *AllRequest) (*AllReply, error) {
   215  	return nil, status.Errorf(codes.Unimplemented, "method All not implemented")
   216  }
   217  func (UnimplementedTxpoolServer) Pending(context.Context, *emptypb.Empty) (*PendingReply, error) {
   218  	return nil, status.Errorf(codes.Unimplemented, "method Pending not implemented")
   219  }
   220  func (UnimplementedTxpoolServer) OnAdd(*OnAddRequest, Txpool_OnAddServer) error {
   221  	return status.Errorf(codes.Unimplemented, "method OnAdd not implemented")
   222  }
   223  func (UnimplementedTxpoolServer) Status(context.Context, *StatusRequest) (*StatusReply, error) {
   224  	return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
   225  }
   226  func (UnimplementedTxpoolServer) Nonce(context.Context, *NonceRequest) (*NonceReply, error) {
   227  	return nil, status.Errorf(codes.Unimplemented, "method Nonce not implemented")
   228  }
   229  func (UnimplementedTxpoolServer) mustEmbedUnimplementedTxpoolServer() {}
   230  
   231  // UnsafeTxpoolServer may be embedded to opt out of forward compatibility for this service.
   232  // Use of this interface is not recommended, as added methods to TxpoolServer will
   233  // result in compilation errors.
   234  type UnsafeTxpoolServer interface {
   235  	mustEmbedUnimplementedTxpoolServer()
   236  }
   237  
   238  func RegisterTxpoolServer(s grpc.ServiceRegistrar, srv TxpoolServer) {
   239  	s.RegisterService(&Txpool_ServiceDesc, srv)
   240  }
   241  
   242  func _Txpool_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   243  	in := new(emptypb.Empty)
   244  	if err := dec(in); err != nil {
   245  		return nil, err
   246  	}
   247  	if interceptor == nil {
   248  		return srv.(TxpoolServer).Version(ctx, in)
   249  	}
   250  	info := &grpc.UnaryServerInfo{
   251  		Server:     srv,
   252  		FullMethod: Txpool_Version_FullMethodName,
   253  	}
   254  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   255  		return srv.(TxpoolServer).Version(ctx, req.(*emptypb.Empty))
   256  	}
   257  	return interceptor(ctx, in, info, handler)
   258  }
   259  
   260  func _Txpool_FindUnknown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   261  	in := new(TxHashes)
   262  	if err := dec(in); err != nil {
   263  		return nil, err
   264  	}
   265  	if interceptor == nil {
   266  		return srv.(TxpoolServer).FindUnknown(ctx, in)
   267  	}
   268  	info := &grpc.UnaryServerInfo{
   269  		Server:     srv,
   270  		FullMethod: Txpool_FindUnknown_FullMethodName,
   271  	}
   272  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   273  		return srv.(TxpoolServer).FindUnknown(ctx, req.(*TxHashes))
   274  	}
   275  	return interceptor(ctx, in, info, handler)
   276  }
   277  
   278  func _Txpool_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   279  	in := new(AddRequest)
   280  	if err := dec(in); err != nil {
   281  		return nil, err
   282  	}
   283  	if interceptor == nil {
   284  		return srv.(TxpoolServer).Add(ctx, in)
   285  	}
   286  	info := &grpc.UnaryServerInfo{
   287  		Server:     srv,
   288  		FullMethod: Txpool_Add_FullMethodName,
   289  	}
   290  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   291  		return srv.(TxpoolServer).Add(ctx, req.(*AddRequest))
   292  	}
   293  	return interceptor(ctx, in, info, handler)
   294  }
   295  
   296  func _Txpool_Transactions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   297  	in := new(TransactionsRequest)
   298  	if err := dec(in); err != nil {
   299  		return nil, err
   300  	}
   301  	if interceptor == nil {
   302  		return srv.(TxpoolServer).Transactions(ctx, in)
   303  	}
   304  	info := &grpc.UnaryServerInfo{
   305  		Server:     srv,
   306  		FullMethod: Txpool_Transactions_FullMethodName,
   307  	}
   308  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   309  		return srv.(TxpoolServer).Transactions(ctx, req.(*TransactionsRequest))
   310  	}
   311  	return interceptor(ctx, in, info, handler)
   312  }
   313  
   314  func _Txpool_All_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   315  	in := new(AllRequest)
   316  	if err := dec(in); err != nil {
   317  		return nil, err
   318  	}
   319  	if interceptor == nil {
   320  		return srv.(TxpoolServer).All(ctx, in)
   321  	}
   322  	info := &grpc.UnaryServerInfo{
   323  		Server:     srv,
   324  		FullMethod: Txpool_All_FullMethodName,
   325  	}
   326  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   327  		return srv.(TxpoolServer).All(ctx, req.(*AllRequest))
   328  	}
   329  	return interceptor(ctx, in, info, handler)
   330  }
   331  
   332  func _Txpool_Pending_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   333  	in := new(emptypb.Empty)
   334  	if err := dec(in); err != nil {
   335  		return nil, err
   336  	}
   337  	if interceptor == nil {
   338  		return srv.(TxpoolServer).Pending(ctx, in)
   339  	}
   340  	info := &grpc.UnaryServerInfo{
   341  		Server:     srv,
   342  		FullMethod: Txpool_Pending_FullMethodName,
   343  	}
   344  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   345  		return srv.(TxpoolServer).Pending(ctx, req.(*emptypb.Empty))
   346  	}
   347  	return interceptor(ctx, in, info, handler)
   348  }
   349  
   350  func _Txpool_OnAdd_Handler(srv interface{}, stream grpc.ServerStream) error {
   351  	m := new(OnAddRequest)
   352  	if err := stream.RecvMsg(m); err != nil {
   353  		return err
   354  	}
   355  	return srv.(TxpoolServer).OnAdd(m, &txpoolOnAddServer{stream})
   356  }
   357  
   358  type Txpool_OnAddServer interface {
   359  	Send(*OnAddReply) error
   360  	grpc.ServerStream
   361  }
   362  
   363  type txpoolOnAddServer struct {
   364  	grpc.ServerStream
   365  }
   366  
   367  func (x *txpoolOnAddServer) Send(m *OnAddReply) error {
   368  	return x.ServerStream.SendMsg(m)
   369  }
   370  
   371  func _Txpool_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   372  	in := new(StatusRequest)
   373  	if err := dec(in); err != nil {
   374  		return nil, err
   375  	}
   376  	if interceptor == nil {
   377  		return srv.(TxpoolServer).Status(ctx, in)
   378  	}
   379  	info := &grpc.UnaryServerInfo{
   380  		Server:     srv,
   381  		FullMethod: Txpool_Status_FullMethodName,
   382  	}
   383  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   384  		return srv.(TxpoolServer).Status(ctx, req.(*StatusRequest))
   385  	}
   386  	return interceptor(ctx, in, info, handler)
   387  }
   388  
   389  func _Txpool_Nonce_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   390  	in := new(NonceRequest)
   391  	if err := dec(in); err != nil {
   392  		return nil, err
   393  	}
   394  	if interceptor == nil {
   395  		return srv.(TxpoolServer).Nonce(ctx, in)
   396  	}
   397  	info := &grpc.UnaryServerInfo{
   398  		Server:     srv,
   399  		FullMethod: Txpool_Nonce_FullMethodName,
   400  	}
   401  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   402  		return srv.(TxpoolServer).Nonce(ctx, req.(*NonceRequest))
   403  	}
   404  	return interceptor(ctx, in, info, handler)
   405  }
   406  
   407  // Txpool_ServiceDesc is the grpc.ServiceDesc for Txpool service.
   408  // It's only intended for direct use with grpc.RegisterService,
   409  // and not to be introspected or modified (even as a copy)
   410  var Txpool_ServiceDesc = grpc.ServiceDesc{
   411  	ServiceName: "txpool.Txpool",
   412  	HandlerType: (*TxpoolServer)(nil),
   413  	Methods: []grpc.MethodDesc{
   414  		{
   415  			MethodName: "Version",
   416  			Handler:    _Txpool_Version_Handler,
   417  		},
   418  		{
   419  			MethodName: "FindUnknown",
   420  			Handler:    _Txpool_FindUnknown_Handler,
   421  		},
   422  		{
   423  			MethodName: "Add",
   424  			Handler:    _Txpool_Add_Handler,
   425  		},
   426  		{
   427  			MethodName: "Transactions",
   428  			Handler:    _Txpool_Transactions_Handler,
   429  		},
   430  		{
   431  			MethodName: "All",
   432  			Handler:    _Txpool_All_Handler,
   433  		},
   434  		{
   435  			MethodName: "Pending",
   436  			Handler:    _Txpool_Pending_Handler,
   437  		},
   438  		{
   439  			MethodName: "Status",
   440  			Handler:    _Txpool_Status_Handler,
   441  		},
   442  		{
   443  			MethodName: "Nonce",
   444  			Handler:    _Txpool_Nonce_Handler,
   445  		},
   446  	},
   447  	Streams: []grpc.StreamDesc{
   448  		{
   449  			StreamName:    "OnAdd",
   450  			Handler:       _Txpool_OnAdd_Handler,
   451  			ServerStreams: true,
   452  		},
   453  	},
   454  	Metadata: "txpool/txpool.proto",
   455  }