Skip to content

fix(celo): preserve signature when parsing signed CIP-42 and CIP-64 transactions - #5622

Merged
jxom merged 1 commit into
wevm:mainfrom
mortezashojaei:fix/celo-cip64-parse-signature
Nov 20, 2026
Merged

jxom merged 1 commit into
wevm:mainfrom
mortezashojaei:fix/celo-cip64-parse-signature

Conversation

@mortezashojaei

Copy link
Copy Markdown
Contributor

Summary

parseTransaction from viem/celo accepts signed CIP-42 (15-field) and CIP-64 (13-field) payloads but never reads the trailing v/r/s, so the signature is silently dropped. As a result, serializeTransaction(parseTransaction(signed)) returns an unsigned transaction, even though the Celo docs say signed CIP-64 transactions are supported.

import { parseTransaction, serializeTransaction } from 'viem/celo'

const parsed = parseTransaction(signedCip64)
parsed.r // undefined (before), '0x…' (after)
serializeTransaction(parsed) === signedCip64 // false (before), true (after)

Fix

  • Export the existing core parseEIP155Signature helper from src/utils/transaction/parseTransaction.ts. It is internal-only and not re-exported from any entrypoint.
  • When the payload has the signed field count, spread its result (r, s, v, yParity) into the parsed CIP-42 and CIP-64 transactions.

Tests

  • src/celo/serializers.test.ts: the signed CIP-64 assertions now expect the signature, plus a serialize → parse → serialize round-trip check.
  • src/celo/parsers.test.ts: new snapshot for a signed CIP-42 payload.

Celo tests are excluded from the default Vitest projects, so I ran src/celo/parsers.test.ts and src/celo/serializers.test.ts with a temporary config: 43/43 passed. I couldn't run the full tsc -b locally because of memory limits, so CI will cover typechecking.

@vercel

vercel Bot commented Nov 20, 2026

Copy link
Copy Markdown

@mortezashojaei is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89957e7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jxom
jxom merged commit 0715fb1 into wevm:main Nov 20, 2026
28 of 35 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants