Merge pull request #4012 from halseth/mpp-paymentid-error

[trivial] channeldb: remove unused payments status serialization
This commit is contained in:
Johan T. Halseth 2020-02-18 21:37:02 +01:00 committed by GitHub
commit 3da5ca0bd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 {