Skip to content

Commit 1d0a85d

Browse files
committed
itest: return RPC response from SendAsset in sendAssetAndAssert
Update the sendAssetAndAssert integration test helper to return the RPC response from the SendAsset call. This allows callers to access the full response data for further assertions or processing.
1 parent 5a23f0a commit 1d0a85d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

itest/psbt_test.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3619,10 +3619,19 @@ func sendToTapscriptAddr(ctx context.Context, t *harnessTest, alice,
36193619
AssertSendEventsComplete(t.t, bobAddr.ScriptKey, sendEvents)
36203620
}
36213621

3622+
// sendAssetAndAssertResponse is a struct that holds the response of a
3623+
// sendAssetsToAddr call.
3624+
type sendAssetAndAssertResponse struct {
3625+
// RpcResp is the response message returned by the SendAsset RPC
3626+
// endpoint.
3627+
RpcResp *taprpc.SendAssetResponse
3628+
}
3629+
36223630
func sendAssetAndAssert(ctx context.Context, t *harnessTest, alice,
36233631
bob *tapdHarness, numUnits, change uint64,
36243632
genInfo *taprpc.GenesisInfo, mintedAsset *taprpc.Asset,
3625-
outTransferIdx, numOutTransfers, numInTransfers int) {
3633+
outTransferIdx, numOutTransfers,
3634+
numInTransfers int) sendAssetAndAssertResponse {
36263635

36273636
// And finally, we make sure that we can send out one of the asset UTXOs
36283637
// that shared the anchor output and the other one is treated as a
@@ -3645,6 +3654,10 @@ func sendAssetAndAssert(ctx context.Context, t *harnessTest, alice,
36453654
// appear in that RPC output).
36463655
AssertNonInteractiveRecvComplete(t.t, bob, numInTransfers)
36473656
AssertSendEventsComplete(t.t, bobAddr.ScriptKey, sendEvents)
3657+
3658+
return sendAssetAndAssertResponse{
3659+
RpcResp: sendResp,
3660+
}
36483661
}
36493662

36503663
func signPacket(t *testing.T, lnd *node.HarnessNode,

0 commit comments

Comments
 (0)