Skip to content

Commit e5bf0e5

Browse files
committed
itest: rename helper func LogAndPublish to PublishAndLogTransfer
Renames the helper function to match RPC endpoint name.
1 parent a4775b4 commit e5bf0e5

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

itest/mint_fund_seal_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ func testMintFundSealAssets(t *harnessTest) {
464464

465465
// Finalize and publish the transfer anchor TX.
466466
signedPkt := FinalizePacket(t.t, aliceLnd.RPC, transferPkt)
467-
logResp := LogAndPublish(
467+
logResp := PublishAndLogTransfer(
468468
t.t, aliceTapd, signedPkt, bobVpsbt, passiveVpsbts,
469469
commitResp,
470470
)

itest/multi_send_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ func testAnchorMultipleVirtualTransactions(t *harnessTest) {
374374

375375
btcPacket = signPacket(t.t, aliceLnd, btcPacket)
376376
btcPacket = FinalizePacket(t.t, aliceLnd.RPC, btcPacket)
377-
sendResp = LogAndPublish(
377+
sendResp = PublishAndLogTransfer(
378378
t.t, aliceTapd, btcPacket, activeAssets, passiveAssets,
379379
commitResp,
380380
)

itest/multisig.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ func MultiSigTest(t *testing.T, ctx context.Context, aliceTapd,
334334
// transaction.
335335
signedPkt := FinalizePacket(t, bobLnd, btcWithdrawPkt)
336336

337-
logResp := LogAndPublish(
337+
logResp := PublishAndLogTransfer(
338338
t, bobTapd, signedPkt, finalizedWithdrawPackets, nil,
339339
commitResp,
340340
)
@@ -490,11 +490,16 @@ func FinalizePacket(t *testing.T, lnd *rpc.HarnessRPC,
490490
return signedPacket
491491
}
492492

493-
func LogAndPublish(t *testing.T, tapd commands.RpcClientsBundle,
493+
// PublishAndLogTransfer is a helper function that invokes the
494+
// PublishAndLogTransfer RPC endpoint on the specified tapd node. This endpoint
495+
// performs a pre-anchored transfer.
496+
func PublishAndLogTransfer(t *testing.T, tapd commands.RpcClientsBundle,
494497
btcPkt *psbt.Packet, activeAssets []*tappsbt.VPacket,
495498
passiveAssets []*tappsbt.VPacket,
496499
commitResp *wrpc.CommitVirtualPsbtsResponse) *taprpc.SendAssetResponse {
497500

501+
t.Helper()
502+
498503
ctxb := context.Background()
499504
ctxt, cancel := context.WithTimeout(ctxb, defaultWaitTimeout)
500505
defer cancel()

itest/psbt_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ func testPsbtInteractiveAltLeafAnchoring(t *harnessTest) {
11241124

11251125
commitPacket = signPacket(t.t, senderLnd, commitPacket)
11261126
commitPacket = FinalizePacket(t.t, senderLnd.RPC, commitPacket)
1127-
publishResp := LogAndPublish(
1127+
publishResp := PublishAndLogTransfer(
11281128
t.t, sender, commitPacket, []*tappsbt.VPacket{activePacket},
11291129
[]*tappsbt.VPacket{passivePacket}, commitResp,
11301130
)
@@ -2438,7 +2438,7 @@ func testPsbtTrustlessSwap(t *harnessTest) {
24382438
signedPkt := finalizePacket(t.t, lndBob, finalPsbt)
24392439
require.True(t.t, signedPkt.IsComplete())
24402440

2441-
logResp := LogAndPublish(
2441+
logResp := PublishAndLogTransfer(
24422442
t.t, alice, signedPkt, []*tappsbt.VPacket{bobVPsbt}, nil, resp,
24432443
)
24442444
t.Logf("Logged transaction: %v", toJSON(t.t, logResp))
@@ -2611,7 +2611,7 @@ func testPsbtExternalCommit(t *harnessTest) {
26112611

26122612
btcPacket = signPacket(t.t, aliceLnd, btcPacket)
26132613
btcPacket = FinalizePacket(t.t, aliceLnd.RPC, btcPacket)
2614-
sendResp := LogAndPublish(
2614+
sendResp := PublishAndLogTransfer(
26152615
t.t, aliceTapd, btcPacket, activeAssets, passiveAssets,
26162616
commitResp,
26172617
)
@@ -3273,7 +3273,7 @@ func testPsbtRelativeLockTimeSendProofFail(t *harnessTest) {
32733273
Cancel: streamCancel,
32743274
}
32753275

3276-
LogAndPublish(t.t, bob, btcPacket, vPackets, nil, commitResp)
3276+
PublishAndLogTransfer(t.t, bob, btcPacket, vPackets, nil, commitResp)
32773277

32783278
MineBlocks(t.t, t.lndHarness.Miner().Client, 1, 1)
32793279

0 commit comments

Comments
 (0)