xdr: Add marshal binary compress test #4076
Merged
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.
I wanted to make sure nothing broke on #4071 and there were no pre-existing tests.
For the record, I run the tests with the prior implementation and I could only see two justified differences:
LedgerEntryTypeOffer
:Which makes sense since we removed the
SellerID
from the output (which these 33 bytes []{0x0, 0x1d, 0x4, 0x9a, 0x80, 0xf, 0xda, 0x8f, 0xab, 0xe8, 0xf6, 0x9d, 0x10, 0xdd, 0x8d, 0xda, 0x79, 0x29, 0x5a, 0x14, 0x87, 0xca, 0xe2, 0x3e, 0x43, 0x4e, 0xf5, 0xab, 0x68, 0xec, 0x13, 0x6c, 0xf3})LedgerEntryTypeTrustline
:There are three extra zeros {0x0, 0x0, 0x0}, which also makes sense because. For some reason, we weren't compressing assets issuers:
go/xdr/asset.go
Line 290 in d9d4986
(note that it isn't a binary compression call, but a normal binary call)