Skip to content

Commit 5cdf31b

Browse files
committed
labels: add easy autoloop labels
1 parent f4419aa commit 5cdf31b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

labels/labels.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ const (
2323
// autoIn is the label used for loop in swaps that are automatically
2424
// dispatched.
2525
autoIn = "autoloop-in"
26+
27+
// easyAutoOut is the label used for easy loop out swaps that are
28+
// automatically dispatched.
29+
easyAutoOut = "easy-autoloop-out"
30+
31+
// easyAutoIn is the label used for easy loop in swaps that are
32+
// automatically dispatched.
33+
easyAutoIn = "easy-autoloop-in"
2634
)
2735

2836
var (
@@ -44,6 +52,16 @@ func AutoloopLabel(swapType swap.Type) string {
4452
return fmt.Sprintf("%v: %v", Reserved, autoIn)
4553
}
4654

55+
// EasyAutoloopLabel returns a label with the reserved prefix that identifies
56+
// automatically dispatched swaps depending on the type of swap being executed.
57+
func EasyAutoloopLabel(swapType swap.Type) string {
58+
if swapType == swap.TypeOut {
59+
return fmt.Sprintf("%v: %v", Reserved, easyAutoOut)
60+
}
61+
62+
return fmt.Sprintf("%v: %v", Reserved, easyAutoIn)
63+
}
64+
4765
// Validate checks that a label is of appropriate length and is not in our list
4866
// of reserved labels.
4967
func Validate(label string) error {

0 commit comments

Comments
 (0)