capcons

package
v1.0.0-preview.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanSkipCapabilityValueMigration

func CanSkipCapabilityValueMigration(valueType interpreter.StaticType) bool

Types

type CapabilityEntry

type CapabilityEntry struct {
	CapabilityID interpreter.UInt64Value
	BorrowType   *sema.ReferenceType
}

type CapabilityEntryMap

type CapabilityEntryMap map[interpreter.PathValue]CapabilityEntry

type CapabilityMapping

type CapabilityMapping struct {
	// contains filtered or unexported fields
}

func (*CapabilityMapping) Get

func (*CapabilityMapping) Record

func (m *CapabilityMapping) Record(
	addressPath interpreter.AddressPath,
	capabilityID interpreter.UInt64Value,
	borrowType *sema.ReferenceType,
)

type CapabilityMigrationReporter

type CapabilityMigrationReporter interface {
	MigratedPathCapability(
		accountAddress common.Address,
		addressPath interpreter.AddressPath,
		borrowType *interpreter.ReferenceStaticType,
	)
	MissingCapabilityID(
		accountAddress common.Address,
		addressPath interpreter.AddressPath,
	)
}

type CapabilityValueMigration

type CapabilityValueMigration struct {
	CapabilityMapping *CapabilityMapping
	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

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

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  *CapabilityMapping
	AccountIDGenerator stdlib.AccountIDGenerator
	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 (*LinkValueMigration) Name

func (*LinkValueMigration) Name() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL