Creating a 1.13.3 patch for backwards compatibility. #136
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.
In the TM SDK 1.13 we supported dynamic accounts by returning 0 from the size() trait function for TokenMetadataAccount. This indicated to the deserializer that the account was dynamically sized and size should not be used as a discriminator. This patch makes the TM accounts being resized qualify as "dynamically sized" to support people still using the old SDKs. This will allow older Anchor and SDK users to still function so long as they rebuild their programs while pulling in the latest 1.x version.
I do, however, keep the MAX_XXX_LEN fields the same to minimize breaking changes. Additionally, because size() now returns zero but it used elsewhere, I swapped its usage in the fee and burn calculations with MAX_METADATA_LEN to get the tests to pass. However this should have no effect on the actual program as we will never be deploying from this branch.