-
Notifications
You must be signed in to change notification settings - Fork 124
Introduce Word wrapper for storage map keys #1864
Copy link
Copy link
Labels
good first issueGood for newcomersGood for newcomersrustIssues that affect or pull requests that update Rust codeIssues that affect or pull requests that update Rust code
Milestone
Description
Storage map keys are internally hashed (#1129) and so in storage map related APIs we sometimes deal with the unhashed key and sometimes with the hashed key.
Once we have 0xMiden/crypto#430 we should consider adding wrappers for StorageMapKey and HashedStorageMapKey so the APIs would more clearly communicate what kind of key they expect.
Additionally, some methods could be moved to the key, e.g.:
StorageMap::hash_keycould more naturally beStorageMapKey::hash(&self) -> HashedStorageMapKey.StorageMap::hashed_map_key_to_leaf_index(if we still have it) could be moved toHashedStorageMapKey. The absence of that method onStorageMapKeywould prevent misusing that key as aLeafIndex.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersrustIssues that affect or pull requests that update Rust codeIssues that affect or pull requests that update Rust code