Skip to content

Commit

Permalink
Merge pull request #807 from lightninglabs/tap-channel-rpcs
Browse files Browse the repository at this point in the history
[custom channels]: Use new `tapchannelrpc` RPC methods
  • Loading branch information
Roasbeef authored Aug 9, 2024
2 parents 3280923 + 8853d2c commit d4b2b41
Show file tree
Hide file tree
Showing 8 changed files with 443 additions and 611 deletions.
21 changes: 12 additions & 9 deletions accounts/checkers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,14 @@ func testSendPayment(t *testing.T, uri string) {
}

lndMock := newMockLnd()
routerMock := newMockRouter()
errFunc := func(err error) {
lndMock.mainErrChan <- err
}
service, err := NewService(t.TempDir(), errFunc)
require.NoError(t, err)

err = service.Start(lndMock, lndMock, chainParams)
err = service.Start(lndMock, routerMock, chainParams)
require.NoError(t, err)

assertBalance := func(id AccountID, expectedBalance int64) {
Expand Down Expand Up @@ -615,7 +616,7 @@ func testSendPayment(t *testing.T, uri string) {
require.NoError(t, err)
assertBalance(acct.ID, 4000)

lndMock.assertPaymentRequests(t, map[lntypes.Hash]struct{}{
routerMock.assertPaymentRequests(t, map[lntypes.Hash]struct{}{
testHash: {},
})

Expand Down Expand Up @@ -646,7 +647,7 @@ func testSendPayment(t *testing.T, uri string) {
// was initiated.
assertBalance(acct.ID, 4000)

lndMock.assertNoPaymentRequest(t)
routerMock.assertNoPaymentRequest(t)

// The final test we will do is to have two send requests initiated
// before the response for the first one has been received.
Expand Down Expand Up @@ -708,13 +709,14 @@ func TestSendPaymentV2(t *testing.T) {
}

lndMock := newMockLnd()
routerMock := newMockRouter()
errFunc := func(err error) {
lndMock.mainErrChan <- err
}
service, err := NewService(t.TempDir(), errFunc)
require.NoError(t, err)

err = service.Start(lndMock, lndMock, chainParams)
err = service.Start(lndMock, routerMock, chainParams)
require.NoError(t, err)

assertBalance := func(id AccountID, expectedBalance int64) {
Expand Down Expand Up @@ -808,7 +810,7 @@ func TestSendPaymentV2(t *testing.T) {
require.NoError(t, err)
assertBalance(acct.ID, 4000)

lndMock.assertPaymentRequests(t, map[lntypes.Hash]struct{}{
routerMock.assertPaymentRequests(t, map[lntypes.Hash]struct{}{
testHash: {},
})

Expand Down Expand Up @@ -836,7 +838,7 @@ func TestSendPaymentV2(t *testing.T) {
// was initiated.
assertBalance(acct.ID, 4000)

lndMock.assertNoPaymentRequest(t)
routerMock.assertNoPaymentRequest(t)

// The final test we will do is to have two send requests initiated
// before the response for the first one has been received.
Expand Down Expand Up @@ -894,13 +896,14 @@ func TestSendToRouteV2(t *testing.T) {
}

lndMock := newMockLnd()
routerMock := newMockRouter()
errFunc := func(err error) {
lndMock.mainErrChan <- err
}
service, err := NewService(t.TempDir(), errFunc)
require.NoError(t, err)

err = service.Start(lndMock, lndMock, chainParams)
err = service.Start(lndMock, routerMock, chainParams)
require.NoError(t, err)

assertBalance := func(id AccountID, expectedBalance int64) {
Expand Down Expand Up @@ -998,7 +1001,7 @@ func TestSendToRouteV2(t *testing.T) {
require.NoError(t, err)
assertBalance(acct.ID, 4000)

lndMock.assertPaymentRequests(t, map[lntypes.Hash]struct{}{
routerMock.assertPaymentRequests(t, map[lntypes.Hash]struct{}{
testHash: {},
})

Expand Down Expand Up @@ -1028,7 +1031,7 @@ func TestSendToRouteV2(t *testing.T) {
// was initiated.
assertBalance(acct.ID, 4000)

lndMock.assertNoPaymentRequest(t)
routerMock.assertNoPaymentRequest(t)

// The final test we will do is to have two send requests initiated
// before the response for the first one has been received.
Expand Down
Loading

0 comments on commit d4b2b41

Please sign in to comment.