Skip to content

Commit

Permalink
mint - set invoice expiry in fakebackend to properly get invoice upda…
Browse files Browse the repository at this point in the history
…tes from sub
  • Loading branch information
elnosh committed Feb 7, 2025
1 parent 7fdf168 commit 9ac39b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mint/lightning/fakebackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
)

const (
InvoiceExpiry = 3600
FakePreimage = "0000000000000000"
FailPaymentDescription = "fail the payment"
)
Expand All @@ -29,6 +30,7 @@ type FakeBackendInvoice struct {
Preimage string
Status State
Amount uint64
Expiry uint64
}

func (i *FakeBackendInvoice) ToInvoice() Invoice {
Expand All @@ -38,6 +40,7 @@ func (i *FakeBackendInvoice) ToInvoice() Invoice {
Preimage: i.Preimage,
Settled: i.Status == Succeeded,
Amount: i.Amount,
Expiry: i.Expiry,
}
}

Expand All @@ -60,6 +63,7 @@ func (fb *FakeBackend) CreateInvoice(amount uint64) (Invoice, error) {
Preimage: preimage,
Status: Succeeded,
Amount: amount,
Expiry: InvoiceExpiry,
}
fb.Invoices = append(fb.Invoices, fakeInvoice)

Expand Down

0 comments on commit 9ac39b9

Please sign in to comment.