Support Deserialization of fields when they have fixed-size #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
When in the client the user needs to deserialize(read) a field, when he reads the blockchain state for a certain account from his anchor deployed program.The dart-renderer should handle fixed-sized fields(arrays, etc..) in the
readBorsh
methods because it needs to know how much bytes(how long is the field) to take from the buffer to show the correct value.I tried to handle that in a more abstract way, specifically from the visitors, but I struggled a lot there because the visitor passes recursively and I needed to have all that information in TypeManifest instead of me modifying a specific node. That is why I decided to keep using Aleksandar’s approach for using regex and comments, which i have extended.
Key Changes