Skip to content

fix(wallet): align sendTransactionSync dataSuffix behavior - #4547

Merged
jxom merged 2 commits into
wevm:mainfrom
IrshadKohl51:fix-send-transaction-sync-data-suffix-semantics
May 4, 2026
Merged

jxom merged 2 commits into
wevm:mainfrom
IrshadKohl51:fix-send-transaction-sync-data-suffix-semantics

Conversation

@IrshadKohl51

Copy link
Copy Markdown
Contributor

What is this PR solving?

This PR fixes inconsistent dataSuffix behavior in sendTransactionSync (fixes #<issue_number>).

Before this change, dataSuffix was only appended when data already existed, so calls that only passed dataSuffix would silently drop it.
Now sendTransactionSync matches sendTransaction semantics: if dataSuffix is provided, it appends to data ?? '0x'.

What alternatives have you explored?

  1. Keep the old behavior and require callers to always pass data: '0x' with dataSuffix.
    Not chosen because it is easy to misuse and inconsistent with sendTransaction.
  2. Use only client-level dataSuffix and avoid action-level handling.
    Not chosen because action-level dataSuffix should be explicit and deterministic.
  3. Force data: '0x' for all transactions.
    Not chosen because it changes behavior beyond the scope of this bug fix.

Are there any parts that require more reviewer attention?

  1. Both execution paths were updated:
  • JSON-RPC account path
  • Local account path (prepareTransactionRequest path)
  1. Interaction when client-level dataSuffix and action-level dataSuffix are both set (ensuring no unexpected double-appending semantics).

Documentation

No documentation update needed (bug fix only, no API changes).

Tests

Added regression tests in src/actions/wallet/sendTransactionSync.test.ts:

  1. sends transaction with sendTransactionSync dataSuffix (hex string)
  2. sends transaction with sendTransactionSync dataSuffix (local account)

These tests fail without this fix and pass with it, and they cover the case where only dataSuffix is provided.

Pre-PR checklist

@vercel

vercel Bot commented Apr 23, 2026

Copy link
Copy Markdown

@IrshadKohl51 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 May 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2647411

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 bb4a63f into wevm:main May 4, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request May 4, 2026
@tmm tmm mentioned this pull request May 26, 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