From 19bbdb2c461edc3d5ffc31b189cf6b66ddddc6a8 Mon Sep 17 00:00:00 2001 From: josh <josh@elixxir.io> Date: Thu, 18 Feb 2021 13:57:49 -0800 Subject: [PATCH] Refactor messages.go to results.go --- api/{messages.go => results.go} | 14 ++++++++++++++ api/{messages_test.go => results_test.go} | 0 2 files changed, 14 insertions(+) rename api/{messages.go => results.go} (96%) rename api/{messages_test.go => results_test.go} (100%) diff --git a/api/messages.go b/api/results.go similarity index 96% rename from api/messages.go rename to api/results.go index a44ca4ce0..9cd07a081 100644 --- a/api/messages.go +++ b/api/results.go @@ -7,6 +7,7 @@ package api import ( + "fmt" jww "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/client/globals" "gitlab.com/elixxir/client/network/gateway" @@ -28,6 +29,19 @@ const ( Succeeded ) +func (rr RoundResult) String() string { + switch rr { + case TimeOut: + return "TimeOut" + case Failed: + return "Failed" + case Succeeded: + return "Succeeded" + default: + return fmt.Sprintf("UNKNOWN RESULT: %d", RR) + } +} + // Callback interface which reports the requested rounds. // Designed such that the caller may decide how much detail they need. // allRoundsSucceeded: diff --git a/api/messages_test.go b/api/results_test.go similarity index 100% rename from api/messages_test.go rename to api/results_test.go -- GitLab