diff --git a/ethers-core/src/types/crypto/signature.rs b/ethers-core/src/types/crypto/signature.rs index 89b1d4b70..c01e5b692 100644 --- a/ethers-core/src/types/crypto/signature.rs +++ b/ethers-core/src/types/crypto/signature.rs @@ -279,18 +279,13 @@ mod tests { .parse() .unwrap(); let address = Address::from(&key); + let our_signature = key.sign("Some data"); let signature = Signature::from_str( "b91467e570a6466aa9e9876cbcd013baba02900b8979d43fe208a4a4f339f5fd6007e74cd82e037b800186422fc2da167c747ef045e5d18a5f5d4300f8e1a0291c" ).expect("could not parse signature"); - - // recover the address from the above signature - let recovered = signature.recover("Some data").unwrap(); - assert_eq!( - format!("{:?}", recovered), - "0x2c7536e3605d9c16a7a3d7b1898e529396a65c23" - ); - - assert_eq!(recovered, address); + assert_eq!(our_signature.recover("Some data").unwrap(), address,); + assert_eq!(signature.recover("Some data").unwrap(), address); + assert_eq!(our_signature, signature); } #[test]