Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

rlp_derive: #[rlp(default)] attribute#11449

Closed
ordian wants to merge 7 commits into
masterfrom
ao-rlp-default-attribute
Closed

rlp_derive: #[rlp(default)] attribute#11449
ordian wants to merge 7 commits into
masterfrom
ao-rlp-default-attribute

Conversation

@ordian
Copy link
Copy Markdown
Member

@ordian ordian commented Feb 4, 2020

This PR adds [rlp(default)] attribute to the rlp_derive proc macro with the restriction of only 1 in a struct (the restriction can be removed in the future).

On top of #11446

@ordian ordian added A0-pleasereview 🤓 Pull request needs code review. B0-patch-stable 🕷 Pull request should also be back-ported to the stable branch. labels Feb 4, 2020
@dvdplm
Copy link
Copy Markdown
Collaborator

dvdplm commented Feb 4, 2020

So what does this do exactly? It looks like the [rlp(default)] attribute lets us decode data from older versions of a struct, iff the struct changes were limited to adding new members, is that correct?

Copy link
Copy Markdown
Collaborator

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some docs would be good, and I'm not good with proc macros, but lgtm.

@ordian ordian requested a review from debris February 4, 2020 20:00
@ordian
Copy link
Copy Markdown
Member Author

ordian commented Feb 5, 2020

merged as part of #11450

@ordian ordian closed this Feb 5, 2020
@ordian ordian deleted the ao-rlp-default-attribute branch February 5, 2020 14:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-pleasereview 🤓 Pull request needs code review. B0-patch-stable 🕷 Pull request should also be back-ported to the stable branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants