@@ -886,8 +886,7 @@ mod tests {
886
886
use key:: { SecretKey , PublicKey } ;
887
887
use super :: { from_hex, to_hex} ;
888
888
use super :: constants;
889
- use super :: { Secp256k1 , Signature , Message } ;
890
- use super :: Error :: { InvalidMessage , IncorrectSignature , InvalidSignature } ;
889
+ use super :: { Secp256k1 , Signature , Message , Error } ;
891
890
use ffi:: { self , types:: AlignedType } ;
892
891
use context:: * ;
893
892
@@ -1193,20 +1192,20 @@ mod tests {
1193
1192
let mut msg = [ 0u8 ; 32 ] ;
1194
1193
thread_rng ( ) . fill_bytes ( & mut msg) ;
1195
1194
let msg = Message :: from_slice ( & msg) . unwrap ( ) ;
1196
- assert_eq ! ( s. verify( & msg, & sig, & pk) , Err ( IncorrectSignature ) ) ;
1195
+ assert_eq ! ( s. verify( & msg, & sig, & pk) , Err ( Error :: IncorrectSignature ) ) ;
1197
1196
}
1198
1197
1199
1198
#[ test]
1200
1199
fn test_bad_slice ( ) {
1201
1200
assert_eq ! ( Signature :: from_der( & [ 0 ; constants:: MAX_SIGNATURE_SIZE + 1 ] ) ,
1202
- Err ( InvalidSignature ) ) ;
1201
+ Err ( Error :: InvalidSignature ) ) ;
1203
1202
assert_eq ! ( Signature :: from_der( & [ 0 ; constants:: MAX_SIGNATURE_SIZE ] ) ,
1204
- Err ( InvalidSignature ) ) ;
1203
+ Err ( Error :: InvalidSignature ) ) ;
1205
1204
1206
1205
assert_eq ! ( Message :: from_slice( & [ 0 ; constants:: MESSAGE_SIZE - 1 ] ) ,
1207
- Err ( InvalidMessage ) ) ;
1206
+ Err ( Error :: InvalidMessage ) ) ;
1208
1207
assert_eq ! ( Message :: from_slice( & [ 0 ; constants:: MESSAGE_SIZE + 1 ] ) ,
1209
- Err ( InvalidMessage ) ) ;
1208
+ Err ( Error :: InvalidMessage ) ) ;
1210
1209
assert ! ( Message :: from_slice( & [ 0 ; constants:: MESSAGE_SIZE ] ) . is_ok( ) ) ;
1211
1210
assert ! ( Message :: from_slice( & [ 1 ; constants:: MESSAGE_SIZE ] ) . is_ok( ) ) ;
1212
1211
}
@@ -1253,7 +1252,7 @@ mod tests {
1253
1252
let msg = Message :: from_slice ( & msg[ ..] ) . unwrap ( ) ;
1254
1253
1255
1254
// without normalization we expect this will fail
1256
- assert_eq ! ( secp. verify( & msg, & sig, & pk) , Err ( IncorrectSignature ) ) ;
1255
+ assert_eq ! ( secp. verify( & msg, & sig, & pk) , Err ( Error :: IncorrectSignature ) ) ;
1257
1256
// after normalization it should pass
1258
1257
sig. normalize_s ( ) ;
1259
1258
assert_eq ! ( secp. verify( & msg, & sig, & pk) , Ok ( ( ) ) ) ;
0 commit comments