test: add assertion within integration tests for proper preimage after send
In this commit we modify the testSingleHopInvoice test to ensure that we obtain the proper preimage from the SendPayment RPC upon successful payment completion.
This commit is contained in:
parent
250c763c76
commit
026753bce4
@ -571,9 +571,16 @@ func testSingleHopInvoice(net *networkHarness, t *harnessTest) {
|
||||
if err := sendStream.Send(sendReq); err != nil {
|
||||
t.Fatalf("unable to send payment: %v", err)
|
||||
}
|
||||
if _, err := sendStream.Recv(); err != nil {
|
||||
|
||||
// Ensure we obtain the proper preimage in the response.
|
||||
resp, err := sendStream.Recv()
|
||||
if err != nil {
|
||||
t.Fatalf("error when attempting recv: %v", err)
|
||||
}
|
||||
if !bytes.Equal(preimage, resp.PaymentPreimage) {
|
||||
t.Fatalf("preimage mismatch: expected %v, got %v", preimage,
|
||||
resp.PaymentPreimage)
|
||||
}
|
||||
|
||||
// Bob's invoice should now be found and marked as settled.
|
||||
// TODO(roasbeef): remove sleep after hooking into the to-be-written
|
||||
|
Loading…
Reference in New Issue
Block a user