Skip to content

Commit 7dbac07

Browse files
committed
itest: query ListBatches with verbose after unfunded pending batch
Covers an edge case that previously caused a panic during RPC message marshalling when an unfunded pending batch was present.
1 parent 07ab992 commit 7dbac07

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

itest/assets_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,17 @@ func testMintBatchResume(t *harnessTest) {
174174

175175
// Build one batch, but leave it as pending.
176176
BuildMintingBatch(t.t, t.tapd, simpleAssets)
177-
batchResp, err := t.tapd.ListBatches(ctxt, &mintrpc.ListBatchRequest{})
177+
178+
// The batch is pending and unfunded, so the verbose batch listing
179+
// should return an empty list. An anchor transaction (BTC funding) is
180+
// required for verbose listing to include group key requests.
181+
batchResp, err := t.tapd.ListBatches(ctxt, &mintrpc.ListBatchRequest{
182+
Verbose: true,
183+
})
184+
require.NoError(t.t, err)
185+
require.Empty(t.t, batchResp.Batches)
186+
187+
batchResp, err = t.tapd.ListBatches(ctxt, &mintrpc.ListBatchRequest{})
178188
require.NoError(t.t, err)
179189
require.Len(t.t, batchResp.Batches, 1)
180190
t.Logf("batches: %v", toJSON(t.t, batchResp))

0 commit comments

Comments
 (0)