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:
Joost Jager
2018-12-19 15:56:26 +01:00
parent 552a9b7190
commit 5515713b88
8 changed files with 88 additions and 46 deletions

View File

@@ -106,7 +106,7 @@ func TestInvoiceWorkflow(t *testing.T) {
if err != nil {
t.Fatalf("unable to fetch invoice: %v", err)
}
if !dbInvoice2.Terms.Settled {
if dbInvoice2.Terms.State != ContractSettled {
t.Fatalf("invoice should now be settled but isn't")
}
if dbInvoice2.SettleDate.IsZero() {
@@ -348,7 +348,7 @@ func TestDuplicateSettleInvoice(t *testing.T) {
// We'll update what we expect the settle invoice to be so that our
// comparison below has the correct assumption.
invoice.SettleIndex = 1
invoice.Terms.Settled = true
invoice.Terms.State = ContractSettled
invoice.AmtPaid = amt
invoice.SettleDate = dbInvoice.SettleDate