You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code doesn't work, it looks like it's returned Parity() every signature, but if we convert to bytes and restore elsewhere, it returns NonEip155.
The following test fails:
#[test]fntest_parity(){let signer = PrivateKeySigner::random();// The message to sign.let message = b"hello";// Sign the message asynchronously with the signer.let signature = signer.sign_message_sync(message).unwrap();let value = signature.as_bytes().to_vec();let recovered_signature:Signature = value.as_slice().try_into().unwrap();assert_eq!(signature, recovered_signature);}
The error is the following:
assertion `left == right` failed
left: Signature { inner: ecdsa::Signature<Secp256k1>(33828FC1FE49FB3177AA80459AE130BD8147158000FA701D7E33BC33B8EDDF25586239AF447392DD8AC6DACBE5E3F91B72AB5593BE3ED6DC702489CA4E2BE1B6), v: Parity(false), r: 23298637575944829774526378124809190621347391490807772432023406486951885135653, s: 39977079812416937747731152449858872909720600328418637835900651766296202699190 }
right: Signature { inner: ecdsa::Signature<Secp256k1>(33828FC1FE49FB3177AA80459AE130BD8147158000FA701D7E33BC33B8EDDF25586239AF447392DD8AC6DACBE5E3F91B72AB5593BE3ED6DC702489CA4E2BE1B6), v: NonEip155(false), r: 23298637575944829774526378124809190621347391490807772432023406486951885135653, s: 39977079812416937747731152449858872909720600328418637835900651766296202699190 }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test tap::context::rav::test::test_parity ... FAILED
failures:
failures:
test::test_parity
The text was updated successfully, but these errors were encountered:
Component
primitives
What version of Alloy are you on?
0.2.1
Operating System
None
Describe the bug
The following code doesn't work, it looks like it's returned Parity() every signature, but if we convert to bytes and restore elsewhere, it returns NonEip155.
The following test fails:
The error is the following:
The text was updated successfully, but these errors were encountered: