Allow built-in composite types to be storable #2881
Closed
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.
Description
Allow built-in composite types to be storable
Allow built-in composite values to be storable.
As discussed in https://discord.com/channels/613813861610684416/1108479699732152503/1164334273684324402, allowing
CompositeValue.Storable
to determine if the value's type is storable, by getting theCompositeType
for the value, is tricky, as the function is called by atree, and it does not provide access to anInterpreter
easily.Allow getting root interpreter from interpreter storage, which is ugly and works. If you have any better ideas, please let me know – I don't like this, but couldn't find another easy workable solution.
For now this is tech-debt: Eventually in Stable Cadence (which cannot be used, we need this feature on master), we'll have fewer
CompositeValue
s with built-inCompositeType
s that are non-storable (e.g. currentlyAuthAccount
), and we might find a better alternative to this approach later. At least for now this unblocks the work on the EVM integration in flow-go.Finally, allow built-in composite values to be storable, by checking for built-in types, if the composite value's composite type is storable (some are not, e.g.
AuthAccount
). Only check built-in types, because non-built-in composite values/types are always considered storable.master
branchFiles changed
in the Github PR explorer