@@ -236,6 +236,7 @@ mod tests {
236236 use rand:: { RngCore , thread_rng} ;
237237
238238 use crate :: { Error , SecretKey , Secp256k1 , Message } ;
239+ use crate :: constants:: ONE ;
239240 use super :: { RecoveryId , RecoverableSignature } ;
240241
241242 #[ cfg( target_arch = "wasm32" ) ]
@@ -280,13 +281,12 @@ mod tests {
280281 fn sign ( ) {
281282 let mut s = Secp256k1 :: new ( ) ;
282283 s. randomize ( & mut thread_rng ( ) ) ;
283- let one: [ u8 ; 32 ] = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
284- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 ] ;
285284
286- let sk = SecretKey :: from_slice ( & one ) . unwrap ( ) ;
287- let msg = Message :: from_slice ( & one ) . unwrap ( ) ;
285+ let sk = SecretKey :: from_slice ( & ONE ) . unwrap ( ) ;
286+ let msg = Message :: from_slice ( & ONE ) . unwrap ( ) ;
288287
289288 let sig = s. sign_ecdsa_recoverable ( & msg, & sk) ;
289+
290290 assert_eq ! ( Ok ( sig) , RecoverableSignature :: from_compact( & [
291291 0x66 , 0x73 , 0xff , 0xad , 0x21 , 0x47 , 0x74 , 0x1f ,
292292 0x04 , 0x77 , 0x2b , 0x6f , 0x92 , 0x1f , 0x0b , 0xa6 ,
@@ -305,14 +305,13 @@ mod tests {
305305 fn sign_with_noncedata ( ) {
306306 let mut s = Secp256k1 :: new ( ) ;
307307 s. randomize ( & mut thread_rng ( ) ) ;
308- let one: [ u8 ; 32 ] = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
309- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 ] ;
310308
311- let sk = SecretKey :: from_slice ( & one ) . unwrap ( ) ;
312- let msg = Message :: from_slice ( & one ) . unwrap ( ) ;
309+ let sk = SecretKey :: from_slice ( & ONE ) . unwrap ( ) ;
310+ let msg = Message :: from_slice ( & ONE ) . unwrap ( ) ;
313311 let noncedata = [ 42u8 ; 32 ] ;
314312
315313 let sig = s. sign_ecdsa_recoverable_with_noncedata ( & msg, & sk, & noncedata) ;
314+
316315 assert_eq ! ( Ok ( sig) , RecoverableSignature :: from_compact( & [
317316 0xb5 , 0x0b , 0xb6 , 0x79 , 0x5f , 0x31 , 0x74 , 0x8a ,
318317 0x4d , 0x37 , 0xc3 , 0xa9 , 0x7e , 0xbd , 0x06 , 0xa2 ,
0 commit comments