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.
Hello again
Message body parsing fix
I have been playing around with lite and tonlib api to check if we can migrate safely
For one of my tests I found the difference between message body parsing
Blockchain just read data cell till the end with it's references, but ton-lab-block checks if cell is empty - and treat such empty cell as None.
However people are inventive and usually put message body right into cell reference. So it worth to read it anyway (that's match with tl description - body is not optional, it's always presented).
After fixing it data matches with tonlibjson
Example of mismatch:
As you can see, body part in
db_data
(data from ton-labs-block) basically shows empty cell (I serialized None as empty cell). While tonlib body boc is not empty at all.Helper functions
Sorry for putting it at the same PR.
That's required for our data serialization - to save some space, we split Message to different parts and store it separately in DB.
But when we need to build
Message
(andTransaction
) back, we must know how exactly these parts were stored (otherwise we get transaction hash mismatch)Hope these changes small enough to pass review =)