Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Velenir committed Nov 16, 2024
1 parent 8828039 commit 55780f3
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/helpers/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,10 @@ export function deriveCompactSignature(signature: string): string {
// Handle 64-byte (EIP-2098 compact) and 65-byte signatures
if (bytes.length === 64) {
// Extract v from the highest bit of s and clear the bit in s
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
v = 27 + (bytes[32]! >> 7);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
bytes[32]! &= 0x7f; // Clear the highest bit
} else {
// Extract v directly for 65-byte signature
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
v = bytes[64]!;

// Normalize v to canonical form (27 or 28)
Expand Down

0 comments on commit 55780f3

Please sign in to comment.