Skip to content

Introduce Word wrapper for storage map keys #1864

@PhilippGackstatter

Description

@PhilippGackstatter

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_key could more naturally be StorageMapKey::hash(&self) -> HashedStorageMapKey.
  • StorageMap::hashed_map_key_to_leaf_index (if we still have it) could be moved to HashedStorageMapKey. The absence of that method on StorageMapKey would prevent misusing that key as a LeafIndex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    rustIssues that affect or pull requests that update Rust code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions