looprpc: extend client.proto with lnrpc.OutPoint and lnrpc.OpenChannelRequest

In this commit we import the lnd's lightning.proto into client.proto to
then be able to use lnrpc.OutPoint and lnrpc.OpenChannelRequest instead
of the looprpc.OutPoint type.
This is safe because the lnrpc and looprpc versions of OutPoint are the
same type.
This commit is contained in:
Slyghtning 2025-05-21 14:08:54 +02:00
parent 6aaacf8b93
commit f47b611557
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF
7 changed files with 1002 additions and 584 deletions

View file

@ -32,6 +32,7 @@ import (
"github.com/lightninglabs/loop/staticaddr/address"
"github.com/lightninglabs/loop/staticaddr/deposit"
"github.com/lightninglabs/loop/staticaddr/loopin"
"github.com/lightninglabs/loop/staticaddr/staticutil"
"github.com/lightninglabs/loop/staticaddr/withdraw"
"github.com/lightninglabs/loop/swap"
"github.com/lightninglabs/loop/swapserverrpc"
@ -1763,7 +1764,7 @@ func (s *swapClientServer) WithdrawDeposits(ctx context.Context,
}
case isUtxoSelected:
outpoints, err = toServerOutpoints(req.Outpoints)
outpoints, err = staticutil.ToWireOutpoints(req.Outpoints)
if err != nil {
return nil, err
}
@ -2328,23 +2329,6 @@ func toServerState(state looprpc.DepositState) fsm.StateType {
}
}
func toServerOutpoints(outpoints []*looprpc.OutPoint) ([]wire.OutPoint,
error) {
var serverOutpoints []wire.OutPoint
for _, o := range outpoints {
outpointStr := fmt.Sprintf("%s:%d", o.TxidStr, o.OutputIndex)
newOutpoint, err := wire.NewOutPointFromString(outpointStr)
if err != nil {
return nil, err
}
serverOutpoints = append(serverOutpoints, *newOutpoint)
}
return serverOutpoints, nil
}
func rpcAutoloopReason(reason liquidity.Reason) (looprpc.AutoReason, error) {
switch reason {
case liquidity.ReasonNone: