Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListPayments: filter out non-succeeded payments, include payment status #3190

Merged
merged 2 commits into from Jun 13, 2019

Conversation

@halseth
Copy link
Collaborator

@halseth halseth commented Jun 11, 2019

Earlier versions of ListPayments only included completed payments. We
return to this behavior by ignore all other payments if the nonSucceeded
boolean is not set in the request

Copy link
Collaborator

@wpaulino wpaulino left a comment

LGTM 💫

Note: the status will show in the lncli response as UNKNOWN, SUCCEEDED, IN_FLIGHT, and FAILED for those wondering.

@wpaulino wpaulino added this to the 0.7 milestone Jun 12, 2019
@Roasbeef
Copy link
Member

@Roasbeef Roasbeef commented Jun 12, 2019

Fails existing integration tests:

    --- FAIL: TestLightningNetworkDaemon/hold_invoice_sender_persistence (22.03s)
        lnd_test.go:88: Failed: (hold invoice sender persistence): exited with error: 
            *errors.errorString predicate not satisfied: payhash not found in response
            /home/travis/gopath/src/github.com/lightningnetwork/lnd/lntest/itest/lnd_test.go:13328 (0xd3ab63)
            	testHoldInvoicePersistence: t.Fatalf("predicate not satisfied: %v", err)
            /home/travis/gopath/src/github.com/lightningnetwork/lnd/lntest/itest/lnd_test.go:113 (0xced806)
            	(*harnessTest).RunTestCase: testCase.test(net, h)
            /home/travis/gopath/src/github.com/lightningnetwork/lnd/lntest/itest/lnd_test.go:13866 (0xd541f5)
            	TestLightningNetworkDaemon.func4: ht.RunTestCase(testCase, lndHarness)
            /home/travis/.gimme/versions/go1.12.6.linux.amd64/src/testing/testing.go:865 (0x4fbeb0)
            	tRunner: fn(t)
            /home/travis/.gimme/versions/go1.12.6.linux.amd64/src/runtime/asm_amd64.s:1337 (0x45e6d1)
            	goexit: BYTE	$0x90	// NOP

halseth added 2 commits Jun 12, 2019
Also make it optional to list non-succeeded payments.
Earlier versions of ListPayments only included completed payments. We
return to this behavior by ignore all other payments if the nonSucceeded
boolean is not set in the request.
}

message ListPaymentsRequest {
/// Set to also return payments that are not (yet) succeeded.
bool non_succeeded = 1;
Copy link
Collaborator

@cfromknecht cfromknecht Jun 12, 2019

naming suggestion: include_incomplete or include_unsuccessful?

}

return paymentsResp, nil
}

// convertPaymentStatus converts a channeldb.PaymentStatus to the type expected
// by the RPC.
func convertPaymentStatus(dbStatus channeldb.PaymentStatus) (
Copy link
Collaborator

@cfromknecht cfromknecht Jun 12, 2019

is this something that could be defined in lnrpc?

@Roasbeef Roasbeef merged commit 41b7da9 into lightningnetwork:master Jun 13, 2019
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants