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

WIP: Storage refactor #143

Merged
merged 8 commits into from
Jan 24, 2023
Merged

WIP: Storage refactor #143

merged 8 commits into from
Jan 24, 2023

Conversation

aakamenov
Copy link
Contributor

@aakamenov aakamenov commented Jan 20, 2023

Reworks and extends the Fadroma storage functionality by introducing a flexible storage key building system and storage types built on top of that. All keys are built using a single allocation. The storage types allow a single declaration, similar to the CW Plus types, but due to the key system we allow for customizing how the type is stored and also the types from which the keys are created can now be expressed in code now which introduces the concept of strongly-typed keys. For example, if we store data under an address + an index we can now express that as TypedKey2<CanonicalAddr, u64>. In addition, the existing Canonize/Humanize traits allow us to extend the new storage types to accept types that canonize to the given type T and inversely, load and humanize the type T to the given type requested. This means we can canonize and store in a single call (and load and humanize).

@aakamenov aakamenov marked this pull request as draft January 20, 2023 14:49
@aakamenov aakamenov marked this pull request as ready for review January 24, 2023 16:20
@aakamenov aakamenov merged commit eb2e233 into unstable Jan 24, 2023
@aakamenov aakamenov deleted the feat/storage branch January 24, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant