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

Serialize Option[T] in DataSerializer #659

Open
aslesarenko opened this issue May 29, 2020 · 1 comment · Fixed by #990
Open

Serialize Option[T] in DataSerializer #659

aslesarenko opened this issue May 29, 2020 · 1 comment · Fixed by #990
Labels
A-consensus Area: Code used in consensus (i.e. transaction validation) C-enhancement Category: A PR with an enhancement or a proposed one in an issue. P2-medium Priority: Medium soft-fork Implementation requires soft-fork
Milestone

Comments

@aslesarenko
Copy link
Collaborator

Problem

DataSerializer is used to serialize data values for any supported ErgoTree type. It is in particular used to serialize Constant values, where type is first serialized (see TypeSerializer) and then the constant value is serialized using DataSerializer).
Option[T] is supported type of constant values, i.e. it is possible to create tree node like Constant(SOption(SInt), Some(10)), however DataSerializer don't support serialization of Option[T] values and hence such constants are not supported.

Solution

Add Option[T] case in DataSerializer using Writer.putOption method.

@aslesarenko aslesarenko added C-enhancement Category: A PR with an enhancement or a proposed one in an issue. soft-fork Implementation requires soft-fork A-consensus Area: Code used in consensus (i.e. transaction validation) P2-medium Priority: Medium labels May 29, 2020
@aslesarenko aslesarenko added this to the v4.x milestone May 29, 2020
@aslesarenko aslesarenko modified the milestones: v4.x, v4.0 Jun 10, 2020
@aslesarenko aslesarenko modified the milestones: v5.0, v6.0 Sep 10, 2020
@greenhat greenhat removed their assignment Oct 8, 2021
@aslesarenko aslesarenko mentioned this issue Dec 26, 2021
21 tasks
@kushti
Copy link
Contributor

kushti commented May 20, 2024

done in #990

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Code used in consensus (i.e. transaction validation) C-enhancement Category: A PR with an enhancement or a proposed one in an issue. P2-medium Priority: Medium soft-fork Implementation requires soft-fork
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants