diff --git a/itest/send_test.go b/itest/send_test.go index 137a13654..3ffd8b08a 100644 --- a/itest/send_test.go +++ b/itest/send_test.go @@ -754,6 +754,10 @@ func testReattemptFailedReceiveUniCourier(t *harnessTest) { // proof(s). t.Logf("Attempting to confirm asset received by receiver node") AssertNonInteractiveRecvComplete(t.t, receiveTapd, 1) + + // Confirm that the sender tapd node eventually receives the asset + // transfer and publishes an asset recv complete event. + assertAssetRecvCompleteEvent(t, ctxb, 5*time.Second, eventNtfns) } // testOfflineReceiverEventuallyReceives tests that a receiver node will @@ -967,6 +971,28 @@ func assertAssetRecvNtfsEvent(t *harnessTest, ctx context.Context, expectedCount, countFound) } +// assertAssetRecvNtfsEvent asserts that the given asset receive complete event +// notification was received. This function will block until the event is +// received or the event stream is closed. +func assertAssetRecvCompleteEvent(t *harnessTest, ctxb context.Context, + timeout time.Duration, + eventNtfns taprpc.TaprootAssets_SubscribeReceiveAssetEventNtfnsClient) { + + ctx, cancel := context.WithTimeout(ctxb, timeout) + defer cancel() + + eventSelector := func(event *taprpc.ReceiveAssetEvent) bool { + switch event.Event.(type) { + case *taprpc.ReceiveAssetEvent_AssetReceiveCompleteEvent: + return true + default: + return false + } + } + + assertAssetRecvNtfsEvent(t, ctx, eventNtfns, eventSelector, 1) +} + // testMultiInputSendNonInteractiveSingleID tests that we can properly // non-interactively send a single asset from multiple inputs. //