lndclient: add forwarding history call

This commit is contained in:
carla 2020-06-17 08:44:43 +02:00
parent c1a9889e4d
commit e016d2ebf4
No known key found for this signature in database
GPG key ID: 4CA7FE54A6213C91
3 changed files with 108 additions and 2 deletions

View file

@ -182,6 +182,17 @@ func (h *mockLightningClient) ClosedChannels(_ context.Context) ([]lndclient.Clo
return h.lnd.ClosedChannels, nil
}
// ForwardingHistory returns the mock's set of forwarding events.
func (h *mockLightningClient) ForwardingHistory(_ context.Context,
_ lndclient.ForwardingHistoryRequest) (*lndclient.ForwardingHistoryResponse,
error) {
return &lndclient.ForwardingHistoryResponse{
LastIndexOffset: 0,
Events: h.lnd.ForwardingEvents,
}, nil
}
// ChannelBackup retrieves the backup for a particular channel. The
// backup is returned as an encrypted chanbackup.Single payload.
func (h *mockLightningClient) ChannelBackup(context.Context, wire.OutPoint) ([]byte, error) {

View file

@ -163,8 +163,9 @@ type LndMockServices struct {
// keyed by hash string.
Invoices map[lntypes.Hash]*lndclient.Invoice
Channels []lndclient.ChannelInfo
ClosedChannels []lndclient.ClosedChannel
Channels []lndclient.ChannelInfo
ClosedChannels []lndclient.ClosedChannel
ForwardingEvents []lndclient.ForwardingEvent
WaitForFinished func()