channeldb: convert settled boolean to state
This commit is a preparation for the addition of new invoice states. A database migration is not needed because we keep the same field length and values.
This commit is contained in:
8 files changed
+88
-46
No files matched your search
@@ -236,7 +236,7 @@ func TestChannelLinkSingleHopPayment(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unable to get invoice: %v", err)
|
||||
}
|
||||
if !invoice.Terms.Settled {
|
||||
if invoice.Terms.State != channeldb.ContractSettled {
|
||||
t.Fatal("alice invoice wasn't settled")
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ func TestChannelLinkMultiHopPayment(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unable to get invoice: %v", err)
|
||||
}
|
||||
if !invoice.Terms.Settled {
|
||||
if invoice.Terms.State != channeldb.ContractSettled {
|
||||
t.Fatal("carol invoice haven't been settled")
|
||||
}
|
||||
|
||||
@@ -818,7 +818,7 @@ func TestUpdateForwardingPolicy(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unable to get invoice: %v", err)
|
||||
}
|
||||
if !invoice.Terms.Settled {
|
||||
if invoice.Terms.State != channeldb.ContractSettled {
|
||||
t.Fatal("carol invoice haven't been settled")
|
||||
}
|
||||
|
||||
@@ -937,7 +937,7 @@ func TestChannelLinkMultiHopInsufficientPayment(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unable to get invoice: %v", err)
|
||||
}
|
||||
if invoice.Terms.Settled {
|
||||
if invoice.Terms.State == channeldb.ContractSettled {
|
||||
t.Fatal("carol invoice have been settled")
|
||||
}
|
||||
|
||||
@@ -1026,7 +1026,7 @@ func TestChannelLinkMultiHopUnknownPaymentHash(t *testing.T) {
|
||||
|
||||
// Check that alice invoice wasn't settled and bandwidth of htlc
|
||||
// links hasn't been changed.
|
||||
if invoice.Terms.Settled {
|
||||
if invoice.Terms.State == channeldb.ContractSettled {
|
||||
t.Fatal("alice invoice was settled")
|
||||
}
|
||||
|
||||
@@ -1112,7 +1112,7 @@ func TestChannelLinkMultiHopUnknownNextHop(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unable to get invoice: %v", err)
|
||||
}
|
||||
if invoice.Terms.Settled {
|
||||
if invoice.Terms.State == channeldb.ContractSettled {
|
||||
t.Fatal("carol invoice have been settled")
|
||||
}
|
||||
|
||||
@@ -1227,7 +1227,7 @@ func TestChannelLinkMultiHopDecodeError(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unable to get invoice: %v", err)
|
||||
}
|
||||
if invoice.Terms.Settled {
|
||||
if invoice.Terms.State == channeldb.ContractSettled {
|
||||
t.Fatal("carol invoice have been settled")
|
||||
}
|
||||
|
||||
@@ -3332,7 +3332,7 @@ func TestChannelRetransmission(t *testing.T) {
|
||||
err = errors.Errorf("unable to get invoice: %v", err)
|
||||
continue
|
||||
}
|
||||
if !invoice.Terms.Settled {
|
||||
if invoice.Terms.State != channeldb.ContractSettled {
|
||||
err = errors.Errorf("alice invoice haven't been settled")
|
||||
continue
|
||||
}
|
||||
@@ -3828,7 +3828,7 @@ func TestChannelLinkAcceptOverpay(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unable to get invoice: %v", err)
|
||||
}
|
||||
if !invoice.Terms.Settled {
|
||||
if invoice.Terms.State != channeldb.ContractSettled {
|
||||
t.Fatal("carol invoice haven't been settled")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user