From 5ece7fec2df7c832b9f686c3e9435a5138db98e5 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 31 Jul 2017 20:37:44 -0700 Subject: [PATCH] lnwallet: add a String() method to updateType --- lnwallet/channel.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index d47e31d9..72e3a688 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -114,6 +114,21 @@ const ( Settle ) +// String returns a human readable string that uniquely identifies the target +// update type. +func (u updateType) String() string { + switch u { + case Add: + return "Add" + case Fail: + return "Fail" + case Settle: + return "Settle" + default: + return "" + } +} + // PaymentDescriptor represents a commitment state update which either adds, // settles, or removes an HTLC. PaymentDescriptors encapsulate all necessary // metadata w.r.t to an HTLC, and additional data pairing a settle message to