@@ -49,7 +49,7 @@ func TestControlTowerSubscribeUnknown(t *testing.T) {
4949
5050 db := initDB (t , false )
5151
52- pControl := NewControlTower (channeldb .NewPaymentControl (db ))
52+ pControl := NewControlTower (channeldb .NewKVPaymentsDB (db ))
5353
5454 // Subscription should fail when the payment is not known.
5555 _ , err := pControl .SubscribePayment (lntypes.Hash {1 })
@@ -63,7 +63,7 @@ func TestControlTowerSubscribeSuccess(t *testing.T) {
6363
6464 db := initDB (t , false )
6565
66- pControl := NewControlTower (channeldb .NewPaymentControl (db ))
66+ pControl := NewControlTower (channeldb .NewKVPaymentsDB (db ))
6767
6868 // Initiate a payment.
6969 info , attempt , preimg , err := genInfo ()
@@ -156,33 +156,33 @@ func TestControlTowerSubscribeSuccess(t *testing.T) {
156156 }
157157}
158158
159- // TestPaymentControlSubscribeFail tests that payment updates for a
159+ // TestKVPaymentsDBSubscribeFail tests that payment updates for a
160160// failed payment are properly sent to subscribers.
161- func TestPaymentControlSubscribeFail (t * testing.T ) {
161+ func TestKVPaymentsDBSubscribeFail (t * testing.T ) {
162162 t .Parallel ()
163163
164164 t .Run ("register attempt, keep failed payments" , func (t * testing.T ) {
165- testPaymentControlSubscribeFail (t , true , true )
165+ testKVPaymentsDBSubscribeFail (t , true , true )
166166 })
167167 t .Run ("register attempt, delete failed payments" , func (t * testing.T ) {
168- testPaymentControlSubscribeFail (t , true , false )
168+ testKVPaymentsDBSubscribeFail (t , true , false )
169169 })
170170 t .Run ("no register attempt, keep failed payments" , func (t * testing.T ) {
171- testPaymentControlSubscribeFail (t , false , true )
171+ testKVPaymentsDBSubscribeFail (t , false , true )
172172 })
173173 t .Run ("no register attempt, delete failed payments" , func (t * testing.T ) {
174- testPaymentControlSubscribeFail (t , false , false )
174+ testKVPaymentsDBSubscribeFail (t , false , false )
175175 })
176176}
177177
178- // TestPaymentControlSubscribeAllSuccess tests that multiple payments are
178+ // TestKVPaymentsDBSubscribeAllSuccess tests that multiple payments are
179179// properly sent to subscribers of TrackPayments.
180- func TestPaymentControlSubscribeAllSuccess (t * testing.T ) {
180+ func TestKVPaymentsDBSubscribeAllSuccess (t * testing.T ) {
181181 t .Parallel ()
182182
183183 db := initDB (t , true )
184184
185- pControl := NewControlTower (channeldb .NewPaymentControl (db ))
185+ pControl := NewControlTower (channeldb .NewKVPaymentsDB (db ))
186186
187187 // Initiate a payment.
188188 info1 , attempt1 , preimg1 , err := genInfo ()
@@ -288,14 +288,14 @@ func TestPaymentControlSubscribeAllSuccess(t *testing.T) {
288288 require .Equal (t , attempt2 .Route , htlc2 .Route , "unexpected htlc route." )
289289}
290290
291- // TestPaymentControlSubscribeAllImmediate tests whether already inflight
291+ // TestKVPaymentsDBSubscribeAllImmediate tests whether already inflight
292292// payments are reported at the start of the SubscribeAllPayments subscription.
293- func TestPaymentControlSubscribeAllImmediate (t * testing.T ) {
293+ func TestKVPaymentsDBSubscribeAllImmediate (t * testing.T ) {
294294 t .Parallel ()
295295
296296 db := initDB (t , true )
297297
298- pControl := NewControlTower (channeldb .NewPaymentControl (db ))
298+ pControl := NewControlTower (channeldb .NewKVPaymentsDB (db ))
299299
300300 // Initiate a payment.
301301 info , attempt , _ , err := genInfo ()
@@ -325,14 +325,14 @@ func TestPaymentControlSubscribeAllImmediate(t *testing.T) {
325325 }
326326}
327327
328- // TestPaymentControlUnsubscribeSuccess tests that when unsubscribed, there are
328+ // TestKVPaymentsDBUnsubscribeSuccess tests that when unsubscribed, there are
329329// no more notifications to that specific subscription.
330- func TestPaymentControlUnsubscribeSuccess (t * testing.T ) {
330+ func TestKVPaymentsDBUnsubscribeSuccess (t * testing.T ) {
331331 t .Parallel ()
332332
333333 db := initDB (t , true )
334334
335- pControl := NewControlTower (channeldb .NewPaymentControl (db ))
335+ pControl := NewControlTower (channeldb .NewKVPaymentsDB (db ))
336336
337337 subscription1 , err := pControl .SubscribeAllPayments ()
338338 require .NoError (t , err , "expected subscribe to succeed, but got: %v" )
@@ -396,12 +396,12 @@ func TestPaymentControlUnsubscribeSuccess(t *testing.T) {
396396 require .Len (t , subscription2 .Updates (), 0 )
397397}
398398
399- func testPaymentControlSubscribeFail (t * testing.T , registerAttempt ,
399+ func testKVPaymentsDBSubscribeFail (t * testing.T , registerAttempt ,
400400 keepFailedPaymentAttempts bool ) {
401401
402402 db := initDB (t , keepFailedPaymentAttempts )
403403
404- pControl := NewControlTower (channeldb .NewPaymentControl (db ))
404+ pControl := NewControlTower (channeldb .NewKVPaymentsDB (db ))
405405
406406 // Initiate a payment.
407407 info , attempt , _ , err := genInfo ()
0 commit comments