Skip to content

Cannot (de)serialize objects with optional fields #112

Description

@lithp

Parity uses a custom BlockDetails object with a very weird last field.

is_finalized is a boolean field with the following representation:

  • A value of True is represented as a True boolean field: len(BlockDetails) == 5
  • A value of False is represented as nothing: len(BlockDetails) == 4

Presumably they wanted to save a little space in the database by simply not saving this field.

I don't think it's possible to create a subclass of rlp.Serializable which handles this use-case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions