CosmWasm / CosmWasm/storey

`OwnedKey::from_bytes` should operate on things like `&[u8; 4]` when key size is fixed

Open
#58 0 comments 0 reactions 0 assignees View on GitHub
prio 1 project research storey trac 2
Dominant language
Rust
Stars
6
Forks
3
PR merge metrics
No merged PRs in 30d

Description

This sounds simple but would require digging into some type-fu.

It looks like [the big "behavior" match thing](https://github.com/CosmWasm/storey/blob/map-fixed-length-keys/packages/storey/src/containers/map/mod.rs#L131) would have to go to make this possible. Probably a good design choice anyway.

The benefit is implementing custom key types becomes a little easier for devs (no need for extra error handling when keys are fixed size).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in packages/storey/src/containers/map/mod.rs at the linked behavior match around line 131, and inspect how OwnedKey::from_bytes handles fixed-size keys. Determine how the type-fu should support inputs such as &[u8; 4] without extra error handling; done means fixed-size byte-array keys work through OwnedKey::from_bytes while preserving existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.