Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support storing InclusiveRange in Account storage #2870

Open
Tracked by #2482
darkdrag00nv2 opened this issue Oct 14, 2023 · 1 comment
Open
Tracked by #2482

Support storing InclusiveRange in Account storage #2870

darkdrag00nv2 opened this issue Oct 14, 2023 · 1 comment

Comments

@darkdrag00nv2
Copy link
Contributor

Issue to be solved

InclusiveRange was introduced as part of #2482.

It cannot be stored in Account storage. It should be made storable.

Suggested Solution

It requires a bit of effort. Comments from @turbolent on Discord

Composite values of built-in types are not storable by default (because usually, they have some special behaviour, like functions need to be injected ... like here). See CompositeValue.IsStorable

e.g. there's a PublicKey built-in type, and because it has natively implemented functions (e.g. verify) and computed fields (publicKey, returns a copy on each access), the type/values of it are not storable (yet) 
we'll need to change/extend this, so we have a general mechanism to allow composite values with built-in types to be stored, and their computed fields and functions be injected after the value has been loaded, when those fields/functions are accessed, just like for "normal" composite values (CompositeValue.InitializeFunctions)
we basically already wanted to have it for PublicKey but didn't get to it (it's not very important to have the ability to store/load a public key in account storage), we want to have it for the new range types, and I actually also happen to need for some other work that's in progress
@darkdrag00nv2
Copy link
Contributor Author

@turbolent I saw that we have closed the PR that makes built-in composite types storable: #2881. Does that mean we wouldn't be able to make InclusiveRange storable at least in the short term?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants