|
|
@ -23,6 +23,14 @@ const (
|
|
|
|
// autoIn is the label used for loop in swaps that are automatically
|
|
|
|
// autoIn is the label used for loop in swaps that are automatically
|
|
|
|
// dispatched.
|
|
|
|
// dispatched.
|
|
|
|
autoIn = "autoloop-in"
|
|
|
|
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 (
|
|
|
|
var (
|
|
|
@ -44,6 +52,16 @@ func AutoloopLabel(swapType swap.Type) string {
|
|
|
|
return fmt.Sprintf("%v: %v", Reserved, autoIn)
|
|
|
|
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
|
|
|
|
// Validate checks that a label is of appropriate length and is not in our list
|
|
|
|
// of reserved labels.
|
|
|
|
// of reserved labels.
|
|
|
|
func Validate(label string) error {
|
|
|
|
func Validate(label string) error {
|
|
|
|