Skip to content

Commit

Permalink
Add comments and warnings about StorageDomain
Browse files Browse the repository at this point in the history
  • Loading branch information
fxamacker committed Nov 12, 2024
1 parent 88c31e6 commit f68c5eb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions common/storagedomain.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ import (
"github.com/onflow/cadence/errors"
)

// StorageDomain is used to store domain values on chain.
//
// !!! *WARNING* !!!
//
// Only add new StorageDomain by:
// - appending to the end.
//
// Only remove StorageDomain by:
// - replacing existing StorageDomain with a placeholder `_`.
//
// DO *NOT* REPLACE EXISTING STORAGEDOMAIN!
// DO *NOT* REMOVE EXISTING STORAGEDOMAIN!
// DO *NOT* INSERT NEW STORAGEDOMAIN IN BETWEEN!
type StorageDomain uint8

const (
Expand Down Expand Up @@ -54,6 +67,8 @@ const (
// StorageDomainAccountCapability is the storage domain which
// records active account capability controller IDs
StorageDomainAccountCapability

// Append new StorageDomain here (if needed).
)

var AllStorageDomains = []StorageDomain{
Expand Down

0 comments on commit f68c5eb

Please sign in to comment.