mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-18 12:44:19 +01:00
Cleanup (#121)
* Cleanup common * Cleanup client * Cleanup server * Renamings * Tidy up proto * Update ocean protos * Fixes * Fixes
This commit is contained in:
committed by
GitHub
parent
1650ea5935
commit
6d0d03e316
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,8 @@ type TransactionServiceClient interface {
|
||||
// Selected utxos are locked for predefined amount of time to prevent
|
||||
// double-spending them.
|
||||
SelectUtxos(ctx context.Context, in *SelectUtxosRequest, opts ...grpc.CallOption) (*SelectUtxosResponse, error)
|
||||
// LockUtxos allows to manually select utxos to spend by a subsequent tx.
|
||||
LockUtxos(ctx context.Context, in *LockUtxosRequest, opts ...grpc.CallOption) (*LockUtxosResponse, error)
|
||||
// EstimateFees returns the fee amount to pay for a tx containing the given
|
||||
// inputs and outputs.
|
||||
EstimateFees(ctx context.Context, in *EstimateFeesRequest, opts ...grpc.CallOption) (*EstimateFeesResponse, error)
|
||||
@@ -87,6 +89,15 @@ func (c *transactionServiceClient) SelectUtxos(ctx context.Context, in *SelectUt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *transactionServiceClient) LockUtxos(ctx context.Context, in *LockUtxosRequest, opts ...grpc.CallOption) (*LockUtxosResponse, error) {
|
||||
out := new(LockUtxosResponse)
|
||||
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/LockUtxos", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *transactionServiceClient) EstimateFees(ctx context.Context, in *EstimateFeesRequest, opts ...grpc.CallOption) (*EstimateFeesResponse, error) {
|
||||
out := new(EstimateFeesResponse)
|
||||
err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/EstimateFees", in, out, opts...)
|
||||
@@ -224,6 +235,8 @@ type TransactionServiceServer interface {
|
||||
// Selected utxos are locked for predefined amount of time to prevent
|
||||
// double-spending them.
|
||||
SelectUtxos(context.Context, *SelectUtxosRequest) (*SelectUtxosResponse, error)
|
||||
// LockUtxos allows to manually select utxos to spend by a subsequent tx.
|
||||
LockUtxos(context.Context, *LockUtxosRequest) (*LockUtxosResponse, error)
|
||||
// EstimateFees returns the fee amount to pay for a tx containing the given
|
||||
// inputs and outputs.
|
||||
EstimateFees(context.Context, *EstimateFeesRequest) (*EstimateFeesResponse, error)
|
||||
@@ -270,6 +283,9 @@ func (UnimplementedTransactionServiceServer) GetTransaction(context.Context, *Ge
|
||||
func (UnimplementedTransactionServiceServer) SelectUtxos(context.Context, *SelectUtxosRequest) (*SelectUtxosResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SelectUtxos not implemented")
|
||||
}
|
||||
func (UnimplementedTransactionServiceServer) LockUtxos(context.Context, *LockUtxosRequest) (*LockUtxosResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LockUtxos not implemented")
|
||||
}
|
||||
func (UnimplementedTransactionServiceServer) EstimateFees(context.Context, *EstimateFeesRequest) (*EstimateFeesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method EstimateFees not implemented")
|
||||
}
|
||||
@@ -360,6 +376,24 @@ func _TransactionService_SelectUtxos_Handler(srv interface{}, ctx context.Contex
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TransactionService_LockUtxos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LockUtxosRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TransactionServiceServer).LockUtxos(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ocean.v1.TransactionService/LockUtxos",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TransactionServiceServer).LockUtxos(ctx, req.(*LockUtxosRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TransactionService_EstimateFees_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EstimateFeesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -627,6 +661,10 @@ var TransactionService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "SelectUtxos",
|
||||
Handler: _TransactionService_SelectUtxos_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LockUtxos",
|
||||
Handler: _TransactionService_LockUtxos_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "EstimateFees",
|
||||
Handler: _TransactionService_EstimateFees_Handler,
|
||||
|
||||
Reference in New Issue
Block a user