Skip to content

Utility methods for slab keys #587

@janezpodhostnik

Description

@janezpodhostnik

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: onflow/flow-go#3644

Suggested Solution

add function:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions