@@ -127,20 +127,30 @@ func TestTaprootBriefcase(t *testing.T) {
127
127
require .Equal (t , testCase , & decodedCase )
128
128
}
129
129
130
+ // testHtlcAuxBlobProperties is a rapid property that verifies the encoding and
131
+ // decoding of the HTLC aux blobs.
132
+ func testHtlcAuxBlobProperties (t * rapid.T ) {
133
+ htlcBlobs := rapid .Make [htlcAuxBlobs ]().Draw (t , "htlcAuxBlobs" )
134
+
135
+ var b bytes.Buffer
136
+ require .NoError (t , htlcBlobs .Encode (& b ))
137
+
138
+ decodedBlobs := newAuxHtlcBlobs ()
139
+ require .NoError (t , decodedBlobs .Decode (& b ))
140
+
141
+ require .Equal (t , htlcBlobs , decodedBlobs )
142
+ }
143
+
130
144
// TestHtlcAuxBlobEncodeDecode tests the encode/decode methods of the HTLC aux
131
145
// blobs.
132
146
func TestHtlcAuxBlobEncodeDecode (t * testing.T ) {
133
147
t .Parallel ()
134
148
135
- rapid .Check (t , func (t * rapid.T ) {
136
- htlcBlobs := rapid .Make [htlcAuxBlobs ]().Draw (t , "htlcAuxBlobs" )
137
-
138
- var b bytes.Buffer
139
- require .NoError (t , htlcBlobs .Encode (& b ))
140
-
141
- decodedBlobs := newAuxHtlcBlobs ()
142
- require .NoError (t , decodedBlobs .Decode (& b ))
149
+ rapid .Check (t , testHtlcAuxBlobProperties )
150
+ }
143
151
144
- require .Equal (t , htlcBlobs , decodedBlobs )
145
- })
152
+ // FuzzHtlcAuxBlobEncodeDecodeFuzz tests the encode/decode methods of the HTLC
153
+ // aux blobs using the rapid derived fuzzer.
154
+ func FuzzHtlcAuxBlobEncodeDecode (f * testing.F ) {
155
+ f .Fuzz (rapid .MakeFuzz (testHtlcAuxBlobProperties ))
146
156
}
0 commit comments