From 60ab7935e63e6d997db359c7c64adb4f8ad4dc97 Mon Sep 17 00:00:00 2001 From: Enrique Date: Thu, 25 Jan 2024 13:42:57 -0400 Subject: [PATCH] fix(`signature`): construct Signature bytes using v+27 when we do not have an EIP155 `v` (#503) fix(signature): use v+27 and default to parity bool when using as_bytes --- crates/primitives/src/signature/sig.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/primitives/src/signature/sig.rs b/crates/primitives/src/signature/sig.rs index 00f7d49a4..131467cd2 100644 --- a/crates/primitives/src/signature/sig.rs +++ b/crates/primitives/src/signature/sig.rs @@ -328,7 +328,7 @@ impl Signature { let mut sig = [0u8; 65]; sig[..32].copy_from_slice(&self.r.to_be_bytes::<32>()); sig[32..64].copy_from_slice(&self.s.to_be_bytes::<32>()); - sig[64] = self.v.y_parity_byte(); + sig[64] = self.v.y_parity_byte_non_eip155().unwrap_or(self.v.y_parity_byte()); sig }