lnwallet: run commitment tx tests in parallel

This commit is contained in:
Elle Mouton committed 2023-03-16 17:27:03 +02:00
1 parent 8a2999c789
commit b5d281dca8
1 file changed
+7 -3
+7 -3
View File
@@ -170,7 +170,8 @@ func TestCommitmentAndHTLCTransactions(t *testing.T) {
}, },
{ {
name: "anchors", name: "anchors",
chanType: channeldb.SingleFunderTweaklessBit | channeldb.AnchorOutputsBit, chanType: channeldb.SingleFunderTweaklessBit |
channeldb.AnchorOutputsBit,
jsonFile: "test_vectors_anchors.json", jsonFile: "test_vectors_anchors.json",
}, },
} }
@@ -186,16 +187,19 @@ func TestCommitmentAndHTLCTransactions(t *testing.T) {
err = json.Unmarshal(jsonText, &testCases) err = json.Unmarshal(jsonText, &testCases)
require.NoError(t, err) require.NoError(t, err)
t.Run(set.name, func(t *testing.T) {
for _, test := range testCases { for _, test := range testCases {
test := test test := test
name := fmt.Sprintf("%s-%s", set.name, test.Name)
t.Run(name, func(t *testing.T) {
t.Parallel()
t.Run(test.Name, func(t *testing.T) { t.Run(test.Name, func(t *testing.T) {
testVectors(t, set.chanType, test) testVectors(t, set.chanType, test)
}) })
}
}) })
} }
}
} }
// addTestHtlcs adds the test vector htlcs to the update logs of the local and // addTestHtlcs adds the test vector htlcs to the update logs of the local and