@@ -199,22 +199,24 @@ impl<'a, Pk: MiniscriptKey, Ctx: ScriptContext> Iterator for PkIter<'a, Pk, Ctx>
199199 }
200200}
201201
202- // Module is public since it export testcase generation which may be used in
203- // dependent libraries for their own tasts based on Miniscript AST
202+ /// Module is public since it export testcase generation which may be used in
203+ /// dependent libraries for their own tasts based on Miniscript AST
204204#[ cfg( test) ]
205205pub mod test {
206206 use bitcoin:: hashes:: { hash160, ripemd160, sha256, sha256d, Hash } ;
207207
208208 use super :: Miniscript ;
209209 use crate :: miniscript:: context:: Segwitv0 ;
210210
211+ /// Test case.
211212 pub type TestData = (
212213 Miniscript < bitcoin:: PublicKey , Segwitv0 > ,
213214 Vec < bitcoin:: PublicKey > ,
214215 Vec < hash160:: Hash > ,
215216 bool , // Indicates that the top-level contains public key or hashes
216217 ) ;
217218
219+ /// Generate a deterministic list of public keys of the given length.
218220 pub fn gen_secp_pubkeys ( n : usize ) -> Vec < secp256k1:: PublicKey > {
219221 let mut ret = Vec :: with_capacity ( n) ;
220222 let secp = secp256k1:: Secp256k1 :: new ( ) ;
@@ -233,13 +235,15 @@ pub mod test {
233235 ret
234236 }
235237
238+ /// Generate a deterministic list of Bitcoin public keys of the given length.
236239 pub fn gen_bitcoin_pubkeys ( n : usize , compressed : bool ) -> Vec < bitcoin:: PublicKey > {
237240 gen_secp_pubkeys ( n)
238241 . into_iter ( )
239242 . map ( |inner| bitcoin:: PublicKey { inner, compressed } )
240243 . collect ( )
241244 }
242245
246+ /// Generate a deterministic list of test cases of the given length.
243247 pub fn gen_testcases ( ) -> Vec < TestData > {
244248 let k = gen_bitcoin_pubkeys ( 10 , true ) ;
245249 let _h: Vec < hash160:: Hash > = k
0 commit comments