-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Optional [ list [ Optional [ Data Structures ] ] ] #19157
Comments
Hi Harold, it looks like you may be most familiar with this. Can you respond |
I can't remember exactly what was the reason. I'd have to go through it all and check. The only thing that I vaguely remember might be the type checker complaining at some point. There might be some more info looking through the initial PR: https://github.com/Chia-Network/chia-blockchain/pull/17435/commits I can look into it more once the current work slows down |
I can't recall exactly if there is at least one element, but it might be the case. You might be able to find additional info in the PR above. There's some tests there that help show its usage and intent as well |
Hi Harold, thank you for your pointers! If I see serialized messages in the wild that show this behavior I report back. Cheers! |
Closing, open another issue if u continue to have problems. thanks! |
Hi there!
I'm trying to deserialize this twisted little line here [1]:
message_data: Optional[list[Optional[SignatureRequestSourceData]]]
Does it mean that if there is a list (1st Optional) then the list will always contain at least one element? Either 0x00 if the SignatureRequestSourceData item isn't present or 0x01 plus the SignatureRequestSourceData item?
Is the inner Optional really necessary? I have the impression that the (non-)existence of the item is already established by the serialized length of the list, and deserializing the inner Optional feels a little futile. Although I enjoyed the little mind twist :) ;)
Kind regards
[1] https://github.com/Chia-Network/chia-blockchain/blob/main/chia/protocols/harvester_protocol.py#L95
The text was updated successfully, but these errors were encountered: