multi: add ProtocolVersion_HTLC_V3

This commit is contained in:
Andras Banki-Horvath 2022-04-24 22:29:13 +02:00
parent 7cc6ef2ffd
commit 9b37d744a0
No known key found for this signature in database
GPG key ID: 80E5375C094198D8
7 changed files with 177 additions and 153 deletions

View file

@ -51,13 +51,17 @@ const (
// in order to enhance off-chain payments corresponding to a swap.
ProtocolVersionRoutingPlugin = 9
// ProtocolVersionHtlcV3 indicates that the client will now use the new
// HTLC v3 (P2TR) script for swaps.
ProtocolVersionHtlcV3 = 10
// 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_ROUTING_PLUGIN
CurrentRPCProtocolVersion = looprpc.ProtocolVersion_HTLC_V3
// CurrentInternalProtocolVersion defines the RPC current protocol in
// the internal representation.
@ -102,6 +106,9 @@ func (p ProtocolVersion) String() string {
case ProtocolVersionRoutingPlugin:
return "Routing Plugin"
case ProtocolVersionHtlcV3:
return "HTLC V3"
default:
return "Unknown"
}

View file

@ -24,6 +24,7 @@ func TestProtocolVersionSanity(t *testing.T) {
ProtocolVersionLoopOutCancel,
ProtocolVersionProbe,
ProtocolVersionRoutingPlugin,
ProtocolVersionHtlcV3,
}
rpcVersions := [...]looprpc.ProtocolVersion{
@ -37,6 +38,7 @@ func TestProtocolVersionSanity(t *testing.T) {
looprpc.ProtocolVersion_LOOP_OUT_CANCEL,
looprpc.ProtocolVersion_PROBE,
looprpc.ProtocolVersion_ROUTING_PLUGIN,
looprpc.ProtocolVersion_HTLC_V3,
}
require.Equal(t, len(versions), len(rpcVersions))