ApeWorX / ApeWorX/pyrlp

Cannot (de)serialize objects with optional fields

Đang mở
#112 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
103
Fork
69
Merge trung bình
54 phút
Pull request đã merge (30 ngày)
1

Mô tả

Parity uses [a custom `BlockDetails`](https://github.com/paritytech/parity-ethereum/blob/7c335e87642b848f61ab3ee7bbff5964b53d6f11/ethcore/db/src/keys.rs#L148) 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.