Skip to content

Commit

Permalink
fix(signature): construct Signature bytes using v+27 when we do not…
Browse files Browse the repository at this point in the history
… have an EIP155 `v` (#503)

fix(signature): use v+27 and default to parity bool when using as_bytes
  • Loading branch information
Evalir authored Jan 25, 2024
1 parent 3569cfc commit 60ab793
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/primitives/src/signature/sig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ impl<S> Signature<S> {
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
}

Expand Down

0 comments on commit 60ab793

Please sign in to comment.