You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I've come to learn with Borsh serialization, the processing order of the fields is of utmost importance for proper serialization/deserialization. Unfortunately Java doesn't enforce any sort of internal ordering for its properties, so when borshj goes to deserialize, the properties might be handled in any order, thus making deserialization not work.
As a result, an annotation with an order property is likely needed for POJO fields to denote the order that they should be handled. Then when processing the fields in the readPOJO() methods, you can just sort by the annotation's order number and things will work properly. I've submitted a PR with just such an annotation for a kotlin-based implementation of borsh. You can see it here:
As I've come to learn with Borsh serialization, the processing order of the fields is of utmost importance for proper serialization/deserialization. Unfortunately Java doesn't enforce any sort of internal ordering for its properties, so when borshj goes to deserialize, the properties might be handled in any order, thus making deserialization not work.
As a result, an annotation with an order property is likely needed for POJO fields to denote the order that they should be handled. Then when processing the fields in the
readPOJO()
methods, you can just sort by the annotation's order number and things will work properly. I've submitted a PR with just such an annotation for a kotlin-based implementation of borsh. You can see it here:metaplex-foundation/SolanaKT#31
The text was updated successfully, but these errors were encountered: