mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
routing+routerrpc: test stream cancellation
Test stream cancellation of the TrackPayments rpc call. In order to achieve this, ControlTowerSubscriber is converted to an interface, to avoid trying to close a null channel when closing the subscription. By returning a mock implementation of the ControlTowerSubscriber in the test that problem is avoided.
This commit is contained in:
@@ -552,13 +552,13 @@ func (m *mockControlTowerOld) FetchInFlightPayments() (
|
||||
}
|
||||
|
||||
func (m *mockControlTowerOld) SubscribePayment(paymentHash lntypes.Hash) (
|
||||
*ControlTowerSubscriber, error) {
|
||||
ControlTowerSubscriber, error) {
|
||||
|
||||
return nil, errors.New("not implemented")
|
||||
}
|
||||
|
||||
func (m *mockControlTowerOld) SubscribeAllPayments() (
|
||||
*ControlTowerSubscriber, error) {
|
||||
ControlTowerSubscriber, error) {
|
||||
|
||||
return nil, errors.New("not implemented")
|
||||
}
|
||||
@@ -774,17 +774,17 @@ func (m *mockControlTower) FetchInFlightPayments() (
|
||||
}
|
||||
|
||||
func (m *mockControlTower) SubscribePayment(paymentHash lntypes.Hash) (
|
||||
*ControlTowerSubscriber, error) {
|
||||
ControlTowerSubscriber, error) {
|
||||
|
||||
args := m.Called(paymentHash)
|
||||
return args.Get(0).(*ControlTowerSubscriber), args.Error(1)
|
||||
return args.Get(0).(ControlTowerSubscriber), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *mockControlTower) SubscribeAllPayments() (
|
||||
*ControlTowerSubscriber, error) {
|
||||
ControlTowerSubscriber, error) {
|
||||
|
||||
args := m.Called()
|
||||
return args.Get(0).(*ControlTowerSubscriber), args.Error(1)
|
||||
return args.Get(0).(ControlTowerSubscriber), args.Error(1)
|
||||
}
|
||||
|
||||
type mockLink struct {
|
||||
|
Reference in New Issue
Block a user