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

Projects
None yet
4 participants
@halseth
Copy link
Collaborator

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

@wpaulino
Copy link
Collaborator

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

This comment has been minimized.

Copy link
Member

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 some commits Jun 11, 2019

lnrpc: expose PaymentStatus for ListPayments
Also make it optional to list non-succeeded payments.
rpcserver: filter out non-suceeded payments, include payment status
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.

@halseth halseth force-pushed the halseth:listpayments-status-filter branch from 608b18b to 0aec3fd Jun 12, 2019

}

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

This comment has been minimized.

Copy link
@cfromknecht

cfromknecht Jun 12, 2019

Collaborator

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) (

This comment has been minimized.

Copy link
@cfromknecht

cfromknecht Jun 12, 2019

Collaborator

is this something that could be defined in lnrpc?

@Roasbeef Roasbeef merged commit 41b7da9 into lightningnetwork:master Jun 13, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.03%) to 60.873%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.