bug: serializeTransaction function expect transaction.data but JSON RPC spec is transaction.input #1898
Unanswered
vincentlg
asked this question in
Idea / Feature Request
Replies: 1 comment
-
Moving this to feature request as it is not really a bug. A bit annoying that there is this type inconsistency in the JSON-RPC spec (ie. transaction requests have |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there an existing issue for this?
Package Version
2.7.14
Current Behavior
Get transactions with
Then try to serialize a transaction with
const value = serializeTransaction(transaction, transaction);
The serializeTransaction function expects a transaction with a
data
field. But RPC returns a transaction withinput
instead. So, invalue
, the serialized transaction do not have any input.To fix this issue, I have to overwrite the
data
field myself before calling serializeTransaction , like so:Then, the result is as expected.
Expected Behavior
I expect not to have to overwrite the
data
field.serializeTransaction
should directly be compatible with RPC resultSteps To Reproduce
No response
Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
https://stackblitz.com/edit/viem-getting-started-ksz1ya?file=index.ts
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions