From 5cdf31bfc8873bf71ed3f116570c6928e110ff98 Mon Sep 17 00:00:00 2001 From: George Tsagkarelis Date: Mon, 29 May 2023 13:33:06 +0300 Subject: [PATCH] labels: add easy autoloop labels --- labels/labels.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/labels/labels.go b/labels/labels.go index e17f907..c06e180 100644 --- a/labels/labels.go +++ b/labels/labels.go @@ -23,6 +23,14 @@ const ( // autoIn is the label used for loop in swaps that are automatically // dispatched. autoIn = "autoloop-in" + + // easyAutoOut is the label used for easy loop out swaps that are + // automatically dispatched. + easyAutoOut = "easy-autoloop-out" + + // easyAutoIn is the label used for easy loop in swaps that are + // automatically dispatched. + easyAutoIn = "easy-autoloop-in" ) var ( @@ -44,6 +52,16 @@ func AutoloopLabel(swapType swap.Type) string { return fmt.Sprintf("%v: %v", Reserved, autoIn) } +// EasyAutoloopLabel returns a label with the reserved prefix that identifies +// automatically dispatched swaps depending on the type of swap being executed. +func EasyAutoloopLabel(swapType swap.Type) string { + if swapType == swap.TypeOut { + return fmt.Sprintf("%v: %v", Reserved, easyAutoOut) + } + + return fmt.Sprintf("%v: %v", Reserved, easyAutoIn) +} + // Validate checks that a label is of appropriate length and is not in our list // of reserved labels. func Validate(label string) error {