Documentation ¶
Index ¶
- func CanSkipCapabilityValueMigration(valueType interpreter.StaticType) bool
- func IssueAccountCapabilities(inter *interpreter.Interpreter, storage *runtime.Storage, ...)
- type AccountCapabilities
- type AccountCapability
- type AccountsCapabilities
- type CapabilityMigrationReporter
- type CapabilityValueMigration
- func (m *CapabilityValueMigration) CanSkip(valueType interpreter.StaticType) bool
- func (*CapabilityValueMigration) Domains() map[string]struct{}
- func (m *CapabilityValueMigration) Migrate(storageKey interpreter.StorageKey, _ interpreter.StorageMapKey, ...) (interpreter.Value, error)
- func (*CapabilityValueMigration) Name() string
- type CyclicLinkError
- type LinkMigrationReporter
- type LinkValueMigration
- func (m *LinkValueMigration) CanSkip(valueType interpreter.StaticType) bool
- func (m *LinkValueMigration) Domains() map[string]struct{}
- func (m *LinkValueMigration) Migrate(storageKey interpreter.StorageKey, storageMapKey interpreter.StorageMapKey, ...) (interpreter.Value, error)
- func (*LinkValueMigration) Name() string
- type Path
- type PathCapabilityEntry
- type PathCapabilityEntryMap
- type PathCapabilityMapping
- type PathTypeCapabilityEntryMap
- type PathTypeCapabilityKey
- type PathTypeCapabilityMapping
- type StorageCapMigration
- func (m *StorageCapMigration) CanSkip(valueType interpreter.StaticType) bool
- func (*StorageCapMigration) Domains() map[string]struct{}
- func (m *StorageCapMigration) Migrate(storageKey interpreter.StorageKey, storageMapKey interpreter.StorageMapKey, ...) (interpreter.Value, error)
- func (*StorageCapMigration) Name() string
- type StorageCapabilityMigrationReporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanSkipCapabilityValueMigration ¶
func CanSkipCapabilityValueMigration(valueType interpreter.StaticType) bool
func IssueAccountCapabilities ¶
func IssueAccountCapabilities( inter *interpreter.Interpreter, storage *runtime.Storage, reporter StorageCapabilityMigrationReporter, address common.Address, capabilities *AccountCapabilities, handler stdlib.CapabilityControllerIssueHandler, typedCapabilityMapping *PathTypeCapabilityMapping, untypedCapabilityMapping *PathCapabilityMapping, inferAuth func(valueType interpreter.StaticType) interpreter.Authorization, )
Types ¶
type AccountCapabilities ¶
type AccountCapabilities struct {
// contains filtered or unexported fields
}
func (*AccountCapabilities) ForEachSorted ¶
func (c *AccountCapabilities) ForEachSorted( f func(AccountCapability) bool, )
ForEachSorted will first sort the capabilities list, and iterates through the sorted list.
func (*AccountCapabilities) Record ¶
func (c *AccountCapabilities) Record( path interpreter.PathValue, borrowType interpreter.StaticType, storageKey interpreter.StorageKey, storageMapKey interpreter.StorageMapKey, )
type AccountCapability ¶
type AccountCapability struct { TargetPath interpreter.PathValue BorrowType interpreter.StaticType StoredPath Path }
type AccountsCapabilities ¶
type AccountsCapabilities struct {
// contains filtered or unexported fields
}
func (*AccountsCapabilities) ForEach ¶
func (m *AccountsCapabilities) ForEach( address common.Address, f func(AccountCapability) bool, )
func (*AccountsCapabilities) Get ¶
func (m *AccountsCapabilities) Get(address common.Address) *AccountCapabilities
func (*AccountsCapabilities) Record ¶
func (m *AccountsCapabilities) Record( addressPath interpreter.AddressPath, borrowType interpreter.StaticType, storageKey interpreter.StorageKey, storageMapKey interpreter.StorageMapKey, )
type CapabilityMigrationReporter ¶
type CapabilityMigrationReporter interface { MigratedPathCapability( accountAddress common.Address, addressPath interpreter.AddressPath, borrowType *interpreter.ReferenceStaticType, capabilityID interpreter.UInt64Value, ) MissingCapabilityID( accountAddress common.Address, addressPath interpreter.AddressPath, ) MissingBorrowType( targetPath interpreter.AddressPath, storedPath interpreter.AddressPath, ) }
type CapabilityValueMigration ¶
type CapabilityValueMigration struct { PrivatePublicCapabilityMapping *PathCapabilityMapping TypedStorageCapabilityMapping *PathTypeCapabilityMapping UntypedStorageCapabilityMapping *PathCapabilityMapping Reporter CapabilityMigrationReporter }
CapabilityValueMigration migrates all path capabilities to ID capabilities, using the path to ID capability controller mapping generated by LinkValueMigration.
func (*CapabilityValueMigration) CanSkip ¶
func (m *CapabilityValueMigration) CanSkip(valueType interpreter.StaticType) bool
func (*CapabilityValueMigration) Domains ¶
func (*CapabilityValueMigration) Domains() map[string]struct{}
func (*CapabilityValueMigration) Migrate ¶
func (m *CapabilityValueMigration) Migrate( storageKey interpreter.StorageKey, _ interpreter.StorageMapKey, value interpreter.Value, _ *interpreter.Interpreter, _ migrations.ValueMigrationPosition, ) ( interpreter.Value, error, )
Migrate migrates a path capability to an ID capability in the given value. If a value is returned, the value must be updated with the replacement in the parent. If nil is returned, the value was not updated and no operation has to be performed.
func (*CapabilityValueMigration) Name ¶
func (*CapabilityValueMigration) Name() string
type CyclicLinkError ¶
type CyclicLinkError struct { Paths []interpreter.PathValue Address common.Address }
CyclicLinkError
func (CyclicLinkError) Error ¶
func (e CyclicLinkError) Error() string
func (CyclicLinkError) IsUserError ¶
func (CyclicLinkError) IsUserError()
type LinkMigrationReporter ¶
type LinkMigrationReporter interface { MigratedLink( accountAddressPath interpreter.AddressPath, capabilityID interpreter.UInt64Value, ) CyclicLink(err CyclicLinkError) MissingTarget(accountAddressPath interpreter.AddressPath) }
type LinkValueMigration ¶
type LinkValueMigration struct { CapabilityMapping *PathCapabilityMapping IssueHandler stdlib.CapabilityControllerIssueHandler Handler stdlib.CapabilityControllerHandler Reporter LinkMigrationReporter }
LinkValueMigration migrates all links to capability controllers.
func (*LinkValueMigration) CanSkip ¶
func (m *LinkValueMigration) CanSkip(valueType interpreter.StaticType) bool
func (*LinkValueMigration) Domains ¶
func (m *LinkValueMigration) Domains() map[string]struct{}
func (*LinkValueMigration) Migrate ¶
func (m *LinkValueMigration) Migrate( storageKey interpreter.StorageKey, storageMapKey interpreter.StorageMapKey, value interpreter.Value, inter *interpreter.Interpreter, _ migrations.ValueMigrationPosition, ) ( interpreter.Value, error, )
func (*LinkValueMigration) Name ¶
func (*LinkValueMigration) Name() string
type PathCapabilityEntry ¶
type PathCapabilityEntry struct { CapabilityID interpreter.UInt64Value BorrowType *interpreter.ReferenceStaticType }
type PathCapabilityEntryMap ¶
type PathCapabilityEntryMap map[interpreter.PathValue]PathCapabilityEntry
type PathCapabilityMapping ¶
type PathCapabilityMapping struct {
// contains filtered or unexported fields
}
func (*PathCapabilityMapping) Get ¶
func (m *PathCapabilityMapping) Get(addressPath interpreter.AddressPath) (interpreter.UInt64Value, *interpreter.ReferenceStaticType, bool)
func (*PathCapabilityMapping) Record ¶
func (m *PathCapabilityMapping) Record( addressPath interpreter.AddressPath, capabilityID interpreter.UInt64Value, borrowType *interpreter.ReferenceStaticType, )
type PathTypeCapabilityEntryMap ¶
type PathTypeCapabilityEntryMap map[PathTypeCapabilityKey]interpreter.UInt64Value
type PathTypeCapabilityKey ¶
type PathTypeCapabilityKey struct { Path interpreter.PathValue BorrowType common.TypeID }
type PathTypeCapabilityMapping ¶
type PathTypeCapabilityMapping struct {
// contains filtered or unexported fields
}
func (*PathTypeCapabilityMapping) Get ¶
func (m *PathTypeCapabilityMapping) Get( addressPath interpreter.AddressPath, borrowType common.TypeID, ) (interpreter.UInt64Value, bool)
func (*PathTypeCapabilityMapping) Record ¶
func (m *PathTypeCapabilityMapping) Record( addressPath interpreter.AddressPath, capabilityID interpreter.UInt64Value, borrowType common.TypeID, )
type StorageCapMigration ¶
type StorageCapMigration struct {
StorageDomainCapabilities *AccountsCapabilities
}
StorageCapMigration records path capabilities with storage domain target. It does not actually migrate any values.
func (*StorageCapMigration) CanSkip ¶
func (m *StorageCapMigration) CanSkip(valueType interpreter.StaticType) bool
func (*StorageCapMigration) Domains ¶
func (*StorageCapMigration) Domains() map[string]struct{}
func (*StorageCapMigration) Migrate ¶
func (m *StorageCapMigration) Migrate( storageKey interpreter.StorageKey, storageMapKey interpreter.StorageMapKey, value interpreter.Value, _ *interpreter.Interpreter, _ migrations.ValueMigrationPosition, ) ( interpreter.Value, error, )
Migrate records path capabilities with storage domain target. It does not actually migrate any values.
func (*StorageCapMigration) Name ¶
func (*StorageCapMigration) Name() string
type StorageCapabilityMigrationReporter ¶
type StorageCapabilityMigrationReporter interface { MissingBorrowType( targetPath interpreter.AddressPath, storedPath interpreter.AddressPath, ) IssuedStorageCapabilityController( accountAddress common.Address, addressPath interpreter.AddressPath, borrowType *interpreter.ReferenceStaticType, capabilityID interpreter.UInt64Value, ) InferredMissingBorrowType( targetPath interpreter.AddressPath, borrowType *interpreter.ReferenceStaticType, storedPath interpreter.AddressPath, ) }