channeldb: remove unused payments status serialization

This commit is contained in:
Johan T. Halseth 2020-02-18 13:01:57 +01:00
parent 3e9087a0f4
commit cdf3a49c54
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -3,7 +3,6 @@ package channeldb
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"io"
"sort"
@ -154,27 +153,6 @@ const (
StatusFailed PaymentStatus = 3
)
// Bytes returns status as slice of bytes.
func (ps PaymentStatus) Bytes() []byte {
return []byte{byte(ps)}
}
// FromBytes sets status from slice of bytes.
func (ps *PaymentStatus) FromBytes(status []byte) error {
if len(status) != 1 {
return errors.New("payment status is empty")
}
switch PaymentStatus(status[0]) {
case StatusUnknown, StatusInFlight, StatusSucceeded, StatusFailed:
*ps = PaymentStatus(status[0])
default:
return errors.New("unknown payment status")
}
return nil
}
// String returns readable representation of payment status.
func (ps PaymentStatus) String() string {
switch ps {