mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loop: add support for the probe API
This commit is contained in:
parent
7d044f58e8
commit
f786aaa016
20 changed files with 2118 additions and 849 deletions
|
|
@ -43,13 +43,17 @@ const (
|
|||
// canceling loop out swaps.
|
||||
ProtocolVersionLoopOutCancel = 7
|
||||
|
||||
// ProtocolVerionProbe indicates that the client is able to request
|
||||
// the server to perform a probe to test inbound liquidty.
|
||||
ProtocolVersionProbe ProtocolVersion = 8
|
||||
|
||||
// ProtocolVersionUnrecorded is set for swaps were created before we
|
||||
// started saving protocol version with swaps.
|
||||
ProtocolVersionUnrecorded ProtocolVersion = math.MaxUint32
|
||||
|
||||
// CurrentRPCProtocolVersion defines the version of the RPC protocol
|
||||
// that is currently supported by the loop client.
|
||||
CurrentRPCProtocolVersion = looprpc.ProtocolVersion_LOOP_OUT_CANCEL
|
||||
CurrentRPCProtocolVersion = looprpc.ProtocolVersion_PROBE
|
||||
|
||||
// CurrentInternalProtocolVersion defines the RPC current protocol in
|
||||
// the internal representation.
|
||||
|
|
@ -88,6 +92,9 @@ func (p ProtocolVersion) String() string {
|
|||
case ProtocolVersionLoopOutCancel:
|
||||
return "Loop Out Cancel"
|
||||
|
||||
case ProtocolVersionProbe:
|
||||
return "Probe"
|
||||
|
||||
default:
|
||||
return "Unknown"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ func TestProtocolVersionSanity(t *testing.T) {
|
|||
ProtocolVersionHtlcV2,
|
||||
ProtocolVersionMultiLoopIn,
|
||||
ProtocolVersionLoopOutCancel,
|
||||
ProtocolVersionProbe,
|
||||
}
|
||||
|
||||
rpcVersions := [...]looprpc.ProtocolVersion{
|
||||
|
|
@ -33,6 +34,7 @@ func TestProtocolVersionSanity(t *testing.T) {
|
|||
looprpc.ProtocolVersion_HTLC_V2,
|
||||
looprpc.ProtocolVersion_MULTI_LOOP_IN,
|
||||
looprpc.ProtocolVersion_LOOP_OUT_CANCEL,
|
||||
looprpc.ProtocolVersion_PROBE,
|
||||
}
|
||||
|
||||
require.Equal(t, len(versions), len(rpcVersions))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue