lnwallet: run commitment tx tests in parallel

This commit is contained in:
Elle Mouton
2023-02-22 09:26:47 +02:00
parent 8a2999c789
commit b5d281dca8

View File

@@ -170,7 +170,8 @@ func TestCommitmentAndHTLCTransactions(t *testing.T) {
},
{
name: "anchors",
chanType: channeldb.SingleFunderTweaklessBit | channeldb.AnchorOutputsBit,
chanType: channeldb.SingleFunderTweaklessBit |
channeldb.AnchorOutputsBit,
jsonFile: "test_vectors_anchors.json",
},
}
@@ -186,16 +187,19 @@ func TestCommitmentAndHTLCTransactions(t *testing.T) {
err = json.Unmarshal(jsonText, &testCases)
require.NoError(t, err)
t.Run(set.name, func(t *testing.T) {
for _, test := range testCases {
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) {
testVectors(t, set.chanType, test)
})
}
})
}
}
}
// addTestHtlcs adds the test vector htlcs to the update logs of the local and