@@ -140,7 +140,7 @@ mod test {
140140 desc : & str ,
141141 ) -> Result < ConfidentialDescriptor < DescriptorPublicKey > , Error > {
142142 let desc = add_checksum ( desc) ;
143- let desc = OrdinaryDescriptor :: < DescriptorPublicKey > :: from_str ( & desc) . unwrap ( ) ;
143+ let desc = OrdinaryDescriptor :: < DescriptorPublicKey > :: from_str ( & desc) ? ;
144144 ConfidentialDescriptor :: with_elip151_descriptor_blinding_key ( desc)
145145 }
146146
@@ -176,6 +176,8 @@ mod test {
176176 for ( desc, key) in [
177177 ( & format ! ( "elwpkh({xpub}/<0;1>/*)" ) , "b3baf94d60cf8423cd257283575997a2c00664ced3e8de00f8726703142b1989" ) ,
178178 ( & format ! ( "elwpkh({xpub}/0/*)" ) , "de9c5fb624154624146a8aea0489b30f05c720eed6b493b1f3ab63405a11bf37" ) ,
179+ ( & format ! ( "elwsh(multi(2,{xpub}/<0;1>/*,{xpub}/0/<0;1>/*))" ) , "7fcc1b9a20bbf611d157016192a7d28e353033cfa6a4885b3c48fa5ff9ce1881" ) ,
180+ ( & format ! ( "elwsh(multi(2,{xpub}/<0;1>/*,{xpub}/0/<1;2>/*))" ) , "ff0a08050417f0ca95fb6ef7df979ae464739cb79b8c8f4b05408e0ac681a527" ) ,
179181 ] {
180182 let conf_desc = confidential_descriptor ( desc) . unwrap ( ) ;
181183 let elip151_desc = add_checksum ( & format ! ( "ct(elip151,{})" , desc) ) ;
@@ -198,16 +200,21 @@ mod test {
198200 }
199201
200202 _i = 0 ;
201- for invalid_desc in [ & format ! ( "elwpkh({xpub})" ) , & format ! ( "elwpkh({pubkey})" ) ] {
203+ let text = "Descriptors without wildcards are not supported in elip151" . to_string ( ) ;
204+ for ( invalid_desc, expected_err) in [
205+ ( & format ! ( "elwpkh({xpub})" ) , Error :: Unexpected ( text. to_string ( ) ) ) ,
206+ ( & format ! ( "elwpkh({pubkey})" ) , Error :: Unexpected ( text. to_string ( ) ) ) ,
207+ ( & format ! ( "elwsh(multi(2,{xpub}/<0;1>/*,{xpub}/0/<0;1;2>/*))" ) , Error :: MultipathDescLenMismatch ) ,
208+ ] {
202209 let err = confidential_descriptor ( invalid_desc) . unwrap_err ( ) ;
203- let text = "Descriptors without wildcards are not supported in elip151" . to_string ( ) ;
204- assert_eq ! ( err, Error :: Unexpected ( text) ) ;
210+ assert_eq ! ( err, expected_err) ;
205211 /*
206212 _i = _i + 1;
207213 println!("* Invalid Test vector {}", _i);
208214 println!("** Ordinary descriptor: <code>{}</code>", add_checksum(invalid_desc));
209215 println!("** Invalid confidential descriptor: <code>{}</code>", add_checksum(&format!("ct(elip151,{})", invalid_desc)));
210216 */
211217 }
218+
212219 }
213220}
0 commit comments