Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: serde for AnyTxEnvelope #1613

Merged
merged 1 commit into from
Nov 4, 2024
Merged

fix: serde for AnyTxEnvelope #1613

merged 1 commit into from
Nov 4, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Nov 3, 2024

Motivation

RIght now AnyTxType is serialized as number but we should use quantity for it.

Also, MaybeTaggedEnvelope would correctly deserialize legacy transaction if map has all its fields and a different type flag. This is the case for deposit transaction breaking its deserialization in AnyTxEnvelope context

Solution

Serialize and deserialize AnyTxType as U8

Fail Untagged variant deserialization if type is present.

Also fixed deserialization of transaction fields in Transaction trait impl. We had incorrect name for gas and didn't use quantity when deserializing integers.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@klkvr klkvr changed the title fix: serde for AnyTxType fix: serde for AnyTxType Nov 3, 2024
@klkvr klkvr changed the title fix: serde for AnyTxType fix: serde for AnyTxEnvelope Nov 3, 2024
@klkvr klkvr force-pushed the klkvr/fix-any-serde branch 6 times, most recently from ee2893c to 9c26e82 Compare November 4, 2024 03:06
@klkvr klkvr merged commit a332e1e into main Nov 4, 2024
26 checks passed
@klkvr klkvr deleted the klkvr/fix-any-serde branch November 4, 2024 13:08
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