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

Add #[borsh(use_discriminant = <bool>)] that change enum discriminant de- and serialization behavior #148 #183

Merged
merged 35 commits into from
Jul 31, 2023

Conversation

iho
Copy link
Contributor

@iho iho commented Jul 27, 2023

Addressing #138 (comment)

Resolves #147

I closed previous PR #148 because it has too much commits and I had problem with rebasing master

@iho iho requested review from frol and dj8yfo as code owners July 27, 2023 12:09
borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/attribute_helpers.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/attribute_helpers.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/attribute_helpers.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/attribute_helpers.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/attribute_helpers.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/attribute_helpers.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/attribute_helpers.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/attribute_helpers.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/attribute_helpers.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/enum_ser.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/enum_de.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/enum_ser.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/enum_ser.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/enum_ser.rs Outdated Show resolved Hide resolved
borsh-derive-internal/src/enum_ser.rs Outdated Show resolved Hide resolved
@iho iho marked this pull request as draft July 27, 2023 16:12
iho and others added 3 commits July 27, 2023 21:27
Co-authored-by: dj8yf0μl <26653921+dj8yfo@users.noreply.github.com>
README.md Outdated Show resolved Hide resolved
borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
borsh/tests/test_simple_structs.rs Outdated Show resolved Hide resolved
iho and others added 3 commits July 30, 2023 14:54
Co-authored-by: dj8yf0μl <26653921+dj8yfo@users.noreply.github.com>
@iho iho requested a review from dj8yfo July 30, 2023 12:11
@iho iho marked this pull request as ready for review July 30, 2023 12:11
Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

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

@iho I have updated the README. Thanks for pushing it forward! This PR looks good to me, but I still defer the final decision here to @dj8yfo.

.github/workflows/rust.yml Show resolved Hide resolved
@dj8yfo
Copy link
Collaborator

dj8yfo commented Jul 31, 2023

this is a formal proof that behavior of 0.10.3 is identical to this pr - https://github.com/iho/borsh-test.
It's not fully automated, requires edits to switch from one version of borsh to another and test against the same snapshots.

borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
borsh-derive/src/lib.rs Outdated Show resolved Hide resolved
.github/workflows/rust.yml Outdated Show resolved Hide resolved
@dj8yfo dj8yfo merged commit 3db1c31 into near:master Jul 31, 2023
7 checks passed
@frol frol mentioned this pull request Aug 7, 2023
@dj8yfo dj8yfo changed the title Add borsh macros that change enum discriminant de- and serialization behavior #148 Add #[borsh(use_discriminant = <bool>)] that change enum discriminant de- and serialization behavior #148 Aug 7, 2023
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.

Introduce a required #[borsh(use_discriminant = true|false)] enum attribute when discriminants are specified
3 participants