Skip to content

Commit 60ab793

Browse files
authored
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
1 parent 3569cfc commit 60ab793

File tree

1 file changed

+1
-1
lines changed
  • crates/primitives/src/signature

1 file changed

+1
-1
lines changed

crates/primitives/src/signature/sig.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl<S> Signature<S> {
328328
let mut sig = [0u8; 65];
329329
sig[..32].copy_from_slice(&self.r.to_be_bytes::<32>());
330330
sig[32..64].copy_from_slice(&self.s.to_be_bytes::<32>());
331-
sig[64] = self.v.y_parity_byte();
331+
sig[64] = self.v.y_parity_byte_non_eip155().unwrap_or(self.v.y_parity_byte());
332332
sig
333333
}
334334

0 commit comments

Comments
 (0)