onflow / onflow/atree

Utility methods for slab keys

Open
#587 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
43
Forks
20
PR merge metrics
No merged PRs in 30d

Description

Issue To Be Solved

It would be convenient (and safer) if cadence exposed methods for recognizing if a storage key is a slab key, so that code importing cadence doesn't have to know about the slab key structure.

This was relevant here: https://github.com/onflow/flow-go/pull/3644

Suggested Solution

add function:

func IsSlabIndex(key string) bool {
	return len(key) == 9 && key[0] == '$'
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing slab-key handling in the Go package and the relevant tests. Add the requested public recognition utility and verify that it correctly identifies slab keys without requiring callers to know their structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.