interpreter

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CBORTagVoidValue = CBORTagBase + iota

	CBORTagSomeValue
	CBORTagAddressValue
	CBORTagCompositeValue
	CBORTagTypeValue

	CBORTagStringValue
	CBORTagCharacterValue
	CBORTagSomeValueWithNestedLevels

	// Int*
	CBORTagIntValue
	CBORTagInt8Value
	CBORTagInt16Value
	CBORTagInt32Value
	CBORTagInt64Value
	CBORTagInt128Value
	CBORTagInt256Value

	// UInt*
	CBORTagUIntValue
	CBORTagUInt8Value
	CBORTagUInt16Value
	CBORTagUInt32Value
	CBORTagUInt64Value
	CBORTagUInt128Value
	CBORTagUInt256Value

	CBORTagWord8Value
	CBORTagWord16Value
	CBORTagWord32Value
	CBORTagWord64Value
	CBORTagWord128Value
	CBORTagWord256Value

	CBORTagFix64Value

	CBORTagUFix64Value

	// Locations
	CBORTagAddressLocation
	CBORTagStringLocation
	CBORTagIdentifierLocation
	CBORTagTransactionLocation
	CBORTagScriptLocation

	CBORTagPathValue
	// Deprecated: CBORTagPathCapabilityValue
	CBORTagPathCapabilityValue

	// Deprecated: CBORTagPathLinkValue
	CBORTagPathLinkValue
	CBORTagPublishedValue
	// Deprecated: CBORTagAccountLinkValue
	CBORTagAccountLinkValue
	CBORTagStorageCapabilityControllerValue
	CBORTagAccountCapabilityControllerValue
	CBORTagCapabilityValue

	// Static Types
	CBORTagPrimitiveStaticType
	CBORTagCompositeStaticType
	CBORTagInterfaceStaticType
	CBORTagVariableSizedStaticType
	CBORTagConstantSizedStaticType
	CBORTagDictionaryStaticType
	CBORTagOptionalStaticType
	CBORTagReferenceStaticType
	CBORTagIntersectionStaticType
	CBORTagCapabilityStaticType
	CBORTagUnauthorizedStaticAuthorization
	CBORTagEntitlementMapStaticAuthorization
	CBORTagEntitlementSetStaticAuthorization
	CBORTagInaccessibleStaticAuthorization

	CBORTagInclusiveRangeStaticType

	// !!! *WARNING* !!!
	// ADD NEW TYPES *BEFORE* THIS WARNING.
	// DO *NOT* ADD NEW TYPES AFTER THIS LINE!
	CBORTag_Count
)
View Source
const CBORTagBase = 128
View Source
const FalseValue = BoolValue(false)
View Source
const Fix64MaxValue = math.MaxInt64
View Source
const TrueValue = BoolValue(true)
View Source
const UFix64MaxValue = math.MaxUint64
View Source
const UnknownElementSize = 0

Variables

Memory is NOT metered for this value

View Source
var CBORDecMode = func() cbor.DecMode {
	decMode, err := cbor.DecOptions{
		IntDec:           cbor.IntDecConvertNone,
		MaxArrayElements: math.MaxInt64,
		MaxMapPairs:      math.MaxInt64,
		MaxNestedLevels:  math.MaxInt16,
	}.DecMode()
	if err != nil {
		panic(err)
	}
	return decMode
}()
View Source
var CBOREncMode = func() cbor.EncMode {
	options := cbor.CanonicalEncOptions()
	options.BigIntConvert = cbor.BigIntConvertNone
	encMode, err := options.EncMode()
	if err != nil {
		panic(err)
	}
	return encMode
}()

CBOREncMode

See https://github.com/fxamacker/cbor: "For best performance, reuse EncMode and DecMode after creating them."

View Source
var ConverterDeclarations = []ValueConverterDeclaration{
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
}

It would be nice if return types in Go's function types would be covariant

View Source
var EmptyLocationRange = LocationRange{}
View Source
var EmptyPathLinkValue = PathLinkValue{}
View Source
var EmptyPathValue = PathValue{}
View Source
var EmptyString = NewUnmeteredStringValue("")
View Source
var EmptyTypeValue = TypeValue{}
View Source
var Int128MemoryUsage = common.NewBigIntMemoryUsage(16)
View Source
var Int16MemoryUsage = common.NewNumberMemoryUsage(int16Size)
View Source
var Int256MemoryUsage = common.NewBigIntMemoryUsage(32)
View Source
var Int32MemoryUsage = common.NewNumberMemoryUsage(int32Size)
View Source
var Int64MemoryUsage = common.NewNumberMemoryUsage(int64Size)
View Source
var Int8MemoryUsage = common.NewNumberMemoryUsage(int8Size)
View Source
var NilStorable atree.Storable = NilValue{}
View Source
var PrimitiveStaticTypes = _PrimitiveStaticType_map
View Source
var Uint128MemoryUsage = common.NewBigIntMemoryUsage(16)
View Source
var Uint256MemoryUsage = common.NewBigIntMemoryUsage(32)
View Source
var VoidStorable atree.Storable = VoidValue{}
View Source
var Word128MemoryUsage = common.NewBigIntMemoryUsage(16)
View Source
var Word256MemoryUsage = common.NewBigIntMemoryUsage(32)

Functions

func ArrayElementSize added in v1.0.0

func ArrayElementSize(staticType ArrayStaticType) uint

func AttachmentMemberName added in v1.0.0

func AttachmentMemberName(typeID string) string

func BigEndianBytesToSignedBigInt added in v0.39.0

func BigEndianBytesToSignedBigInt(b []byte) *big.Int

func BigEndianBytesToUnsignedBigInt added in v0.39.0

func BigEndianBytesToUnsignedBigInt(b []byte) *big.Int

func ByteArrayValueToByteSlice added in v0.2.0

func ByteArrayValueToByteSlice(interpreter *Interpreter, value Value, locationRange LocationRange) ([]byte, error)

func ByteValueToByte added in v0.2.0

func ByteValueToByte(memoryGauge common.MemoryGauge, element Value, locationRange LocationRange) (byte, error)

func ConvertStaticAuthorizationToSemaAccess added in v1.0.0

func ConvertStaticAuthorizationToSemaAccess(
	memoryGauge common.MemoryGauge,
	auth Authorization,
	handler StaticAuthorizationConversionHandler,
) (
	sema.Access,
	error,
)

func ConvertStaticToSemaType

func ConvertStaticToSemaType(
	memoryGauge common.MemoryGauge,
	typ StaticType,
	handler StaticTypeConversionHandler,
) (_ sema.Type, err error)

func ConvertUnsigned added in v0.25.0

func ConvertUnsigned[T Unsigned](
	memoryGauge common.MemoryGauge,
	value Value,
	maxBigNumber *big.Int,
	maxNumber int,
	locationRange LocationRange,
) T

func ConvertWord added in v0.25.0

func ConvertWord[T Unsigned](
	memoryGauge common.MemoryGauge,
	value Value,
	locationRange LocationRange,
) T

func Declare added in v0.27.0

func Declare(a *VariableActivation, declaration ValueDeclaration)

func DecodeStorable added in v0.20.0

func DecodeStorable(
	decoder *cbor.StreamDecoder,
	slabID atree.SlabID,
	inlinedExtraData []atree.ExtraData,
	memoryGauge common.MemoryGauge,
) (
	atree.Storable,
	error,
)

func DecodeTypeInfo added in v0.20.0

func DecodeTypeInfo(decoder *cbor.StreamDecoder, memoryGauge common.MemoryGauge) (atree.TypeInfo, error)

func DictionaryElementSize added in v1.0.0

func DictionaryElementSize(staticType *DictionaryStaticType) uint

func GetNativeCompositeValueComputedFields added in v1.0.0

func GetNativeCompositeValueComputedFields(qualifiedIdentifier string) map[string]ComputedField

func InspectValue added in v0.19.0

func InspectValue(interpreter *Interpreter, value Value, f func(Value) bool, locationRange LocationRange)

func NewCompositeTypeInfo added in v0.24.0

func NewCompositeTypeInfo(
	memoryGauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
	kind common.CompositeKind,
) compositeTypeInfo

func OverEstimateBigIntStringLength added in v0.24.0

func OverEstimateBigIntStringLength(n *big.Int) int

func OverEstimateFixedPointStringLength added in v0.24.0

func OverEstimateFixedPointStringLength(
	memoryGauge common.MemoryGauge,
	integerPart NumberValue,
	scale int,
) int

func OverEstimateIntStringLength added in v0.24.0

func OverEstimateIntStringLength(n int) int

func OverEstimateNumberStringLength added in v0.24.0

func OverEstimateNumberStringLength(memoryGauge common.MemoryGauge, value NumberValue) int

func OverEstimateUintStringLength added in v0.24.0

func OverEstimateUintStringLength(n uint) int

func ReturnEmptyRange added in v0.23.0

func ReturnEmptyRange() ast.Range

func SignedBigIntToBigEndianBytes added in v0.5.0

func SignedBigIntToBigEndianBytes(bigInt *big.Int) []byte

func SignedBigIntToSizedBigEndianBytes added in v0.32.0

func SignedBigIntToSizedBigEndianBytes(bigInt *big.Int, sizeInBytes uint) []byte

func StaticTypeToBytes added in v0.20.0

func StaticTypeToBytes(t StaticType) (cbor.RawMessage, error)

func StorableSize added in v0.20.0

func StorableSize(storable atree.Storable) (uint32, error)

StorableSize returns the size of the storable in bytes.

func StorageMapKeyAtreeValueComparator added in v1.0.0

func StorageMapKeyAtreeValueComparator(slabStorage atree.SlabStorage, value atree.Value, otherStorable atree.Storable) (bool, error)

func StorageMapKeyAtreeValueHashInput added in v1.0.0

func StorageMapKeyAtreeValueHashInput(value atree.Value, scratch []byte) ([]byte, error)

func StringAtreeValueComparator added in v0.39.0

func StringAtreeValueComparator(storage atree.SlabStorage, value atree.Value, otherStorable atree.Storable) (bool, error)

func StringAtreeValueHashInput added in v0.39.0

func StringAtreeValueHashInput(v atree.Value, _ []byte) ([]byte, error)

func Uint64AtreeValueComparator added in v0.39.0

func Uint64AtreeValueComparator(_ atree.SlabStorage, value atree.Value, otherStorable atree.Storable) (bool, error)

func Uint64AtreeValueHashInput added in v0.39.0

func Uint64AtreeValueHashInput(v atree.Value, scratch []byte) ([]byte, error)

func UnsignedBigIntToBigEndianBytes added in v0.5.0

func UnsignedBigIntToBigEndianBytes(bigInt *big.Int) []byte

func UnsignedBigIntToSizedBigEndianBytes added in v0.32.0

func UnsignedBigIntToSizedBigEndianBytes(bigInt *big.Int, sizeInBytes uint) []byte

func WalkValue added in v0.19.0

func WalkValue(interpreter *Interpreter, walker ValueWalker, value Value, locationRange LocationRange)

WalkValue traverses a Value object graph in depth-first order: It starts by calling valueWalker.WalkValue(value); If the returned walker is nil, child values are not walked. If the returned walker is not-nil, then WalkValue is invoked recursively on this returned walker for each of the non-nil children of the value, followed by a call of WalkValue(nil) on the returned walker.

The initial walker may not be nil.

func WrappedExternalError added in v0.40.0

func WrappedExternalError(err error) error

Types

type AccountCapabilityControllerValue added in v0.39.0

type AccountCapabilityControllerValue struct {
	BorrowType   *ReferenceStaticType
	CapabilityID UInt64Value

	// Injected functions.
	// Tags are not stored directly inside the controller
	// to avoid unnecessary storage reads
	// when the controller is loaded for borrowing/checking
	GetCapability func(inter *Interpreter) *IDCapabilityValue
	GetTag        func(inter *Interpreter) *StringValue
	SetTag        func(inter *Interpreter, tag *StringValue)
	Delete        func(inter *Interpreter, locationRange LocationRange)
	// contains filtered or unexported fields
}

func NewAccountCapabilityControllerValue added in v0.39.0

func NewAccountCapabilityControllerValue(
	memoryGauge common.MemoryGauge,
	borrowType *ReferenceStaticType,
	capabilityID UInt64Value,
) *AccountCapabilityControllerValue

func NewUnmeteredAccountCapabilityControllerValue added in v0.39.0

func NewUnmeteredAccountCapabilityControllerValue(
	borrowType *ReferenceStaticType,
	capabilityID UInt64Value,
) *AccountCapabilityControllerValue

func (*AccountCapabilityControllerValue) Accept added in v0.39.0

func (v *AccountCapabilityControllerValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (*AccountCapabilityControllerValue) ByteSize added in v0.39.0

func (*AccountCapabilityControllerValue) CapabilityControllerBorrowType added in v0.39.0

func (v *AccountCapabilityControllerValue) CapabilityControllerBorrowType() *ReferenceStaticType

func (*AccountCapabilityControllerValue) ChildStorables added in v0.39.0

func (v *AccountCapabilityControllerValue) ChildStorables() []atree.Storable

func (*AccountCapabilityControllerValue) Clone added in v0.39.0

func (*AccountCapabilityControllerValue) ConformsToStaticType added in v0.39.0

func (*AccountCapabilityControllerValue) ControllerCapabilityID added in v0.41.0

func (v *AccountCapabilityControllerValue) ControllerCapabilityID() UInt64Value

func (*AccountCapabilityControllerValue) DeepRemove added in v0.39.0

func (v *AccountCapabilityControllerValue) DeepRemove(_ *Interpreter, _ bool)

func (*AccountCapabilityControllerValue) Encode added in v0.39.0

Encode encodes AccountCapabilityControllerValue as

cbor.Tag{
			Number: CBORTagAccountCapabilityControllerValue,
			Content: []any{
				encodedAccountCapabilityControllerValueBorrowTypeFieldKey:   StaticType(v.BorrowType),
				encodedAccountCapabilityControllerValueCapabilityIDFieldKey: UInt64Value(v.CapabilityID),
			},
}

func (*AccountCapabilityControllerValue) Equal added in v0.39.0

func (v *AccountCapabilityControllerValue) Equal(
	interpreter *Interpreter,
	locationRange LocationRange,
	other Value,
) bool

func (*AccountCapabilityControllerValue) GetMember added in v0.39.0

func (v *AccountCapabilityControllerValue) GetMember(inter *Interpreter, _ LocationRange, name string) (result Value)

func (*AccountCapabilityControllerValue) IsImportable added in v0.39.0

func (*AccountCapabilityControllerValue) IsResourceKinded added in v0.39.0

func (*AccountCapabilityControllerValue) IsResourceKinded(_ *Interpreter) bool

func (*AccountCapabilityControllerValue) IsStorable added in v0.39.0

func (*AccountCapabilityControllerValue) IsStorable() bool

func (*AccountCapabilityControllerValue) MeteredString added in v0.39.0

func (v *AccountCapabilityControllerValue) MeteredString(
	interpreter *Interpreter,
	seenReferences SeenReferences,
	locationRange LocationRange,
) string

func (*AccountCapabilityControllerValue) NeedsStoreTo added in v0.39.0

func (*AccountCapabilityControllerValue) RecursiveString added in v0.39.0

func (v *AccountCapabilityControllerValue) RecursiveString(seenReferences SeenReferences) string

func (*AccountCapabilityControllerValue) ReferenceValue added in v0.39.0

func (v *AccountCapabilityControllerValue) ReferenceValue(
	interpreter *Interpreter,
	capabilityAddress common.Address,
	resultBorrowType *sema.ReferenceType,
	locationRange LocationRange,
) ReferenceValue

func (*AccountCapabilityControllerValue) RemoveMember added in v0.39.0

func (*AccountCapabilityControllerValue) SetMember added in v0.39.0

func (v *AccountCapabilityControllerValue) SetMember(
	inter *Interpreter,
	_ LocationRange,
	identifier string,
	value Value,
) bool

func (*AccountCapabilityControllerValue) StaticType added in v0.39.0

func (*AccountCapabilityControllerValue) Storable added in v0.39.0

func (v *AccountCapabilityControllerValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint64,
) (
	atree.Storable,
	error,
)

func (*AccountCapabilityControllerValue) StoredValue added in v0.39.0

func (*AccountCapabilityControllerValue) String added in v0.39.0

func (*AccountCapabilityControllerValue) Transfer added in v0.39.0

func (v *AccountCapabilityControllerValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*AccountCapabilityControllerValue) Walk added in v0.39.0

func (v *AccountCapabilityControllerValue) Walk(_ *Interpreter, walkChild func(Value), _ LocationRange)

type AccountHandlerFunc added in v0.15.0

type AccountHandlerFunc func(
	inter *Interpreter,
	address AddressValue,
) Value

AccountHandlerFunc is a function that handles retrieving an auth account at a given address. The account returned must be of type `Account`.

type AccountKeysCountGetter added in v0.29.0

type AccountKeysCountGetter func() UInt64Value

type AccountLinkValue deprecated added in v0.30.0

type AccountLinkValue struct{}

Deprecated: AccountLinkValue

func (AccountLinkValue) Accept added in v0.30.0

func (AccountLinkValue) ByteSize added in v0.30.0

func (v AccountLinkValue) ByteSize() uint32

func (AccountLinkValue) ChildStorables added in v0.30.0

func (v AccountLinkValue) ChildStorables() []atree.Storable

func (AccountLinkValue) Clone added in v0.30.0

func (AccountLinkValue) ConformsToStaticType added in v0.30.0

func (v AccountLinkValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (AccountLinkValue) DeepRemove added in v0.30.0

func (AccountLinkValue) DeepRemove(_ *Interpreter, _ bool)

func (AccountLinkValue) Encode added in v0.30.0

func (AccountLinkValue) Encode(e *atree.Encoder) error

Encode writes a value of type AccountValue to the encoder

func (AccountLinkValue) Equal added in v0.30.0

func (v AccountLinkValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (AccountLinkValue) IsImportable added in v0.30.0

func (AccountLinkValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (AccountLinkValue) IsResourceKinded added in v0.30.0

func (AccountLinkValue) IsResourceKinded(_ *Interpreter) bool

func (AccountLinkValue) IsStorable added in v0.30.0

func (AccountLinkValue) IsStorable() bool

func (AccountLinkValue) MeteredString added in v0.30.0

func (AccountLinkValue) NeedsStoreTo added in v0.30.0

func (AccountLinkValue) NeedsStoreTo(_ atree.Address) bool

func (AccountLinkValue) RecursiveString added in v0.30.0

func (v AccountLinkValue) RecursiveString(_ SeenReferences) string

func (AccountLinkValue) StaticType added in v0.30.0

func (v AccountLinkValue) StaticType(interpreter *Interpreter) StaticType

func (AccountLinkValue) Storable added in v0.30.0

func (v AccountLinkValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint64) (atree.Storable, error)

func (AccountLinkValue) StoredValue added in v0.30.0

func (v AccountLinkValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (AccountLinkValue) String added in v0.30.0

func (v AccountLinkValue) String() string

func (AccountLinkValue) Transfer added in v0.30.0

func (v AccountLinkValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (AccountLinkValue) Walk added in v0.30.0

func (AccountLinkValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type AddressPath added in v0.39.0

type AddressPath struct {
	Address common.Address
	Path    PathValue
}

type AddressValue

type AddressValue common.Address

AddressValue

func ConvertAddress

func ConvertAddress(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) AddressValue

func NewAddressValue

func NewAddressValue(
	memoryGauge common.MemoryGauge,
	address common.Address,
) AddressValue

NewAddressValue constructs an address-value from a `common.Address`.

NOTE: This method must only be used if the `address` value is already constructed, and/or already loaded onto memory. This is a convenient method for better performance. If the `address` needs to be constructed, the `NewAddressValueFromConstructor` must be used.

func NewAddressValueFromBytes

func NewAddressValueFromBytes(memoryGauge common.MemoryGauge, constructor func() []byte) AddressValue

func NewAddressValueFromConstructor added in v0.24.0

func NewAddressValueFromConstructor(
	memoryGauge common.MemoryGauge,
	addressConstructor func() common.Address,
) AddressValue

func NewUnmeteredAddressValueFromBytes added in v0.24.0

func NewUnmeteredAddressValueFromBytes(b []byte) AddressValue

func (AddressValue) Accept added in v0.12.0

func (v AddressValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (AddressValue) ByteSize added in v0.20.0

func (v AddressValue) ByteSize() uint32

func (AddressValue) ChildStorables added in v0.20.0

func (AddressValue) ChildStorables() []atree.Storable

func (AddressValue) Clone added in v0.24.0

func (v AddressValue) Clone(_ *Interpreter) Value

func (AddressValue) ConformsToStaticType added in v0.24.0

func (v AddressValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (AddressValue) DeepRemove added in v0.20.0

func (AddressValue) DeepRemove(_ *Interpreter, _ bool)

func (AddressValue) Encode added in v0.20.0

func (v AddressValue) Encode(e *atree.Encoder) error

Encode encodes AddressValue as

cbor.Tag{
		Number:  CBORTagAddressValue,
		Content: []byte(v.ToAddress().Bytes()),
}

func (AddressValue) Equal

func (v AddressValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (AddressValue) GetMember added in v0.3.0

func (v AddressValue) GetMember(interpreter *Interpreter, _ LocationRange, name string) Value

func (AddressValue) HashInput added in v0.20.0

func (v AddressValue) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeAddress (1 byte) - address (8 bytes)

func (AddressValue) Hex

func (v AddressValue) Hex() string

func (AddressValue) IsImportable added in v0.24.0

func (AddressValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (AddressValue) IsResourceKinded added in v0.20.0

func (AddressValue) IsResourceKinded(_ *Interpreter) bool

func (AddressValue) IsStorable added in v0.16.0

func (AddressValue) IsStorable() bool

func (AddressValue) MeteredString added in v0.24.0

func (v AddressValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (AddressValue) NeedsStoreTo added in v0.20.0

func (AddressValue) NeedsStoreTo(_ atree.Address) bool

func (AddressValue) RecursiveString added in v0.17.0

func (v AddressValue) RecursiveString(_ SeenReferences) string

func (AddressValue) RemoveMember added in v0.20.0

func (AddressValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (AddressValue) SetMember added in v0.3.0

func (AddressValue) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (AddressValue) StaticType added in v0.12.0

func (AddressValue) StaticType(interpreter *Interpreter) StaticType

func (AddressValue) Storable added in v0.20.0

func (AddressValue) StoredValue added in v0.20.0

func (v AddressValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (AddressValue) String

func (v AddressValue) String() string

func (AddressValue) ToAddress

func (v AddressValue) ToAddress() common.Address

func (AddressValue) Transfer added in v0.20.0

func (v AddressValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (AddressValue) Walk added in v0.19.0

func (AddressValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type ArgumentCountError

type ArgumentCountError struct {
	ParameterCount int
	ArgumentCount  int
}

func (ArgumentCountError) Error

func (e ArgumentCountError) Error() string

func (ArgumentCountError) IsUserError added in v0.25.0

func (ArgumentCountError) IsUserError()

type ArrayIndexOutOfBoundsError added in v0.9.2

type ArrayIndexOutOfBoundsError struct {
	LocationRange
	Index int
	Size  int
}

ArrayIndexOutOfBoundsError

func (ArrayIndexOutOfBoundsError) Error added in v0.9.2

func (ArrayIndexOutOfBoundsError) IsUserError added in v0.25.0

func (ArrayIndexOutOfBoundsError) IsUserError()

type ArraySliceIndicesError added in v0.24.0

type ArraySliceIndicesError struct {
	LocationRange
	FromIndex int
	UpToIndex int
	Size      int
}

ArraySliceIndicesError

func (ArraySliceIndicesError) Error added in v0.24.0

func (e ArraySliceIndicesError) Error() string

func (ArraySliceIndicesError) IsUserError added in v0.25.0

func (ArraySliceIndicesError) IsUserError()

type ArrayStaticType added in v0.19.0

type ArrayStaticType interface {
	StaticType

	ElementType() StaticType
	atree.TypeInfo
	// contains filtered or unexported methods
}

func ConvertSemaArrayTypeToStaticArrayType added in v0.19.0

func ConvertSemaArrayTypeToStaticArrayType(
	memoryGauge common.MemoryGauge,
	t sema.ArrayType,
) ArrayStaticType

type ArrayValue

type ArrayValue struct {
	Type ArrayStaticType
	// contains filtered or unexported fields
}

func ByteSliceToByteArrayValue added in v0.2.0

func ByteSliceToByteArrayValue(interpreter *Interpreter, buf []byte) *ArrayValue

func ByteSliceToConstantSizedByteArrayValue added in v0.39.2

func ByteSliceToConstantSizedByteArrayValue(interpreter *Interpreter, buf []byte) *ArrayValue

func NewArrayValue added in v0.16.0

func NewArrayValue(
	interpreter *Interpreter,
	locationRange LocationRange,
	arrayType ArrayStaticType,
	address common.Address,
	values ...Value,
) *ArrayValue

func NewArrayValueWithIterator added in v0.20.0

func NewArrayValueWithIterator(
	interpreter *Interpreter,
	arrayType ArrayStaticType,
	address common.Address,
	countOverestimate uint64,
	values func() Value,
) *ArrayValue

func (*ArrayValue) Accept added in v0.12.0

func (v *ArrayValue) Accept(interpreter *Interpreter, visitor Visitor, locationRange LocationRange)

func (*ArrayValue) Append

func (v *ArrayValue) Append(interpreter *Interpreter, locationRange LocationRange, element Value)

func (*ArrayValue) AppendAll added in v0.15.0

func (v *ArrayValue) AppendAll(interpreter *Interpreter, locationRange LocationRange, other *ArrayValue)

func (*ArrayValue) Clone added in v0.24.0

func (v *ArrayValue) Clone(interpreter *Interpreter) Value

func (*ArrayValue) Concat

func (v *ArrayValue) Concat(interpreter *Interpreter, locationRange LocationRange, other *ArrayValue) Value

func (*ArrayValue) ConformsToStaticType added in v0.24.0

func (v *ArrayValue) ConformsToStaticType(
	interpreter *Interpreter,
	locationRange LocationRange,
	results TypeConformanceResults,
) bool

func (*ArrayValue) Contains

func (v *ArrayValue) Contains(
	interpreter *Interpreter,
	locationRange LocationRange,
	needleValue Value,
) BoolValue

func (*ArrayValue) Count

func (v *ArrayValue) Count() int

func (*ArrayValue) DeepRemove added in v0.20.0

func (v *ArrayValue) DeepRemove(interpreter *Interpreter, hasNoParentContainer bool)

func (*ArrayValue) Destroy

func (v *ArrayValue) Destroy(interpreter *Interpreter, locationRange LocationRange)

func (*ArrayValue) Equal added in v0.15.0

func (v *ArrayValue) Equal(interpreter *Interpreter, locationRange LocationRange, other Value) bool

func (*ArrayValue) Filter added in v0.41.0

func (v *ArrayValue) Filter(
	interpreter *Interpreter,
	locationRange LocationRange,
	procedure FunctionValue,
) Value

func (*ArrayValue) FirstIndex added in v0.24.0

func (v *ArrayValue) FirstIndex(interpreter *Interpreter, locationRange LocationRange, needleValue Value) OptionalValue

func (*ArrayValue) ForEach added in v1.0.0

func (v *ArrayValue) ForEach(
	interpreter *Interpreter,
	_ sema.Type,
	function func(value Value) (resume bool),
	transferElements bool,
	locationRange LocationRange,
)

func (*ArrayValue) Get

func (v *ArrayValue) Get(interpreter *Interpreter, locationRange LocationRange, index int) Value

func (*ArrayValue) GetKey added in v0.20.0

func (v *ArrayValue) GetKey(interpreter *Interpreter, locationRange LocationRange, key Value) Value

func (*ArrayValue) GetMember

func (v *ArrayValue) GetMember(interpreter *Interpreter, _ LocationRange, name string) Value

func (*ArrayValue) GetOwner

func (v *ArrayValue) GetOwner() common.Address

func (*ArrayValue) Insert

func (v *ArrayValue) Insert(interpreter *Interpreter, locationRange LocationRange, index int, element Value)

func (*ArrayValue) InsertKey added in v0.20.0

func (v *ArrayValue) InsertKey(interpreter *Interpreter, locationRange LocationRange, key Value, value Value)

func (*ArrayValue) InsertWithoutTransfer added in v1.0.0

func (v *ArrayValue) InsertWithoutTransfer(
	interpreter *Interpreter,
	locationRange LocationRange,
	index int,
	element Value,
)

func (*ArrayValue) IsDestroyed added in v0.20.0

func (v *ArrayValue) IsDestroyed() bool

func (*ArrayValue) IsImportable added in v0.24.0

func (v *ArrayValue) IsImportable(inter *Interpreter, locationRange LocationRange) bool

func (*ArrayValue) IsReferenceTrackedResourceKindedValue added in v0.21.0

func (v *ArrayValue) IsReferenceTrackedResourceKindedValue()

func (*ArrayValue) IsResourceKinded added in v0.20.0

func (v *ArrayValue) IsResourceKinded(interpreter *Interpreter) bool

func (*ArrayValue) IsStaleResource added in v0.32.0

func (v *ArrayValue) IsStaleResource(interpreter *Interpreter) bool

func (*ArrayValue) Iterate added in v0.20.0

func (v *ArrayValue) Iterate(
	interpreter *Interpreter,
	f func(element Value) (resume bool),
	transferElements bool,
	locationRange LocationRange,
)

func (*ArrayValue) IterateReadOnlyLoaded added in v1.0.0

func (v *ArrayValue) IterateReadOnlyLoaded(
	interpreter *Interpreter,
	f func(element Value) (resume bool),
	locationRange LocationRange,
)

IterateReadOnlyLoaded iterates over all LOADED elements of the array. DO NOT perform storage mutations in the callback!

func (*ArrayValue) Iterator added in v0.29.0

func (*ArrayValue) Map added in v0.41.0

func (v *ArrayValue) Map(
	interpreter *Interpreter,
	locationRange LocationRange,
	procedure FunctionValue,
) Value

func (*ArrayValue) MeteredString added in v0.24.0

func (v *ArrayValue) MeteredString(interpreter *Interpreter, seenReferences SeenReferences, locationRange LocationRange) string

func (*ArrayValue) NeedsStoreTo added in v0.20.0

func (v *ArrayValue) NeedsStoreTo(address atree.Address) bool

func (*ArrayValue) RecursiveString added in v0.17.0

func (v *ArrayValue) RecursiveString(seenReferences SeenReferences) string

func (*ArrayValue) Remove

func (v *ArrayValue) Remove(interpreter *Interpreter, locationRange LocationRange, index int) Value

func (*ArrayValue) RemoveFirst

func (v *ArrayValue) RemoveFirst(interpreter *Interpreter, locationRange LocationRange) Value

func (*ArrayValue) RemoveKey added in v0.20.0

func (v *ArrayValue) RemoveKey(interpreter *Interpreter, locationRange LocationRange, key Value) Value

func (*ArrayValue) RemoveLast

func (v *ArrayValue) RemoveLast(interpreter *Interpreter, locationRange LocationRange) Value

func (*ArrayValue) RemoveMember added in v0.20.0

func (v *ArrayValue) RemoveMember(interpreter *Interpreter, locationRange LocationRange, _ string) Value

func (*ArrayValue) RemoveWithoutTransfer added in v1.0.0

func (v *ArrayValue) RemoveWithoutTransfer(
	interpreter *Interpreter,
	locationRange LocationRange,
	index int,
) atree.Storable

func (*ArrayValue) Reverse added in v0.40.0

func (v *ArrayValue) Reverse(
	interpreter *Interpreter,
	locationRange LocationRange,
) Value

func (*ArrayValue) SemaType added in v0.20.0

func (v *ArrayValue) SemaType(interpreter *Interpreter) sema.ArrayType

func (*ArrayValue) Set

func (v *ArrayValue) Set(interpreter *Interpreter, locationRange LocationRange, index int, element Value)

func (*ArrayValue) SetKey added in v0.20.0

func (v *ArrayValue) SetKey(interpreter *Interpreter, locationRange LocationRange, key Value, value Value)

func (*ArrayValue) SetMember

func (v *ArrayValue) SetMember(interpreter *Interpreter, locationRange LocationRange, _ string, _ Value) bool

func (*ArrayValue) SetType added in v1.0.0

func (v *ArrayValue) SetType(staticType ArrayStaticType)

func (*ArrayValue) SlabID added in v1.0.0

func (v *ArrayValue) SlabID() atree.SlabID

func (*ArrayValue) Slice added in v0.24.0

func (v *ArrayValue) Slice(
	interpreter *Interpreter,
	from IntValue,
	to IntValue,
	locationRange LocationRange,
) Value

func (*ArrayValue) StaticType added in v0.12.0

func (v *ArrayValue) StaticType(_ *Interpreter) StaticType

func (*ArrayValue) Storable added in v0.20.0

func (v *ArrayValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint64,
) (atree.Storable, error)

func (*ArrayValue) StorageAddress added in v0.40.0

func (v *ArrayValue) StorageAddress() atree.Address

func (*ArrayValue) String

func (v *ArrayValue) String() string

func (*ArrayValue) ToConstantSized added in v1.0.0

func (v *ArrayValue) ToConstantSized(
	interpreter *Interpreter,
	locationRange LocationRange,
	expectedConstantSizedArraySize int64,
) OptionalValue

func (*ArrayValue) ToVariableSized added in v1.0.0

func (v *ArrayValue) ToVariableSized(
	interpreter *Interpreter,
	locationRange LocationRange,
) Value

func (*ArrayValue) Transfer added in v0.20.0

func (v *ArrayValue) Transfer(
	interpreter *Interpreter,
	locationRange LocationRange,
	address atree.Address,
	remove bool,
	storable atree.Storable,
	preventTransfer map[atree.ValueID]struct{},
	hasNoParentContainer bool,
) Value

func (*ArrayValue) ValueID added in v1.0.0

func (v *ArrayValue) ValueID() atree.ValueID

func (*ArrayValue) Walk added in v0.19.0

func (v *ArrayValue) Walk(
	interpreter *Interpreter,
	walkChild func(Value),
	locationRange LocationRange,
)

type ArrayValueIterator added in v0.29.0

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

func (ArrayValueIterator) Next added in v0.29.0

func (i ArrayValueIterator) Next(interpreter *Interpreter, _ LocationRange) Value

type AttachmentIterationMutationError added in v0.36.0

type AttachmentIterationMutationError struct {
	Value *CompositeValue
	LocationRange
}

AttachmentIterationMutationError

func (AttachmentIterationMutationError) Error added in v0.36.0

func (AttachmentIterationMutationError) IsUserError added in v0.36.0

func (AttachmentIterationMutationError) IsUserError()

type Authorization added in v1.0.0

type Authorization interface {
	String() string
	MeteredString(common.MemoryGauge) string
	Equal(auth Authorization) bool
	Encode(e *cbor.StreamEncoder) error
	ID() TypeID
	// contains filtered or unexported methods
}
var InaccessibleAccess Authorization = Inaccessible{}
var UnauthorizedAccess Authorization = Unauthorized{}

func ConvertSemaAccessToStaticAuthorization added in v1.0.0

func ConvertSemaAccessToStaticAuthorization(
	memoryGauge common.MemoryGauge,
	access sema.Access,
) Authorization

type AuthorizedValue added in v1.0.0

type AuthorizedValue interface {
	GetAuthorization() Authorization
}

type BigNumberValue

type BigNumberValue interface {
	NumberValue
	ByteLength() int
	ToBigInt(memoryGauge common.MemoryGauge) *big.Int
}

BigNumberValue is a number value with an integer value outside the range of int64

type BoolValue

type BoolValue bool

func AsBoolValue added in v0.28.0

func AsBoolValue(v bool) BoolValue

func (BoolValue) Accept added in v0.12.0

func (v BoolValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (BoolValue) ByteSize added in v0.20.0

func (v BoolValue) ByteSize() uint32

func (BoolValue) ChildStorables added in v0.20.0

func (BoolValue) ChildStorables() []atree.Storable

func (BoolValue) Clone added in v0.24.0

func (v BoolValue) Clone(_ *Interpreter) Value

func (BoolValue) ConformsToStaticType added in v0.24.0

func (v BoolValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (BoolValue) DeepRemove added in v0.20.0

func (BoolValue) DeepRemove(_ *Interpreter, _ bool)

func (BoolValue) Encode added in v0.20.0

func (v BoolValue) Encode(e *atree.Encoder) error

Encode encodes the value as a CBOR bool

func (BoolValue) Equal

func (v BoolValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (BoolValue) Greater added in v0.39.0

func (BoolValue) GreaterEqual added in v0.39.0

func (v BoolValue) GreaterEqual(_ *Interpreter, other ComparableValue, _ LocationRange) BoolValue

func (BoolValue) HashInput added in v0.20.0

func (v BoolValue) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeBool (1 byte) - 1/0 (1 byte)

func (BoolValue) IsImportable added in v0.24.0

func (BoolValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (BoolValue) IsResourceKinded added in v0.20.0

func (BoolValue) IsResourceKinded(_ *Interpreter) bool

func (BoolValue) Less added in v0.39.0

func (BoolValue) LessEqual added in v0.39.0

func (v BoolValue) LessEqual(_ *Interpreter, other ComparableValue, _ LocationRange) BoolValue

func (BoolValue) MeteredString added in v0.24.0

func (v BoolValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (BoolValue) NeedsStoreTo added in v0.20.0

func (BoolValue) NeedsStoreTo(_ atree.Address) bool

func (BoolValue) Negate

func (v BoolValue) Negate(_ *Interpreter) BoolValue

func (BoolValue) RecursiveString added in v0.17.0

func (v BoolValue) RecursiveString(_ SeenReferences) string

func (BoolValue) StaticType added in v0.12.0

func (BoolValue) StaticType(interpreter *Interpreter) StaticType

func (BoolValue) Storable added in v0.20.0

func (BoolValue) StoredValue added in v0.20.0

func (v BoolValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (BoolValue) String

func (v BoolValue) String() string

func (BoolValue) Transfer added in v0.20.0

func (v BoolValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (BoolValue) Walk added in v0.19.0

func (BoolValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type BoundFunctionGenerator added in v1.0.0

type BoundFunctionGenerator func(MemberAccessibleValue) BoundFunctionValue

type BoundFunctionValue

type BoundFunctionValue struct {
	Function           FunctionValue
	Base               *EphemeralReferenceValue
	BoundAuthorization Authorization
	SelfReference      ReferenceValue
	// contains filtered or unexported fields
}

BoundFunctionValue

func NewBoundFunctionValue added in v0.24.0

func NewBoundFunctionValue(
	interpreter *Interpreter,
	function FunctionValue,
	self *Value,
	base *EphemeralReferenceValue,
	boundAuth Authorization,
) BoundFunctionValue

func NewBoundFunctionValueFromSelfReference added in v1.0.1

func NewBoundFunctionValueFromSelfReference(
	interpreter *Interpreter,
	function FunctionValue,
	selfReference ReferenceValue,
	selfIsReference bool,
	base *EphemeralReferenceValue,
	boundAuth Authorization,
) BoundFunctionValue

func NewBoundHostFunctionValue added in v1.0.0

func NewBoundHostFunctionValue[T Value](
	interpreter *Interpreter,
	self Value,
	funcType *sema.FunctionType,
	function func(self T, invocation Invocation) Value,
) BoundFunctionValue

NewBoundHostFunctionValue creates a bound-function value for a host-function.

func NewUnmeteredBoundHostFunctionValue added in v1.0.0

func NewUnmeteredBoundHostFunctionValue(
	interpreter *Interpreter,
	self Value,
	funcType *sema.FunctionType,
	function HostFunction,
) BoundFunctionValue

NewUnmeteredBoundHostFunctionValue creates a bound-function value for a host-function.

func (BoundFunctionValue) Accept added in v0.12.0

func (f BoundFunctionValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (BoundFunctionValue) Clone added in v0.24.0

func (f BoundFunctionValue) Clone(_ *Interpreter) Value

func (BoundFunctionValue) ConformsToStaticType added in v0.24.0

func (f BoundFunctionValue) ConformsToStaticType(
	interpreter *Interpreter,
	locationRange LocationRange,
	results TypeConformanceResults,
) bool

func (BoundFunctionValue) DeepRemove added in v0.20.0

func (BoundFunctionValue) DeepRemove(_ *Interpreter, _ bool)

func (BoundFunctionValue) FunctionType added in v0.27.0

func (f BoundFunctionValue) FunctionType() *sema.FunctionType

func (BoundFunctionValue) IsImportable added in v0.24.0

func (BoundFunctionValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (BoundFunctionValue) IsResourceKinded added in v0.20.0

func (BoundFunctionValue) IsResourceKinded(_ *Interpreter) bool

func (BoundFunctionValue) MeteredString added in v0.24.0

func (f BoundFunctionValue) MeteredString(interpreter *Interpreter, seenReferences SeenReferences, locationRange LocationRange) string

func (BoundFunctionValue) NeedsStoreTo added in v0.20.0

func (BoundFunctionValue) NeedsStoreTo(_ atree.Address) bool

func (BoundFunctionValue) RecursiveString added in v0.17.0

func (f BoundFunctionValue) RecursiveString(seenReferences SeenReferences) string

func (BoundFunctionValue) StaticType added in v0.12.0

func (f BoundFunctionValue) StaticType(inter *Interpreter) StaticType

func (BoundFunctionValue) Storable added in v0.20.0

func (BoundFunctionValue) String added in v0.2.0

func (f BoundFunctionValue) String() string

func (BoundFunctionValue) Transfer added in v0.20.0

func (f BoundFunctionValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (BoundFunctionValue) Walk added in v0.19.0

func (f BoundFunctionValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type BreakResult added in v0.27.0

type BreakResult struct{}

type CallStack added in v0.25.0

type CallStack struct {
	Invocations []Invocation
}

CallStack is the stack of invocations (call stack).

func (*CallStack) Pop added in v0.25.0

func (i *CallStack) Pop()

func (*CallStack) Push added in v0.25.0

func (i *CallStack) Push(invocation Invocation)

type CapabilityAddressPublishingError added in v1.0.0

type CapabilityAddressPublishingError struct {
	LocationRange
	CapabilityAddress AddressValue
	AccountAddress    AddressValue
}

CapabilityAddressPublishingError

func (CapabilityAddressPublishingError) Error added in v1.0.0

func (CapabilityAddressPublishingError) IsUserError added in v1.0.0

func (CapabilityAddressPublishingError) IsUserError()

type CapabilityBorrowHandlerFunc added in v1.0.0

type CapabilityBorrowHandlerFunc func(
	inter *Interpreter,
	locationRange LocationRange,
	address AddressValue,
	capabilityID UInt64Value,
	wantedBorrowType *sema.ReferenceType,
	capabilityBorrowType *sema.ReferenceType,
) ReferenceValue

CapabilityBorrowHandlerFunc is a function that is used to borrow ID capabilities.

type CapabilityCheckHandlerFunc added in v1.0.0

type CapabilityCheckHandlerFunc func(
	inter *Interpreter,
	locationRange LocationRange,
	address AddressValue,
	capabilityID UInt64Value,
	wantedBorrowType *sema.ReferenceType,
	capabilityBorrowType *sema.ReferenceType,
) BoolValue

CapabilityCheckHandlerFunc is a function that is used to check ID capabilities.

type CapabilityControllerValue added in v0.39.0

type CapabilityControllerValue interface {
	Value

	CapabilityControllerBorrowType() *ReferenceStaticType
	ReferenceValue(
		interpreter *Interpreter,
		capabilityAddress common.Address,
		resultBorrowType *sema.ReferenceType,
		locationRange LocationRange,
	) ReferenceValue
	ControllerCapabilityID() UInt64Value
	// contains filtered or unexported methods
}

type CapabilityStaticType added in v0.5.0

type CapabilityStaticType struct {
	BorrowType StaticType
}

func NewCapabilityStaticType added in v0.24.0

func NewCapabilityStaticType(
	memoryGauge common.MemoryGauge,
	borrowType StaticType,
) *CapabilityStaticType

func (*CapabilityStaticType) Encode added in v0.20.0

func (t *CapabilityStaticType) Encode(e *cbor.StreamEncoder) error

Encode encodes CapabilityStaticType as

cbor.Tag{
		Number:  CBORTagCapabilityStaticType,
		Content: StaticType(v.BorrowType),
}

func (*CapabilityStaticType) Equal added in v0.15.0

func (t *CapabilityStaticType) Equal(other StaticType) bool

func (*CapabilityStaticType) ID added in v0.41.0

func (t *CapabilityStaticType) ID() TypeID

func (*CapabilityStaticType) IsDeprecated added in v1.0.0

func (t *CapabilityStaticType) IsDeprecated() bool

func (*CapabilityStaticType) MeteredString added in v0.24.0

func (t *CapabilityStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (*CapabilityStaticType) String added in v0.5.0

func (t *CapabilityStaticType) String() string

type CapabilityValue

type CapabilityValue interface {
	EquatableValue
	MemberAccessibleValue
	atree.Storable

	Address() AddressValue
	// contains filtered or unexported methods
}

TODO: remove once migration to Cadence 1.0 / ID capabilities is complete

type CharacterValue added in v0.24.0

type CharacterValue struct {
	Str             string
	UnnormalizedStr string
}

CharacterValue represents a Cadence character, which is a Unicode extended grapheme cluster. Hence, use a Go string to be able to hold multiple Unicode code points (Go runes). It should consist of exactly one grapheme cluster

func NewCharacterValue added in v0.24.0

func NewCharacterValue(
	memoryGauge common.MemoryGauge,
	memoryUsage common.MemoryUsage,
	characterConstructor func() string,
) CharacterValue

func NewCharacterValue_Unsafe deprecated added in v1.0.0

func NewCharacterValue_Unsafe(normalizedStr, unnormalizedStr string) CharacterValue

Deprecated: NewStringValue_UnsafeNewCharacterValue_Unsafe creates a new character value from the given normalized and unnormalized string. NOTE: this function is unsafe, as it does not normalize the string. It should only be used for e.g. migration purposes.

func NewUnmeteredCharacterValue added in v0.24.0

func NewUnmeteredCharacterValue(str string) CharacterValue

func (CharacterValue) Accept added in v0.24.0

func (v CharacterValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (CharacterValue) ByteSize added in v0.24.0

func (v CharacterValue) ByteSize() uint32

func (CharacterValue) ChildStorables added in v0.24.0

func (CharacterValue) ChildStorables() []atree.Storable

func (CharacterValue) Clone added in v0.24.0

func (v CharacterValue) Clone(_ *Interpreter) Value

func (CharacterValue) ConformsToStaticType added in v0.24.0

func (v CharacterValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (CharacterValue) DeepRemove added in v0.24.0

func (CharacterValue) DeepRemove(_ *Interpreter, _ bool)

func (CharacterValue) Encode added in v0.24.0

func (v CharacterValue) Encode(e *atree.Encoder) error

Encode encodes the value as a CBOR string

func (CharacterValue) Equal added in v0.24.0

func (v CharacterValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (CharacterValue) GetMember added in v0.24.0

func (v CharacterValue) GetMember(interpreter *Interpreter, _ LocationRange, name string) Value

func (CharacterValue) Greater added in v0.39.0

func (CharacterValue) GreaterEqual added in v0.39.0

func (v CharacterValue) GreaterEqual(_ *Interpreter, other ComparableValue, _ LocationRange) BoolValue

func (CharacterValue) HashInput added in v0.24.0

func (v CharacterValue) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

func (CharacterValue) IsImportable added in v0.24.0

func (CharacterValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (CharacterValue) IsResourceKinded added in v0.24.0

func (CharacterValue) IsResourceKinded(_ *Interpreter) bool

func (CharacterValue) Less added in v0.39.0

func (CharacterValue) LessEqual added in v0.39.0

func (CharacterValue) MeteredString added in v0.24.0

func (v CharacterValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (CharacterValue) NeedsStoreTo added in v0.24.0

func (CharacterValue) NeedsStoreTo(_ atree.Address) bool

func (CharacterValue) RecursiveString added in v0.24.0

func (v CharacterValue) RecursiveString(_ SeenReferences) string

func (CharacterValue) RemoveMember added in v0.24.0

func (CharacterValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (CharacterValue) SetMember added in v0.24.0

func (CharacterValue) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (CharacterValue) StaticType added in v0.24.0

func (CharacterValue) StaticType(interpreter *Interpreter) StaticType

func (CharacterValue) Storable added in v0.24.0

func (CharacterValue) StoredValue added in v0.24.0

func (v CharacterValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (CharacterValue) String added in v0.24.0

func (v CharacterValue) String() string

func (CharacterValue) Transfer added in v0.24.0

func (v CharacterValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (CharacterValue) Walk added in v0.24.0

func (CharacterValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type ComparableValue added in v0.39.0

type ComparableValue interface {
	EquatableValue
	Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue
	LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue
	Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue
	GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue
}

ComparableValue

type CompositeField added in v0.20.0

type CompositeField struct {
	Value Value
	Name  string
}

func NewCompositeField added in v0.24.0

func NewCompositeField(memoryGauge common.MemoryGauge, name string, value Value) CompositeField

func NewUnmeteredCompositeField added in v0.24.0

func NewUnmeteredCompositeField(name string, value Value) CompositeField

type CompositeStaticType

type CompositeStaticType struct {
	Location            common.Location
	QualifiedIdentifier string
	TypeID              TypeID
}

func ConvertSemaCompositeTypeToStaticCompositeType added in v0.41.0

func ConvertSemaCompositeTypeToStaticCompositeType(
	memoryGauge common.MemoryGauge,
	t *sema.CompositeType,
) *CompositeStaticType

func NewCompositeStaticType added in v0.20.0

func NewCompositeStaticType(
	memoryGauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
	typeID TypeID,
) *CompositeStaticType

func NewCompositeStaticTypeComputeTypeID added in v0.24.0

func NewCompositeStaticTypeComputeTypeID(
	memoryGauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
) *CompositeStaticType

func (*CompositeStaticType) Encode added in v0.20.0

func (t *CompositeStaticType) Encode(e *cbor.StreamEncoder) error

Encode encodes CompositeStaticType as

cbor.Tag{
			Number: CBORTagCompositeStaticType,
			Content: cborArray{
				encodedCompositeStaticTypeLocationFieldKey:            Location(v.Location),
				encodedCompositeStaticTypeQualifiedIdentifierFieldKey: string(v.QualifiedIdentifier),
		},
}

func (*CompositeStaticType) Equal added in v0.15.0

func (t *CompositeStaticType) Equal(other StaticType) bool

func (*CompositeStaticType) ID added in v0.41.0

func (t *CompositeStaticType) ID() TypeID

func (*CompositeStaticType) IsDeprecated added in v1.0.0

func (*CompositeStaticType) IsDeprecated() bool

func (*CompositeStaticType) MeteredString added in v0.24.0

func (t *CompositeStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (*CompositeStaticType) String

func (t *CompositeStaticType) String() string

type CompositeTypeCode added in v0.5.0

type CompositeTypeCode struct {
	CompositeFunctions *FunctionOrderedMap
}

CompositeTypeCode contains the "prepared" / "callable" "code" for the functions and the destructor of a composite (contract, struct, resource, event).

As there is no support for inheritance of concrete types, these are the "leaf" nodes in the call chain, and are functions.

type CompositeTypeHandlerFunc added in v0.39.2

type CompositeTypeHandlerFunc func(location common.Location, typeID TypeID) *sema.CompositeType

CompositeTypeHandlerFunc is a function that loads composite types.

type CompositeValue

type CompositeValue struct {
	Location common.Location

	Stringer func(gauge common.MemoryGauge, value *CompositeValue, seenReferences SeenReferences) string

	NestedVariables map[string]Variable
	Functions       *FunctionOrderedMap

	QualifiedIdentifier string
	Kind                common.CompositeKind
	// contains filtered or unexported fields
}

func NewCompositeValue added in v0.2.1

func NewCompositeValue(
	interpreter *Interpreter,
	locationRange LocationRange,
	location common.Location,
	qualifiedIdentifier string,
	kind common.CompositeKind,
	fields []CompositeField,
	address common.Address,
) *CompositeValue

func NewCompositeValueWithStaticType added in v1.0.0

func NewCompositeValueWithStaticType(
	interpreter *Interpreter,
	locationRange LocationRange,
	location common.Location,
	qualifiedIdentifier string,
	kind common.CompositeKind,
	fields []CompositeField,
	address common.Address,
	staticType StaticType,
) *CompositeValue

Create a CompositeValue with the provided StaticType. Useful when we wish to utilize CompositeValue as the value for a type which isn't CompositeType. For e.g. InclusiveRangeType

func NewEnumCaseValue added in v0.18.0

func NewEnumCaseValue(
	interpreter *Interpreter,
	locationRange LocationRange,
	enumType *sema.CompositeType,
	rawValue NumberValue,
	functions *FunctionOrderedMap,
) *CompositeValue

func NewInclusiveRangeValue added in v1.0.0

func NewInclusiveRangeValue(
	interpreter *Interpreter,
	locationRange LocationRange,
	start IntegerValue,
	end IntegerValue,
	rangeStaticType InclusiveRangeStaticType,
	rangeSemaType *sema.InclusiveRangeType,
) *CompositeValue

NewInclusiveRangeValue constructs an InclusiveRange value with the provided start, end with default value of step. NOTE: Assumes that the values start and end are of the same static type.

func NewInclusiveRangeValueWithStep added in v1.0.0

func NewInclusiveRangeValueWithStep(
	interpreter *Interpreter,
	locationRange LocationRange,
	start IntegerValue,
	end IntegerValue,
	step IntegerValue,
	rangeType InclusiveRangeStaticType,
	rangeSemaType *sema.InclusiveRangeType,
) *CompositeValue

NewInclusiveRangeValue constructs an InclusiveRange value with the provided start, end & step. NOTE: Assumes that the values start, end and step are of the same static type.

func NewPublicKeyValue added in v0.14.0

func NewPublicKeyValue(
	interpreter *Interpreter,
	locationRange LocationRange,
	publicKey *ArrayValue,
	signAlgo Value,
	validatePublicKey PublicKeyValidationHandlerFunc,
) *CompositeValue

NewPublicKeyValue constructs a PublicKey value.

func (*CompositeValue) Accept added in v0.12.0

func (v *CompositeValue) Accept(interpreter *Interpreter, visitor Visitor, locationRange LocationRange)

func (*CompositeValue) Clone added in v0.24.0

func (v *CompositeValue) Clone(interpreter *Interpreter) Value

func (*CompositeValue) CompositeStaticTypeConformsToStaticType added in v1.0.0

func (v *CompositeValue) CompositeStaticTypeConformsToStaticType(
	interpreter *Interpreter,
	locationRange LocationRange,
	results TypeConformanceResults,
	semaType sema.Type,
) bool

func (*CompositeValue) ConformsToStaticType added in v0.24.0

func (v *CompositeValue) ConformsToStaticType(
	interpreter *Interpreter,
	locationRange LocationRange,
	results TypeConformanceResults,
) bool

func (*CompositeValue) DeepRemove added in v0.20.0

func (v *CompositeValue) DeepRemove(interpreter *Interpreter, hasNoParentContainer bool)

func (*CompositeValue) Destroy

func (v *CompositeValue) Destroy(interpreter *Interpreter, locationRange LocationRange)

func (*CompositeValue) Equal added in v0.10.0

func (v *CompositeValue) Equal(interpreter *Interpreter, locationRange LocationRange, other Value) bool

func (*CompositeValue) FieldCount added in v0.42.8

func (v *CompositeValue) FieldCount() int

func (*CompositeValue) ForEach added in v1.0.0

func (v *CompositeValue) ForEach(
	interpreter *Interpreter,
	_ sema.Type,
	function func(value Value) (resume bool),
	transferElements bool,
	locationRange LocationRange,
)

func (*CompositeValue) ForEachField added in v0.20.0

func (v *CompositeValue) ForEachField(
	interpreter *Interpreter,
	f func(fieldName string, fieldValue Value) (resume bool),
	locationRange LocationRange,
)

ForEachField iterates over all field-name field-value pairs of the composite value. It does NOT iterate over computed fields and functions!

func (*CompositeValue) ForEachFieldName added in v1.0.0

func (v *CompositeValue) ForEachFieldName(
	f func(fieldName string) (resume bool),
)

ForEachFieldName iterates over all field names of the composite value. It does NOT iterate over computed fields and functions!

func (*CompositeValue) ForEachReadOnlyLoadedField added in v1.0.0

func (v *CompositeValue) ForEachReadOnlyLoadedField(
	interpreter *Interpreter,
	f func(fieldName string, fieldValue Value) (resume bool),
	locationRange LocationRange,
)

ForEachReadOnlyLoadedField iterates over all LOADED field-name field-value pairs of the composite value. It does NOT iterate over computed fields and functions! DO NOT perform storage mutations in the callback!

func (*CompositeValue) GetAttachments added in v0.36.0

func (v *CompositeValue) GetAttachments(interpreter *Interpreter, locationRange LocationRange) []*CompositeValue

func (*CompositeValue) GetComputedField added in v1.0.0

func (v *CompositeValue) GetComputedField(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (*CompositeValue) GetComputedFields added in v1.0.0

func (v *CompositeValue) GetComputedFields(interpreter *Interpreter) map[string]ComputedField

func (*CompositeValue) GetField

func (v *CompositeValue) GetField(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (*CompositeValue) GetFunction added in v1.0.0

func (v *CompositeValue) GetFunction(interpreter *Interpreter, locationRange LocationRange, name string) FunctionValue

func (*CompositeValue) GetInjectedField added in v1.0.0

func (v *CompositeValue) GetInjectedField(interpreter *Interpreter, name string) Value

func (*CompositeValue) GetMember

func (v *CompositeValue) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (*CompositeValue) GetOwner

func (v *CompositeValue) GetOwner() common.Address

func (*CompositeValue) GetTypeKey added in v0.36.0

func (v *CompositeValue) GetTypeKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	ty sema.Type,
) Value

func (*CompositeValue) HashInput added in v0.20.0

func (v *CompositeValue) HashInput(interpreter *Interpreter, locationRange LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeEnum (1 byte) - type id (n bytes) - hash input of raw value field name (n bytes)

func (*CompositeValue) InclusiveRangeStaticTypeConformsToStaticType added in v1.0.0

func (v *CompositeValue) InclusiveRangeStaticTypeConformsToStaticType(
	interpreter *Interpreter,
	locationRange LocationRange,
	results TypeConformanceResults,
	semaType sema.Type,
) bool

func (*CompositeValue) IsDestroyed added in v0.20.0

func (v *CompositeValue) IsDestroyed() bool

func (*CompositeValue) IsImportable added in v0.24.0

func (v *CompositeValue) IsImportable(inter *Interpreter, locationRange LocationRange) bool

func (*CompositeValue) IsReferenceTrackedResourceKindedValue added in v0.21.0

func (v *CompositeValue) IsReferenceTrackedResourceKindedValue()

func (*CompositeValue) IsResourceKinded added in v0.20.0

func (v *CompositeValue) IsResourceKinded(interpreter *Interpreter) bool

func (*CompositeValue) IsStaleResource added in v0.32.0

func (v *CompositeValue) IsStaleResource(inter *Interpreter) bool

func (*CompositeValue) IsStorable added in v0.16.0

func (v *CompositeValue) IsStorable() bool

func (*CompositeValue) Iterator added in v1.0.0

func (v *CompositeValue) Iterator(interpreter *Interpreter, locationRange LocationRange) ValueIterator

func (*CompositeValue) MeteredString added in v0.24.0

func (v *CompositeValue) MeteredString(interpreter *Interpreter, seenReferences SeenReferences, locationRange LocationRange) string

func (*CompositeValue) NeedsStoreTo added in v0.20.0

func (v *CompositeValue) NeedsStoreTo(address atree.Address) bool

func (*CompositeValue) OwnerValue

func (v *CompositeValue) OwnerValue(interpreter *Interpreter, locationRange LocationRange) OptionalValue

func (*CompositeValue) RecursiveString added in v0.17.0

func (v *CompositeValue) RecursiveString(seenReferences SeenReferences) string

func (*CompositeValue) RemoveField added in v0.20.0

func (v *CompositeValue) RemoveField(
	interpreter *Interpreter,
	locationRange LocationRange,
	name string,
)

func (*CompositeValue) RemoveMember added in v0.20.0

func (v *CompositeValue) RemoveMember(
	interpreter *Interpreter,
	locationRange LocationRange,
	name string,
) Value

func (*CompositeValue) RemoveTypeKey added in v0.36.0

func (v *CompositeValue) RemoveTypeKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	attachmentType sema.Type,
) Value

func (*CompositeValue) ResourceUUID added in v0.24.0

func (v *CompositeValue) ResourceUUID(interpreter *Interpreter, locationRange LocationRange) *UInt64Value

func (*CompositeValue) SetMember

func (v *CompositeValue) SetMember(
	interpreter *Interpreter,
	locationRange LocationRange,
	name string,
	value Value,
) bool

func (*CompositeValue) SetMemberWithoutTransfer added in v1.0.0

func (v *CompositeValue) SetMemberWithoutTransfer(
	interpreter *Interpreter,
	locationRange LocationRange,
	name string,
	value Value,
) bool

func (*CompositeValue) SetNestedVariables added in v0.27.0

func (v *CompositeValue) SetNestedVariables(variables map[string]Variable)

func (*CompositeValue) SetTypeKey added in v0.36.0

func (v *CompositeValue) SetTypeKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	attachmentType sema.Type,
	attachment Value,
)

func (*CompositeValue) SlabID added in v1.0.0

func (v *CompositeValue) SlabID() atree.SlabID

func (*CompositeValue) StaticType added in v0.12.0

func (v *CompositeValue) StaticType(interpreter *Interpreter) StaticType

func (*CompositeValue) Storable added in v0.20.0

func (v *CompositeValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint64,
) (atree.Storable, error)

func (*CompositeValue) StorageAddress added in v0.40.0

func (v *CompositeValue) StorageAddress() atree.Address

func (*CompositeValue) String

func (v *CompositeValue) String() string

func (*CompositeValue) Transfer added in v0.20.0

func (v *CompositeValue) Transfer(
	interpreter *Interpreter,
	locationRange LocationRange,
	address atree.Address,
	remove bool,
	storable atree.Storable,
	preventTransfer map[atree.ValueID]struct{},
	hasNoParentContainer bool,
) Value

func (*CompositeValue) TypeID

func (v *CompositeValue) TypeID() TypeID

func (*CompositeValue) ValueID added in v1.0.0

func (v *CompositeValue) ValueID() atree.ValueID

func (*CompositeValue) Walk added in v0.19.0

func (v *CompositeValue) Walk(interpreter *Interpreter, walkChild func(Value), locationRange LocationRange)

Walk iterates over all field values of the composite value. It does NOT walk the computed field or functions!

type CompositeValueFunctionsHandlerFunc added in v1.0.0

type CompositeValueFunctionsHandlerFunc func(
	inter *Interpreter,
	locationRange LocationRange,
	compositeValue *CompositeValue,
) *FunctionOrderedMap

CompositeValueFunctionsHandlerFunc is a function that loads composite value functions.

type ComputedField added in v0.13.5

type ComputedField func(*Interpreter, LocationRange, *CompositeValue) Value

type ConditionError

type ConditionError struct {
	LocationRange
	Message       string
	ConditionKind ast.ConditionKind
}

func (ConditionError) Error

func (e ConditionError) Error() string

func (ConditionError) IsUserError added in v0.25.0

func (ConditionError) IsUserError()

type Config added in v0.26.0

type Config struct {
	MemoryGauge common.MemoryGauge
	Storage     Storage
	// ImportLocationHandler is used to handle imports of locations
	ImportLocationHandler ImportLocationHandlerFunc
	// OnInvokedFunctionReturn is triggered when an invoked function returned
	OnInvokedFunctionReturn OnInvokedFunctionReturnFunc
	// OnRecordTrace is triggered when a trace is recorded
	OnRecordTrace OnRecordTraceFunc
	// OnResourceOwnerChange is triggered when the owner of a resource changes
	OnResourceOwnerChange OnResourceOwnerChangeFunc
	// OnMeterComputation is triggered when a computation is about to happen
	OnMeterComputation OnMeterComputationFunc
	// InjectedCompositeFieldsHandler is used to initialize new composite values' fields
	InjectedCompositeFieldsHandler InjectedCompositeFieldsHandlerFunc
	// ContractValueHandler is used to handle imports of values
	ContractValueHandler ContractValueHandlerFunc
	// OnEventEmitted is triggered when an event is emitted by the program
	OnEventEmitted OnEventEmittedFunc
	// OnFunctionInvocation is triggered when a function invocation is about to be executed
	OnFunctionInvocation OnFunctionInvocationFunc
	// AccountHandler is used to handle accounts
	AccountHandler AccountHandlerFunc
	// UUIDHandler is used to handle the generation of UUIDs
	UUIDHandler UUIDHandlerFunc
	// CompositeTypeHandler is used to load composite types
	CompositeTypeHandler CompositeTypeHandlerFunc
	// InterfaceTypeHandler is used to load interface types
	InterfaceTypeHandler InterfaceTypeHandlerFunc
	// CompositeValueFunctionsHandler is used to load composite value functions
	CompositeValueFunctionsHandler CompositeValueFunctionsHandlerFunc
	BaseActivationHandler          func(location common.Location) *VariableActivation
	Debugger                       *Debugger
	// OnStatement is triggered when a statement is about to be executed
	OnStatement OnStatementFunc
	// OnLoopIteration is triggered when a loop iteration is about to be executed
	OnLoopIteration OnLoopIterationFunc
	// TracingEnabled determines if tracing is enabled.
	// Tracing reports certain operations, e.g. composite value transfers
	TracingEnabled bool
	// AtreeStorageValidationEnabled determines if the validation of atree storage is enabled
	AtreeStorageValidationEnabled bool
	// AtreeValueValidationEnabled determines if the validation of atree values is enabled
	AtreeValueValidationEnabled bool
	// CapabilityCheckHandler is used to check ID capabilities
	CapabilityCheckHandler CapabilityCheckHandlerFunc
	// CapabilityBorrowHandler is used to borrow ID capabilities
	CapabilityBorrowHandler CapabilityBorrowHandlerFunc
	// LegacyContractUpgradeEnabled specifies whether to fall back to the old parser when attempting a contract upgrade
	LegacyContractUpgradeEnabled bool
	// ContractUpdateTypeRemovalEnabled specifies if type removal is enabled in contract updates
	ContractUpdateTypeRemovalEnabled bool
	// ValidateAccountCapabilitiesGetHandler is used to handle when a capability of an account is got.
	ValidateAccountCapabilitiesGetHandler ValidateAccountCapabilitiesGetHandlerFunc
	// ValidateAccountCapabilitiesPublishHandler is used to handle when a capability of an account is got.
	ValidateAccountCapabilitiesPublishHandler ValidateAccountCapabilitiesPublishHandlerFunc
}

type ConstantSizedStaticType

type ConstantSizedStaticType struct {
	Type StaticType
	Size int64
}

func NewConstantSizedStaticType added in v0.24.0

func NewConstantSizedStaticType(
	memoryGauge common.MemoryGauge,
	elementType StaticType,
	size int64,
) *ConstantSizedStaticType

func (*ConstantSizedStaticType) Copy added in v1.0.0

func (*ConstantSizedStaticType) ElementType added in v0.19.0

func (t *ConstantSizedStaticType) ElementType() StaticType

func (*ConstantSizedStaticType) Encode added in v0.20.0

func (t *ConstantSizedStaticType) Encode(e *cbor.StreamEncoder) error

Encode encodes ConstantSizedStaticType as

cbor.Tag{
		Number: CBORTagConstantSizedStaticType,
		Content: cborArray{
				encodedConstantSizedStaticTypeSizeFieldKey: int64(v.Size),
				encodedConstantSizedStaticTypeTypeFieldKey: StaticType(v.Type),
		},
}

func (*ConstantSizedStaticType) Equal added in v0.15.0

func (t *ConstantSizedStaticType) Equal(other StaticType) bool

func (*ConstantSizedStaticType) ID added in v0.41.0

func (*ConstantSizedStaticType) Identifier added in v1.0.0

func (t *ConstantSizedStaticType) Identifier() string

func (*ConstantSizedStaticType) IsComposite added in v1.0.0

func (*ConstantSizedStaticType) IsComposite() bool

func (*ConstantSizedStaticType) IsDeprecated added in v1.0.0

func (t *ConstantSizedStaticType) IsDeprecated() bool

func (*ConstantSizedStaticType) MeteredString added in v0.24.0

func (t *ConstantSizedStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (*ConstantSizedStaticType) String

func (t *ConstantSizedStaticType) String() string

type ContainerMutatedDuringIterationError added in v0.39.3

type ContainerMutatedDuringIterationError struct {
	LocationRange
}

ContainerMutatedDuringIterationError

func (ContainerMutatedDuringIterationError) Error added in v0.39.3

func (ContainerMutatedDuringIterationError) IsUserError added in v0.39.3

type ContainerMutationError added in v0.19.0

type ContainerMutationError struct {
	ExpectedType sema.Type
	ActualType   sema.Type
	LocationRange
}

ContainerMutationError

func (ContainerMutationError) Error added in v0.19.0

func (e ContainerMutationError) Error() string

func (ContainerMutationError) IsUserError added in v0.25.0

func (ContainerMutationError) IsUserError()

type ContinueResult added in v0.27.0

type ContinueResult struct{}

type ContractNamesGetter added in v0.25.0

type ContractNamesGetter func(interpreter *Interpreter, locationRange LocationRange) *ArrayValue

type ContractValue added in v0.27.0

type ContractValue interface {
	Value
	SetNestedVariables(variables map[string]Variable)
}

ContractValue is the value of a contract. Under normal circumstances, a contract value is always a CompositeValue. However, in the test framework, an imported contract is constructed via a constructor function. Hence, during tests, the value is a HostFunctionValue.

type ContractValueHandlerFunc

type ContractValueHandlerFunc func(
	inter *Interpreter,
	compositeType *sema.CompositeType,
	constructorGenerator func(common.Address) *HostFunctionValue,
	invocationRange ast.Range,
) ContractValue

ContractValueHandlerFunc is a function that handles contract values.

type Debugger added in v0.24.0

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

func NewDebugger added in v0.24.0

func NewDebugger() *Debugger

func (*Debugger) AddBreakpoint added in v0.25.0

func (d *Debugger) AddBreakpoint(location common.Location, line uint)

func (*Debugger) ClearBreakpoints added in v0.25.0

func (d *Debugger) ClearBreakpoints()

func (*Debugger) ClearBreakpointsForLocation added in v0.25.0

func (d *Debugger) ClearBreakpointsForLocation(location common.Location)

func (*Debugger) Continue added in v0.24.0

func (d *Debugger) Continue()

func (*Debugger) CurrentActivation added in v0.24.0

func (d *Debugger) CurrentActivation(interpreter *Interpreter) *VariableActivation

func (*Debugger) Next added in v0.24.0

func (d *Debugger) Next() Stop

func (*Debugger) Pause added in v0.24.0

func (d *Debugger) Pause() Stop

func (*Debugger) RemoveBreakpoint added in v0.25.0

func (d *Debugger) RemoveBreakpoint(location common.Location, line uint)

func (*Debugger) RequestPause added in v0.24.0

func (d *Debugger) RequestPause()

func (*Debugger) Stops added in v0.24.0

func (d *Debugger) Stops() <-chan Stop

type DereferenceError

type DereferenceError struct {
	Cause        string
	ExpectedType sema.Type
	ActualType   sema.Type
	LocationRange
}

func (DereferenceError) Error

func (e DereferenceError) Error() string

func (DereferenceError) IsUserError added in v0.25.0

func (DereferenceError) IsUserError()

func (DereferenceError) SecondaryError added in v0.32.0

func (e DereferenceError) SecondaryError() string

type DestroyedResourceError added in v0.24.0

type DestroyedResourceError struct {
	LocationRange
}

DestroyedResourceError is the error which is reported when a user uses a destroyed resource through a reference

func (DestroyedResourceError) Error added in v0.24.0

func (e DestroyedResourceError) Error() string

func (DestroyedResourceError) IsUserError added in v0.25.0

func (DestroyedResourceError) IsUserError()

type DictionaryEntryValues

type DictionaryEntryValues struct {
	Key   Value
	Value Value
}

type DictionaryKeyIterator added in v1.0.0

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

func (DictionaryKeyIterator) Next added in v1.0.0

func (DictionaryKeyIterator) NextKey added in v1.0.0

func (i DictionaryKeyIterator) NextKey(gauge common.MemoryGauge) Value

func (DictionaryKeyIterator) NextKeyUnconverted added in v1.0.0

func (i DictionaryKeyIterator) NextKeyUnconverted() atree.Value

type DictionaryStaticType

type DictionaryStaticType struct {
	KeyType   StaticType
	ValueType StaticType
}

func ConvertSemaDictionaryTypeToStaticDictionaryType added in v0.19.0

func ConvertSemaDictionaryTypeToStaticDictionaryType(
	memoryGauge common.MemoryGauge,
	t *sema.DictionaryType,
) *DictionaryStaticType

func NewDictionaryStaticType added in v0.24.0

func NewDictionaryStaticType(
	memoryGauge common.MemoryGauge,
	keyType, valueType StaticType,
) *DictionaryStaticType

func (*DictionaryStaticType) Copy added in v1.0.0

func (*DictionaryStaticType) Encode added in v0.20.0

func (t *DictionaryStaticType) Encode(e *cbor.StreamEncoder) error

Encode encodes DictionaryStaticType as

cbor.Tag{
		Number: CBORTagDictionaryStaticType,
		Content: []any{
				encodedDictionaryStaticTypeKeyTypeFieldKey:   StaticType(v.KeyType),
				encodedDictionaryStaticTypeValueTypeFieldKey: StaticType(v.ValueType),
		},
}

func (*DictionaryStaticType) Equal added in v0.15.0

func (t *DictionaryStaticType) Equal(other StaticType) bool

func (*DictionaryStaticType) ID added in v0.41.0

func (t *DictionaryStaticType) ID() TypeID

func (*DictionaryStaticType) Identifier added in v1.0.0

func (t *DictionaryStaticType) Identifier() string

func (*DictionaryStaticType) IsComposite added in v1.0.0

func (*DictionaryStaticType) IsComposite() bool

func (*DictionaryStaticType) IsDeprecated added in v1.0.0

func (t *DictionaryStaticType) IsDeprecated() bool

func (*DictionaryStaticType) MeteredString added in v0.24.0

func (t *DictionaryStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (*DictionaryStaticType) String

func (t *DictionaryStaticType) String() string

type DictionaryValue

type DictionaryValue struct {
	Type *DictionaryStaticType
	// contains filtered or unexported fields
}

func NewDictionaryValue added in v0.20.0

func NewDictionaryValue(
	interpreter *Interpreter,
	locationRange LocationRange,
	dictionaryType *DictionaryStaticType,
	keysAndValues ...Value,
) *DictionaryValue

func NewDictionaryValueWithAddress added in v0.20.0

func NewDictionaryValueWithAddress(
	interpreter *Interpreter,
	locationRange LocationRange,
	dictionaryType *DictionaryStaticType,
	address common.Address,
	keysAndValues ...Value,
) *DictionaryValue

func (*DictionaryValue) Accept added in v0.12.0

func (v *DictionaryValue) Accept(interpreter *Interpreter, visitor Visitor, locationRange LocationRange)

func (*DictionaryValue) Clone added in v0.24.0

func (v *DictionaryValue) Clone(interpreter *Interpreter) Value

func (*DictionaryValue) ConformsToStaticType added in v0.24.0

func (v *DictionaryValue) ConformsToStaticType(
	interpreter *Interpreter,
	locationRange LocationRange,
	results TypeConformanceResults,
) bool

func (*DictionaryValue) ContainsKey added in v0.14.4

func (v *DictionaryValue) ContainsKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	keyValue Value,
) BoolValue

func (*DictionaryValue) Count

func (v *DictionaryValue) Count() int

func (*DictionaryValue) DeepRemove added in v0.20.0

func (v *DictionaryValue) DeepRemove(interpreter *Interpreter, hasNoParentContainer bool)

func (*DictionaryValue) Destroy

func (v *DictionaryValue) Destroy(interpreter *Interpreter, locationRange LocationRange)

func (*DictionaryValue) Equal added in v0.15.0

func (v *DictionaryValue) Equal(interpreter *Interpreter, locationRange LocationRange, other Value) bool

func (*DictionaryValue) ForEachKey added in v0.27.1

func (v *DictionaryValue) ForEachKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	procedure FunctionValue,
)

func (*DictionaryValue) Get

func (v *DictionaryValue) Get(
	interpreter *Interpreter,
	locationRange LocationRange,
	keyValue Value,
) (Value, bool)

func (*DictionaryValue) GetKey added in v0.20.0

func (v *DictionaryValue) GetKey(interpreter *Interpreter, locationRange LocationRange, keyValue Value) Value

func (*DictionaryValue) GetMember

func (v *DictionaryValue) GetMember(
	interpreter *Interpreter,
	locationRange LocationRange,
	name string,
) Value

func (*DictionaryValue) GetOwner

func (v *DictionaryValue) GetOwner() common.Address

func (*DictionaryValue) Insert

func (v *DictionaryValue) Insert(
	interpreter *Interpreter,
	locationRange LocationRange,
	keyValue, value Value,
) OptionalValue

func (*DictionaryValue) InsertKey added in v0.20.0

func (v *DictionaryValue) InsertKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key, value Value,
)

func (*DictionaryValue) InsertWithoutTransfer added in v1.0.0

func (v *DictionaryValue) InsertWithoutTransfer(
	interpreter *Interpreter,
	locationRange LocationRange,
	keyValue, value atree.Value,
) (existingValueStorable atree.Storable)

func (*DictionaryValue) IsDestroyed added in v0.20.0

func (v *DictionaryValue) IsDestroyed() bool

func (*DictionaryValue) IsImportable added in v0.24.0

func (v *DictionaryValue) IsImportable(inter *Interpreter, locationRange LocationRange) bool

func (*DictionaryValue) IsReferenceTrackedResourceKindedValue added in v0.21.0

func (v *DictionaryValue) IsReferenceTrackedResourceKindedValue()

func (*DictionaryValue) IsResourceKinded added in v0.20.0

func (v *DictionaryValue) IsResourceKinded(interpreter *Interpreter) bool

func (*DictionaryValue) IsStaleResource added in v0.32.0

func (v *DictionaryValue) IsStaleResource(interpreter *Interpreter) bool

func (*DictionaryValue) Iterate added in v0.20.0

func (v *DictionaryValue) Iterate(
	interpreter *Interpreter,
	locationRange LocationRange,
	f func(key, value Value) (resume bool),
)

func (*DictionaryValue) IterateKeys added in v1.0.0

func (v *DictionaryValue) IterateKeys(
	interpreter *Interpreter,
	locationRange LocationRange,
	f func(key Value) (resume bool),
)

func (*DictionaryValue) IterateReadOnly added in v1.0.0

func (v *DictionaryValue) IterateReadOnly(
	interpreter *Interpreter,
	locationRange LocationRange,
	f func(key, value Value) (resume bool),
)

func (*DictionaryValue) IterateReadOnlyLoaded added in v1.0.0

func (v *DictionaryValue) IterateReadOnlyLoaded(
	interpreter *Interpreter,
	locationRange LocationRange,
	f func(key, value Value) (resume bool),
)

IterateReadOnlyLoaded iterates over all LOADED key-valye pairs of the array. DO NOT perform storage mutations in the callback!

func (*DictionaryValue) Iterator added in v0.39.0

func (v *DictionaryValue) Iterator() DictionaryKeyIterator

func (*DictionaryValue) MeteredString added in v0.24.0

func (v *DictionaryValue) MeteredString(interpreter *Interpreter, seenReferences SeenReferences, locationRange LocationRange) string

func (*DictionaryValue) NeedsStoreTo added in v0.20.0

func (v *DictionaryValue) NeedsStoreTo(address atree.Address) bool

func (*DictionaryValue) RecursiveString added in v0.17.0

func (v *DictionaryValue) RecursiveString(seenReferences SeenReferences) string

func (*DictionaryValue) Remove

func (v *DictionaryValue) Remove(
	interpreter *Interpreter,
	locationRange LocationRange,
	keyValue Value,
) OptionalValue

func (*DictionaryValue) RemoveKey added in v0.20.0

func (v *DictionaryValue) RemoveKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key Value,
) Value

func (*DictionaryValue) RemoveMember added in v0.20.0

func (v *DictionaryValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (*DictionaryValue) RemoveWithoutTransfer added in v1.0.0

func (v *DictionaryValue) RemoveWithoutTransfer(
	interpreter *Interpreter,
	locationRange LocationRange,
	keyValue atree.Value,
) (
	existingKeyStorable,
	existingValueStorable atree.Storable,
)

func (*DictionaryValue) SemaType added in v0.20.0

func (v *DictionaryValue) SemaType(interpreter *Interpreter) *sema.DictionaryType

func (*DictionaryValue) SetKey added in v0.20.0

func (v *DictionaryValue) SetKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	keyValue Value,
	value Value,
)

func (*DictionaryValue) SetMember

func (v *DictionaryValue) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (*DictionaryValue) SetType added in v1.0.0

func (v *DictionaryValue) SetType(staticType *DictionaryStaticType)

func (*DictionaryValue) SlabID added in v1.0.0

func (v *DictionaryValue) SlabID() atree.SlabID

func (*DictionaryValue) StaticType added in v0.12.0

func (v *DictionaryValue) StaticType(_ *Interpreter) StaticType

func (*DictionaryValue) Storable added in v0.20.0

func (v *DictionaryValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint64,
) (atree.Storable, error)

func (*DictionaryValue) StorageAddress added in v0.40.0

func (v *DictionaryValue) StorageAddress() atree.Address

func (*DictionaryValue) String

func (v *DictionaryValue) String() string

func (*DictionaryValue) Transfer added in v0.20.0

func (v *DictionaryValue) Transfer(
	interpreter *Interpreter,
	locationRange LocationRange,
	address atree.Address,
	remove bool,
	storable atree.Storable,
	preventTransfer map[atree.ValueID]struct{},
	hasNoParentContainer bool,
) Value

func (*DictionaryValue) ValueID added in v1.0.0

func (v *DictionaryValue) ValueID() atree.ValueID

func (*DictionaryValue) Walk added in v0.19.0

func (v *DictionaryValue) Walk(interpreter *Interpreter, walkChild func(Value), locationRange LocationRange)

type DivisionByZeroError

type DivisionByZeroError struct {
	LocationRange
}

func (DivisionByZeroError) Error

func (e DivisionByZeroError) Error() string

func (DivisionByZeroError) IsUserError added in v0.25.0

func (DivisionByZeroError) IsUserError()

type DuplicateAttachmentError added in v0.36.0

type DuplicateAttachmentError struct {
	AttachmentType sema.Type
	Value          *CompositeValue
	LocationRange
}

DuplicateAttachmentError

func (DuplicateAttachmentError) Error added in v0.36.0

func (e DuplicateAttachmentError) Error() string

func (DuplicateAttachmentError) IsUserError added in v0.36.0

func (DuplicateAttachmentError) IsUserError()

type DuplicateKeyInResourceDictionaryError added in v0.24.7

type DuplicateKeyInResourceDictionaryError struct {
	LocationRange
}

DuplicateKeyInResourceDictionaryError

func (DuplicateKeyInResourceDictionaryError) Error added in v0.24.7

func (DuplicateKeyInResourceDictionaryError) IsUserError added in v0.25.0

type EmptyTypeInfo added in v0.23.0

type EmptyTypeInfo struct{}

EmptyTypeInfo

func (EmptyTypeInfo) Copy added in v1.0.0

func (e EmptyTypeInfo) Copy() atree.TypeInfo

func (EmptyTypeInfo) Encode added in v0.23.0

func (e EmptyTypeInfo) Encode(encoder *cbor.StreamEncoder) error

func (EmptyTypeInfo) Identifier added in v1.0.0

func (e EmptyTypeInfo) Identifier() string

func (EmptyTypeInfo) IsComposite added in v1.0.0

func (e EmptyTypeInfo) IsComposite() bool

type EmptyVisitor added in v0.12.0

type EmptyVisitor struct {
	SimpleCompositeValueVisitor             func(interpreter *Interpreter, value *SimpleCompositeValue)
	TypeValueVisitor                        func(interpreter *Interpreter, value TypeValue)
	VoidValueVisitor                        func(interpreter *Interpreter, value VoidValue)
	BoolValueVisitor                        func(interpreter *Interpreter, value BoolValue)
	CharacterValueVisitor                   func(interpreter *Interpreter, value CharacterValue)
	StringValueVisitor                      func(interpreter *Interpreter, value *StringValue)
	ArrayValueVisitor                       func(interpreter *Interpreter, value *ArrayValue) bool
	IntValueVisitor                         func(interpreter *Interpreter, value IntValue)
	Int8ValueVisitor                        func(interpreter *Interpreter, value Int8Value)
	Int16ValueVisitor                       func(interpreter *Interpreter, value Int16Value)
	Int32ValueVisitor                       func(interpreter *Interpreter, value Int32Value)
	Int64ValueVisitor                       func(interpreter *Interpreter, value Int64Value)
	Int128ValueVisitor                      func(interpreter *Interpreter, value Int128Value)
	Int256ValueVisitor                      func(interpreter *Interpreter, value Int256Value)
	UIntValueVisitor                        func(interpreter *Interpreter, value UIntValue)
	UInt8ValueVisitor                       func(interpreter *Interpreter, value UInt8Value)
	UInt16ValueVisitor                      func(interpreter *Interpreter, value UInt16Value)
	UInt32ValueVisitor                      func(interpreter *Interpreter, value UInt32Value)
	UInt64ValueVisitor                      func(interpreter *Interpreter, value UInt64Value)
	UInt128ValueVisitor                     func(interpreter *Interpreter, value UInt128Value)
	UInt256ValueVisitor                     func(interpreter *Interpreter, value UInt256Value)
	Word8ValueVisitor                       func(interpreter *Interpreter, value Word8Value)
	Word16ValueVisitor                      func(interpreter *Interpreter, value Word16Value)
	Word32ValueVisitor                      func(interpreter *Interpreter, value Word32Value)
	Word64ValueVisitor                      func(interpreter *Interpreter, value Word64Value)
	Word128ValueVisitor                     func(interpreter *Interpreter, value Word128Value)
	Word256ValueVisitor                     func(interpreter *Interpreter, value Word256Value)
	Fix64ValueVisitor                       func(interpreter *Interpreter, value Fix64Value)
	UFix64ValueVisitor                      func(interpreter *Interpreter, value UFix64Value)
	CompositeValueVisitor                   func(interpreter *Interpreter, value *CompositeValue) bool
	DictionaryValueVisitor                  func(interpreter *Interpreter, value *DictionaryValue) bool
	NilValueVisitor                         func(interpreter *Interpreter, value NilValue)
	SomeValueVisitor                        func(interpreter *Interpreter, value *SomeValue) bool
	StorageReferenceValueVisitor            func(interpreter *Interpreter, value *StorageReferenceValue)
	EphemeralReferenceValueVisitor          func(interpreter *Interpreter, value *EphemeralReferenceValue)
	AddressValueVisitor                     func(interpreter *Interpreter, value AddressValue)
	PathValueVisitor                        func(interpreter *Interpreter, value PathValue)
	CapabilityValueVisitor                  func(interpreter *Interpreter, value *IDCapabilityValue)
	PublishedValueVisitor                   func(interpreter *Interpreter, value *PublishedValue)
	InterpretedFunctionValueVisitor         func(interpreter *Interpreter, value *InterpretedFunctionValue)
	HostFunctionValueVisitor                func(interpreter *Interpreter, value *HostFunctionValue)
	BoundFunctionValueVisitor               func(interpreter *Interpreter, value BoundFunctionValue)
	StorageCapabilityControllerValueVisitor func(interpreter *Interpreter, value *StorageCapabilityControllerValue)
	AccountCapabilityControllerValueVisitor func(interpreter *Interpreter, value *AccountCapabilityControllerValue)
}

func (EmptyVisitor) VisitAccountCapabilityControllerValue added in v0.39.0

func (v EmptyVisitor) VisitAccountCapabilityControllerValue(interpreter *Interpreter, value *AccountCapabilityControllerValue)

func (EmptyVisitor) VisitAddressValue added in v0.12.0

func (v EmptyVisitor) VisitAddressValue(interpreter *Interpreter, value AddressValue)

func (EmptyVisitor) VisitArrayValue added in v0.12.0

func (v EmptyVisitor) VisitArrayValue(interpreter *Interpreter, value *ArrayValue) bool

func (EmptyVisitor) VisitBoolValue added in v0.12.0

func (v EmptyVisitor) VisitBoolValue(interpreter *Interpreter, value BoolValue)

func (EmptyVisitor) VisitBoundFunctionValue added in v0.12.0

func (v EmptyVisitor) VisitBoundFunctionValue(interpreter *Interpreter, value BoundFunctionValue)

func (EmptyVisitor) VisitCapabilityValue added in v0.12.0

func (v EmptyVisitor) VisitCapabilityValue(interpreter *Interpreter, value *IDCapabilityValue)

func (EmptyVisitor) VisitCharacterValue added in v0.24.0

func (v EmptyVisitor) VisitCharacterValue(interpreter *Interpreter, value CharacterValue)

func (EmptyVisitor) VisitCompositeValue added in v0.12.0

func (v EmptyVisitor) VisitCompositeValue(interpreter *Interpreter, value *CompositeValue) bool

func (EmptyVisitor) VisitDictionaryValue added in v0.12.0

func (v EmptyVisitor) VisitDictionaryValue(interpreter *Interpreter, value *DictionaryValue) bool

func (EmptyVisitor) VisitEphemeralReferenceValue added in v0.12.0

func (v EmptyVisitor) VisitEphemeralReferenceValue(interpreter *Interpreter, value *EphemeralReferenceValue)

func (EmptyVisitor) VisitFix64Value added in v0.12.0

func (v EmptyVisitor) VisitFix64Value(interpreter *Interpreter, value Fix64Value)

func (EmptyVisitor) VisitHostFunctionValue added in v0.12.0

func (v EmptyVisitor) VisitHostFunctionValue(interpreter *Interpreter, value *HostFunctionValue)

func (EmptyVisitor) VisitInt128Value added in v0.12.0

func (v EmptyVisitor) VisitInt128Value(interpreter *Interpreter, value Int128Value)

func (EmptyVisitor) VisitInt16Value added in v0.12.0

func (v EmptyVisitor) VisitInt16Value(interpreter *Interpreter, value Int16Value)

func (EmptyVisitor) VisitInt256Value added in v0.12.0

func (v EmptyVisitor) VisitInt256Value(interpreter *Interpreter, value Int256Value)

func (EmptyVisitor) VisitInt32Value added in v0.12.0

func (v EmptyVisitor) VisitInt32Value(interpreter *Interpreter, value Int32Value)

func (EmptyVisitor) VisitInt64Value added in v0.12.0

func (v EmptyVisitor) VisitInt64Value(interpreter *Interpreter, value Int64Value)

func (EmptyVisitor) VisitInt8Value added in v0.12.0

func (v EmptyVisitor) VisitInt8Value(interpreter *Interpreter, value Int8Value)

func (EmptyVisitor) VisitIntValue added in v0.12.0

func (v EmptyVisitor) VisitIntValue(interpreter *Interpreter, value IntValue)

func (EmptyVisitor) VisitInterpretedFunctionValue added in v0.12.0

func (v EmptyVisitor) VisitInterpretedFunctionValue(interpreter *Interpreter, value *InterpretedFunctionValue)

func (EmptyVisitor) VisitNilValue added in v0.12.0

func (v EmptyVisitor) VisitNilValue(interpreter *Interpreter, value NilValue)

func (EmptyVisitor) VisitPathValue added in v0.12.0

func (v EmptyVisitor) VisitPathValue(interpreter *Interpreter, value PathValue)

func (EmptyVisitor) VisitPublishedValue added in v0.29.0

func (v EmptyVisitor) VisitPublishedValue(interpreter *Interpreter, value *PublishedValue)

func (EmptyVisitor) VisitSimpleCompositeValue added in v0.20.0

func (v EmptyVisitor) VisitSimpleCompositeValue(interpreter *Interpreter, value *SimpleCompositeValue)

func (EmptyVisitor) VisitSomeValue added in v0.12.0

func (v EmptyVisitor) VisitSomeValue(interpreter *Interpreter, value *SomeValue) bool

func (EmptyVisitor) VisitStorageCapabilityControllerValue added in v0.39.0

func (v EmptyVisitor) VisitStorageCapabilityControllerValue(interpreter *Interpreter, value *StorageCapabilityControllerValue)

func (EmptyVisitor) VisitStorageReferenceValue added in v0.12.0

func (v EmptyVisitor) VisitStorageReferenceValue(interpreter *Interpreter, value *StorageReferenceValue)

func (EmptyVisitor) VisitStringValue added in v0.12.0

func (v EmptyVisitor) VisitStringValue(interpreter *Interpreter, value *StringValue)

func (EmptyVisitor) VisitTypeValue added in v0.12.0

func (v EmptyVisitor) VisitTypeValue(interpreter *Interpreter, value TypeValue)

func (EmptyVisitor) VisitUFix64Value added in v0.12.0

func (v EmptyVisitor) VisitUFix64Value(interpreter *Interpreter, value UFix64Value)

func (EmptyVisitor) VisitUInt128Value added in v0.12.0

func (v EmptyVisitor) VisitUInt128Value(interpreter *Interpreter, value UInt128Value)

func (EmptyVisitor) VisitUInt16Value added in v0.12.0

func (v EmptyVisitor) VisitUInt16Value(interpreter *Interpreter, value UInt16Value)

func (EmptyVisitor) VisitUInt256Value added in v0.12.0

func (v EmptyVisitor) VisitUInt256Value(interpreter *Interpreter, value UInt256Value)

func (EmptyVisitor) VisitUInt32Value added in v0.12.0

func (v EmptyVisitor) VisitUInt32Value(interpreter *Interpreter, value UInt32Value)

func (EmptyVisitor) VisitUInt64Value added in v0.12.0

func (v EmptyVisitor) VisitUInt64Value(interpreter *Interpreter, value UInt64Value)

func (EmptyVisitor) VisitUInt8Value added in v0.12.0

func (v EmptyVisitor) VisitUInt8Value(interpreter *Interpreter, value UInt8Value)

func (EmptyVisitor) VisitUIntValue added in v0.12.0

func (v EmptyVisitor) VisitUIntValue(interpreter *Interpreter, value UIntValue)

func (EmptyVisitor) VisitVoidValue added in v0.12.0

func (v EmptyVisitor) VisitVoidValue(interpreter *Interpreter, value VoidValue)

func (EmptyVisitor) VisitWord128Value added in v0.39.0

func (v EmptyVisitor) VisitWord128Value(interpreter *Interpreter, value Word128Value)

func (EmptyVisitor) VisitWord16Value added in v0.12.0

func (v EmptyVisitor) VisitWord16Value(interpreter *Interpreter, value Word16Value)

func (EmptyVisitor) VisitWord256Value added in v0.39.0

func (v EmptyVisitor) VisitWord256Value(interpreter *Interpreter, value Word256Value)

func (EmptyVisitor) VisitWord32Value added in v0.12.0

func (v EmptyVisitor) VisitWord32Value(interpreter *Interpreter, value Word32Value)

func (EmptyVisitor) VisitWord64Value added in v0.12.0

func (v EmptyVisitor) VisitWord64Value(interpreter *Interpreter, value Word64Value)

func (EmptyVisitor) VisitWord8Value added in v0.12.0

func (v EmptyVisitor) VisitWord8Value(interpreter *Interpreter, value Word8Value)

type EntitledCapabilityPublishingError added in v1.0.0

type EntitledCapabilityPublishingError struct {
	LocationRange
	BorrowType *ReferenceStaticType
	Path       PathValue
}

EntitledCapabilityPublishingError

func (EntitledCapabilityPublishingError) Error added in v1.0.0

func (EntitledCapabilityPublishingError) IsUserError added in v1.0.0

func (EntitledCapabilityPublishingError) IsUserError()

type EntitlementMapAuthorization added in v1.0.0

type EntitlementMapAuthorization struct {
	TypeID common.TypeID
}

func NewEntitlementMapAuthorization added in v1.0.0

func NewEntitlementMapAuthorization(memoryGauge common.MemoryGauge, id common.TypeID) EntitlementMapAuthorization

func (EntitlementMapAuthorization) Encode added in v1.0.0

func (a EntitlementMapAuthorization) Encode(e *cbor.StreamEncoder) error

func (EntitlementMapAuthorization) Equal added in v1.0.0

func (EntitlementMapAuthorization) ID added in v1.0.0

func (EntitlementMapAuthorization) MeteredString added in v1.0.0

func (a EntitlementMapAuthorization) MeteredString(memoryGauge common.MemoryGauge) string

func (EntitlementMapAuthorization) String added in v1.0.0

type EntitlementSetAuthorization added in v1.0.0

type EntitlementSetAuthorization struct {
	Entitlements *sema.TypeIDOrderedSet
	SetKind      sema.EntitlementSetKind
}

func NewEntitlementSetAuthorization added in v1.0.0

func NewEntitlementSetAuthorization(
	memoryGauge common.MemoryGauge,
	entitlementListConstructor func() []common.TypeID,
	entitlementListSize int,
	kind sema.EntitlementSetKind,
) EntitlementSetAuthorization

func (EntitlementSetAuthorization) Encode added in v1.0.0

func (a EntitlementSetAuthorization) Encode(e *cbor.StreamEncoder) error

func (EntitlementSetAuthorization) Equal added in v1.0.0

func (EntitlementSetAuthorization) ID added in v1.0.0

func (EntitlementSetAuthorization) MeteredString added in v1.0.0

func (a EntitlementSetAuthorization) MeteredString(memoryGauge common.MemoryGauge) string

func (EntitlementSetAuthorization) String added in v1.0.0

type EnumCase added in v0.26.0

type EnumCase struct {
	RawValue IntegerValue
	Value    MemberAccessibleValue
}

type EphemeralReferenceValue

type EphemeralReferenceValue struct {
	Value Value
	// BorrowedType is the T in &T
	BorrowedType  sema.Type
	Authorization Authorization
}

func NewEphemeralReferenceValue added in v0.24.0

func NewEphemeralReferenceValue(
	interpreter *Interpreter,
	authorization Authorization,
	value Value,
	borrowedType sema.Type,
	locationRange LocationRange,
) *EphemeralReferenceValue

func NewUnmeteredEphemeralReferenceValue added in v0.24.0

func NewUnmeteredEphemeralReferenceValue(
	interpreter *Interpreter,
	authorization Authorization,
	value Value,
	borrowedType sema.Type,
	locationRange LocationRange,
) *EphemeralReferenceValue

func (*EphemeralReferenceValue) Accept added in v0.12.0

func (v *EphemeralReferenceValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (*EphemeralReferenceValue) BorrowType added in v1.0.0

func (v *EphemeralReferenceValue) BorrowType() sema.Type

func (*EphemeralReferenceValue) Clone added in v0.24.0

func (v *EphemeralReferenceValue) Clone(inter *Interpreter) Value

func (*EphemeralReferenceValue) ConformsToStaticType added in v0.24.0

func (v *EphemeralReferenceValue) ConformsToStaticType(
	interpreter *Interpreter,
	locationRange LocationRange,
	results TypeConformanceResults,
) bool

func (*EphemeralReferenceValue) DeepRemove added in v0.20.0

func (*EphemeralReferenceValue) DeepRemove(_ *Interpreter, _ bool)

func (*EphemeralReferenceValue) Equal

func (*EphemeralReferenceValue) ForEach added in v1.0.0

func (v *EphemeralReferenceValue) ForEach(
	interpreter *Interpreter,
	elementType sema.Type,
	function func(value Value) (resume bool),
	_ bool,
	locationRange LocationRange,
)

func (*EphemeralReferenceValue) GetAuthorization added in v1.0.0

func (v *EphemeralReferenceValue) GetAuthorization() Authorization

func (*EphemeralReferenceValue) GetKey added in v0.20.0

func (v *EphemeralReferenceValue) GetKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key Value,
) Value

func (*EphemeralReferenceValue) GetMember

func (v *EphemeralReferenceValue) GetMember(
	interpreter *Interpreter,
	locationRange LocationRange,
	name string,
) Value

func (*EphemeralReferenceValue) GetTypeKey added in v0.36.0

func (v *EphemeralReferenceValue) GetTypeKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key sema.Type,
) Value

func (*EphemeralReferenceValue) InsertKey added in v0.20.0

func (v *EphemeralReferenceValue) InsertKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key Value,
	value Value,
)

func (*EphemeralReferenceValue) IsImportable added in v0.24.0

func (*EphemeralReferenceValue) IsResourceKinded added in v0.20.0

func (*EphemeralReferenceValue) IsResourceKinded(_ *Interpreter) bool

func (*EphemeralReferenceValue) IsStorable added in v0.16.0

func (*EphemeralReferenceValue) IsStorable() bool

func (*EphemeralReferenceValue) Iterator added in v1.0.0

func (*EphemeralReferenceValue) MeteredString added in v0.24.0

func (v *EphemeralReferenceValue) MeteredString(interpreter *Interpreter, seenReferences SeenReferences, locationRange LocationRange) string

func (*EphemeralReferenceValue) NeedsStoreTo added in v0.20.0

func (*EphemeralReferenceValue) NeedsStoreTo(_ atree.Address) bool

func (*EphemeralReferenceValue) RecursiveString added in v0.17.0

func (v *EphemeralReferenceValue) RecursiveString(seenReferences SeenReferences) string

func (*EphemeralReferenceValue) ReferencedValue added in v0.11.0

func (v *EphemeralReferenceValue) ReferencedValue(
	_ *Interpreter,
	_ LocationRange,
	_ bool,
) *Value

func (*EphemeralReferenceValue) RemoveKey added in v0.20.0

func (v *EphemeralReferenceValue) RemoveKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key Value,
) Value

func (*EphemeralReferenceValue) RemoveMember added in v0.20.0

func (v *EphemeralReferenceValue) RemoveMember(
	interpreter *Interpreter,
	locationRange LocationRange,
	identifier string,
) Value

func (*EphemeralReferenceValue) RemoveTypeKey added in v0.36.0

func (v *EphemeralReferenceValue) RemoveTypeKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key sema.Type,
) Value

func (*EphemeralReferenceValue) SetKey added in v0.20.0

func (v *EphemeralReferenceValue) SetKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key Value,
	value Value,
)

func (*EphemeralReferenceValue) SetMember

func (v *EphemeralReferenceValue) SetMember(
	interpreter *Interpreter,
	locationRange LocationRange,
	name string,
	value Value,
) bool

func (*EphemeralReferenceValue) SetTypeKey added in v0.36.0

func (v *EphemeralReferenceValue) SetTypeKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key sema.Type,
	value Value,
)

func (*EphemeralReferenceValue) StaticType added in v0.12.0

func (v *EphemeralReferenceValue) StaticType(inter *Interpreter) StaticType

func (*EphemeralReferenceValue) Storable added in v0.20.0

func (*EphemeralReferenceValue) String added in v0.5.0

func (v *EphemeralReferenceValue) String() string

func (*EphemeralReferenceValue) Transfer added in v0.20.0

func (v *EphemeralReferenceValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*EphemeralReferenceValue) Walk added in v0.19.0

type EquatableValue

type EquatableValue interface {
	Value
	// Equal returns true if the given value is equal to this value.
	// If no location range is available, pass e.g. EmptyLocationRange
	Equal(interpreter *Interpreter, locationRange LocationRange, other Value) bool
}

type Error added in v0.12.0

type Error struct {
	Err        error
	Location   common.Location
	StackTrace []Invocation
}

Error is the containing type for all errors produced by the interpreter.

func (Error) ChildErrors added in v0.12.1

func (e Error) ChildErrors() []error

func (Error) Error added in v0.12.0

func (e Error) Error() string

func (Error) ImportLocation added in v0.12.1

func (e Error) ImportLocation() common.Location

func (Error) Unwrap added in v0.12.0

func (e Error) Unwrap() error

type EventEmissionUnavailableError added in v0.10.4

type EventEmissionUnavailableError struct {
	LocationRange
}

EventEmissionUnavailableError

func (EventEmissionUnavailableError) Error added in v0.10.4

func (EventEmissionUnavailableError) IsUserError added in v0.25.0

func (EventEmissionUnavailableError) IsUserError()

type ExpressionResult added in v0.27.0

type ExpressionResult struct {
	Value
}

type Fix64Value

type Fix64Value int64

Fix64Value

func ConvertFix64

func ConvertFix64(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Fix64Value

func NewFix64Value added in v0.24.0

func NewFix64Value(gauge common.MemoryGauge, valueGetter func() int64) Fix64Value

func NewFix64ValueWithInteger added in v0.2.0

func NewFix64ValueWithInteger(gauge common.MemoryGauge, constructor func() int64, locationRange LocationRange) Fix64Value

func NewUnmeteredFix64Value added in v0.24.0

func NewUnmeteredFix64Value(integer int64) Fix64Value

func NewUnmeteredFix64ValueWithInteger added in v0.24.0

func NewUnmeteredFix64ValueWithInteger(integer int64, locationRange LocationRange) Fix64Value

func (Fix64Value) Accept added in v0.12.0

func (v Fix64Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Fix64Value) ByteSize added in v0.20.0

func (v Fix64Value) ByteSize() uint32

func (Fix64Value) ChildStorables added in v0.20.0

func (Fix64Value) ChildStorables() []atree.Storable

func (Fix64Value) Clone added in v0.24.0

func (v Fix64Value) Clone(_ *Interpreter) Value

func (Fix64Value) ConformsToStaticType added in v0.24.0

func (v Fix64Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Fix64Value) DeepRemove added in v0.20.0

func (Fix64Value) DeepRemove(_ *Interpreter, _ bool)

func (Fix64Value) Div

func (v Fix64Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Fix64Value) Encode added in v0.20.0

func (v Fix64Value) Encode(e *atree.Encoder) error

Encode encodes Fix64Value as

cbor.Tag{
		Number:  CBORTagFix64Value,
		Content: int64(v),
}

func (Fix64Value) Equal

func (v Fix64Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Fix64Value) GetMember added in v0.3.0

func (v Fix64Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Fix64Value) Greater

func (v Fix64Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Fix64Value) GreaterEqual

func (v Fix64Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Fix64Value) HashInput added in v0.20.0

func (v Fix64Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeFix64 (1 byte) - int64 value encoded in big-endian (8 bytes)

func (Fix64Value) IntegerPart added in v0.24.0

func (v Fix64Value) IntegerPart() NumberValue

func (Fix64Value) IsImportable added in v0.24.0

func (Fix64Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Fix64Value) IsResourceKinded added in v0.20.0

func (Fix64Value) IsResourceKinded(_ *Interpreter) bool

func (Fix64Value) IsStorable added in v0.16.0

func (Fix64Value) IsStorable() bool

func (Fix64Value) Less

func (v Fix64Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Fix64Value) LessEqual

func (v Fix64Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Fix64Value) MeteredString added in v0.24.0

func (v Fix64Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Fix64Value) Minus

func (v Fix64Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Fix64Value) Mod

func (v Fix64Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Fix64Value) Mul

func (v Fix64Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Fix64Value) NeedsStoreTo added in v0.20.0

func (Fix64Value) NeedsStoreTo(_ atree.Address) bool

func (Fix64Value) Negate

func (v Fix64Value) Negate(interpreter *Interpreter, locationRange LocationRange) NumberValue

func (Fix64Value) Plus

func (v Fix64Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Fix64Value) RecursiveString added in v0.17.0

func (v Fix64Value) RecursiveString(_ SeenReferences) string

func (Fix64Value) RemoveMember added in v0.20.0

func (Fix64Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Fix64Value) SaturatingDiv added in v0.15.0

func (v Fix64Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Fix64Value) SaturatingMinus added in v0.15.0

func (v Fix64Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Fix64Value) SaturatingMul added in v0.15.0

func (v Fix64Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Fix64Value) SaturatingPlus added in v0.15.0

func (v Fix64Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Fix64Value) Scale added in v0.24.0

func (Fix64Value) Scale() int

func (Fix64Value) SetMember added in v0.3.0

func (Fix64Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Fix64Value) StaticType added in v0.12.0

func (Fix64Value) StaticType(interpreter *Interpreter) StaticType

func (Fix64Value) Storable added in v0.20.0

func (Fix64Value) StoredValue added in v0.20.0

func (v Fix64Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Fix64Value) String

func (v Fix64Value) String() string

func (Fix64Value) ToBigEndianBytes added in v0.5.0

func (v Fix64Value) ToBigEndianBytes() []byte

func (Fix64Value) ToInt

func (v Fix64Value) ToInt(_ LocationRange) int

func (Fix64Value) Transfer added in v0.20.0

func (v Fix64Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Fix64Value) Walk added in v0.19.0

func (Fix64Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type FixedPointValue added in v0.24.0

type FixedPointValue interface {
	NumberValue
	IntegerPart() NumberValue
	Scale() int
}

FixedPointValue is a fixed-point number value

type ForceCastTypeMismatchError added in v0.19.0

type ForceCastTypeMismatchError struct {
	ExpectedType sema.Type
	ActualType   sema.Type
	LocationRange
}

ForceCastTypeMismatchError

func (ForceCastTypeMismatchError) Error added in v0.19.0

func (ForceCastTypeMismatchError) IsUserError added in v0.25.0

func (ForceCastTypeMismatchError) IsUserError()

type ForceNilError

type ForceNilError struct {
	LocationRange
}

ForceNilError

func (ForceNilError) Error

func (e ForceNilError) Error() string

func (ForceNilError) IsUserError added in v0.25.0

func (ForceNilError) IsUserError()

type FunctionOrderedMap added in v1.0.0

type FunctionOrderedMap = orderedmap.OrderedMap[string, FunctionValue]

type FunctionStaticType added in v0.19.0

type FunctionStaticType struct {
	Type *sema.FunctionType
}

func NewFunctionStaticType added in v0.24.0

func NewFunctionStaticType(
	memoryGauge common.MemoryGauge,
	functionType *sema.FunctionType,
) FunctionStaticType

func (FunctionStaticType) Encode added in v0.20.0

func (t FunctionStaticType) Encode(_ *cbor.StreamEncoder) error

func (FunctionStaticType) Equal added in v0.19.0

func (t FunctionStaticType) Equal(other StaticType) bool

func (FunctionStaticType) ID added in v0.41.0

func (t FunctionStaticType) ID() TypeID

func (FunctionStaticType) IsDeprecated added in v1.0.0

func (FunctionStaticType) IsDeprecated() bool

func (FunctionStaticType) MeteredString added in v0.24.0

func (t FunctionStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (FunctionStaticType) ReturnType added in v0.19.0

func (t FunctionStaticType) ReturnType(gauge common.MemoryGauge) StaticType

func (FunctionStaticType) String added in v0.19.0

func (t FunctionStaticType) String() string

type FunctionValue

type FunctionValue interface {
	Value

	FunctionType() *sema.FunctionType
	// contains filtered or unexported methods
}

FunctionValue

type FunctionWrapper

type FunctionWrapper = func(inner FunctionValue) FunctionValue

type GetCapabilityError added in v1.0.0

type GetCapabilityError struct {
	LocationRange
}

GetCapabilityError

func (GetCapabilityError) Error added in v1.0.0

func (e GetCapabilityError) Error() string

func (GetCapabilityError) IsUserError added in v1.0.0

func (GetCapabilityError) IsUserError()

type GlobalVariables added in v0.19.0

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

GlobalVariables represents global variables defined in a program.

func (*GlobalVariables) Contains added in v0.19.0

func (g *GlobalVariables) Contains(name string) bool

func (*GlobalVariables) Get added in v0.19.0

func (g *GlobalVariables) Get(name string) Variable

func (*GlobalVariables) Set added in v0.19.0

func (g *GlobalVariables) Set(name string, variable Variable)

type HashInputType added in v0.20.0

type HashInputType byte

HashInputType is a type flag that is included in the hash input for a value, i.e., it should be included in the result of HashableValue.HashInput.

const (
	HashInputTypeBool HashInputType = iota
	HashInputTypeString
	HashInputTypeEnum
	HashInputTypeAddress
	HashInputTypePath
	HashInputTypeType
	HashInputTypeCharacter

	// Int*
	HashInputTypeInt
	HashInputTypeInt8
	HashInputTypeInt16
	HashInputTypeInt32
	HashInputTypeInt64
	HashInputTypeInt128
	HashInputTypeInt256

	// UInt*
	HashInputTypeUInt
	HashInputTypeUInt8
	HashInputTypeUInt16
	HashInputTypeUInt32
	HashInputTypeUInt64
	HashInputTypeUInt128
	HashInputTypeUInt256

	HashInputTypeWord8
	HashInputTypeWord16
	HashInputTypeWord32
	HashInputTypeWord64
	HashInputTypeWord128
	HashInputTypeWord256

	HashInputTypeFix64

	HashInputTypeUFix64

	// !!! *WARNING* !!!
	// ADD NEW TYPES *BEFORE* THIS WARNING.
	// DO *NOT* ADD NEW TYPES AFTER THIS LINE!
	HashInputType_Count
)

type HashableValue added in v0.20.0

type HashableValue interface {
	Value
	HashInput(interpreter *Interpreter, locationRange LocationRange, scratch []byte) []byte
}

HashableValue is an immutable value that can be hashed

type HostFunction

type HostFunction func(invocation Invocation) Value

HostFunctionValue

type HostFunctionValue

type HostFunctionValue struct {
	Function        HostFunction
	NestedVariables map[string]Variable
	Type            *sema.FunctionType
}

func EnumConstructorFunction added in v0.14.0

func EnumConstructorFunction(
	gauge common.MemoryGauge,
	locationRange LocationRange,
	enumType *sema.CompositeType,
	cases []EnumCase,
	nestedVariables map[string]Variable,
) *HostFunctionValue

func NewStaticHostFunctionValue added in v1.0.0

func NewStaticHostFunctionValue(
	gauge common.MemoryGauge,
	funcType *sema.FunctionType,
	function HostFunction,
) *HostFunctionValue

NewStaticHostFunctionValue constructs a host function that is not bounded to any value. For constructing a function bound to a value (e.g: a member function), the output of this method must be wrapped with a bound-function, or `NewBoundHostFunctionValue` method must be used.

func NewUnmeteredStaticHostFunctionValue added in v1.0.0

func NewUnmeteredStaticHostFunctionValue(
	funcType *sema.FunctionType,
	function HostFunction,
) *HostFunctionValue

func (*HostFunctionValue) Accept added in v0.12.0

func (f *HostFunctionValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (*HostFunctionValue) Clone added in v0.24.0

func (f *HostFunctionValue) Clone(_ *Interpreter) Value

func (*HostFunctionValue) ConformsToStaticType added in v0.24.0

func (f *HostFunctionValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (*HostFunctionValue) DeepRemove added in v0.20.0

func (*HostFunctionValue) DeepRemove(_ *Interpreter, _ bool)

func (*HostFunctionValue) FunctionType added in v0.27.0

func (f *HostFunctionValue) FunctionType() *sema.FunctionType

func (*HostFunctionValue) GetMember

func (f *HostFunctionValue) GetMember(inter *Interpreter, _ LocationRange, name string) Value

func (*HostFunctionValue) IsImportable added in v0.24.0

func (*HostFunctionValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (*HostFunctionValue) IsResourceKinded added in v0.20.0

func (*HostFunctionValue) IsResourceKinded(_ *Interpreter) bool

func (*HostFunctionValue) MeteredString added in v0.24.0

func (f *HostFunctionValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (*HostFunctionValue) NeedsStoreTo added in v0.20.0

func (*HostFunctionValue) NeedsStoreTo(_ atree.Address) bool

func (*HostFunctionValue) RecursiveString added in v0.17.0

func (f *HostFunctionValue) RecursiveString(_ SeenReferences) string

func (*HostFunctionValue) RemoveMember added in v0.20.0

func (*HostFunctionValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (*HostFunctionValue) SetMember

func (*HostFunctionValue) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (*HostFunctionValue) SetNestedVariables added in v0.27.0

func (v *HostFunctionValue) SetNestedVariables(variables map[string]Variable)

func (*HostFunctionValue) StaticType added in v0.12.0

func (f *HostFunctionValue) StaticType(interpreter *Interpreter) StaticType

func (*HostFunctionValue) Storable added in v0.20.0

func (*HostFunctionValue) String added in v0.2.0

func (f *HostFunctionValue) String() string

func (*HostFunctionValue) Transfer added in v0.20.0

func (f *HostFunctionValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*HostFunctionValue) Walk added in v0.19.0

func (f *HostFunctionValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type IDCapabilityValue added in v0.39.0

type IDCapabilityValue struct {
	BorrowType StaticType

	ID UInt64Value
	// contains filtered or unexported fields
}

func NewCapabilityValue added in v0.24.0

func NewCapabilityValue(
	memoryGauge common.MemoryGauge,
	id UInt64Value,
	address AddressValue,
	borrowType StaticType,
) *IDCapabilityValue

func NewInvalidCapabilityValue added in v1.0.0

func NewInvalidCapabilityValue(
	memoryGauge common.MemoryGauge,
	address AddressValue,
	borrowType StaticType,
) *IDCapabilityValue

func NewUnmeteredCapabilityValue added in v0.24.0

func NewUnmeteredCapabilityValue(
	id UInt64Value,
	address AddressValue,
	borrowType StaticType,
) *IDCapabilityValue

func (*IDCapabilityValue) Accept added in v0.39.0

func (v *IDCapabilityValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (*IDCapabilityValue) Address added in v0.39.0

func (v *IDCapabilityValue) Address() AddressValue

func (*IDCapabilityValue) ByteSize added in v0.39.0

func (v *IDCapabilityValue) ByteSize() uint32

func (*IDCapabilityValue) ChildStorables added in v0.39.0

func (v *IDCapabilityValue) ChildStorables() []atree.Storable

func (*IDCapabilityValue) Clone added in v0.39.0

func (v *IDCapabilityValue) Clone(interpreter *Interpreter) Value

func (*IDCapabilityValue) ConformsToStaticType added in v0.39.0

func (v *IDCapabilityValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (*IDCapabilityValue) DeepRemove added in v0.39.0

func (v *IDCapabilityValue) DeepRemove(interpreter *Interpreter, _ bool)

func (*IDCapabilityValue) Encode added in v0.39.0

func (v *IDCapabilityValue) Encode(e *atree.Encoder) error

Encode encodes IDCapabilityValue as

cbor.Tag{
			Number: CBORTagCapabilityValue,
			Content: []any{
					encodedCapabilityValueAddressFieldKey:    AddressValue(v.Address),
					encodedCapabilityValueIDFieldKey:         v.ID,
					encodedCapabilityValueBorrowTypeFieldKey: StaticType(v.BorrowType),
				},
}

func (*IDCapabilityValue) Equal added in v0.39.0

func (v *IDCapabilityValue) Equal(interpreter *Interpreter, locationRange LocationRange, other Value) bool

func (*IDCapabilityValue) GetMember added in v0.39.0

func (v *IDCapabilityValue) GetMember(interpreter *Interpreter, _ LocationRange, name string) Value

func (*IDCapabilityValue) IsImportable added in v0.39.0

func (v *IDCapabilityValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (*IDCapabilityValue) IsResourceKinded added in v0.39.0

func (*IDCapabilityValue) IsResourceKinded(_ *Interpreter) bool

func (*IDCapabilityValue) IsStorable added in v0.39.0

func (*IDCapabilityValue) IsStorable() bool

func (*IDCapabilityValue) MeteredString added in v0.39.0

func (v *IDCapabilityValue) MeteredString(interpreter *Interpreter, seenReferences SeenReferences, locationRange LocationRange) string

func (*IDCapabilityValue) NeedsStoreTo added in v0.39.0

func (*IDCapabilityValue) NeedsStoreTo(_ atree.Address) bool

func (*IDCapabilityValue) RecursiveString added in v0.39.0

func (v *IDCapabilityValue) RecursiveString(seenReferences SeenReferences) string

func (*IDCapabilityValue) RemoveMember added in v0.39.0

func (*IDCapabilityValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (*IDCapabilityValue) SetMember added in v0.39.0

func (*IDCapabilityValue) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (*IDCapabilityValue) StaticType added in v0.39.0

func (v *IDCapabilityValue) StaticType(inter *Interpreter) StaticType

func (*IDCapabilityValue) Storable added in v0.39.0

func (v *IDCapabilityValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint64,
) (atree.Storable, error)

func (*IDCapabilityValue) StoredValue added in v0.39.0

func (v *IDCapabilityValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (*IDCapabilityValue) String added in v0.39.0

func (v *IDCapabilityValue) String() string

func (*IDCapabilityValue) Transfer added in v0.39.0

func (v *IDCapabilityValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*IDCapabilityValue) Walk added in v0.39.0

func (v *IDCapabilityValue) Walk(_ *Interpreter, walkChild func(Value), _ LocationRange)

type Import added in v0.5.0

type Import interface {
	// contains filtered or unexported methods
}

type ImportLocationHandlerFunc added in v0.5.0

type ImportLocationHandlerFunc func(
	inter *Interpreter,
	location common.Location,
) Import

ImportLocationHandlerFunc is a function that handles imports of locations.

type InMemoryStorage added in v0.20.0

type InMemoryStorage struct {
	*atree.BasicSlabStorage
	StorageMaps map[StorageKey]*StorageMap
	// contains filtered or unexported fields
}

InMemoryStorage

func NewInMemoryStorage added in v0.20.0

func NewInMemoryStorage(memoryGauge common.MemoryGauge) InMemoryStorage

func (InMemoryStorage) CheckHealth added in v0.20.0

func (i InMemoryStorage) CheckHealth() error

func (InMemoryStorage) GetStorageMap added in v0.23.0

func (i InMemoryStorage) GetStorageMap(
	address common.Address,
	domain string,
	createIfNotExists bool,
) (
	storageMap *StorageMap,
)

type Inaccessible added in v1.0.0

type Inaccessible struct{}

func (Inaccessible) Encode added in v1.0.0

func (t Inaccessible) Encode(e *cbor.StreamEncoder) error

func (Inaccessible) Equal added in v1.0.0

func (Inaccessible) Equal(auth Authorization) bool

func (Inaccessible) ID added in v1.0.0

func (Inaccessible) ID() TypeID

func (Inaccessible) MeteredString added in v1.0.0

func (Inaccessible) MeteredString(_ common.MemoryGauge) string

func (Inaccessible) String added in v1.0.0

func (Inaccessible) String() string

type InclusiveRangeConstructionError added in v1.0.0

type InclusiveRangeConstructionError struct {
	LocationRange
	Message string
}

func (InclusiveRangeConstructionError) Error added in v1.0.0

func (InclusiveRangeConstructionError) IsUserError added in v1.0.0

func (InclusiveRangeConstructionError) IsUserError()

type InclusiveRangeIterator added in v1.0.0

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

func NewInclusiveRangeIterator added in v1.0.0

func NewInclusiveRangeIterator(
	interpreter *Interpreter,
	locationRange LocationRange,
	v *CompositeValue,
	typ InclusiveRangeStaticType,
) *InclusiveRangeIterator

func (*InclusiveRangeIterator) Next added in v1.0.0

func (i *InclusiveRangeIterator) Next(interpreter *Interpreter, locationRange LocationRange) Value

type InclusiveRangeStaticType added in v1.0.0

type InclusiveRangeStaticType struct {
	ElementType StaticType
}

func NewInclusiveRangeStaticType added in v1.0.0

func NewInclusiveRangeStaticType(
	memoryGauge common.MemoryGauge,
	elementType StaticType,
) InclusiveRangeStaticType

func (InclusiveRangeStaticType) Encode added in v1.0.0

func (t InclusiveRangeStaticType) Encode(e *cbor.StreamEncoder) error

Encode encodes InclusiveRangeStaticType as

cbor.Tag{
		Number: CBORTagInclusiveRangeStaticType,
		Content: StaticType(v.Type),
}

func (InclusiveRangeStaticType) Equal added in v1.0.0

func (t InclusiveRangeStaticType) Equal(other StaticType) bool

func (InclusiveRangeStaticType) ID added in v1.0.0

func (InclusiveRangeStaticType) IsDeprecated added in v1.0.0

func (t InclusiveRangeStaticType) IsDeprecated() bool

func (InclusiveRangeStaticType) MeteredString added in v1.0.0

func (t InclusiveRangeStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (InclusiveRangeStaticType) String added in v1.0.0

func (t InclusiveRangeStaticType) String() string

type InjectedCompositeFieldsHandlerFunc

type InjectedCompositeFieldsHandlerFunc func(
	inter *Interpreter,
	location common.Location,
	qualifiedIdentifier string,
	compositeKind common.CompositeKind,
) map[string]Value

InjectedCompositeFieldsHandlerFunc is a function that handles storage reads.

type Int128Value

type Int128Value struct {
	BigInt *big.Int
}

func ConvertInt128

func ConvertInt128(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Int128Value

func NewInt128ValueFromBigInt

func NewInt128ValueFromBigInt(memoryGauge common.MemoryGauge, bigIntConstructor func() *big.Int) Int128Value

func NewInt128ValueFromUint64 added in v0.24.0

func NewInt128ValueFromUint64(memoryGauge common.MemoryGauge, value int64) Int128Value

func NewUnmeteredInt128ValueFromBigInt added in v0.24.0

func NewUnmeteredInt128ValueFromBigInt(value *big.Int) Int128Value

func NewUnmeteredInt128ValueFromInt64 added in v0.24.0

func NewUnmeteredInt128ValueFromInt64(value int64) Int128Value

func (Int128Value) Accept added in v0.12.0

func (v Int128Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Int128Value) BitwiseAnd added in v0.2.0

func (v Int128Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int128Value) BitwiseLeftShift added in v0.2.0

func (v Int128Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int128Value) BitwiseOr added in v0.2.0

func (v Int128Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int128Value) BitwiseRightShift added in v0.2.0

func (v Int128Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int128Value) BitwiseXor added in v0.2.0

func (v Int128Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int128Value) ByteLength added in v0.24.0

func (v Int128Value) ByteLength() int

func (Int128Value) ByteSize added in v0.20.0

func (v Int128Value) ByteSize() uint32

func (Int128Value) ChildStorables added in v0.20.0

func (Int128Value) ChildStorables() []atree.Storable

func (Int128Value) Clone added in v0.24.0

func (v Int128Value) Clone(_ *Interpreter) Value

func (Int128Value) ConformsToStaticType added in v0.24.0

func (v Int128Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Int128Value) DeepRemove added in v0.20.0

func (Int128Value) DeepRemove(_ *Interpreter, _ bool)

func (Int128Value) Div

func (v Int128Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int128Value) Encode added in v0.20.0

func (v Int128Value) Encode(e *atree.Encoder) error

Encode encodes Int128Value as

cbor.Tag{
		Number:  CBORTagInt128Value,
		Content: *big.Int(v.BigInt),
}

func (Int128Value) Equal

func (v Int128Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Int128Value) GetMember added in v0.3.0

func (v Int128Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Int128Value) Greater

func (v Int128Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int128Value) GreaterEqual

func (v Int128Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int128Value) HashInput added in v0.20.0

func (v Int128Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeInt128 (1 byte) - big int value encoded in big-endian (n bytes)

func (Int128Value) IsImportable added in v0.24.0

func (Int128Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Int128Value) IsResourceKinded added in v0.20.0

func (Int128Value) IsResourceKinded(_ *Interpreter) bool

func (Int128Value) Less

func (v Int128Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int128Value) LessEqual

func (v Int128Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int128Value) MeteredString added in v0.24.0

func (v Int128Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Int128Value) Minus

func (v Int128Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int128Value) Mod

func (v Int128Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int128Value) Mul

func (v Int128Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int128Value) NeedsStoreTo added in v0.20.0

func (Int128Value) NeedsStoreTo(_ atree.Address) bool

func (Int128Value) Negate

func (v Int128Value) Negate(interpreter *Interpreter, locationRange LocationRange) NumberValue

func (Int128Value) Plus

func (v Int128Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int128Value) RecursiveString added in v0.17.0

func (v Int128Value) RecursiveString(_ SeenReferences) string

func (Int128Value) RemoveMember added in v0.20.0

func (Int128Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Int128Value) SaturatingDiv added in v0.15.0

func (v Int128Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int128Value) SaturatingMinus added in v0.15.0

func (v Int128Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int128Value) SaturatingMul added in v0.15.0

func (v Int128Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int128Value) SaturatingPlus added in v0.15.0

func (v Int128Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int128Value) SetMember added in v0.3.0

func (Int128Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Int128Value) StaticType added in v0.12.0

func (Int128Value) StaticType(interpreter *Interpreter) StaticType

func (Int128Value) Storable added in v0.20.0

func (Int128Value) StoredValue added in v0.20.0

func (v Int128Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Int128Value) String

func (v Int128Value) String() string

func (Int128Value) ToBigEndianBytes added in v0.5.0

func (v Int128Value) ToBigEndianBytes() []byte

func (Int128Value) ToBigInt

func (v Int128Value) ToBigInt(memoryGauge common.MemoryGauge) *big.Int

func (Int128Value) ToInt

func (v Int128Value) ToInt(locationRange LocationRange) int

func (Int128Value) Transfer added in v0.20.0

func (v Int128Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Int128Value) Walk added in v0.19.0

func (Int128Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Int16Value

type Int16Value int16

func ConvertInt16

func ConvertInt16(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Int16Value

func NewInt16Value added in v0.24.0

func NewInt16Value(gauge common.MemoryGauge, valueGetter func() int16) Int16Value

func NewUnmeteredInt16Value added in v0.24.0

func NewUnmeteredInt16Value(value int16) Int16Value

func (Int16Value) Accept added in v0.12.0

func (v Int16Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Int16Value) BitwiseAnd added in v0.2.0

func (v Int16Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int16Value) BitwiseLeftShift added in v0.2.0

func (v Int16Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int16Value) BitwiseOr added in v0.2.0

func (v Int16Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int16Value) BitwiseRightShift added in v0.2.0

func (v Int16Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int16Value) BitwiseXor added in v0.2.0

func (v Int16Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int16Value) ByteSize added in v0.20.0

func (v Int16Value) ByteSize() uint32

func (Int16Value) ChildStorables added in v0.20.0

func (Int16Value) ChildStorables() []atree.Storable

func (Int16Value) Clone added in v0.24.0

func (v Int16Value) Clone(_ *Interpreter) Value

func (Int16Value) ConformsToStaticType added in v0.24.0

func (v Int16Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Int16Value) DeepRemove added in v0.20.0

func (Int16Value) DeepRemove(_ *Interpreter, _ bool)

func (Int16Value) Div

func (v Int16Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int16Value) Encode added in v0.20.0

func (v Int16Value) Encode(e *atree.Encoder) error

Encode encodes Int16Value as

cbor.Tag{
		Number:  CBORTagInt16Value,
		Content: int16(v),
}

func (Int16Value) Equal

func (v Int16Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Int16Value) GetMember added in v0.3.0

func (v Int16Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Int16Value) Greater

func (v Int16Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int16Value) GreaterEqual

func (v Int16Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int16Value) HashInput added in v0.20.0

func (v Int16Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeInt16 (1 byte) - int16 value encoded in big-endian (2 bytes)

func (Int16Value) IsImportable added in v0.24.0

func (Int16Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Int16Value) IsResourceKinded added in v0.20.0

func (Int16Value) IsResourceKinded(_ *Interpreter) bool

func (Int16Value) Less

func (v Int16Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int16Value) LessEqual

func (v Int16Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int16Value) MeteredString added in v0.24.0

func (v Int16Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Int16Value) Minus

func (v Int16Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int16Value) Mod

func (v Int16Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int16Value) Mul

func (v Int16Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int16Value) NeedsStoreTo added in v0.20.0

func (Int16Value) NeedsStoreTo(_ atree.Address) bool

func (Int16Value) Negate

func (v Int16Value) Negate(interpreter *Interpreter, locationRange LocationRange) NumberValue

func (Int16Value) Plus

func (v Int16Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int16Value) RecursiveString added in v0.17.0

func (v Int16Value) RecursiveString(_ SeenReferences) string

func (Int16Value) RemoveMember added in v0.20.0

func (Int16Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Int16Value) SaturatingDiv added in v0.15.0

func (v Int16Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int16Value) SaturatingMinus added in v0.15.0

func (v Int16Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int16Value) SaturatingMul added in v0.15.0

func (v Int16Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int16Value) SaturatingPlus added in v0.15.0

func (v Int16Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int16Value) SetMember added in v0.3.0

func (Int16Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Int16Value) StaticType added in v0.12.0

func (Int16Value) StaticType(interpreter *Interpreter) StaticType

func (Int16Value) Storable added in v0.20.0

func (Int16Value) StoredValue added in v0.20.0

func (v Int16Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Int16Value) String

func (v Int16Value) String() string

func (Int16Value) ToBigEndianBytes added in v0.5.0

func (v Int16Value) ToBigEndianBytes() []byte

func (Int16Value) ToInt

func (v Int16Value) ToInt(_ LocationRange) int

func (Int16Value) Transfer added in v0.20.0

func (v Int16Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Int16Value) Walk added in v0.19.0

func (Int16Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Int256Value

type Int256Value struct {
	BigInt *big.Int
}

func ConvertInt256

func ConvertInt256(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Int256Value

func NewInt256ValueFromBigInt

func NewInt256ValueFromBigInt(memoryGauge common.MemoryGauge, bigIntConstructor func() *big.Int) Int256Value

func NewInt256ValueFromUint64 added in v0.24.0

func NewInt256ValueFromUint64(memoryGauge common.MemoryGauge, value int64) Int256Value

func NewUnmeteredInt256ValueFromBigInt added in v0.24.0

func NewUnmeteredInt256ValueFromBigInt(value *big.Int) Int256Value

func NewUnmeteredInt256ValueFromInt64 added in v0.24.0

func NewUnmeteredInt256ValueFromInt64(value int64) Int256Value

func (Int256Value) Accept added in v0.12.0

func (v Int256Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Int256Value) BitwiseAnd added in v0.2.0

func (v Int256Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int256Value) BitwiseLeftShift added in v0.2.0

func (v Int256Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int256Value) BitwiseOr added in v0.2.0

func (v Int256Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int256Value) BitwiseRightShift added in v0.2.0

func (v Int256Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int256Value) BitwiseXor added in v0.2.0

func (v Int256Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int256Value) ByteLength added in v0.24.0

func (v Int256Value) ByteLength() int

func (Int256Value) ByteSize added in v0.20.0

func (v Int256Value) ByteSize() uint32

func (Int256Value) ChildStorables added in v0.20.0

func (Int256Value) ChildStorables() []atree.Storable

func (Int256Value) Clone added in v0.24.0

func (v Int256Value) Clone(_ *Interpreter) Value

func (Int256Value) ConformsToStaticType added in v0.24.0

func (v Int256Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Int256Value) DeepRemove added in v0.20.0

func (Int256Value) DeepRemove(_ *Interpreter, _ bool)

func (Int256Value) Div

func (v Int256Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int256Value) Encode added in v0.20.0

func (v Int256Value) Encode(e *atree.Encoder) error

Encode encodes Int256Value as

cbor.Tag{
		Number:  CBORTagInt256Value,
		Content: *big.Int(v.BigInt),
}

func (Int256Value) Equal

func (v Int256Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Int256Value) GetMember added in v0.3.0

func (v Int256Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Int256Value) Greater

func (v Int256Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int256Value) GreaterEqual

func (v Int256Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int256Value) HashInput added in v0.20.0

func (v Int256Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeInt256 (1 byte) - big int value encoded in big-endian (n bytes)

func (Int256Value) IsImportable added in v0.24.0

func (Int256Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Int256Value) IsResourceKinded added in v0.20.0

func (Int256Value) IsResourceKinded(_ *Interpreter) bool

func (Int256Value) Less

func (v Int256Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int256Value) LessEqual

func (v Int256Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int256Value) MeteredString added in v0.24.0

func (v Int256Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Int256Value) Minus

func (v Int256Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int256Value) Mod

func (v Int256Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int256Value) Mul

func (v Int256Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int256Value) NeedsStoreTo added in v0.20.0

func (Int256Value) NeedsStoreTo(_ atree.Address) bool

func (Int256Value) Negate

func (v Int256Value) Negate(interpreter *Interpreter, locationRange LocationRange) NumberValue

func (Int256Value) Plus

func (v Int256Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int256Value) RecursiveString added in v0.17.0

func (v Int256Value) RecursiveString(_ SeenReferences) string

func (Int256Value) RemoveMember added in v0.20.0

func (Int256Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Int256Value) SaturatingDiv added in v0.15.0

func (v Int256Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int256Value) SaturatingMinus added in v0.15.0

func (v Int256Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int256Value) SaturatingMul added in v0.15.0

func (v Int256Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int256Value) SaturatingPlus added in v0.15.0

func (v Int256Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int256Value) SetMember added in v0.3.0

func (Int256Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Int256Value) StaticType added in v0.12.0

func (Int256Value) StaticType(interpreter *Interpreter) StaticType

func (Int256Value) Storable added in v0.20.0

func (Int256Value) StoredValue added in v0.20.0

func (v Int256Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Int256Value) String

func (v Int256Value) String() string

func (Int256Value) ToBigEndianBytes added in v0.5.0

func (v Int256Value) ToBigEndianBytes() []byte

func (Int256Value) ToBigInt

func (v Int256Value) ToBigInt(memoryGauge common.MemoryGauge) *big.Int

func (Int256Value) ToInt

func (v Int256Value) ToInt(locationRange LocationRange) int

func (Int256Value) Transfer added in v0.20.0

func (v Int256Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Int256Value) Walk added in v0.19.0

func (Int256Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Int32Value

type Int32Value int32

func ConvertInt32

func ConvertInt32(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Int32Value

func NewInt32Value added in v0.24.0

func NewInt32Value(gauge common.MemoryGauge, valueGetter func() int32) Int32Value

func NewUnmeteredInt32Value added in v0.24.0

func NewUnmeteredInt32Value(value int32) Int32Value

func (Int32Value) Accept added in v0.12.0

func (v Int32Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Int32Value) BitwiseAnd added in v0.2.0

func (v Int32Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int32Value) BitwiseLeftShift added in v0.2.0

func (v Int32Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int32Value) BitwiseOr added in v0.2.0

func (v Int32Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int32Value) BitwiseRightShift added in v0.2.0

func (v Int32Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int32Value) BitwiseXor added in v0.2.0

func (v Int32Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int32Value) ByteSize added in v0.20.0

func (v Int32Value) ByteSize() uint32

func (Int32Value) ChildStorables added in v0.20.0

func (Int32Value) ChildStorables() []atree.Storable

func (Int32Value) Clone added in v0.24.0

func (v Int32Value) Clone(_ *Interpreter) Value

func (Int32Value) ConformsToStaticType added in v0.24.0

func (v Int32Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Int32Value) DeepRemove added in v0.20.0

func (Int32Value) DeepRemove(_ *Interpreter, _ bool)

func (Int32Value) Div

func (v Int32Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int32Value) Encode added in v0.20.0

func (v Int32Value) Encode(e *atree.Encoder) error

Encode encodes Int32Value as

cbor.Tag{
		Number:  CBORTagInt32Value,
		Content: int32(v),
}

func (Int32Value) Equal

func (v Int32Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Int32Value) GetMember added in v0.3.0

func (v Int32Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Int32Value) Greater

func (v Int32Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int32Value) GreaterEqual

func (v Int32Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int32Value) HashInput added in v0.20.0

func (v Int32Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeInt32 (1 byte) - int32 value encoded in big-endian (4 bytes)

func (Int32Value) IsImportable added in v0.24.0

func (Int32Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Int32Value) IsResourceKinded added in v0.20.0

func (Int32Value) IsResourceKinded(_ *Interpreter) bool

func (Int32Value) Less

func (v Int32Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int32Value) LessEqual

func (v Int32Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int32Value) MeteredString added in v0.24.0

func (v Int32Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Int32Value) Minus

func (v Int32Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int32Value) Mod

func (v Int32Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int32Value) Mul

func (v Int32Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int32Value) NeedsStoreTo added in v0.20.0

func (Int32Value) NeedsStoreTo(_ atree.Address) bool

func (Int32Value) Negate

func (v Int32Value) Negate(interpreter *Interpreter, locationRange LocationRange) NumberValue

func (Int32Value) Plus

func (v Int32Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int32Value) RecursiveString added in v0.17.0

func (v Int32Value) RecursiveString(_ SeenReferences) string

func (Int32Value) RemoveMember added in v0.20.0

func (Int32Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Int32Value) SaturatingDiv added in v0.15.0

func (v Int32Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int32Value) SaturatingMinus added in v0.15.0

func (v Int32Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int32Value) SaturatingMul added in v0.15.0

func (v Int32Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int32Value) SaturatingPlus added in v0.15.0

func (v Int32Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int32Value) SetMember added in v0.3.0

func (Int32Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Int32Value) StaticType added in v0.12.0

func (Int32Value) StaticType(interpreter *Interpreter) StaticType

func (Int32Value) Storable added in v0.20.0

func (Int32Value) StoredValue added in v0.20.0

func (v Int32Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Int32Value) String

func (v Int32Value) String() string

func (Int32Value) ToBigEndianBytes added in v0.5.0

func (v Int32Value) ToBigEndianBytes() []byte

func (Int32Value) ToInt

func (v Int32Value) ToInt(_ LocationRange) int

func (Int32Value) Transfer added in v0.20.0

func (v Int32Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Int32Value) Walk added in v0.19.0

func (Int32Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Int64Value

type Int64Value int64

func ConvertInt64

func ConvertInt64(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Int64Value

func NewInt64Value added in v0.24.0

func NewInt64Value(gauge common.MemoryGauge, valueGetter func() int64) Int64Value

func NewUnmeteredInt64Value added in v0.24.0

func NewUnmeteredInt64Value(value int64) Int64Value

func (Int64Value) Accept added in v0.12.0

func (v Int64Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Int64Value) BitwiseAnd added in v0.2.0

func (v Int64Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int64Value) BitwiseLeftShift added in v0.2.0

func (v Int64Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int64Value) BitwiseOr added in v0.2.0

func (v Int64Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int64Value) BitwiseRightShift added in v0.2.0

func (v Int64Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int64Value) BitwiseXor added in v0.2.0

func (v Int64Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int64Value) ByteSize added in v0.20.0

func (v Int64Value) ByteSize() uint32

func (Int64Value) ChildStorables added in v0.20.0

func (Int64Value) ChildStorables() []atree.Storable

func (Int64Value) Clone added in v0.24.0

func (v Int64Value) Clone(_ *Interpreter) Value

func (Int64Value) ConformsToStaticType added in v0.24.0

func (v Int64Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Int64Value) DeepRemove added in v0.20.0

func (Int64Value) DeepRemove(_ *Interpreter, _ bool)

func (Int64Value) Div

func (v Int64Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int64Value) Encode added in v0.20.0

func (v Int64Value) Encode(e *atree.Encoder) error

Encode encodes Int64Value as

cbor.Tag{
		Number:  CBORTagInt64Value,
		Content: int64(v),
}

func (Int64Value) Equal

func (v Int64Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Int64Value) GetMember added in v0.3.0

func (v Int64Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Int64Value) Greater

func (v Int64Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int64Value) GreaterEqual

func (v Int64Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int64Value) HashInput added in v0.20.0

func (v Int64Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeInt64 (1 byte) - int64 value encoded in big-endian (8 bytes)

func (Int64Value) IsImportable added in v0.24.0

func (Int64Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Int64Value) IsResourceKinded added in v0.20.0

func (Int64Value) IsResourceKinded(_ *Interpreter) bool

func (Int64Value) Less

func (v Int64Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int64Value) LessEqual

func (v Int64Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int64Value) MeteredString added in v0.24.0

func (v Int64Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Int64Value) Minus

func (v Int64Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int64Value) Mod

func (v Int64Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int64Value) Mul

func (v Int64Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int64Value) NeedsStoreTo added in v0.20.0

func (Int64Value) NeedsStoreTo(_ atree.Address) bool

func (Int64Value) Negate

func (v Int64Value) Negate(interpreter *Interpreter, locationRange LocationRange) NumberValue

func (Int64Value) Plus

func (v Int64Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int64Value) RecursiveString added in v0.17.0

func (v Int64Value) RecursiveString(_ SeenReferences) string

func (Int64Value) RemoveMember added in v0.20.0

func (Int64Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Int64Value) SaturatingDiv added in v0.15.0

func (v Int64Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int64Value) SaturatingMinus added in v0.15.0

func (v Int64Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int64Value) SaturatingMul added in v0.15.0

func (v Int64Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int64Value) SaturatingPlus added in v0.15.0

func (v Int64Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int64Value) SetMember added in v0.3.0

func (Int64Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Int64Value) StaticType added in v0.12.0

func (Int64Value) StaticType(interpreter *Interpreter) StaticType

func (Int64Value) Storable added in v0.20.0

func (Int64Value) StoredValue added in v0.20.0

func (v Int64Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Int64Value) String

func (v Int64Value) String() string

func (Int64Value) ToBigEndianBytes added in v0.5.0

func (v Int64Value) ToBigEndianBytes() []byte

func (Int64Value) ToInt

func (v Int64Value) ToInt(_ LocationRange) int

func (Int64Value) Transfer added in v0.20.0

func (v Int64Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Int64Value) Walk added in v0.19.0

func (Int64Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Int8Value

type Int8Value int8

func ConvertInt8

func ConvertInt8(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Int8Value

func NewInt8Value added in v0.24.0

func NewInt8Value(gauge common.MemoryGauge, valueGetter func() int8) Int8Value

func NewUnmeteredInt8Value added in v0.24.0

func NewUnmeteredInt8Value(value int8) Int8Value

func (Int8Value) Accept added in v0.12.0

func (v Int8Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Int8Value) BitwiseAnd added in v0.2.0

func (v Int8Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int8Value) BitwiseLeftShift added in v0.2.0

func (v Int8Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int8Value) BitwiseOr added in v0.2.0

func (v Int8Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int8Value) BitwiseRightShift added in v0.2.0

func (v Int8Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int8Value) BitwiseXor added in v0.2.0

func (v Int8Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Int8Value) ByteSize added in v0.20.0

func (v Int8Value) ByteSize() uint32

func (Int8Value) ChildStorables added in v0.20.0

func (Int8Value) ChildStorables() []atree.Storable

func (Int8Value) Clone added in v0.24.0

func (v Int8Value) Clone(_ *Interpreter) Value

func (Int8Value) ConformsToStaticType added in v0.24.0

func (v Int8Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Int8Value) DeepRemove added in v0.20.0

func (Int8Value) DeepRemove(_ *Interpreter, _ bool)

func (Int8Value) Div

func (v Int8Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int8Value) Encode added in v0.20.0

func (v Int8Value) Encode(e *atree.Encoder) error

Encode encodes Int8Value as

cbor.Tag{
		Number:  CBORTagInt8Value,
		Content: int8(v),
}

func (Int8Value) Equal

func (v Int8Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Int8Value) GetMember added in v0.3.0

func (v Int8Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Int8Value) Greater

func (v Int8Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int8Value) GreaterEqual

func (v Int8Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int8Value) HashInput added in v0.20.0

func (v Int8Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeInt8 (1 byte) - int8 value (1 byte)

func (Int8Value) IsImportable added in v0.24.0

func (Int8Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Int8Value) IsResourceKinded added in v0.20.0

func (Int8Value) IsResourceKinded(_ *Interpreter) bool

func (Int8Value) Less

func (v Int8Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int8Value) LessEqual

func (v Int8Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Int8Value) MeteredString added in v0.24.0

func (v Int8Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Int8Value) Minus

func (v Int8Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int8Value) Mod

func (v Int8Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int8Value) Mul

func (v Int8Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int8Value) NeedsStoreTo added in v0.20.0

func (Int8Value) NeedsStoreTo(_ atree.Address) bool

func (Int8Value) Negate

func (v Int8Value) Negate(interpreter *Interpreter, locationRange LocationRange) NumberValue

func (Int8Value) Plus

func (v Int8Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int8Value) RecursiveString added in v0.17.0

func (v Int8Value) RecursiveString(_ SeenReferences) string

func (Int8Value) RemoveMember added in v0.20.0

func (Int8Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Int8Value) SaturatingDiv added in v0.15.0

func (v Int8Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int8Value) SaturatingMinus added in v0.15.0

func (v Int8Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int8Value) SaturatingMul added in v0.15.0

func (v Int8Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int8Value) SaturatingPlus added in v0.15.0

func (v Int8Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Int8Value) SetMember added in v0.3.0

func (Int8Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Int8Value) StaticType added in v0.12.0

func (Int8Value) StaticType(interpreter *Interpreter) StaticType

func (Int8Value) Storable added in v0.20.0

func (Int8Value) StoredValue added in v0.20.0

func (v Int8Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Int8Value) String

func (v Int8Value) String() string

func (Int8Value) ToBigEndianBytes added in v0.5.0

func (v Int8Value) ToBigEndianBytes() []byte

func (Int8Value) ToInt

func (v Int8Value) ToInt(_ LocationRange) int

func (Int8Value) Transfer added in v0.20.0

func (v Int8Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Int8Value) Walk added in v0.19.0

func (Int8Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type IntValue

type IntValue struct {
	BigInt *big.Int
}

func ConvertInt

func ConvertInt(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) IntValue

func NewIntValueFromBigInt

func NewIntValueFromBigInt(
	memoryGauge common.MemoryGauge,
	memoryUsage common.MemoryUsage,
	bigIntConstructor func() *big.Int,
) IntValue

func NewIntValueFromInt64

func NewIntValueFromInt64(memoryGauge common.MemoryGauge, value int64) IntValue

func NewUnmeteredIntValueFromBigInt added in v0.24.0

func NewUnmeteredIntValueFromBigInt(value *big.Int) IntValue

func NewUnmeteredIntValueFromInt64 added in v0.24.0

func NewUnmeteredIntValueFromInt64(value int64) IntValue

func (IntValue) Accept added in v0.12.0

func (v IntValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (IntValue) BitwiseAnd added in v0.2.0

func (v IntValue) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (IntValue) BitwiseLeftShift added in v0.2.0

func (v IntValue) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (IntValue) BitwiseOr added in v0.2.0

func (v IntValue) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (IntValue) BitwiseRightShift added in v0.2.0

func (v IntValue) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (IntValue) BitwiseXor added in v0.2.0

func (v IntValue) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (IntValue) ByteLength added in v0.24.0

func (v IntValue) ByteLength() int

func (IntValue) ByteSize added in v0.20.0

func (v IntValue) ByteSize() uint32

func (IntValue) ChildStorables added in v0.20.0

func (IntValue) ChildStorables() []atree.Storable

func (IntValue) Clone added in v0.24.0

func (v IntValue) Clone(_ *Interpreter) Value

func (IntValue) ConformsToStaticType added in v0.24.0

func (v IntValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (IntValue) DeepRemove added in v0.20.0

func (IntValue) DeepRemove(_ *Interpreter, _ bool)

func (IntValue) Div

func (v IntValue) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (IntValue) Encode added in v0.20.0

func (v IntValue) Encode(e *atree.Encoder) error

Encode encodes the value as

cbor.Tag{
		Number:  CBORTagIntValue,
		Content: *big.Int(v.BigInt),
}

func (IntValue) Equal

func (v IntValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (IntValue) GetMember added in v0.3.0

func (v IntValue) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (IntValue) Greater

func (v IntValue) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (IntValue) GreaterEqual

func (v IntValue) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (IntValue) HashInput added in v0.20.0

func (v IntValue) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeInt (1 byte) - big int encoded in big-endian (n bytes)

func (IntValue) IsImportable added in v0.24.0

func (IntValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (IntValue) IsResourceKinded added in v0.20.0

func (IntValue) IsResourceKinded(_ *Interpreter) bool

func (IntValue) Less

func (v IntValue) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (IntValue) LessEqual

func (v IntValue) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (IntValue) MeteredString added in v0.24.0

func (v IntValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (IntValue) Minus

func (v IntValue) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (IntValue) Mod

func (v IntValue) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (IntValue) Mul

func (v IntValue) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (IntValue) NeedsStoreTo added in v0.20.0

func (IntValue) NeedsStoreTo(_ atree.Address) bool

func (IntValue) Negate

func (v IntValue) Negate(interpreter *Interpreter, _ LocationRange) NumberValue

func (IntValue) Plus

func (v IntValue) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (IntValue) RecursiveString added in v0.17.0

func (v IntValue) RecursiveString(_ SeenReferences) string

func (IntValue) RemoveMember added in v0.20.0

func (IntValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (IntValue) SaturatingDiv added in v0.15.0

func (v IntValue) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (IntValue) SaturatingMinus added in v0.15.0

func (v IntValue) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (IntValue) SaturatingMul added in v0.15.0

func (v IntValue) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (IntValue) SaturatingPlus added in v0.15.0

func (v IntValue) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (IntValue) SetMember added in v0.3.0

func (IntValue) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (IntValue) StaticType added in v0.12.0

func (IntValue) StaticType(interpreter *Interpreter) StaticType

func (IntValue) Storable added in v0.20.0

func (v IntValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint64) (atree.Storable, error)

func (IntValue) StoredValue added in v0.20.0

func (v IntValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (IntValue) String

func (v IntValue) String() string

func (IntValue) ToBigEndianBytes added in v0.5.0

func (v IntValue) ToBigEndianBytes() []byte

func (IntValue) ToBigInt

func (v IntValue) ToBigInt(memoryGauge common.MemoryGauge) *big.Int

func (IntValue) ToInt

func (v IntValue) ToInt(locationRange LocationRange) int

func (IntValue) ToUint32 added in v1.0.0

func (v IntValue) ToUint32(locationRange LocationRange) uint32

func (IntValue) Transfer added in v0.20.0

func (v IntValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (IntValue) Walk added in v0.19.0

func (IntValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type IntegerValue added in v0.2.0

type IntegerValue interface {
	NumberValue
	BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue
	BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue
	BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue
	BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue
	BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue
}

func GetSmallIntegerValue added in v1.0.0

func GetSmallIntegerValue(value int8, staticType StaticType) IntegerValue

type InterfaceMissingLocationError added in v0.24.0

type InterfaceMissingLocationError struct {
	QualifiedIdentifier string
}

InterfaceMissingLocation is reported during interface lookup, if an interface is looked up without a location

func (InterfaceMissingLocationError) Error added in v0.24.0

func (InterfaceMissingLocationError) IsUserError added in v0.25.0

func (InterfaceMissingLocationError) IsUserError()

type InterfaceStaticType

type InterfaceStaticType struct {
	Location            common.Location
	QualifiedIdentifier string
	TypeID              common.TypeID
}

func ConvertSemaInterfaceTypeToStaticInterfaceType added in v0.19.0

func ConvertSemaInterfaceTypeToStaticInterfaceType(
	memoryGauge common.MemoryGauge,
	t *sema.InterfaceType,
) *InterfaceStaticType

func NewInterfaceStaticType added in v0.24.0

func NewInterfaceStaticType(
	memoryGauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
	typeID common.TypeID,
) *InterfaceStaticType

func NewInterfaceStaticTypeComputeTypeID added in v0.41.0

func NewInterfaceStaticTypeComputeTypeID(
	memoryGauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
) *InterfaceStaticType

func (*InterfaceStaticType) Encode added in v0.20.0

func (t *InterfaceStaticType) Encode(e *cbor.StreamEncoder) error

Encode encodes InterfaceStaticType as

cbor.Tag{
		Number: CBORTagInterfaceStaticType,
		Content: cborArray{
				encodedInterfaceStaticTypeLocationFieldKey:            Location(v.Location),
				encodedInterfaceStaticTypeQualifiedIdentifierFieldKey: string(v.QualifiedIdentifier),
		},
}

func (*InterfaceStaticType) Equal added in v0.15.0

func (t *InterfaceStaticType) Equal(other StaticType) bool

func (*InterfaceStaticType) ID added in v0.41.0

func (t *InterfaceStaticType) ID() TypeID

func (*InterfaceStaticType) IsDeprecated added in v1.0.0

func (*InterfaceStaticType) IsDeprecated() bool

func (*InterfaceStaticType) MeteredString added in v0.24.0

func (t *InterfaceStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (*InterfaceStaticType) String

func (t *InterfaceStaticType) String() string

type InterfaceTypeHandlerFunc added in v1.0.0

type InterfaceTypeHandlerFunc func(location common.Location, typeID TypeID) *sema.InterfaceType

InterfaceTypeHandlerFunc is a function that loads interface types.

type InterpretedFunctionValue

type InterpretedFunctionValue struct {
	Interpreter      *Interpreter
	ParameterList    *ast.ParameterList
	Type             *sema.FunctionType
	Activation       *VariableActivation
	BeforeStatements []ast.Statement
	PreConditions    ast.Conditions
	Statements       []ast.Statement
	PostConditions   ast.Conditions
}

InterpretedFunctionValue

func NewInterpretedFunctionValue added in v0.24.0

func NewInterpretedFunctionValue(
	interpreter *Interpreter,
	parameterList *ast.ParameterList,
	functionType *sema.FunctionType,
	lexicalScope *VariableActivation,
	beforeStatements []ast.Statement,
	preConditions ast.Conditions,
	statements []ast.Statement,
	postConditions ast.Conditions,
) *InterpretedFunctionValue

func (*InterpretedFunctionValue) Accept added in v0.12.0

func (f *InterpretedFunctionValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (*InterpretedFunctionValue) Clone added in v0.24.0

func (*InterpretedFunctionValue) ConformsToStaticType added in v0.24.0

func (f *InterpretedFunctionValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (*InterpretedFunctionValue) DeepRemove added in v0.20.0

func (*InterpretedFunctionValue) DeepRemove(_ *Interpreter, _ bool)

func (*InterpretedFunctionValue) FunctionType added in v0.27.0

func (f *InterpretedFunctionValue) FunctionType() *sema.FunctionType

func (*InterpretedFunctionValue) IsImportable added in v0.24.0

func (*InterpretedFunctionValue) IsResourceKinded added in v0.20.0

func (*InterpretedFunctionValue) IsResourceKinded(_ *Interpreter) bool

func (*InterpretedFunctionValue) MeteredString added in v0.24.0

func (f *InterpretedFunctionValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (*InterpretedFunctionValue) NeedsStoreTo added in v0.20.0

func (*InterpretedFunctionValue) NeedsStoreTo(_ atree.Address) bool

func (*InterpretedFunctionValue) RecursiveString added in v0.17.0

func (f *InterpretedFunctionValue) RecursiveString(_ SeenReferences) string

func (*InterpretedFunctionValue) StaticType added in v0.12.0

func (f *InterpretedFunctionValue) StaticType(interpreter *Interpreter) StaticType

func (*InterpretedFunctionValue) Storable added in v0.20.0

func (*InterpretedFunctionValue) String added in v0.2.0

func (f *InterpretedFunctionValue) String() string

func (*InterpretedFunctionValue) Transfer added in v0.20.0

func (f *InterpretedFunctionValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*InterpretedFunctionValue) Walk added in v0.19.0

func (f *InterpretedFunctionValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Interpreter

type Interpreter struct {
	Location common.Location

	Program     *Program
	SharedState *SharedState
	Globals     GlobalVariables

	Transactions []*HostFunctionValue
	// contains filtered or unexported fields
}

func NewInterpreter

func NewInterpreter(
	program *Program,
	location common.Location,
	config *Config,
) (*Interpreter, error)

func NewInterpreterWithSharedState added in v0.30.0

func NewInterpreterWithSharedState(
	program *Program,
	location common.Location,
	sharedState *SharedState,
) (*Interpreter, error)

func (*Interpreter) AllElaborations added in v1.0.0

func (interpreter *Interpreter) AllElaborations() (elaborations map[common.Location]*sema.Elaboration)

func (*Interpreter) BoxOptional added in v0.20.0

func (interpreter *Interpreter) BoxOptional(
	locationRange LocationRange,
	value Value,
	targetType sema.Type,
) Value

BoxOptional boxes a value in optionals, if necessary

func (*Interpreter) CallStack added in v0.25.0

func (interpreter *Interpreter) CallStack() []Invocation

func (*Interpreter) ConvertAndBox added in v0.20.0

func (interpreter *Interpreter) ConvertAndBox(
	locationRange LocationRange,
	value Value,
	valueType, targetType sema.Type,
) Value

ConvertAndBox converts a value to a target type, and boxes in optionals and any value, if necessary

func (*Interpreter) ConvertStaticToSemaType added in v0.7.0

func (interpreter *Interpreter) ConvertStaticToSemaType(staticType StaticType) (sema.Type, error)

func (*Interpreter) DecodeStorable added in v0.24.0

func (interpreter *Interpreter) DecodeStorable(
	decoder *cbor.StreamDecoder,
	slabID atree.SlabID,
	inlinedExtraData []atree.ExtraData,
) (
	atree.Storable,
	error,
)

func (*Interpreter) DecodeTypeInfo added in v0.24.0

func (interpreter *Interpreter) DecodeTypeInfo(decoder *cbor.StreamDecoder) (atree.TypeInfo, error)

func (*Interpreter) EnsureLoaded added in v0.16.0

func (interpreter *Interpreter) EnsureLoaded(
	location common.Location,
) *Interpreter

func (*Interpreter) ExpectType added in v0.19.0

func (interpreter *Interpreter) ExpectType(
	value Value,
	expectedType sema.Type,
	locationRange LocationRange,
)

func (*Interpreter) FindVariable added in v0.27.0

func (interpreter *Interpreter) FindVariable(name string) Variable

func (*Interpreter) GetCompositeType added in v0.24.0

func (interpreter *Interpreter) GetCompositeType(
	location common.Location,
	qualifiedIdentifier string,
	typeID TypeID,
) (*sema.CompositeType, error)

func (*Interpreter) GetCompositeValueComputedFields added in v1.0.0

func (interpreter *Interpreter) GetCompositeValueComputedFields(v *CompositeValue) map[string]ComputedField

func (*Interpreter) GetCompositeValueFunctions added in v1.0.0

func (interpreter *Interpreter) GetCompositeValueFunctions(
	v *CompositeValue,
	locationRange LocationRange,
) *FunctionOrderedMap

func (*Interpreter) GetCompositeValueInjectedFields added in v1.0.0

func (interpreter *Interpreter) GetCompositeValueInjectedFields(v *CompositeValue) map[string]Value

func (*Interpreter) GetContractComposite added in v0.16.0

func (interpreter *Interpreter) GetContractComposite(contractLocation common.AddressLocation) (*CompositeValue, error)

GetContractComposite gets the composite value of the contract at the address location.

func (*Interpreter) GetEntitlementMapType added in v1.0.0

func (interpreter *Interpreter) GetEntitlementMapType(typeID common.TypeID) (*sema.EntitlementMapType, error)

func (*Interpreter) GetEntitlementType added in v1.0.0

func (interpreter *Interpreter) GetEntitlementType(typeID common.TypeID) (*sema.EntitlementType, error)

func (*Interpreter) GetInterfaceType added in v1.0.0

func (interpreter *Interpreter) GetInterfaceType(
	location common.Location,
	qualifiedIdentifier string,
	typeID TypeID,
) (*sema.InterfaceType, error)

func (*Interpreter) Interpret

func (interpreter *Interpreter) Interpret() (err error)

func (*Interpreter) Invoke

func (interpreter *Interpreter) Invoke(functionName string, arguments ...Value) (value Value, err error)

Invoke invokes a global function with the given arguments

func (*Interpreter) InvokeExternally added in v0.27.0

func (interpreter *Interpreter) InvokeExternally(
	functionValue FunctionValue,
	functionType *sema.FunctionType,
	arguments []Value,
) (
	result Value,
	err error,
)

func (*Interpreter) InvokeFunction added in v0.16.0

func (interpreter *Interpreter) InvokeFunction(function FunctionValue, invocation Invocation) (value Value, err error)

InvokeFunction invokes a function value with the given invocation

func (*Interpreter) InvokeFunctionValue

func (interpreter *Interpreter) InvokeFunctionValue(
	function FunctionValue,
	arguments []Value,
	argumentTypes []sema.Type,
	parameterTypes []sema.Type,
	returnType sema.Type,
	invocationPosition ast.HasPosition,
) (
	value Value,
	err error,
)

func (*Interpreter) InvokeTransaction

func (interpreter *Interpreter) InvokeTransaction(index int, arguments ...Value) (err error)

func (*Interpreter) IsSubType

func (interpreter *Interpreter) IsSubType(subType StaticType, superType StaticType) bool

func (*Interpreter) IsSubTypeOfSemaType added in v0.24.0

func (interpreter *Interpreter) IsSubTypeOfSemaType(staticSubType StaticType, superType sema.Type) bool

func (*Interpreter) MeterMemory added in v0.24.0

func (interpreter *Interpreter) MeterMemory(usage common.MemoryUsage) error

MeterMemory delegates the memory usage to the interpreter's memory gauge, if any.

func (*Interpreter) MustConvertStaticAuthorizationToSemaAccess added in v1.0.0

func (interpreter *Interpreter) MustConvertStaticAuthorizationToSemaAccess(auth Authorization) sema.Access

func (*Interpreter) MustConvertStaticToSemaType added in v0.24.0

func (interpreter *Interpreter) MustConvertStaticToSemaType(staticType StaticType) sema.Type

func (*Interpreter) MustSemaTypeOfValue added in v0.36.0

func (interpreter *Interpreter) MustSemaTypeOfValue(value Value) sema.Type

func (*Interpreter) NewIntegerValueFromBigInt added in v0.24.0

func (interpreter *Interpreter) NewIntegerValueFromBigInt(value *big.Int, integerSubType sema.Type) Value

NewIntegerValueFromBigInt creates a Cadence interpreter value of a given subtype. This method assumes the range validations are done prior to calling this method. (i.e: at semantic level)

func (*Interpreter) NewSubInterpreter added in v0.13.0

func (interpreter *Interpreter) NewSubInterpreter(
	program *Program,
	location common.Location,
) (
	*Interpreter,
	error,
)

func (*Interpreter) ReadStored added in v0.15.0

func (interpreter *Interpreter) ReadStored(
	storageAddress common.Address,
	domain string,
	identifier StorageMapKey,
) Value

func (*Interpreter) RecoverErrors added in v0.17.0

func (interpreter *Interpreter) RecoverErrors(onError func(error))

func (*Interpreter) RemoveReferencedSlab added in v0.20.0

func (interpreter *Interpreter) RemoveReferencedSlab(storable atree.Storable)

func (*Interpreter) ReportComputation added in v0.23.2

func (interpreter *Interpreter) ReportComputation(compKind common.ComputationKind, intensity uint)

func (*Interpreter) Storage added in v0.20.0

func (interpreter *Interpreter) Storage() Storage

func (*Interpreter) StoredValueExists added in v0.39.0

func (interpreter *Interpreter) StoredValueExists(
	storageAddress common.Address,
	domain string,
	identifier StorageMapKey,
) bool

func (*Interpreter) SubstituteMappedEntitlements added in v1.0.0

func (interpreter *Interpreter) SubstituteMappedEntitlements(ty sema.Type) sema.Type

func (*Interpreter) Unbox added in v0.24.0

func (interpreter *Interpreter) Unbox(locationRange LocationRange, value Value) Value

func (*Interpreter) ValidateAtreeValue added in v0.20.0

func (interpreter *Interpreter) ValidateAtreeValue(value atree.Value)

func (*Interpreter) ValueIsSubtypeOfSemaType added in v0.24.6

func (interpreter *Interpreter) ValueIsSubtypeOfSemaType(value Value, targetType sema.Type) bool

func (*Interpreter) VisitArrayExpression

func (interpreter *Interpreter) VisitArrayExpression(expression *ast.ArrayExpression) Value

func (*Interpreter) VisitAssignmentStatement

func (interpreter *Interpreter) VisitAssignmentStatement(assignment *ast.AssignmentStatement) StatementResult

func (*Interpreter) VisitAttachExpression added in v0.36.0

func (interpreter *Interpreter) VisitAttachExpression(attachExpression *ast.AttachExpression) Value

func (*Interpreter) VisitAttachmentDeclaration added in v0.36.0

func (interpreter *Interpreter) VisitAttachmentDeclaration(declaration *ast.AttachmentDeclaration) StatementResult

func (*Interpreter) VisitBinaryExpression

func (interpreter *Interpreter) VisitBinaryExpression(expression *ast.BinaryExpression) Value

func (*Interpreter) VisitBoolExpression

func (interpreter *Interpreter) VisitBoolExpression(expression *ast.BoolExpression) Value

func (*Interpreter) VisitBreakStatement

func (interpreter *Interpreter) VisitBreakStatement(_ *ast.BreakStatement) StatementResult

func (*Interpreter) VisitCastingExpression

func (interpreter *Interpreter) VisitCastingExpression(expression *ast.CastingExpression) Value

func (*Interpreter) VisitCompositeDeclaration

func (interpreter *Interpreter) VisitCompositeDeclaration(declaration *ast.CompositeDeclaration) StatementResult

NOTE: only called for top-level composite declarations

func (*Interpreter) VisitConditionalExpression

func (interpreter *Interpreter) VisitConditionalExpression(expression *ast.ConditionalExpression) Value

func (*Interpreter) VisitContinueStatement

func (interpreter *Interpreter) VisitContinueStatement(_ *ast.ContinueStatement) StatementResult

func (*Interpreter) VisitCreateExpression

func (interpreter *Interpreter) VisitCreateExpression(expression *ast.CreateExpression) Value

func (*Interpreter) VisitDestroyExpression

func (interpreter *Interpreter) VisitDestroyExpression(expression *ast.DestroyExpression) Value

func (*Interpreter) VisitDictionaryExpression

func (interpreter *Interpreter) VisitDictionaryExpression(expression *ast.DictionaryExpression) Value

func (*Interpreter) VisitEmitStatement

func (interpreter *Interpreter) VisitEmitStatement(statement *ast.EmitStatement) StatementResult

func (*Interpreter) VisitEntitlementDeclaration added in v1.0.0

func (interpreter *Interpreter) VisitEntitlementDeclaration(_ *ast.EntitlementDeclaration) StatementResult

func (*Interpreter) VisitEntitlementMappingDeclaration added in v1.0.0

func (interpreter *Interpreter) VisitEntitlementMappingDeclaration(_ *ast.EntitlementMappingDeclaration) StatementResult

func (*Interpreter) VisitEnumCaseDeclaration added in v0.10.0

func (interpreter *Interpreter) VisitEnumCaseDeclaration(_ *ast.EnumCaseDeclaration) StatementResult

func (*Interpreter) VisitExpressionStatement

func (interpreter *Interpreter) VisitExpressionStatement(statement *ast.ExpressionStatement) StatementResult

func (*Interpreter) VisitFieldDeclaration

func (interpreter *Interpreter) VisitFieldDeclaration(_ *ast.FieldDeclaration) StatementResult

func (*Interpreter) VisitFixedPointExpression

func (interpreter *Interpreter) VisitFixedPointExpression(expression *ast.FixedPointExpression) Value

func (*Interpreter) VisitForStatement

func (interpreter *Interpreter) VisitForStatement(statement *ast.ForStatement) (result StatementResult)

func (*Interpreter) VisitForceExpression

func (interpreter *Interpreter) VisitForceExpression(expression *ast.ForceExpression) Value

func (*Interpreter) VisitFunctionDeclaration

func (interpreter *Interpreter) VisitFunctionDeclaration(declaration *ast.FunctionDeclaration) StatementResult

func (*Interpreter) VisitFunctionExpression

func (interpreter *Interpreter) VisitFunctionExpression(expression *ast.FunctionExpression) Value

func (*Interpreter) VisitIdentifierExpression

func (interpreter *Interpreter) VisitIdentifierExpression(expression *ast.IdentifierExpression) Value

func (*Interpreter) VisitIfStatement

func (interpreter *Interpreter) VisitIfStatement(statement *ast.IfStatement) StatementResult

func (*Interpreter) VisitImportDeclaration

func (interpreter *Interpreter) VisitImportDeclaration(declaration *ast.ImportDeclaration) StatementResult

func (*Interpreter) VisitIndexExpression

func (interpreter *Interpreter) VisitIndexExpression(expression *ast.IndexExpression) Value

func (*Interpreter) VisitIntegerExpression

func (interpreter *Interpreter) VisitIntegerExpression(expression *ast.IntegerExpression) Value

func (*Interpreter) VisitInterfaceDeclaration

func (interpreter *Interpreter) VisitInterfaceDeclaration(declaration *ast.InterfaceDeclaration) StatementResult

NOTE: only called for top-level interface declarations

func (*Interpreter) VisitInvocationExpression

func (interpreter *Interpreter) VisitInvocationExpression(invocationExpression *ast.InvocationExpression) Value

func (*Interpreter) VisitMemberExpression

func (interpreter *Interpreter) VisitMemberExpression(expression *ast.MemberExpression) Value

func (*Interpreter) VisitNilExpression

func (interpreter *Interpreter) VisitNilExpression(_ *ast.NilExpression) Value

func (*Interpreter) VisitPathExpression

func (interpreter *Interpreter) VisitPathExpression(expression *ast.PathExpression) Value

func (*Interpreter) VisitPragmaDeclaration added in v0.7.0

func (interpreter *Interpreter) VisitPragmaDeclaration(_ *ast.PragmaDeclaration) StatementResult

func (*Interpreter) VisitProgram

func (interpreter *Interpreter) VisitProgram(program *ast.Program)

func (*Interpreter) VisitReferenceExpression

func (interpreter *Interpreter) VisitReferenceExpression(referenceExpression *ast.ReferenceExpression) Value

func (*Interpreter) VisitRemoveStatement added in v0.36.0

func (interpreter *Interpreter) VisitRemoveStatement(removeStatement *ast.RemoveStatement) StatementResult

func (*Interpreter) VisitReturnStatement

func (interpreter *Interpreter) VisitReturnStatement(statement *ast.ReturnStatement) StatementResult

func (*Interpreter) VisitSpecialFunctionDeclaration added in v0.25.0

func (interpreter *Interpreter) VisitSpecialFunctionDeclaration(declaration *ast.SpecialFunctionDeclaration) StatementResult

func (*Interpreter) VisitStringExpression

func (interpreter *Interpreter) VisitStringExpression(expression *ast.StringExpression) Value

func (*Interpreter) VisitSwapStatement

func (interpreter *Interpreter) VisitSwapStatement(swap *ast.SwapStatement) StatementResult

func (*Interpreter) VisitSwitchStatement added in v0.10.0

func (interpreter *Interpreter) VisitSwitchStatement(switchStatement *ast.SwitchStatement) StatementResult

func (*Interpreter) VisitTransactionDeclaration

func (interpreter *Interpreter) VisitTransactionDeclaration(declaration *ast.TransactionDeclaration) StatementResult

func (*Interpreter) VisitUnaryExpression

func (interpreter *Interpreter) VisitUnaryExpression(expression *ast.UnaryExpression) Value

func (*Interpreter) VisitVariableDeclaration

func (interpreter *Interpreter) VisitVariableDeclaration(declaration *ast.VariableDeclaration) StatementResult

VisitVariableDeclaration first visits the declaration's value, then declares the variable with the name bound to the value

func (*Interpreter) VisitVoidExpression added in v0.27.1

func (interpreter *Interpreter) VisitVoidExpression(_ *ast.VoidExpression) Value

func (*Interpreter) VisitWhileStatement

func (interpreter *Interpreter) VisitWhileStatement(statement *ast.WhileStatement) StatementResult

func (*Interpreter) WriteStored added in v0.29.0

func (interpreter *Interpreter) WriteStored(
	storageAddress common.Address,
	domain string,
	key StorageMapKey,
	value Value,
) (existed bool)

type InterpreterImport added in v0.13.0

type InterpreterImport struct {
	Interpreter *Interpreter
}

type IntersectionStaticType added in v1.0.0

type IntersectionStaticType struct {
	Types      []*InterfaceStaticType
	LegacyType StaticType
}

func NewIntersectionStaticType added in v1.0.0

func NewIntersectionStaticType(
	memoryGauge common.MemoryGauge,
	types []*InterfaceStaticType,
) *IntersectionStaticType

func (*IntersectionStaticType) Encode added in v1.0.0

func (t *IntersectionStaticType) Encode(e *cbor.StreamEncoder) error

Encode encodes IntersectionStaticType as

cbor.Tag{
		Number: CBORTagIntersectionStaticType,
		Content: cborArray{
				encodedIntersectionStaticTypeLegacyTypeFieldKey: StaticType(v.LegacyRestrictedType),
				encodedIntersectionStaticTypeTypesFieldKey:		[]any(v.Types),
		},
}

func (*IntersectionStaticType) Equal added in v1.0.0

func (t *IntersectionStaticType) Equal(other StaticType) bool

func (*IntersectionStaticType) ID added in v1.0.0

func (*IntersectionStaticType) IsDeprecated added in v1.0.0

func (t *IntersectionStaticType) IsDeprecated() bool

func (*IntersectionStaticType) MeteredString added in v1.0.0

func (t *IntersectionStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (*IntersectionStaticType) String added in v1.0.0

func (t *IntersectionStaticType) String() string

type InvalidAttachmentOperationTargetError added in v0.36.0

type InvalidAttachmentOperationTargetError struct {
	Value Value
	LocationRange
}

InvalidAttachmentOperationTargetError

func (InvalidAttachmentOperationTargetError) Error added in v0.36.0

func (InvalidAttachmentOperationTargetError) IsInternalError added in v0.36.0

func (InvalidAttachmentOperationTargetError) IsInternalError()

type InvalidCapabilityIDError added in v1.0.0

type InvalidCapabilityIDError struct{}

func (InvalidCapabilityIDError) Error added in v1.0.0

func (e InvalidCapabilityIDError) Error() string

func (InvalidCapabilityIDError) IsInternalError added in v1.0.0

func (InvalidCapabilityIDError) IsInternalError()

type InvalidCapabilityIssueTypeError added in v1.0.0

type InvalidCapabilityIssueTypeError struct {
	ExpectedTypeDescription string
	ActualType              sema.Type
	LocationRange
}

InvalidCapabilityIssueTypeError

func (InvalidCapabilityIssueTypeError) Error added in v1.0.0

func (InvalidCapabilityIssueTypeError) IsUserError added in v1.0.0

func (InvalidCapabilityIssueTypeError) IsUserError()

type InvalidHexByteError added in v0.26.0

type InvalidHexByteError struct {
	LocationRange
	Byte byte
}

InvalidHexByteError

func (InvalidHexByteError) Error added in v0.26.0

func (e InvalidHexByteError) Error() string

func (InvalidHexByteError) IsUserError added in v0.26.0

func (InvalidHexByteError) IsUserError()

type InvalidHexLengthError added in v0.26.0

type InvalidHexLengthError struct {
	LocationRange
}

InvalidHexLengthError

func (InvalidHexLengthError) Error added in v0.26.0

func (InvalidHexLengthError) Error() string

func (InvalidHexLengthError) IsUserError added in v0.26.0

func (InvalidHexLengthError) IsUserError()

type InvalidMemberReferenceError added in v1.0.0

type InvalidMemberReferenceError struct {
	ExpectedType sema.Type
	ActualType   sema.Type
	LocationRange
}

InvalidMemberReferenceError

func (InvalidMemberReferenceError) Error added in v1.0.0

func (InvalidMemberReferenceError) IsUserError added in v1.0.0

func (InvalidMemberReferenceError) IsUserError()

type InvalidOperandsError added in v0.20.3

type InvalidOperandsError struct {
	LocationRange
	LeftType     StaticType
	RightType    StaticType
	FunctionName string
	Operation    ast.Operation
}

InvalidOperandsError

func (InvalidOperandsError) Error added in v0.20.3

func (e InvalidOperandsError) Error() string

func (InvalidOperandsError) IsUserError added in v0.25.0

func (InvalidOperandsError) IsUserError()

type InvalidPathDomainError

type InvalidPathDomainError struct {
	LocationRange
	ExpectedDomains []common.PathDomain
	ActualDomain    common.PathDomain
}

InvalidPathDomainError

func (InvalidPathDomainError) Error

func (e InvalidPathDomainError) Error() string

func (InvalidPathDomainError) IsUserError added in v0.25.0

func (InvalidPathDomainError) IsUserError()

func (InvalidPathDomainError) SecondaryError

func (e InvalidPathDomainError) SecondaryError() string

type InvalidPublicKeyError added in v0.23.0

type InvalidPublicKeyError struct {
	PublicKey *ArrayValue
	Err       error
	LocationRange
}

InvalidPublicKeyError is reported during PublicKey creation, if the PublicKey is invalid.

func (InvalidPublicKeyError) Error added in v0.23.0

func (e InvalidPublicKeyError) Error() string

func (InvalidPublicKeyError) IsUserError added in v0.25.0

func (InvalidPublicKeyError) IsUserError()

func (InvalidPublicKeyError) Unwrap added in v0.23.0

func (e InvalidPublicKeyError) Unwrap() error

type InvalidSliceIndexError added in v0.24.0

type InvalidSliceIndexError struct {
	LocationRange
	FromIndex int
	UpToIndex int
}

InvalidSliceIndexError is returned when a slice index is invalid, such as fromIndex > upToIndex This error can be returned even when fromIndex and upToIndex are both within bounds.

func (InvalidSliceIndexError) Error added in v0.24.0

func (e InvalidSliceIndexError) Error() string

func (InvalidSliceIndexError) IsUserError added in v0.25.0

func (InvalidSliceIndexError) IsUserError()

type InvalidStringLengthError added in v0.24.0

type InvalidStringLengthError struct {
	Length uint64
}

func (InvalidStringLengthError) Error added in v0.24.0

func (e InvalidStringLengthError) Error() string

func (InvalidStringLengthError) IsInternalError added in v0.25.0

func (InvalidStringLengthError) IsInternalError()

type InvalidatedResourceError added in v0.20.0

type InvalidatedResourceError struct {
	LocationRange
}

InvalidatedResourceError

func (InvalidatedResourceError) Error added in v0.20.0

func (e InvalidatedResourceError) Error() string

func (InvalidatedResourceError) IsInternalError added in v0.25.0

func (InvalidatedResourceError) IsInternalError()

type InvalidatedResourceReferenceError added in v0.32.0

type InvalidatedResourceReferenceError struct {
	LocationRange
}

InvalidatedResourceReferenceError is reported when accessing a reference value that is pointing to a moved or destroyed resource.

func (InvalidatedResourceReferenceError) Error added in v0.32.0

func (InvalidatedResourceReferenceError) IsUserError added in v0.32.0

func (InvalidatedResourceReferenceError) IsUserError()

type Invocation

type Invocation struct {
	LocationRange      LocationRange
	Self               *Value
	Base               *EphemeralReferenceValue
	BoundAuthorization Authorization
	TypeParameterTypes *sema.TypeParameterTypeOrderedMap
	Interpreter        *Interpreter
	Arguments          []Value
	ArgumentTypes      []sema.Type
}

Invocation

func NewInvocation added in v0.24.0

func NewInvocation(
	interpreter *Interpreter,
	self *Value,
	base *EphemeralReferenceValue,
	boundAuth Authorization,
	arguments []Value,
	argumentTypes []sema.Type,
	typeParameterTypes *sema.TypeParameterTypeOrderedMap,
	locationRange LocationRange,
) Invocation

type IterableValue added in v0.29.0

type IterableValue interface {
	Value
	Iterator(interpreter *Interpreter, locationRange LocationRange) ValueIterator
	ForEach(
		interpreter *Interpreter,
		elementType sema.Type,
		function func(value Value) (resume bool),
		transferElements bool,
		locationRange LocationRange,
	)
}

IterableValue is a value which can be iterated over, e.g. with a for-loop

type LinkValue deprecated

type LinkValue interface {
	Value
	// contains filtered or unexported methods
}

Deprecated: LinkValue

type LocationDecoder added in v0.24.0

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

func NewLocationDecoder added in v0.24.0

func NewLocationDecoder(
	decoder *cbor.StreamDecoder,
	memoryGauge common.MemoryGauge,
) LocationDecoder

func (LocationDecoder) DecodeLocation added in v0.24.0

func (d LocationDecoder) DecodeLocation() (common.Location, error)

type LocationRange

type LocationRange struct {
	Location common.Location
	ast.HasPosition
}

LocationRange defines a range in the source of the import tree. The Position defines the script within the import tree, the Range defines the start/end position within the source of that script.

func (LocationRange) EndPosition added in v0.40.0

func (r LocationRange) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (LocationRange) ImportLocation

func (r LocationRange) ImportLocation() common.Location

func (LocationRange) StartPosition added in v0.40.0

func (r LocationRange) StartPosition() ast.Position

type MemberAccessTypeError added in v0.24.6

type MemberAccessTypeError struct {
	ExpectedType sema.Type
	ActualType   sema.Type
	LocationRange
}

MemberAccessTypeError

func (MemberAccessTypeError) Error added in v0.24.6

func (e MemberAccessTypeError) Error() string

func (MemberAccessTypeError) IsInternalError added in v0.32.0

func (MemberAccessTypeError) IsInternalError()

type MemberAccessibleValue

type MemberAccessibleValue interface {
	Value
	GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value
	RemoveMember(interpreter *Interpreter, locationRange LocationRange, name string) Value
	// returns whether a value previously existed with this name
	SetMember(interpreter *Interpreter, locationRange LocationRange, name string, value Value) bool
}

type NestedReferenceError added in v1.0.0

type NestedReferenceError struct {
	Value ReferenceValue
	LocationRange
}

NestedReferenceError

func (NestedReferenceError) Error added in v1.0.0

func (e NestedReferenceError) Error() string

func (NestedReferenceError) IsUserError added in v1.0.0

func (NestedReferenceError) IsUserError()

type NilValue

type NilValue struct{}

func (NilValue) Accept added in v0.12.0

func (v NilValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (NilValue) ByteSize added in v0.20.0

func (v NilValue) ByteSize() uint32

func (NilValue) ChildStorables added in v0.20.0

func (NilValue) ChildStorables() []atree.Storable

func (NilValue) Clone added in v0.24.0

func (v NilValue) Clone(_ *Interpreter) Value

func (NilValue) ConformsToStaticType added in v0.24.0

func (v NilValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (NilValue) DeepRemove added in v0.20.0

func (NilValue) DeepRemove(_ *Interpreter, _ bool)

func (NilValue) Destroy

func (v NilValue) Destroy(_ *Interpreter, _ LocationRange)

func (NilValue) Encode added in v0.20.0

func (v NilValue) Encode(e *atree.Encoder) error

Encode encodes the value as a CBOR nil

func (NilValue) Equal added in v0.15.0

func (v NilValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (NilValue) GetMember added in v0.9.0

func (v NilValue) GetMember(_ *Interpreter, _ LocationRange, name string) Value

func (NilValue) IsDestroyed added in v0.20.0

func (NilValue) IsDestroyed() bool

func (NilValue) IsImportable added in v0.24.0

func (NilValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (NilValue) IsResourceKinded added in v0.20.0

func (NilValue) IsResourceKinded(_ *Interpreter) bool

func (NilValue) IsStorable added in v0.16.0

func (NilValue) IsStorable() bool

func (NilValue) MeteredString added in v0.24.0

func (v NilValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (NilValue) NeedsStoreTo added in v0.20.0

func (NilValue) NeedsStoreTo(_ atree.Address) bool

func (NilValue) RecursiveString added in v0.17.0

func (v NilValue) RecursiveString(_ SeenReferences) string

func (NilValue) RemoveMember added in v0.20.0

func (NilValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (NilValue) SetMember added in v0.9.0

func (NilValue) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (NilValue) StaticType added in v0.12.0

func (NilValue) StaticType(interpreter *Interpreter) StaticType

func (NilValue) Storable added in v0.20.0

func (v NilValue) Storable(_ atree.SlabStorage, _ atree.Address, _ uint64) (atree.Storable, error)

func (NilValue) StoredValue added in v0.20.0

func (v NilValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (NilValue) String

func (NilValue) String() string

func (NilValue) Transfer added in v0.20.0

func (v NilValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (NilValue) Walk added in v0.19.0

func (NilValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type NonStorable added in v0.20.0

type NonStorable struct {
	Value Value
}

NonStorable represents a value that cannot be stored

func (NonStorable) ByteSize added in v0.20.0

func (s NonStorable) ByteSize() uint32

func (NonStorable) ChildStorables added in v0.20.0

func (NonStorable) ChildStorables() []atree.Storable

func (NonStorable) Encode added in v0.20.0

func (s NonStorable) Encode(_ *atree.Encoder) error

func (NonStorable) StoredValue added in v0.20.0

func (s NonStorable) StoredValue(_ atree.SlabStorage) (atree.Value, error)

type NonStorableStaticTypeError added in v0.20.0

type NonStorableStaticTypeError struct {
	Type sema.Type
}

NonStorableStaticTypeError

func (NonStorableStaticTypeError) Error added in v0.20.0

func (NonStorableStaticTypeError) IsUserError added in v0.25.0

func (NonStorableStaticTypeError) IsUserError()

type NonStorableValueError added in v0.20.0

type NonStorableValueError struct {
	Value Value
}

NonStorableValueError

func (NonStorableValueError) Error added in v0.20.0

func (e NonStorableValueError) Error() string

func (NonStorableValueError) IsUserError added in v0.25.0

func (NonStorableValueError) IsUserError()

type NonTransferableValueError added in v0.24.5

type NonTransferableValueError struct {
	Value Value
}

NonTransferableValueError

func (NonTransferableValueError) Error added in v0.24.5

func (NonTransferableValueError) IsUserError added in v0.25.0

func (NonTransferableValueError) IsUserError()

type NotDeclaredError

type NotDeclaredError struct {
	Name         string
	ExpectedKind common.DeclarationKind
}

func (NotDeclaredError) Error

func (e NotDeclaredError) Error() string

func (NotDeclaredError) IsUserError added in v0.25.0

func (NotDeclaredError) IsUserError()

func (NotDeclaredError) SecondaryError

func (e NotDeclaredError) SecondaryError() string

type NotInvokableError

type NotInvokableError struct {
	Value Value
}

func (NotInvokableError) Error

func (e NotInvokableError) Error() string

func (NotInvokableError) IsUserError added in v0.25.0

func (NotInvokableError) IsUserError()

type NumberValue

type NumberValue interface {
	ComparableValue
	ToInt(locationRange LocationRange) int
	Negate(*Interpreter, LocationRange) NumberValue
	Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue
	SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue
	Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue
	SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue
	Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue
	Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue
	SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue
	Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue
	SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue
	ToBigEndianBytes() []byte
}

NumberValue

type OnEventEmittedFunc

type OnEventEmittedFunc func(
	inter *Interpreter,
	locationRange LocationRange,
	event *CompositeValue,
	eventType *sema.CompositeType,
) error

OnEventEmittedFunc is a function that is triggered when an event is emitted by the program.

type OnFunctionInvocationFunc added in v0.2.0

type OnFunctionInvocationFunc func(inter *Interpreter)

OnFunctionInvocationFunc is a function that is triggered when a function is about to be invoked.

type OnInvokedFunctionReturnFunc added in v0.20.0

type OnInvokedFunctionReturnFunc func(inter *Interpreter)

OnInvokedFunctionReturnFunc is a function that is triggered when an invoked function returned.

type OnLoopIterationFunc added in v0.2.0

type OnLoopIterationFunc func(
	inter *Interpreter,
	line int,
)

OnLoopIterationFunc is a function that is triggered when a loop iteration is about to be executed.

type OnMeterComputationFunc added in v0.23.2

type OnMeterComputationFunc func(
	compKind common.ComputationKind,
	intensity uint,
)

OnMeterComputationFunc is a function that is called when some computation is about to happen. intensity captures the intensity of the computation and can be set using input sizes complexity of computation given input sizes, or any other factors that could help the upper levels to differentiate same kind of computation with different level (and time) of execution.

type OnRecordTraceFunc added in v0.23.0

type OnRecordTraceFunc func(
	inter *Interpreter,
	operationName string,
	duration time.Duration,
	attrs []attribute.KeyValue,
)

OnRecordTraceFunc is a function that records a trace.

type OnResourceOwnerChangeFunc added in v0.24.0

type OnResourceOwnerChangeFunc func(
	inter *Interpreter,
	resource *CompositeValue,
	oldOwner common.Address,
	newOwner common.Address,
)

OnResourceOwnerChangeFunc is a function that is triggered when a resource's owner changes.

type OnStatementFunc

type OnStatementFunc func(
	inter *Interpreter,
	statement ast.Statement,
)

OnStatementFunc is a function that is triggered when a statement is about to be executed.

type OptionalStaticType

type OptionalStaticType struct {
	Type StaticType
}

func NewOptionalStaticType added in v0.24.0

func NewOptionalStaticType(
	memoryGauge common.MemoryGauge,
	typ StaticType,
) *OptionalStaticType

func (*OptionalStaticType) Encode added in v0.20.0

func (t *OptionalStaticType) Encode(e *cbor.StreamEncoder) error

Encode encodes OptionalStaticType as

cbor.Tag{
		Number:  CBORTagOptionalStaticType,
		Content: StaticType(v.Type),
}

func (*OptionalStaticType) Equal added in v0.15.0

func (t *OptionalStaticType) Equal(other StaticType) bool

func (*OptionalStaticType) ID added in v0.41.0

func (t *OptionalStaticType) ID() TypeID

func (*OptionalStaticType) IsDeprecated added in v1.0.0

func (t *OptionalStaticType) IsDeprecated() bool

func (*OptionalStaticType) MeteredString added in v0.24.0

func (t *OptionalStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (*OptionalStaticType) String

func (t *OptionalStaticType) String() string

type OptionalValue

type OptionalValue interface {
	Value
	// contains filtered or unexported methods
}
var NilOptionalValue OptionalValue = NilValue{}

type OverflowError

type OverflowError struct {
	LocationRange
}

func (OverflowError) Error

func (e OverflowError) Error() string

func (OverflowError) IsUserError added in v0.25.0

func (OverflowError) IsUserError()

type OverwriteError

type OverwriteError struct {
	LocationRange
	Path    PathValue
	Address AddressValue
}

OverwriteError

func (OverwriteError) Error

func (e OverwriteError) Error() string

func (OverwriteError) IsUserError added in v0.25.0

func (OverwriteError) IsUserError()

type OwnedValue added in v1.0.0

type OwnedValue interface {
	Value
	GetOwner() common.Address
}

OwnedValue is a value which has an owner

type PathCapabilityValue deprecated added in v0.39.0

type PathCapabilityValue struct {
	BorrowType StaticType
	Path       PathValue
	// contains filtered or unexported fields
}

Deprecated: PathCapabilityValue

func NewUnmeteredPathCapabilityValue deprecated added in v0.39.0

func NewUnmeteredPathCapabilityValue(
	borrowType StaticType,
	address AddressValue,
	path PathValue,
) *PathCapabilityValue

Deprecated: NewUnmeteredPathCapabilityValue

func (*PathCapabilityValue) Accept added in v0.39.0

func (*PathCapabilityValue) Address added in v0.39.0

func (v *PathCapabilityValue) Address() AddressValue

func (*PathCapabilityValue) AddressPath added in v1.0.0

func (v *PathCapabilityValue) AddressPath() AddressPath

func (*PathCapabilityValue) ByteSize added in v0.39.0

func (v *PathCapabilityValue) ByteSize() uint32

func (*PathCapabilityValue) ChildStorables added in v0.39.0

func (v *PathCapabilityValue) ChildStorables() []atree.Storable

func (*PathCapabilityValue) Clone added in v0.39.0

func (v *PathCapabilityValue) Clone(interpreter *Interpreter) Value

func (*PathCapabilityValue) ConformsToStaticType added in v0.39.0

func (v *PathCapabilityValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (*PathCapabilityValue) DeepRemove added in v0.39.0

func (v *PathCapabilityValue) DeepRemove(interpreter *Interpreter, _ bool)

func (*PathCapabilityValue) Encode added in v0.39.0

func (v *PathCapabilityValue) Encode(e *atree.Encoder) error

Encode encodes PathCapabilityValue as

cbor.Tag{
			Number: CBORTagPathCapabilityValue,
			Content: []any{
					encodedPathCapabilityValueAddressFieldKey:    AddressValue(v.Address),
					encodedPathCapabilityValuePathFieldKey:       PathValue(v.Path),
					encodedPathCapabilityValueBorrowTypeFieldKey: StaticType(v.BorrowType),
				},
}

func (*PathCapabilityValue) Equal added in v0.39.0

func (v *PathCapabilityValue) Equal(interpreter *Interpreter, locationRange LocationRange, other Value) bool

func (*PathCapabilityValue) GetMember added in v0.39.0

func (v *PathCapabilityValue) GetMember(interpreter *Interpreter, _ LocationRange, name string) Value

func (*PathCapabilityValue) IsImportable added in v0.39.0

func (v *PathCapabilityValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (*PathCapabilityValue) IsResourceKinded added in v0.39.0

func (*PathCapabilityValue) IsResourceKinded(_ *Interpreter) bool

func (*PathCapabilityValue) IsStorable added in v0.39.0

func (*PathCapabilityValue) IsStorable() bool

func (*PathCapabilityValue) MeteredString added in v0.39.0

func (v *PathCapabilityValue) MeteredString(
	interpreter *Interpreter,
	seenReferences SeenReferences,
	locationRange LocationRange,
) string

func (*PathCapabilityValue) NeedsStoreTo added in v0.39.0

func (*PathCapabilityValue) NeedsStoreTo(_ atree.Address) bool

func (*PathCapabilityValue) RecursiveString added in v0.39.0

func (v *PathCapabilityValue) RecursiveString(seenReferences SeenReferences) string

func (*PathCapabilityValue) RemoveMember added in v0.39.0

func (*PathCapabilityValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (*PathCapabilityValue) SetMember added in v0.39.0

func (*PathCapabilityValue) StaticType added in v0.39.0

func (v *PathCapabilityValue) StaticType(inter *Interpreter) StaticType

func (*PathCapabilityValue) Storable added in v0.39.0

func (v *PathCapabilityValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint64,
) (atree.Storable, error)

func (*PathCapabilityValue) StoredValue added in v0.39.0

func (v *PathCapabilityValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (*PathCapabilityValue) String added in v0.39.0

func (v *PathCapabilityValue) String() string

func (*PathCapabilityValue) Transfer added in v0.39.0

func (v *PathCapabilityValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*PathCapabilityValue) Walk added in v0.39.0

func (v *PathCapabilityValue) Walk(_ *Interpreter, walkChild func(Value), _ LocationRange)

type PathLinkValue deprecated added in v0.30.0

type PathLinkValue struct {
	Type       StaticType
	TargetPath PathValue
}

Deprecated: PathLinkValue

func (PathLinkValue) Accept added in v0.30.0

func (v PathLinkValue) Accept(_ *Interpreter, _ Visitor, _ LocationRange)

func (PathLinkValue) ByteSize added in v0.30.0

func (v PathLinkValue) ByteSize() uint32

func (PathLinkValue) ChildStorables added in v0.30.0

func (v PathLinkValue) ChildStorables() []atree.Storable

func (PathLinkValue) Clone added in v0.30.0

func (v PathLinkValue) Clone(inter *Interpreter) Value

func (PathLinkValue) ConformsToStaticType added in v0.30.0

func (v PathLinkValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (PathLinkValue) DeepRemove added in v0.30.0

func (PathLinkValue) DeepRemove(_ *Interpreter, _ bool)

func (PathLinkValue) Encode added in v0.30.0

func (v PathLinkValue) Encode(e *atree.Encoder) error

Encode encodes PathLinkValue as

cbor.Tag{
			Number: CBORTagPathLinkValue,
			Content: []any{
				encodedPathLinkValueTargetPathFieldKey: PathValue(v.TargetPath),
				encodedPathLinkValueTypeFieldKey:       StaticType(v.Type),
			},
}

func (PathLinkValue) Equal added in v0.30.0

func (v PathLinkValue) Equal(interpreter *Interpreter, locationRange LocationRange, other Value) bool

func (PathLinkValue) IsImportable added in v0.30.0

func (PathLinkValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (PathLinkValue) IsResourceKinded added in v0.30.0

func (PathLinkValue) IsResourceKinded(_ *Interpreter) bool

func (PathLinkValue) IsStorable added in v0.30.0

func (PathLinkValue) IsStorable() bool

func (PathLinkValue) MeteredString added in v0.30.0

func (v PathLinkValue) MeteredString(_ *Interpreter, _ SeenReferences, _ LocationRange) string

func (PathLinkValue) NeedsStoreTo added in v0.30.0

func (PathLinkValue) NeedsStoreTo(_ atree.Address) bool

func (PathLinkValue) RecursiveString added in v0.30.0

func (v PathLinkValue) RecursiveString(seenReferences SeenReferences) string

func (PathLinkValue) StaticType added in v0.30.0

func (v PathLinkValue) StaticType(interpreter *Interpreter) StaticType

func (PathLinkValue) Storable added in v0.30.0

func (v PathLinkValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint64) (atree.Storable, error)

func (PathLinkValue) StoredValue added in v0.30.0

func (v PathLinkValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (PathLinkValue) String added in v0.30.0

func (v PathLinkValue) String() string

func (PathLinkValue) Transfer added in v0.30.0

func (v PathLinkValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (PathLinkValue) Walk added in v0.30.0

func (v PathLinkValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type PathValue

type PathValue struct {
	Identifier string
	Domain     common.PathDomain
}

func NewPathValue added in v0.24.0

func NewPathValue(
	memoryGauge common.MemoryGauge,
	domain common.PathDomain,
	identifier string,
) PathValue

func NewUnmeteredPathValue added in v0.24.0

func NewUnmeteredPathValue(domain common.PathDomain, identifier string) PathValue

func (PathValue) Accept added in v0.12.0

func (v PathValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (PathValue) ByteSize added in v0.20.0

func (v PathValue) ByteSize() uint32

func (PathValue) ChildStorables added in v0.20.0

func (PathValue) ChildStorables() []atree.Storable

func (PathValue) Clone added in v0.24.0

func (v PathValue) Clone(_ *Interpreter) Value

func (PathValue) ConformsToStaticType added in v0.24.0

func (v PathValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (PathValue) DeepRemove added in v0.20.0

func (PathValue) DeepRemove(_ *Interpreter, _ bool)

func (PathValue) Encode added in v0.20.0

func (v PathValue) Encode(e *atree.Encoder) error

Encode encodes PathValue as

cbor.Tag{
			Number: CBORTagPathValue,
			Content: []any{
				encodedPathValueDomainFieldKey:     uint(v.Domain),
				encodedPathValueIdentifierFieldKey: string(v.Identifier),
			},
}

func (PathValue) Equal added in v0.15.0

func (v PathValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (PathValue) GetMember added in v0.20.0

func (v PathValue) GetMember(inter *Interpreter, locationRange LocationRange, name string) Value

func (PathValue) HashInput added in v0.20.0

func (v PathValue) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypePath (1 byte) - domain (1 byte) - identifier (n bytes)

func (PathValue) IsImportable added in v0.24.0

func (v PathValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (PathValue) IsResourceKinded added in v0.20.0

func (PathValue) IsResourceKinded(_ *Interpreter) bool

func (PathValue) IsStorable added in v0.16.0

func (PathValue) IsStorable() bool

func (PathValue) MeteredString added in v0.24.0

func (v PathValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (PathValue) NeedsStoreTo added in v0.20.0

func (PathValue) NeedsStoreTo(_ atree.Address) bool

func (PathValue) RecursiveString added in v0.17.0

func (v PathValue) RecursiveString(_ SeenReferences) string

func (PathValue) RemoveMember added in v0.20.0

func (PathValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (PathValue) SetMember added in v0.20.0

func (PathValue) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (PathValue) StaticType added in v0.12.0

func (v PathValue) StaticType(interpreter *Interpreter) StaticType

func (PathValue) Storable added in v0.20.0

func (v PathValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint64,
) (atree.Storable, error)

func (PathValue) StoredValue added in v0.20.0

func (v PathValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (PathValue) String

func (v PathValue) String() string

func (PathValue) Transfer added in v0.20.0

func (v PathValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (PathValue) Walk added in v0.19.0

func (PathValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type PositionedError added in v0.12.1

type PositionedError struct {
	Err error
	ast.Range
}

PositionedError wraps an unpositioned error with position info

func (PositionedError) Error added in v0.12.1

func (e PositionedError) Error() string

func (PositionedError) IsUserError added in v0.25.0

func (PositionedError) IsUserError()

func (PositionedError) Unwrap added in v0.12.1

func (e PositionedError) Unwrap() error

type PrimitiveStaticType added in v0.2.0

type PrimitiveStaticType uint
const (
	PrimitiveStaticTypeUnknown PrimitiveStaticType = iota
	PrimitiveStaticTypeVoid
	PrimitiveStaticTypeAny
	PrimitiveStaticTypeNever
	PrimitiveStaticTypeAnyStruct
	PrimitiveStaticTypeAnyResource
	PrimitiveStaticTypeBool
	PrimitiveStaticTypeAddress
	PrimitiveStaticTypeString
	PrimitiveStaticTypeCharacter
	PrimitiveStaticTypeMetaType
	PrimitiveStaticTypeBlock
	PrimitiveStaticTypeAnyResourceAttachment
	PrimitiveStaticTypeAnyStructAttachment
	PrimitiveStaticTypeHashableStruct

	// Number
	PrimitiveStaticTypeNumber
	PrimitiveStaticTypeSignedNumber

	// Integer
	PrimitiveStaticTypeInteger
	PrimitiveStaticTypeSignedInteger
	PrimitiveStaticTypeFixedSizeUnsignedInteger

	// FixedPoint
	PrimitiveStaticTypeFixedPoint
	PrimitiveStaticTypeSignedFixedPoint

	// Int*
	PrimitiveStaticTypeInt
	PrimitiveStaticTypeInt8
	PrimitiveStaticTypeInt16
	PrimitiveStaticTypeInt32
	PrimitiveStaticTypeInt64
	PrimitiveStaticTypeInt128
	PrimitiveStaticTypeInt256

	// UInt*
	PrimitiveStaticTypeUInt
	PrimitiveStaticTypeUInt8
	PrimitiveStaticTypeUInt16
	PrimitiveStaticTypeUInt32
	PrimitiveStaticTypeUInt64
	PrimitiveStaticTypeUInt128
	PrimitiveStaticTypeUInt256

	PrimitiveStaticTypeWord8
	PrimitiveStaticTypeWord16
	PrimitiveStaticTypeWord32
	PrimitiveStaticTypeWord64
	PrimitiveStaticTypeWord128
	PrimitiveStaticTypeWord256

	PrimitiveStaticTypeFix64

	PrimitiveStaticTypeUFix64

	PrimitiveStaticTypePath
	PrimitiveStaticTypeCapability
	PrimitiveStaticTypeStoragePath
	PrimitiveStaticTypeCapabilityPath
	PrimitiveStaticTypePublicPath
	PrimitiveStaticTypePrivatePath

	// Deprecated: PrimitiveStaticTypeAuthAccount only exists for migration purposes.
	PrimitiveStaticTypeAuthAccount
	// Deprecated: PrimitiveStaticTypePublicAccount only exists for migration purposes.
	PrimitiveStaticTypePublicAccount
	PrimitiveStaticTypeDeployedContract
	// Deprecated: PrimitiveStaticTypeAuthAccountContracts only exists for migration purposes.
	PrimitiveStaticTypeAuthAccountContracts
	// Deprecated: PrimitiveStaticTypePublicAccountContracts only exists for migration purposes.
	PrimitiveStaticTypePublicAccountContracts
	// Deprecated: PrimitiveStaticTypeAuthAccountKeys only exists for migration purposes.
	PrimitiveStaticTypeAuthAccountKeys
	// Deprecated: PrimitiveStaticTypePublicAccountKeys only exists for migration purposes.
	PrimitiveStaticTypePublicAccountKeys
	// Deprecated: PrimitiveStaticTypeAccountKey only exists for migration purposes
	PrimitiveStaticTypeAccountKey
	// Deprecated: PrimitiveStaticTypeAuthAccountInbox only exists for migration purposes.
	PrimitiveStaticTypeAuthAccountInbox
	PrimitiveStaticTypeStorageCapabilityController
	PrimitiveStaticTypeAccountCapabilityController
	// Deprecated: PrimitiveStaticTypeAuthAccountStorageCapabilities only exists for migration purposes.
	PrimitiveStaticTypeAuthAccountStorageCapabilities
	// Deprecated: PrimitiveStaticTypeAuthAccountAccountCapabilities only exists for migration purposes.
	PrimitiveStaticTypeAuthAccountAccountCapabilities
	// Deprecated: PrimitiveStaticTypeAuthAccountCapabilities only exists for migration purposes.
	PrimitiveStaticTypeAuthAccountCapabilities
	// Deprecated: PrimitiveStaticTypePublicAccountCapabilities only exists for migration purposes.
	PrimitiveStaticTypePublicAccountCapabilities
	PrimitiveStaticTypeAccount
	PrimitiveStaticTypeAccount_Contracts
	PrimitiveStaticTypeAccount_Keys
	PrimitiveStaticTypeAccount_Inbox
	PrimitiveStaticTypeAccount_StorageCapabilities
	PrimitiveStaticTypeAccount_AccountCapabilities
	PrimitiveStaticTypeAccount_Capabilities
	PrimitiveStaticTypeAccount_Storage

	PrimitiveStaticTypeMutate
	PrimitiveStaticTypeInsert
	PrimitiveStaticTypeRemove
	PrimitiveStaticTypeIdentity

	PrimitiveStaticTypeStorage
	PrimitiveStaticTypeSaveValue
	PrimitiveStaticTypeLoadValue
	PrimitiveStaticTypeCopyValue
	PrimitiveStaticTypeBorrowValue
	PrimitiveStaticTypeContracts
	PrimitiveStaticTypeAddContract
	PrimitiveStaticTypeUpdateContract
	PrimitiveStaticTypeRemoveContract
	PrimitiveStaticTypeKeys
	PrimitiveStaticTypeAddKey
	PrimitiveStaticTypeRevokeKey
	PrimitiveStaticTypeInbox
	PrimitiveStaticTypePublishInboxCapability
	PrimitiveStaticTypeUnpublishInboxCapability
	PrimitiveStaticTypeClaimInboxCapability
	PrimitiveStaticTypeCapabilities
	PrimitiveStaticTypeStorageCapabilities
	PrimitiveStaticTypeAccountCapabilities
	PrimitiveStaticTypePublishCapability
	PrimitiveStaticTypeUnpublishCapability
	PrimitiveStaticTypeGetStorageCapabilityController
	PrimitiveStaticTypeIssueStorageCapabilityController
	PrimitiveStaticTypeGetAccountCapabilityController
	PrimitiveStaticTypeIssueAccountCapabilityController
	PrimitiveStaticTypeCapabilitiesMapping
	PrimitiveStaticTypeAccountMapping

	// !!! *WARNING* !!!
	// ADD NEW TYPES *BEFORE* THIS WARNING.
	// DO *NOT* ADD NEW TYPES AFTER THIS LINE!
	PrimitiveStaticType_Count
)

!!! *WARNING* !!!

Only add new types by: - replacing existing placeholders (`_`) with new types - appending new types

Only remove types by: - replace existing types with a placeholder `_`

DO *NOT* REPLACE EXISTING TYPES! DO *NOT* ADD NEW TYPES IN BETWEEN!

NOTE: The following types are not primitive types, but CompositeType-s - HashAlgorithm - SigningAlgorithm - AccountKey - PublicKey

func ConvertSemaToPrimitiveStaticType added in v0.2.0

func ConvertSemaToPrimitiveStaticType(
	memoryGauge common.MemoryGauge,
	t sema.Type,
) (typ PrimitiveStaticType)

ConvertSemaToPrimitiveStaticType converts a `sema.Type` to a `PrimitiveStaticType`.

Returns `PrimitiveStaticTypeUnknown` if the given type is not a primitive type.

func NewPrimitiveStaticType added in v0.24.0

func NewPrimitiveStaticType(
	memoryGauge common.MemoryGauge,
	staticType PrimitiveStaticType,
) PrimitiveStaticType

func PrimitiveStaticTypeFromTypeID added in v1.0.0

func PrimitiveStaticTypeFromTypeID(typeID TypeID) PrimitiveStaticType

func (PrimitiveStaticType) Encode added in v0.20.0

func (t PrimitiveStaticType) Encode(e *cbor.StreamEncoder) error

Encode encodes PrimitiveStaticType as

cbor.Tag{
		Number:  CBORTagPrimitiveStaticType,
		Content: uint(v),
}

func (PrimitiveStaticType) Equal added in v0.15.0

func (t PrimitiveStaticType) Equal(other StaticType) bool

func (PrimitiveStaticType) ID added in v0.41.0

func (t PrimitiveStaticType) ID() TypeID

func (PrimitiveStaticType) IsDefined added in v1.0.0

func (t PrimitiveStaticType) IsDefined() bool

func (PrimitiveStaticType) IsDeprecated deprecated added in v1.0.0

func (t PrimitiveStaticType) IsDeprecated() bool

Deprecated: IsDeprecated only exists for migration purposes.

func (PrimitiveStaticType) MeteredString added in v0.24.0

func (t PrimitiveStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (PrimitiveStaticType) SemaType added in v0.2.0

func (t PrimitiveStaticType) SemaType() sema.Type

func (PrimitiveStaticType) String added in v0.2.0

func (i PrimitiveStaticType) String() string

type Program added in v0.13.0

type Program struct {
	Program     *ast.Program
	Elaboration *sema.Elaboration
}

func ProgramFromChecker added in v0.13.0

func ProgramFromChecker(checker *sema.Checker) *Program

type PublicKeyValidationHandlerFunc added in v0.16.0

type PublicKeyValidationHandlerFunc func(
	interpreter *Interpreter,
	locationRange LocationRange,
	publicKey *CompositeValue,
) error

PublicKeyValidationHandlerFunc is a function that validates a given public key. Parameter types: - publicKey: PublicKey

type PublishedValue added in v0.29.0

type PublishedValue struct {
	// NB: If `publish` and `claim` are ever extended to support arbitrary values, rather than just capabilities,
	// this will need to be changed to `Value`, and more storage-related operations must be implemented for `PublishedValue`
	Value     CapabilityValue
	Recipient AddressValue
}

func NewPublishedValue added in v0.29.0

func NewPublishedValue(memoryGauge common.MemoryGauge, recipient AddressValue, value CapabilityValue) *PublishedValue

func (*PublishedValue) Accept added in v0.29.0

func (v *PublishedValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (*PublishedValue) ByteSize added in v0.29.0

func (v *PublishedValue) ByteSize() uint32

func (*PublishedValue) ChildStorables added in v0.29.0

func (v *PublishedValue) ChildStorables() []atree.Storable

func (*PublishedValue) Clone added in v0.29.0

func (v *PublishedValue) Clone(interpreter *Interpreter) Value

func (*PublishedValue) ConformsToStaticType added in v0.29.0

func (v *PublishedValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (*PublishedValue) DeepRemove added in v0.29.0

func (*PublishedValue) DeepRemove(_ *Interpreter, _ bool)

func (*PublishedValue) Encode added in v0.29.0

func (v *PublishedValue) Encode(e *atree.Encoder) error

Encode encodes PublishedValue as

cbor.Tag{
			Number: CBORTagPublishedValue,
			Content: []any{
				encodedPublishedValueRecipientFieldKey: AddressValue(v.Recipient),
				encodedPublishedValueValueFieldKey:     v.Value,
			},
}

func (*PublishedValue) Equal added in v0.29.0

func (v *PublishedValue) Equal(interpreter *Interpreter, locationRange LocationRange, other Value) bool

func (*PublishedValue) IsImportable added in v0.29.0

func (*PublishedValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (*PublishedValue) IsResourceKinded added in v0.29.0

func (*PublishedValue) IsResourceKinded(_ *Interpreter) bool

func (*PublishedValue) IsStorable added in v0.29.0

func (*PublishedValue) IsStorable() bool

func (*PublishedValue) MeteredString added in v0.29.0

func (v *PublishedValue) MeteredString(interpreter *Interpreter, seenReferences SeenReferences, locationRange LocationRange) string

func (*PublishedValue) NeedsStoreTo added in v0.29.0

func (v *PublishedValue) NeedsStoreTo(address atree.Address) bool

func (*PublishedValue) RecursiveString added in v0.29.0

func (v *PublishedValue) RecursiveString(seenReferences SeenReferences) string

func (*PublishedValue) StaticType added in v0.29.0

func (v *PublishedValue) StaticType(interpreter *Interpreter) StaticType

func (*PublishedValue) Storable added in v0.29.0

func (v *PublishedValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint64) (atree.Storable, error)

func (*PublishedValue) StoredValue added in v0.29.0

func (v *PublishedValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (*PublishedValue) String added in v0.29.0

func (v *PublishedValue) String() string

func (*PublishedValue) Transfer added in v0.29.0

func (v *PublishedValue) Transfer(
	interpreter *Interpreter,
	locationRange LocationRange,
	address atree.Address,
	remove bool,
	storable atree.Storable,
	preventTransfer map[atree.ValueID]struct{},
	hasNoParentContainer bool,
) Value

func (*PublishedValue) Walk added in v0.29.0

func (v *PublishedValue) Walk(_ *Interpreter, walkChild func(Value), _ LocationRange)

type RecursiveTransferError added in v0.39.14

type RecursiveTransferError struct {
	LocationRange
}

RecursiveTransferError

func (RecursiveTransferError) Error added in v0.39.14

func (RecursiveTransferError) IsUserError added in v0.39.14

func (RecursiveTransferError) IsUserError()

type RedeclarationError

type RedeclarationError struct {
	Name string
}

func (RedeclarationError) Error

func (e RedeclarationError) Error() string

func (RedeclarationError) IsUserError added in v0.25.0

func (RedeclarationError) IsUserError()

type ReferenceStaticType

type ReferenceStaticType struct {
	Authorization Authorization
	// ReferencedType is type of the referenced value (the type of the target)
	ReferencedType        StaticType
	HasLegacyIsAuthorized bool
	LegacyIsAuthorized    bool
}

func ConvertSemaReferenceTypeToStaticReferenceType added in v0.24.0

func ConvertSemaReferenceTypeToStaticReferenceType(
	memoryGauge common.MemoryGauge,
	t *sema.ReferenceType,
) *ReferenceStaticType

func NewReferenceStaticType added in v0.24.0

func NewReferenceStaticType(
	memoryGauge common.MemoryGauge,
	authorization Authorization,
	referencedType StaticType,
) *ReferenceStaticType

func (*ReferenceStaticType) Encode added in v0.20.0

func (t *ReferenceStaticType) Encode(e *cbor.StreamEncoder) error

Encode encodes ReferenceStaticType as

cbor.Tag{
		Number: CBORTagReferenceStaticType,
		Content: cborArray{
				encodedReferenceStaticTypeAuthorizationFieldKey: v.Authorization,
				encodedReferenceStaticTypeTypeFieldKey:          StaticType(v.Type),
		},
	}

func (*ReferenceStaticType) Equal added in v0.15.0

func (t *ReferenceStaticType) Equal(other StaticType) bool

func (*ReferenceStaticType) ID added in v0.41.0

func (t *ReferenceStaticType) ID() TypeID

func (*ReferenceStaticType) IsDeprecated added in v1.0.0

func (t *ReferenceStaticType) IsDeprecated() bool

func (*ReferenceStaticType) MeteredString added in v0.24.0

func (t *ReferenceStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (*ReferenceStaticType) String

func (t *ReferenceStaticType) String() string

type ReferenceTrackedResourceKindedValue added in v0.21.0

type ReferenceTrackedResourceKindedValue interface {
	ResourceKindedValue
	IsReferenceTrackedResourceKindedValue()
	ValueID() atree.ValueID
	IsStaleResource(*Interpreter) bool
}

ReferenceTrackedResourceKindedValue is a resource-kinded value that must be tracked when a reference of it is taken.

type ReferenceValue added in v0.31.6

type ReferenceValue interface {
	Value
	AuthorizedValue

	ReferencedValue(interpreter *Interpreter, locationRange LocationRange, errorOnFailedDereference bool) *Value
	BorrowType() sema.Type
	// contains filtered or unexported methods
}

type ReferencedResourceKindedValues added in v0.21.0

type ReferencedResourceKindedValues map[atree.ValueID]map[*EphemeralReferenceValue]struct{}

type ReferencedValueChangedError added in v1.0.0

type ReferencedValueChangedError struct {
	LocationRange
}

ReferencedValueChangedError

func (ReferencedValueChangedError) Error added in v1.0.0

func (ReferencedValueChangedError) IsUserError added in v1.0.0

func (ReferencedValueChangedError) IsUserError()

type ResourceConstructionError added in v0.19.0

type ResourceConstructionError struct {
	CompositeType *sema.CompositeType
	LocationRange
}

ResourceConstructionError

func (ResourceConstructionError) Error added in v0.19.0

func (ResourceConstructionError) IsInternalError added in v0.32.0

func (ResourceConstructionError) IsInternalError()

type ResourceKindedValue added in v0.20.0

type ResourceKindedValue interface {
	Value
	Destroy(interpreter *Interpreter, locationRange LocationRange)
	IsDestroyed() bool
	// contains filtered or unexported methods
}

type ResourceLossError added in v0.42.9

type ResourceLossError struct {
	LocationRange
}

ResourceLossError

func (ResourceLossError) Error added in v0.42.9

func (e ResourceLossError) Error() string

func (ResourceLossError) IsUserError added in v0.42.9

func (ResourceLossError) IsUserError()

type ResourceReferenceDereferenceError added in v1.0.0

type ResourceReferenceDereferenceError struct {
	LocationRange
}

ResourceReferenceDereferenceError

func (ResourceReferenceDereferenceError) Error added in v1.0.0

func (ResourceReferenceDereferenceError) IsInternalError added in v1.0.0

func (ResourceReferenceDereferenceError) IsInternalError()

type ReturnResult added in v0.27.0

type ReturnResult struct {
	Value
}

type SeenReferences added in v0.19.0

type SeenReferences map[*EphemeralReferenceValue]struct{}

SeenReferences is a set of seen references.

NOTE: Do not generalize to map[interpreter.Value], as not all values are Go hashable, i.e. this might lead to run-time panics

type SelfVariable added in v1.0.0

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

func (*SelfVariable) GetValue added in v1.0.0

func (v *SelfVariable) GetValue(interpreter *Interpreter) Value

func (*SelfVariable) InitializeWithGetter added in v1.0.0

func (v *SelfVariable) InitializeWithGetter(func() Value)

func (*SelfVariable) InitializeWithValue added in v1.0.0

func (v *SelfVariable) InitializeWithValue(Value)

func (*SelfVariable) SetValue added in v1.0.0

func (v *SelfVariable) SetValue(*Interpreter, LocationRange, Value)

type SharedState added in v0.30.0

type SharedState struct {
	Config *Config

	CapabilityControllerIterations              map[AddressPath]int
	MutationDuringCapabilityControllerIteration bool
	// contains filtered or unexported fields
}

func NewSharedState added in v0.30.0

func NewSharedState(config *Config) *SharedState

type SimpleCompositeValue added in v0.20.0

type SimpleCompositeValue struct {
	Fields       map[string]Value
	ComputeField func(name string, interpreter *Interpreter, locationRange LocationRange) Value

	TypeID sema.TypeID
	// FieldNames are the names of the field members (i.e. not functions, and not computed fields), in order
	FieldNames []string
	// contains filtered or unexported fields
}

func NewAccountAccountCapabilitiesValue added in v1.0.0

func NewAccountAccountCapabilitiesValue(
	gauge common.MemoryGauge,
	address AddressValue,
	getControllerFunction BoundFunctionGenerator,
	getControllersFunction BoundFunctionGenerator,
	forEachControllerFunction BoundFunctionGenerator,
	issueFunction BoundFunctionGenerator,
	issueWithTypeFunction BoundFunctionGenerator,
) *SimpleCompositeValue

func NewAccountKeyValue added in v0.14.0

func NewAccountKeyValue(
	inter *Interpreter,
	keyIndex IntValue,
	publicKey *CompositeValue,
	hashAlgo Value,
	weight UFix64Value,
	isRevoked BoolValue,
) *SimpleCompositeValue

NewAccountKeyValue constructs an AccountKey value.

func NewBlockValue added in v0.20.0

func NewBlockValue(
	inter *Interpreter,
	height UInt64Value,
	view UInt64Value,
	id *ArrayValue,
	timestamp UFix64Value,
) *SimpleCompositeValue

func NewDeployedContractValue added in v0.20.0

func NewDeployedContractValue(
	inter *Interpreter,
	address AddressValue,
	name *StringValue,
	code *ArrayValue,
) *SimpleCompositeValue

func NewSimpleCompositeValue added in v0.20.0

func NewSimpleCompositeValue(
	gauge common.MemoryGauge,
	typeID sema.TypeID,
	staticType StaticType,
	fieldNames []string,
	fields map[string]Value,
	computeField func(name string, interpreter *Interpreter, locationRange LocationRange) Value,
	fieldFormatters map[string]func(common.MemoryGauge, Value, SeenReferences) string,
	stringer func(*Interpreter, SeenReferences, LocationRange) string,
) *SimpleCompositeValue

func (*SimpleCompositeValue) Accept added in v0.20.0

func (v *SimpleCompositeValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (*SimpleCompositeValue) Clone added in v0.24.0

func (v *SimpleCompositeValue) Clone(interpreter *Interpreter) Value

func (*SimpleCompositeValue) ConformsToStaticType added in v0.24.0

func (v *SimpleCompositeValue) ConformsToStaticType(
	interpreter *Interpreter,
	locationRange LocationRange,
	results TypeConformanceResults,
) bool

func (*SimpleCompositeValue) DeepRemove added in v0.20.0

func (v *SimpleCompositeValue) DeepRemove(_ *Interpreter, _ bool)

func (*SimpleCompositeValue) ForEachField added in v0.20.0

func (v *SimpleCompositeValue) ForEachField(
	f func(fieldName string, fieldValue Value) (resume bool),
)

ForEachField iterates over all field-name field-value pairs of the composite value. It does NOT iterate over computed fields and functions!

func (*SimpleCompositeValue) GetMember added in v0.20.0

func (v *SimpleCompositeValue) GetMember(
	interpreter *Interpreter,
	locationRange LocationRange,
	name string,
) Value

func (*SimpleCompositeValue) IsImportable added in v0.24.0

func (v *SimpleCompositeValue) IsImportable(inter *Interpreter, locationRange LocationRange) bool

func (*SimpleCompositeValue) IsResourceKinded added in v0.20.0

func (v *SimpleCompositeValue) IsResourceKinded(_ *Interpreter) bool

func (*SimpleCompositeValue) MeteredString added in v0.24.0

func (v *SimpleCompositeValue) MeteredString(interpreter *Interpreter, seenReferences SeenReferences, locationRange LocationRange) string

func (*SimpleCompositeValue) NeedsStoreTo added in v0.20.0

func (*SimpleCompositeValue) NeedsStoreTo(_ atree.Address) bool

func (*SimpleCompositeValue) RecursiveString added in v0.20.0

func (v *SimpleCompositeValue) RecursiveString(seenReferences SeenReferences) string

func (*SimpleCompositeValue) RemoveMember added in v0.20.0

func (v *SimpleCompositeValue) RemoveMember(_ *Interpreter, _ LocationRange, name string) Value

func (*SimpleCompositeValue) SetMember added in v0.20.0

func (v *SimpleCompositeValue) SetMember(_ *Interpreter, _ LocationRange, name string, value Value) bool

func (*SimpleCompositeValue) StaticType added in v0.20.0

func (v *SimpleCompositeValue) StaticType(_ *Interpreter) StaticType

func (*SimpleCompositeValue) Storable added in v0.20.0

func (*SimpleCompositeValue) String added in v0.20.0

func (v *SimpleCompositeValue) String() string

func (*SimpleCompositeValue) Transfer added in v0.20.0

func (v *SimpleCompositeValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*SimpleCompositeValue) Walk added in v0.20.0

func (v *SimpleCompositeValue) Walk(_ *Interpreter, walkChild func(Value), _ LocationRange)

Walk iterates over all field values of the composite value. It does NOT walk the computed fields and functions!

type SimpleVariable added in v1.0.0

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

func (*SimpleVariable) GetValue added in v1.0.0

func (v *SimpleVariable) GetValue(*Interpreter) Value

func (*SimpleVariable) InitializeWithGetter added in v1.0.0

func (v *SimpleVariable) InitializeWithGetter(getter func() Value)

func (*SimpleVariable) InitializeWithValue added in v1.0.0

func (v *SimpleVariable) InitializeWithValue(value Value)

func (*SimpleVariable) SetValue added in v1.0.0

func (v *SimpleVariable) SetValue(interpreter *Interpreter, locationRange LocationRange, value Value)

type SomeStorable added in v0.20.0

type SomeStorable struct {
	Storable atree.Storable
	// contains filtered or unexported fields
}

func (SomeStorable) ByteSize added in v0.20.0

func (s SomeStorable) ByteSize() uint32

func (SomeStorable) ChildStorables added in v0.20.0

func (s SomeStorable) ChildStorables() []atree.Storable

func (SomeStorable) Encode added in v0.20.0

func (s SomeStorable) Encode(e *atree.Encoder) error

func (SomeStorable) HasPointer added in v1.0.0

func (s SomeStorable) HasPointer() bool

func (SomeStorable) StoredValue added in v0.20.0

func (s SomeStorable) StoredValue(storage atree.SlabStorage) (atree.Value, error)

type SomeValue

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

func NewSomeValueNonCopying added in v0.20.0

func NewSomeValueNonCopying(memoryGauge common.MemoryGauge, value Value) *SomeValue

func NewUnmeteredSomeValueNonCopying added in v0.24.0

func NewUnmeteredSomeValueNonCopying(value Value) *SomeValue

func (*SomeValue) Accept added in v0.12.0

func (v *SomeValue) Accept(interpreter *Interpreter, visitor Visitor, locationRange LocationRange)

func (*SomeValue) Clone added in v0.24.0

func (v *SomeValue) Clone(interpreter *Interpreter) Value

func (*SomeValue) ConformsToStaticType added in v0.24.0

func (v *SomeValue) ConformsToStaticType(
	interpreter *Interpreter,
	locationRange LocationRange,
	results TypeConformanceResults,
) bool

func (*SomeValue) DeepRemove added in v0.20.0

func (v *SomeValue) DeepRemove(interpreter *Interpreter, hasNoParentContainer bool)

func (*SomeValue) Destroy

func (v *SomeValue) Destroy(interpreter *Interpreter, locationRange LocationRange)

func (*SomeValue) Equal added in v0.15.0

func (v *SomeValue) Equal(interpreter *Interpreter, locationRange LocationRange, other Value) bool

func (*SomeValue) GetMember added in v0.9.0

func (v *SomeValue) GetMember(interpreter *Interpreter, _ LocationRange, name string) Value

func (*SomeValue) InnerValue added in v0.24.0

func (v *SomeValue) InnerValue(_ *Interpreter, _ LocationRange) Value

func (*SomeValue) IsDestroyed added in v0.20.0

func (v *SomeValue) IsDestroyed() bool

func (*SomeValue) IsImportable added in v0.24.0

func (v *SomeValue) IsImportable(inter *Interpreter, locationRange LocationRange) bool

func (*SomeValue) IsResourceKinded added in v0.20.0

func (v *SomeValue) IsResourceKinded(interpreter *Interpreter) bool

func (*SomeValue) MeteredString added in v0.24.0

func (v *SomeValue) MeteredString(interpreter *Interpreter, seenReferences SeenReferences, locationRange LocationRange) string

func (*SomeValue) NeedsStoreTo added in v0.20.0

func (v *SomeValue) NeedsStoreTo(address atree.Address) bool

func (*SomeValue) RecursiveString added in v0.17.0

func (v *SomeValue) RecursiveString(seenReferences SeenReferences) string

func (*SomeValue) RemoveMember added in v0.20.0

func (v *SomeValue) RemoveMember(interpreter *Interpreter, locationRange LocationRange, _ string) Value

func (*SomeValue) SetMember added in v0.9.0

func (v *SomeValue) SetMember(interpreter *Interpreter, locationRange LocationRange, _ string, _ Value) bool

func (*SomeValue) StaticType added in v0.12.0

func (v *SomeValue) StaticType(inter *Interpreter) StaticType

func (*SomeValue) Storable added in v0.20.0

func (v *SomeValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint64,
) (atree.Storable, error)

func (*SomeValue) String

func (v *SomeValue) String() string

func (*SomeValue) Transfer added in v0.20.0

func (v *SomeValue) Transfer(
	interpreter *Interpreter,
	locationRange LocationRange,
	address atree.Address,
	remove bool,
	storable atree.Storable,
	preventTransfer map[atree.ValueID]struct{},
	hasNoParentContainer bool,
) Value

func (*SomeValue) Walk added in v0.19.0

func (v *SomeValue) Walk(_ *Interpreter, walkChild func(Value), _ LocationRange)

type StackTraceError added in v0.25.0

type StackTraceError struct {
	LocationRange
}

func (StackTraceError) Error added in v0.25.0

func (e StackTraceError) Error() string

func (StackTraceError) ImportLocation added in v0.25.0

func (e StackTraceError) ImportLocation() common.Location

func (StackTraceError) Prefix added in v0.25.0

func (e StackTraceError) Prefix() string

type StatementResult added in v0.27.0

type StatementResult interface {
	// contains filtered or unexported methods
}

type StaticAuthorizationConversionHandler added in v1.0.0

type StaticAuthorizationConversionHandler interface {
	GetEntitlementType(typeID TypeID) (*sema.EntitlementType, error)
	GetEntitlementMapType(typeID TypeID) (*sema.EntitlementMapType, error)
}

type StaticType

type StaticType interface {
	fmt.Stringer

	Equal(other StaticType) bool
	Encode(e *cbor.StreamEncoder) error
	MeteredString(memoryGauge common.MemoryGauge) string
	ID() TypeID
	IsDeprecated() bool
	// contains filtered or unexported methods
}

StaticType is a shallow representation of a static type (`sema.Type`) which doesn't contain the full information, but only refers to composite and interface types by ID.

This allows static types to be efficiently serialized and deserialized, for example in the world state.

func ConvertSemaToStaticType

func ConvertSemaToStaticType(memoryGauge common.MemoryGauge, t sema.Type) StaticType

type StaticTypeConversionHandler added in v1.0.0

type StaticTypeConversionHandler interface {
	StaticAuthorizationConversionHandler
	GetInterfaceType(location common.Location, qualifiedIdentifier string, typeID TypeID) (*sema.InterfaceType, error)
	GetCompositeType(location common.Location, qualifiedIdentifier string, typeID TypeID) (*sema.CompositeType, error)
}

type Stop added in v0.24.0

type Stop struct {
	Interpreter *Interpreter
	Statement   ast.Statement
}

type StorableDecoder added in v0.24.0

type StorableDecoder struct {
	TypeDecoder
	// contains filtered or unexported fields
}

func NewStorableDecoder added in v0.24.0

func NewStorableDecoder(
	decoder *cbor.StreamDecoder,
	slabID atree.SlabID,
	inlinedExtraData []atree.ExtraData,
	memoryGauge common.MemoryGauge,
) StorableDecoder

type Storage added in v0.20.0

type Storage interface {
	atree.SlabStorage
	GetStorageMap(address common.Address, domain string, createIfNotExists bool) *StorageMap
	CheckHealth() error
}

type StorageCapabilityControllerValue added in v0.39.0

type StorageCapabilityControllerValue struct {
	BorrowType   *ReferenceStaticType
	CapabilityID UInt64Value
	TargetPath   PathValue

	// Injected functions.
	// Tags are not stored directly inside the controller
	// to avoid unnecessary storage reads
	// when the controller is loaded for borrowing/checking
	GetCapability func(inter *Interpreter) *IDCapabilityValue
	GetTag        func(inter *Interpreter) *StringValue
	SetTag        func(inter *Interpreter, tag *StringValue)
	Delete        func(inter *Interpreter, locationRange LocationRange)
	SetTarget     func(inter *Interpreter, locationRange LocationRange, target PathValue)
	// contains filtered or unexported fields
}

func NewStorageCapabilityControllerValue added in v0.39.0

func NewStorageCapabilityControllerValue(
	memoryGauge common.MemoryGauge,
	borrowType *ReferenceStaticType,
	capabilityID UInt64Value,
	targetPath PathValue,
) *StorageCapabilityControllerValue

func NewUnmeteredStorageCapabilityControllerValue added in v0.39.0

func NewUnmeteredStorageCapabilityControllerValue(
	borrowType *ReferenceStaticType,
	capabilityID UInt64Value,
	targetPath PathValue,
) *StorageCapabilityControllerValue

func (*StorageCapabilityControllerValue) Accept added in v0.39.0

func (v *StorageCapabilityControllerValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (*StorageCapabilityControllerValue) ByteSize added in v0.39.0

func (*StorageCapabilityControllerValue) CapabilityControllerBorrowType added in v0.39.0

func (v *StorageCapabilityControllerValue) CapabilityControllerBorrowType() *ReferenceStaticType

func (*StorageCapabilityControllerValue) ChildStorables added in v0.39.0

func (v *StorageCapabilityControllerValue) ChildStorables() []atree.Storable

func (*StorageCapabilityControllerValue) Clone added in v0.39.0

func (v *StorageCapabilityControllerValue) Clone(interpreter *Interpreter) Value

func (*StorageCapabilityControllerValue) ConformsToStaticType added in v0.39.0

func (*StorageCapabilityControllerValue) ControllerCapabilityID added in v0.41.0

func (v *StorageCapabilityControllerValue) ControllerCapabilityID() UInt64Value

func (*StorageCapabilityControllerValue) DeepRemove added in v0.39.0

func (v *StorageCapabilityControllerValue) DeepRemove(_ *Interpreter, _ bool)

func (*StorageCapabilityControllerValue) Encode added in v0.39.0

Encode encodes StorageCapabilityControllerValue as

cbor.Tag{
			Number: CBORTagStorageCapabilityControllerValue,
			Content: []any{
				encodedStorageCapabilityControllerValueBorrowTypeFieldKey:   StaticType(v.BorrowType),
				encodedStorageCapabilityControllerValueCapabilityIDFieldKey: UInt64Value(v.CapabilityID),
				encodedStorageCapabilityControllerValueTargetPathFieldKey:   PathValue(v.TargetPath),
			},
}

func (*StorageCapabilityControllerValue) Equal added in v0.39.0

func (v *StorageCapabilityControllerValue) Equal(
	interpreter *Interpreter,
	locationRange LocationRange,
	other Value,
) bool

func (*StorageCapabilityControllerValue) GetMember added in v0.39.0

func (v *StorageCapabilityControllerValue) GetMember(inter *Interpreter, _ LocationRange, name string) (result Value)

func (*StorageCapabilityControllerValue) IsImportable added in v0.39.0

func (*StorageCapabilityControllerValue) IsResourceKinded added in v0.39.0

func (*StorageCapabilityControllerValue) IsResourceKinded(_ *Interpreter) bool

func (*StorageCapabilityControllerValue) IsStorable added in v0.39.0

func (*StorageCapabilityControllerValue) IsStorable() bool

func (*StorageCapabilityControllerValue) MeteredString added in v0.39.0

func (v *StorageCapabilityControllerValue) MeteredString(
	interpreter *Interpreter,
	seenReferences SeenReferences,
	locationRange LocationRange,
) string

func (*StorageCapabilityControllerValue) NeedsStoreTo added in v0.39.0

func (*StorageCapabilityControllerValue) RecursiveString added in v0.39.0

func (v *StorageCapabilityControllerValue) RecursiveString(seenReferences SeenReferences) string

func (*StorageCapabilityControllerValue) ReferenceValue added in v0.39.0

func (v *StorageCapabilityControllerValue) ReferenceValue(
	interpreter *Interpreter,
	capabilityAddress common.Address,
	resultBorrowType *sema.ReferenceType,
	_ LocationRange,
) ReferenceValue

func (*StorageCapabilityControllerValue) RemoveMember added in v0.39.0

func (*StorageCapabilityControllerValue) SetMember added in v0.39.0

func (v *StorageCapabilityControllerValue) SetMember(
	inter *Interpreter,
	_ LocationRange,
	identifier string,
	value Value,
) bool

func (*StorageCapabilityControllerValue) StaticType added in v0.39.0

func (*StorageCapabilityControllerValue) Storable added in v0.39.0

func (v *StorageCapabilityControllerValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint64,
) (
	atree.Storable,
	error,
)

func (*StorageCapabilityControllerValue) StoredValue added in v0.39.0

func (*StorageCapabilityControllerValue) String added in v0.39.0

func (*StorageCapabilityControllerValue) Transfer added in v0.39.0

func (v *StorageCapabilityControllerValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*StorageCapabilityControllerValue) Walk added in v0.39.0

func (v *StorageCapabilityControllerValue) Walk(_ *Interpreter, walkChild func(Value), _ LocationRange)

type StorageKey added in v0.15.0

type StorageKey struct {
	Key     string
	Address common.Address
}

func NewStorageKey added in v0.24.0

func NewStorageKey(memoryGauge common.MemoryGauge, address common.Address, key string) StorageKey

func (StorageKey) IsLess added in v0.20.0

func (k StorageKey) IsLess(o StorageKey) bool

type StorageMap added in v0.23.0

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

StorageMap is an ordered map which stores values in an account.

func NewStorageMap added in v0.23.0

func NewStorageMap(memoryGauge common.MemoryGauge, storage atree.SlabStorage, address atree.Address) *StorageMap

func NewStorageMapWithRootID added in v0.23.0

func NewStorageMapWithRootID(storage atree.SlabStorage, slabID atree.SlabID) *StorageMap

func (StorageMap) Count added in v0.26.0

func (s StorageMap) Count() uint64

func (StorageMap) Iterator added in v0.23.0

func (s StorageMap) Iterator(gauge common.MemoryGauge) StorageMapIterator

Iterator returns an iterator (StorageMapIterator), which allows iterating over the keys and values of the storage map

func (StorageMap) ReadValue added in v0.23.0

func (s StorageMap) ReadValue(gauge common.MemoryGauge, key StorageMapKey) Value

ReadValue returns the value for the given key. Returns nil if the key does not exist.

func (StorageMap) RemoveValue added in v0.25.0

func (s StorageMap) RemoveValue(interpreter *Interpreter, key StorageMapKey) (existed bool)

RemoveValue removes a value in the storage map, if it exists.

func (StorageMap) SetValue added in v0.23.0

func (s StorageMap) SetValue(interpreter *Interpreter, key StorageMapKey, value atree.Value) (existed bool)

SetValue sets a value in the storage map. If the given key already stores a value, it is overwritten. Returns true if

func (StorageMap) SlabID added in v1.0.0

func (s StorageMap) SlabID() atree.SlabID

func (StorageMap) ValueExists added in v0.23.0

func (s StorageMap) ValueExists(key StorageMapKey) bool

ValueExists returns true if the given key exists in the storage map.

func (StorageMap) WriteValue added in v0.23.0

func (s StorageMap) WriteValue(interpreter *Interpreter, key StorageMapKey, value atree.Value) (existed bool)

WriteValue sets or removes a value in the storage map. If the given value is nil, the key is removed. If the given value is non-nil, the key is added/updated. Returns true if a value previously existed at the given key.

type StorageMapIterator added in v0.23.0

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

StorageMapIterator is an iterator over StorageMap

func (StorageMapIterator) Next added in v0.23.0

func (i StorageMapIterator) Next() (atree.Value, Value)

Next returns the next key and value of the storage map iterator. If there is no further key-value pair, ("", nil) is returned.

func (StorageMapIterator) NextKey added in v0.23.0

func (i StorageMapIterator) NextKey() atree.Value

NextKey returns the next key of the storage map iterator. If there is no further key, "" is returned.

func (StorageMapIterator) NextValue added in v0.23.0

func (i StorageMapIterator) NextValue() Value

NextValue returns the next value in the storage map iterator. If there is nop further value, nil is returned.

type StorageMapKey added in v0.39.0

type StorageMapKey interface {
	AtreeValue() atree.Value
	AtreeValueHashInput(v atree.Value, _ []byte) ([]byte, error)
	AtreeValueCompare(storage atree.SlabStorage, value atree.Value, otherStorable atree.Storable) (bool, error)
	// contains filtered or unexported methods
}

type StorageMutatedDuringIterationError added in v0.26.0

type StorageMutatedDuringIterationError struct {
	LocationRange
}

StorageMutatedDuringIterationError

func (StorageMutatedDuringIterationError) Error added in v0.26.0

func (StorageMutatedDuringIterationError) IsUserError added in v0.26.0

func (StorageMutatedDuringIterationError) IsUserError()

type StorageReferenceValue

type StorageReferenceValue struct {
	BorrowedType         sema.Type
	TargetPath           PathValue
	TargetStorageAddress common.Address
	Authorization        Authorization
}

StorageReferenceValue

func NewStorageReferenceValue added in v0.24.0

func NewStorageReferenceValue(
	memoryGauge common.MemoryGauge,
	authorization Authorization,
	targetStorageAddress common.Address,
	targetPath PathValue,
	borrowedType sema.Type,
) *StorageReferenceValue

func NewUnmeteredStorageReferenceValue added in v0.24.0

func NewUnmeteredStorageReferenceValue(
	authorization Authorization,
	targetStorageAddress common.Address,
	targetPath PathValue,
	borrowedType sema.Type,
) *StorageReferenceValue

func (*StorageReferenceValue) Accept added in v0.12.0

func (v *StorageReferenceValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (*StorageReferenceValue) BorrowType added in v1.0.0

func (v *StorageReferenceValue) BorrowType() sema.Type

func (*StorageReferenceValue) Clone added in v0.23.0

func (*StorageReferenceValue) ConformsToStaticType added in v0.24.0

func (v *StorageReferenceValue) ConformsToStaticType(
	interpreter *Interpreter,
	locationRange LocationRange,
	results TypeConformanceResults,
) bool

func (*StorageReferenceValue) DeepRemove added in v0.20.0

func (*StorageReferenceValue) DeepRemove(_ *Interpreter, _ bool)

func (*StorageReferenceValue) Equal

func (v *StorageReferenceValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (*StorageReferenceValue) ForEach added in v1.0.0

func (v *StorageReferenceValue) ForEach(
	interpreter *Interpreter,
	elementType sema.Type,
	function func(value Value) (resume bool),
	_ bool,
	locationRange LocationRange,
)

func (*StorageReferenceValue) GetAuthorization added in v1.0.0

func (v *StorageReferenceValue) GetAuthorization() Authorization

func (*StorageReferenceValue) GetKey added in v0.20.0

func (v *StorageReferenceValue) GetKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key Value,
) Value

func (*StorageReferenceValue) GetMember

func (v *StorageReferenceValue) GetMember(
	interpreter *Interpreter,
	locationRange LocationRange,
	name string,
) Value

func (*StorageReferenceValue) GetTypeKey added in v0.36.0

func (v *StorageReferenceValue) GetTypeKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key sema.Type,
) Value

func (*StorageReferenceValue) InsertKey added in v0.20.0

func (v *StorageReferenceValue) InsertKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key Value,
	value Value,
)

func (*StorageReferenceValue) IsImportable added in v0.24.0

func (*StorageReferenceValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (*StorageReferenceValue) IsResourceKinded added in v0.20.0

func (*StorageReferenceValue) IsResourceKinded(_ *Interpreter) bool

func (*StorageReferenceValue) IsStorable added in v0.16.0

func (*StorageReferenceValue) IsStorable() bool

func (*StorageReferenceValue) Iterator added in v1.0.0

func (*StorageReferenceValue) MeteredString added in v0.24.0

func (v *StorageReferenceValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (*StorageReferenceValue) NeedsStoreTo added in v0.20.0

func (*StorageReferenceValue) NeedsStoreTo(_ atree.Address) bool

func (*StorageReferenceValue) RecursiveString added in v0.17.0

func (v *StorageReferenceValue) RecursiveString(_ SeenReferences) string

func (*StorageReferenceValue) ReferencedValue added in v0.11.0

func (v *StorageReferenceValue) ReferencedValue(interpreter *Interpreter, locationRange LocationRange, errorOnFailedDereference bool) *Value

func (*StorageReferenceValue) RemoveKey added in v0.20.0

func (v *StorageReferenceValue) RemoveKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key Value,
) Value

func (*StorageReferenceValue) RemoveMember added in v0.20.0

func (v *StorageReferenceValue) RemoveMember(
	interpreter *Interpreter,
	locationRange LocationRange,
	name string,
) Value

func (*StorageReferenceValue) RemoveTypeKey added in v0.36.0

func (v *StorageReferenceValue) RemoveTypeKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key sema.Type,
) Value

func (*StorageReferenceValue) SetKey added in v0.20.0

func (v *StorageReferenceValue) SetKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key Value,
	value Value,
)

func (*StorageReferenceValue) SetMember

func (v *StorageReferenceValue) SetMember(
	interpreter *Interpreter,
	locationRange LocationRange,
	name string,
	value Value,
) bool

func (*StorageReferenceValue) SetTypeKey added in v0.36.0

func (v *StorageReferenceValue) SetTypeKey(
	interpreter *Interpreter,
	locationRange LocationRange,
	key sema.Type,
	value Value,
)

func (*StorageReferenceValue) StaticType added in v0.12.0

func (v *StorageReferenceValue) StaticType(inter *Interpreter) StaticType

func (*StorageReferenceValue) Storable added in v0.20.0

func (*StorageReferenceValue) String added in v0.5.0

func (*StorageReferenceValue) String() string

func (*StorageReferenceValue) Transfer added in v0.20.0

func (v *StorageReferenceValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*StorageReferenceValue) Walk added in v0.19.0

func (*StorageReferenceValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type StringAtreeValue added in v0.24.0

type StringAtreeValue string

func NewStringAtreeValue added in v0.24.0

func NewStringAtreeValue(gauge common.MemoryGauge, s string) StringAtreeValue

func (StringAtreeValue) ByteSize added in v0.24.0

func (v StringAtreeValue) ByteSize() uint32

func (StringAtreeValue) ChildStorables added in v0.24.0

func (StringAtreeValue) ChildStorables() []atree.Storable

func (StringAtreeValue) Copy added in v1.0.0

func (v StringAtreeValue) Copy() atree.Storable

func (StringAtreeValue) Encode added in v0.24.0

func (v StringAtreeValue) Encode(e *atree.Encoder) error

Encode encodes the value as a CBOR string

func (StringAtreeValue) Equal added in v1.0.0

func (v StringAtreeValue) Equal(other atree.Storable) bool

Equal returns true if the given storable is equal to this StringAtreeValue.

func (StringAtreeValue) ID added in v1.0.0

func (v StringAtreeValue) ID() string

ID returns a unique identifier.

func (StringAtreeValue) Less added in v1.0.0

func (v StringAtreeValue) Less(other atree.Storable) bool

Less returns true if the given storable is less than StringAtreeValue.

func (StringAtreeValue) Storable added in v0.24.0

func (v StringAtreeValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint64,
) (
	atree.Storable,
	error,
)

func (StringAtreeValue) StoredValue added in v0.24.0

func (v StringAtreeValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

type StringIndexOutOfBoundsError added in v0.16.0

type StringIndexOutOfBoundsError struct {
	LocationRange
	Index  int
	Length int
}

StringIndexOutOfBoundsError

func (StringIndexOutOfBoundsError) Error added in v0.16.0

func (StringIndexOutOfBoundsError) IsUserError added in v0.25.0

func (StringIndexOutOfBoundsError) IsUserError()

type StringSliceIndicesError added in v0.24.0

type StringSliceIndicesError struct {
	LocationRange
	FromIndex int
	UpToIndex int
	Length    int
}

StringSliceIndicesError

func (StringSliceIndicesError) Error added in v0.24.0

func (e StringSliceIndicesError) Error() string

func (StringSliceIndicesError) IsUserError added in v0.25.0

func (StringSliceIndicesError) IsUserError()

type StringStorageMapKey added in v0.39.0

type StringStorageMapKey StringAtreeValue

StringStorageMapKey is a StorageMapKey backed by a simple StringAtreeValue

func (StringStorageMapKey) AtreeValue added in v0.39.0

func (k StringStorageMapKey) AtreeValue() atree.Value

func (StringStorageMapKey) AtreeValueCompare added in v0.39.0

func (StringStorageMapKey) AtreeValueCompare(
	slabStorage atree.SlabStorage,
	value atree.Value,
	otherStorable atree.Storable,
) (bool, error)

func (StringStorageMapKey) AtreeValueHashInput added in v0.39.0

func (StringStorageMapKey) AtreeValueHashInput(v atree.Value, scratch []byte) ([]byte, error)

type StringValue

type StringValue struct {
	Str             string
	UnnormalizedStr string
	// contains filtered or unexported fields
}

func NewStringValue

func NewStringValue(
	memoryGauge common.MemoryGauge,
	memoryUsage common.MemoryUsage,
	stringConstructor func() string,
) *StringValue

func NewStringValue_Unsafe deprecated added in v1.0.0

func NewStringValue_Unsafe(normalizedStr, unnormalizedStr string) *StringValue

Deprecated: NewStringValue_Unsafe creates a new string value from the given normalized and unnormalized string. NOTE: this function is unsafe, as it does not normalize the string. It should only be used for e.g. migration purposes.

func NewUnmeteredStringValue added in v0.24.0

func NewUnmeteredStringValue(str string) *StringValue

func (*StringValue) Accept added in v0.12.0

func (v *StringValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (*StringValue) ByteSize added in v0.20.0

func (v *StringValue) ByteSize() uint32

func (*StringValue) ChildStorables added in v0.20.0

func (*StringValue) ChildStorables() []atree.Storable

func (*StringValue) Clone added in v0.24.0

func (v *StringValue) Clone(_ *Interpreter) Value

func (*StringValue) Concat

func (v *StringValue) Concat(interpreter *Interpreter, other *StringValue, locationRange LocationRange) Value

func (*StringValue) ConformsToStaticType added in v0.24.0

func (v *StringValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (*StringValue) Contains added in v1.0.0

func (v *StringValue) Contains(inter *Interpreter, other *StringValue) BoolValue

func (*StringValue) Count added in v1.0.0

func (v *StringValue) Count(inter *Interpreter, locationRange LocationRange, other *StringValue) IntValue

func (*StringValue) DecodeHex added in v0.5.0

func (v *StringValue) DecodeHex(interpreter *Interpreter, locationRange LocationRange) *ArrayValue

DecodeHex hex-decodes this string and returns an array of UInt8 values

func (*StringValue) DeepRemove added in v0.20.0

func (*StringValue) DeepRemove(_ *Interpreter, _ bool)

func (*StringValue) Encode added in v0.20.0

func (v *StringValue) Encode(e *atree.Encoder) error

Encode encodes the value as a CBOR string

func (*StringValue) Equal

func (v *StringValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (*StringValue) Explode added in v1.0.0

func (v *StringValue) Explode(inter *Interpreter, locationRange LocationRange) *ArrayValue

Explode returns a Cadence array of type [String], where each element is a single character of the string

func (*StringValue) ForEach added in v1.0.0

func (v *StringValue) ForEach(
	interpreter *Interpreter,
	_ sema.Type,
	function func(value Value) (resume bool),
	transferElements bool,
	locationRange LocationRange,
)

func (*StringValue) GetKey added in v0.20.0

func (v *StringValue) GetKey(interpreter *Interpreter, locationRange LocationRange, key Value) Value

func (*StringValue) GetMember

func (v *StringValue) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (*StringValue) Greater added in v0.39.0

func (v *StringValue) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (*StringValue) GreaterEqual added in v0.39.0

func (v *StringValue) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (*StringValue) HashInput added in v0.20.0

func (v *StringValue) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeString (1 byte) - string value (n bytes)

func (*StringValue) IndexOf added in v1.0.0

func (v *StringValue) IndexOf(inter *Interpreter, other *StringValue) IntValue

func (*StringValue) InsertKey added in v0.20.0

func (*StringValue) InsertKey(_ *Interpreter, _ LocationRange, _ Value, _ Value)

func (*StringValue) IsGraphemeBoundaryEnd added in v1.0.0

func (v *StringValue) IsGraphemeBoundaryEnd(end int) bool

func (*StringValue) IsGraphemeBoundaryStart added in v1.0.0

func (v *StringValue) IsGraphemeBoundaryStart(startOffset int) bool

func (*StringValue) IsImportable added in v0.24.0

func (*StringValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (*StringValue) IsResourceKinded added in v0.20.0

func (*StringValue) IsResourceKinded(_ *Interpreter) bool

func (*StringValue) Iterator added in v0.29.0

func (*StringValue) Length added in v0.5.0

func (v *StringValue) Length() int

Length returns the number of characters (grapheme clusters)

func (*StringValue) Less added in v0.39.0

func (v *StringValue) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (*StringValue) LessEqual added in v0.39.0

func (v *StringValue) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (*StringValue) MeteredString added in v0.24.0

func (v *StringValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (*StringValue) NeedsStoreTo added in v0.20.0

func (*StringValue) NeedsStoreTo(_ atree.Address) bool

func (*StringValue) RecursiveString added in v0.17.0

func (v *StringValue) RecursiveString(_ SeenReferences) string

func (*StringValue) RemoveKey added in v0.20.0

func (*StringValue) RemoveKey(_ *Interpreter, _ LocationRange, _ Value) Value

func (*StringValue) RemoveMember added in v0.20.0

func (*StringValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (*StringValue) ReplaceAll added in v1.0.0

func (v *StringValue) ReplaceAll(
	inter *Interpreter,
	locationRange LocationRange,
	original *StringValue,
	replacement *StringValue,
) *StringValue

func (*StringValue) SetKey added in v0.20.0

func (*StringValue) SetKey(_ *Interpreter, _ LocationRange, _ Value, _ Value)

func (*StringValue) SetMember

func (*StringValue) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (*StringValue) Slice

func (v *StringValue) Slice(from IntValue, to IntValue, locationRange LocationRange) Value

func (*StringValue) Split added in v1.0.0

func (v *StringValue) Split(inter *Interpreter, locationRange LocationRange, separator *StringValue) *ArrayValue

func (*StringValue) StaticType added in v0.12.0

func (*StringValue) StaticType(interpreter *Interpreter) StaticType

func (*StringValue) Storable added in v0.20.0

func (v *StringValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint64) (atree.Storable, error)

func (*StringValue) StoredValue added in v0.20.0

func (v *StringValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (*StringValue) String

func (v *StringValue) String() string

func (*StringValue) ToLower added in v0.20.0

func (v *StringValue) ToLower(interpreter *Interpreter) *StringValue

func (*StringValue) Transfer added in v0.20.0

func (v *StringValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*StringValue) Walk added in v0.19.0

func (*StringValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type StringValueIterator added in v0.29.0

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

func (StringValueIterator) Next added in v0.29.0

type TransactionNotDeclaredError

type TransactionNotDeclaredError struct {
	Index int
}

func (TransactionNotDeclaredError) Error

func (TransactionNotDeclaredError) IsUserError added in v0.25.0

func (TransactionNotDeclaredError) IsUserError()

type TypeCodes added in v0.5.0

type TypeCodes struct {
	CompositeCodes map[sema.TypeID]CompositeTypeCode
	InterfaceCodes map[sema.TypeID]WrapperCode
}

TypeCodes is the value which stores the "prepared" / "callable" "code" of all composite types and interface types.

func (TypeCodes) Merge added in v0.5.0

func (c TypeCodes) Merge(codes TypeCodes)

type TypeConformanceResults added in v0.15.0

type TypeConformanceResults map[typeConformanceResultEntry]bool

type TypeDecoder added in v0.24.0

type TypeDecoder struct {
	LocationDecoder
	// contains filtered or unexported fields
}

func NewTypeDecoder added in v0.24.0

func NewTypeDecoder(
	decoder *cbor.StreamDecoder,
	memoryGauge common.MemoryGauge,
) TypeDecoder

func (TypeDecoder) DecodeStaticType added in v0.24.0

func (d TypeDecoder) DecodeStaticType() (StaticType, error)

type TypeID added in v0.41.0

type TypeID = common.TypeID

type TypeIndexableValue added in v0.36.0

type TypeIndexableValue interface {
	Value
	GetTypeKey(interpreter *Interpreter, locationRange LocationRange, ty sema.Type) Value
	SetTypeKey(interpreter *Interpreter, locationRange LocationRange, ty sema.Type, value Value)
	RemoveTypeKey(interpreter *Interpreter, locationRange LocationRange, ty sema.Type) Value
}

type TypeLoadingError added in v0.10.5

type TypeLoadingError struct {
	TypeID TypeID
}

TypeLoadingError

func (TypeLoadingError) Error added in v0.10.5

func (e TypeLoadingError) Error() string

func (TypeLoadingError) IsUserError added in v0.25.0

func (TypeLoadingError) IsUserError()

type TypeMismatchError

type TypeMismatchError struct {
	ExpectedType sema.Type
	ActualType   sema.Type
	LocationRange
}

TypeMismatchError

func (TypeMismatchError) Error

func (e TypeMismatchError) Error() string

func (TypeMismatchError) IsUserError added in v0.25.0

func (TypeMismatchError) IsUserError()

type TypeParameter added in v0.19.0

type TypeParameter struct {
	TypeBound StaticType
	Name      string
	Optional  bool
}

func (TypeParameter) Equal added in v0.19.0

func (p TypeParameter) Equal(other *TypeParameter) bool

func (TypeParameter) String added in v0.19.0

func (p TypeParameter) String() string

type TypeValue added in v0.4.0

type TypeValue struct {
	// Optional. nil represents "unknown"/"invalid" type
	Type StaticType
}

func NewTypeValue added in v0.24.0

func NewTypeValue(
	memoryGauge common.MemoryGauge,
	staticType StaticType,
) TypeValue

func NewUnmeteredTypeValue added in v0.24.0

func NewUnmeteredTypeValue(t StaticType) TypeValue

func (TypeValue) Accept added in v0.12.0

func (v TypeValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (TypeValue) ByteSize added in v0.20.0

func (v TypeValue) ByteSize() uint32

func (TypeValue) ChildStorables added in v0.20.0

func (TypeValue) ChildStorables() []atree.Storable

func (TypeValue) Clone added in v0.24.0

func (v TypeValue) Clone(_ *Interpreter) Value

func (TypeValue) ConformsToStaticType added in v0.24.0

func (v TypeValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (TypeValue) DeepRemove added in v0.20.0

func (TypeValue) DeepRemove(_ *Interpreter, _ bool)

func (TypeValue) Encode added in v0.20.0

func (v TypeValue) Encode(e *atree.Encoder) error

Encode encodes TypeValue as

cbor.Tag{
			Number: CBORTagTypeValue,
			Content: cborArray{
				encodedTypeValueTypeFieldKey: StaticType(v.Type),
			},
	}

func (TypeValue) Equal added in v0.4.0

func (v TypeValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (TypeValue) GetMember added in v0.4.0

func (v TypeValue) GetMember(interpreter *Interpreter, _ LocationRange, name string) Value

func (TypeValue) HashInput added in v0.24.0

func (v TypeValue) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeType (1 byte) - type id (n bytes)

func (TypeValue) IsImportable added in v0.24.0

func (TypeValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (TypeValue) IsResourceKinded added in v0.20.0

func (TypeValue) IsResourceKinded(_ *Interpreter) bool

func (TypeValue) MeteredString added in v0.24.0

func (v TypeValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (TypeValue) NeedsStoreTo added in v0.20.0

func (TypeValue) NeedsStoreTo(_ atree.Address) bool

func (TypeValue) RecursiveString added in v0.17.0

func (v TypeValue) RecursiveString(_ SeenReferences) string

func (TypeValue) RemoveMember added in v0.20.0

func (TypeValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (TypeValue) SetMember added in v0.4.0

func (TypeValue) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (TypeValue) StaticType added in v0.12.0

func (TypeValue) StaticType(interpreter *Interpreter) StaticType

func (TypeValue) Storable added in v0.20.0

func (v TypeValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint64,
) (atree.Storable, error)

func (TypeValue) StoredValue added in v0.20.0

func (v TypeValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (TypeValue) String added in v0.4.0

func (v TypeValue) String() string

func (TypeValue) Transfer added in v0.20.0

func (v TypeValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (TypeValue) Walk added in v0.19.0

func (TypeValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type UFix64Value

type UFix64Value uint64

UFix64Value

func ConvertUFix64

func ConvertUFix64(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) UFix64Value

func NewUFix64Value added in v0.24.0

func NewUFix64Value(gauge common.MemoryGauge, constructor func() uint64) UFix64Value

func NewUFix64ValueWithInteger added in v0.2.0

func NewUFix64ValueWithInteger(gauge common.MemoryGauge, constructor func() uint64, locationRange LocationRange) UFix64Value

func NewUnmeteredUFix64Value added in v0.24.0

func NewUnmeteredUFix64Value(integer uint64) UFix64Value

func NewUnmeteredUFix64ValueWithInteger added in v0.24.0

func NewUnmeteredUFix64ValueWithInteger(integer uint64, locationRange LocationRange) UFix64Value

func (UFix64Value) Accept added in v0.12.0

func (v UFix64Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UFix64Value) ByteSize added in v0.20.0

func (v UFix64Value) ByteSize() uint32

func (UFix64Value) ChildStorables added in v0.20.0

func (UFix64Value) ChildStorables() []atree.Storable

func (UFix64Value) Clone added in v0.24.0

func (v UFix64Value) Clone(_ *Interpreter) Value

func (UFix64Value) ConformsToStaticType added in v0.24.0

func (v UFix64Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UFix64Value) DeepRemove added in v0.20.0

func (UFix64Value) DeepRemove(_ *Interpreter, _ bool)

func (UFix64Value) Div

func (v UFix64Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UFix64Value) Encode added in v0.20.0

func (v UFix64Value) Encode(e *atree.Encoder) error

Encode encodes UFix64Value as

cbor.Tag{
		Number:  CBORTagUFix64Value,
		Content: uint64(v),
}

func (UFix64Value) Equal

func (v UFix64Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (UFix64Value) GetMember added in v0.3.0

func (v UFix64Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (UFix64Value) Greater

func (v UFix64Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UFix64Value) GreaterEqual

func (v UFix64Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UFix64Value) HashInput added in v0.20.0

func (v UFix64Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeUFix64 (1 byte) - uint64 value encoded in big-endian (8 bytes)

func (UFix64Value) IntegerPart added in v0.24.0

func (v UFix64Value) IntegerPart() NumberValue

func (UFix64Value) IsImportable added in v0.24.0

func (UFix64Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UFix64Value) IsResourceKinded added in v0.20.0

func (UFix64Value) IsResourceKinded(_ *Interpreter) bool

func (UFix64Value) IsStorable added in v0.16.0

func (UFix64Value) IsStorable() bool

func (UFix64Value) Less

func (v UFix64Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UFix64Value) LessEqual

func (v UFix64Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UFix64Value) MeteredString added in v0.24.0

func (v UFix64Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (UFix64Value) Minus

func (v UFix64Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UFix64Value) Mod

func (v UFix64Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UFix64Value) Mul

func (v UFix64Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UFix64Value) NeedsStoreTo added in v0.20.0

func (UFix64Value) NeedsStoreTo(_ atree.Address) bool

func (UFix64Value) Negate

func (UFix64Value) Plus

func (v UFix64Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UFix64Value) RecursiveString added in v0.17.0

func (v UFix64Value) RecursiveString(_ SeenReferences) string

func (UFix64Value) RemoveMember added in v0.20.0

func (UFix64Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UFix64Value) SaturatingDiv added in v0.15.0

func (v UFix64Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UFix64Value) SaturatingMinus added in v0.15.0

func (v UFix64Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UFix64Value) SaturatingMul added in v0.15.0

func (v UFix64Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UFix64Value) SaturatingPlus added in v0.15.0

func (v UFix64Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UFix64Value) Scale added in v0.24.0

func (UFix64Value) Scale() int

func (UFix64Value) SetMember added in v0.3.0

func (UFix64Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UFix64Value) StaticType added in v0.12.0

func (UFix64Value) StaticType(interpreter *Interpreter) StaticType

func (UFix64Value) Storable added in v0.20.0

func (UFix64Value) StoredValue added in v0.20.0

func (v UFix64Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UFix64Value) String

func (v UFix64Value) String() string

func (UFix64Value) ToBigEndianBytes added in v0.5.0

func (v UFix64Value) ToBigEndianBytes() []byte

func (UFix64Value) ToInt

func (v UFix64Value) ToInt(_ LocationRange) int

func (UFix64Value) Transfer added in v0.20.0

func (v UFix64Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UFix64Value) Walk added in v0.19.0

func (UFix64Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type UInt128Value

type UInt128Value struct {
	BigInt *big.Int
}

func NewUInt128ValueFromBigInt

func NewUInt128ValueFromBigInt(memoryGauge common.MemoryGauge, bigIntConstructor func() *big.Int) UInt128Value

func NewUInt128ValueFromUint64 added in v0.2.0

func NewUInt128ValueFromUint64(interpreter *Interpreter, value uint64) UInt128Value

func NewUnmeteredUInt128ValueFromBigInt added in v0.24.0

func NewUnmeteredUInt128ValueFromBigInt(value *big.Int) UInt128Value

func NewUnmeteredUInt128ValueFromUint64 added in v0.24.0

func NewUnmeteredUInt128ValueFromUint64(value uint64) UInt128Value

func (UInt128Value) Accept added in v0.12.0

func (v UInt128Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UInt128Value) BitwiseAnd added in v0.2.0

func (v UInt128Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt128Value) BitwiseLeftShift added in v0.2.0

func (v UInt128Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt128Value) BitwiseOr added in v0.2.0

func (v UInt128Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt128Value) BitwiseRightShift added in v0.2.0

func (v UInt128Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt128Value) BitwiseXor added in v0.2.0

func (v UInt128Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt128Value) ByteLength added in v0.24.0

func (v UInt128Value) ByteLength() int

func (UInt128Value) ByteSize added in v0.20.0

func (v UInt128Value) ByteSize() uint32

func (UInt128Value) ChildStorables added in v0.20.0

func (UInt128Value) ChildStorables() []atree.Storable

func (UInt128Value) Clone added in v0.24.0

func (v UInt128Value) Clone(_ *Interpreter) Value

func (UInt128Value) ConformsToStaticType added in v0.24.0

func (v UInt128Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UInt128Value) DeepRemove added in v0.20.0

func (UInt128Value) DeepRemove(_ *Interpreter, _ bool)

func (UInt128Value) Div

func (v UInt128Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt128Value) Encode added in v0.20.0

func (v UInt128Value) Encode(e *atree.Encoder) error

Encode encodes UInt128Value as

cbor.Tag{
		Number:  CBORTagUInt128Value,
		Content: *big.Int(v.BigInt),
}

func (UInt128Value) Equal

func (v UInt128Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (UInt128Value) GetMember added in v0.3.0

func (v UInt128Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (UInt128Value) Greater

func (v UInt128Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt128Value) GreaterEqual

func (v UInt128Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt128Value) HashInput added in v0.20.0

func (v UInt128Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeUInt128 (1 byte) - big int encoded in big endian (n bytes)

func (UInt128Value) IsImportable added in v0.24.0

func (UInt128Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UInt128Value) IsResourceKinded added in v0.20.0

func (UInt128Value) IsResourceKinded(_ *Interpreter) bool

func (UInt128Value) IsStorable added in v0.16.0

func (UInt128Value) IsStorable() bool

func (UInt128Value) Less

func (v UInt128Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt128Value) LessEqual

func (v UInt128Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt128Value) MeteredString added in v0.24.0

func (v UInt128Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (UInt128Value) Minus

func (v UInt128Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt128Value) Mod

func (v UInt128Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt128Value) Mul

func (v UInt128Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt128Value) NeedsStoreTo added in v0.20.0

func (UInt128Value) NeedsStoreTo(_ atree.Address) bool

func (UInt128Value) Negate

func (UInt128Value) Plus

func (v UInt128Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt128Value) RecursiveString added in v0.17.0

func (v UInt128Value) RecursiveString(_ SeenReferences) string

func (UInt128Value) RemoveMember added in v0.20.0

func (UInt128Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UInt128Value) SaturatingDiv added in v0.15.0

func (v UInt128Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt128Value) SaturatingMinus added in v0.15.0

func (v UInt128Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt128Value) SaturatingMul added in v0.15.0

func (v UInt128Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt128Value) SaturatingPlus added in v0.15.0

func (v UInt128Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt128Value) SetMember added in v0.3.0

func (UInt128Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UInt128Value) StaticType added in v0.12.0

func (UInt128Value) StaticType(interpreter *Interpreter) StaticType

func (UInt128Value) Storable added in v0.20.0

func (UInt128Value) StoredValue added in v0.20.0

func (v UInt128Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UInt128Value) String

func (v UInt128Value) String() string

func (UInt128Value) ToBigEndianBytes added in v0.5.0

func (v UInt128Value) ToBigEndianBytes() []byte

func (UInt128Value) ToBigInt

func (v UInt128Value) ToBigInt(memoryGauge common.MemoryGauge) *big.Int

func (UInt128Value) ToInt

func (v UInt128Value) ToInt(locationRange LocationRange) int

func (UInt128Value) Transfer added in v0.20.0

func (v UInt128Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt128Value) Walk added in v0.19.0

func (UInt128Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type UInt16Value

type UInt16Value uint16

func ConvertUInt16

func ConvertUInt16(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) UInt16Value

func NewUInt16Value added in v0.24.0

func NewUInt16Value(gauge common.MemoryGauge, uint16Constructor func() uint16) UInt16Value

func NewUnmeteredUInt16Value added in v0.24.0

func NewUnmeteredUInt16Value(value uint16) UInt16Value

func (UInt16Value) Accept added in v0.12.0

func (v UInt16Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UInt16Value) BitwiseAnd added in v0.2.0

func (v UInt16Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt16Value) BitwiseLeftShift added in v0.2.0

func (v UInt16Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt16Value) BitwiseOr added in v0.2.0

func (v UInt16Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt16Value) BitwiseRightShift added in v0.2.0

func (v UInt16Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt16Value) BitwiseXor added in v0.2.0

func (v UInt16Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt16Value) ByteSize added in v0.20.0

func (v UInt16Value) ByteSize() uint32

func (UInt16Value) ChildStorables added in v0.20.0

func (UInt16Value) ChildStorables() []atree.Storable

func (UInt16Value) Clone added in v0.24.0

func (v UInt16Value) Clone(_ *Interpreter) Value

func (UInt16Value) ConformsToStaticType added in v0.24.0

func (v UInt16Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UInt16Value) DeepRemove added in v0.20.0

func (UInt16Value) DeepRemove(_ *Interpreter, _ bool)

func (UInt16Value) Div

func (v UInt16Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) Encode added in v0.20.0

func (v UInt16Value) Encode(e *atree.Encoder) error

Encode encodes UInt16Value as

cbor.Tag{
		Number:  CBORTagUInt16Value,
		Content: uint16(v),
}

func (UInt16Value) Equal

func (v UInt16Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (UInt16Value) GetMember added in v0.3.0

func (v UInt16Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (UInt16Value) Greater

func (v UInt16Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt16Value) GreaterEqual

func (v UInt16Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt16Value) HashInput added in v0.20.0

func (v UInt16Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeUInt16 (1 byte) - uint16 value encoded in big-endian (2 bytes)

func (UInt16Value) IsImportable added in v0.24.0

func (UInt16Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UInt16Value) IsResourceKinded added in v0.20.0

func (UInt16Value) IsResourceKinded(_ *Interpreter) bool

func (UInt16Value) IsStorable added in v0.16.0

func (UInt16Value) IsStorable() bool

func (UInt16Value) Less

func (v UInt16Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt16Value) LessEqual

func (v UInt16Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt16Value) MeteredString added in v0.24.0

func (v UInt16Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (UInt16Value) Minus

func (v UInt16Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) Mod

func (v UInt16Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) Mul

func (v UInt16Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) NeedsStoreTo added in v0.20.0

func (UInt16Value) NeedsStoreTo(_ atree.Address) bool

func (UInt16Value) Negate

func (UInt16Value) Plus

func (v UInt16Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) RecursiveString added in v0.17.0

func (v UInt16Value) RecursiveString(_ SeenReferences) string

func (UInt16Value) RemoveMember added in v0.20.0

func (UInt16Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UInt16Value) SaturatingDiv added in v0.15.0

func (v UInt16Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) SaturatingMinus added in v0.15.0

func (v UInt16Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) SaturatingMul added in v0.15.0

func (v UInt16Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) SaturatingPlus added in v0.15.0

func (v UInt16Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) SetMember added in v0.3.0

func (UInt16Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UInt16Value) StaticType added in v0.12.0

func (UInt16Value) StaticType(interpreter *Interpreter) StaticType

func (UInt16Value) Storable added in v0.20.0

func (UInt16Value) StoredValue added in v0.20.0

func (v UInt16Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UInt16Value) String

func (v UInt16Value) String() string

func (UInt16Value) ToBigEndianBytes added in v0.5.0

func (v UInt16Value) ToBigEndianBytes() []byte

func (UInt16Value) ToInt

func (v UInt16Value) ToInt(_ LocationRange) int

func (UInt16Value) Transfer added in v0.20.0

func (v UInt16Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt16Value) Walk added in v0.19.0

func (UInt16Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type UInt256Value

type UInt256Value struct {
	BigInt *big.Int
}

func ConvertUInt256

func ConvertUInt256(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) UInt256Value

func NewUInt256ValueFromBigInt

func NewUInt256ValueFromBigInt(memoryGauge common.MemoryGauge, bigIntConstructor func() *big.Int) UInt256Value

func NewUInt256ValueFromUint64 added in v0.2.0

func NewUInt256ValueFromUint64(interpreter *Interpreter, value uint64) UInt256Value

func NewUnmeteredUInt256ValueFromBigInt added in v0.24.0

func NewUnmeteredUInt256ValueFromBigInt(value *big.Int) UInt256Value

func NewUnmeteredUInt256ValueFromUint64 added in v0.24.0

func NewUnmeteredUInt256ValueFromUint64(value uint64) UInt256Value

func (UInt256Value) Accept added in v0.12.0

func (v UInt256Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UInt256Value) BitwiseAnd added in v0.2.0

func (v UInt256Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt256Value) BitwiseLeftShift added in v0.2.0

func (v UInt256Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt256Value) BitwiseOr added in v0.2.0

func (v UInt256Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt256Value) BitwiseRightShift added in v0.2.0

func (v UInt256Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt256Value) BitwiseXor added in v0.2.0

func (v UInt256Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt256Value) ByteLength added in v0.24.0

func (v UInt256Value) ByteLength() int

func (UInt256Value) ByteSize added in v0.20.0

func (v UInt256Value) ByteSize() uint32

func (UInt256Value) ChildStorables added in v0.20.0

func (UInt256Value) ChildStorables() []atree.Storable

func (UInt256Value) Clone added in v0.24.0

func (v UInt256Value) Clone(_ *Interpreter) Value

func (UInt256Value) ConformsToStaticType added in v0.24.0

func (v UInt256Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UInt256Value) DeepRemove added in v0.20.0

func (UInt256Value) DeepRemove(_ *Interpreter, _ bool)

func (UInt256Value) Div

func (v UInt256Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) Encode added in v0.20.0

func (v UInt256Value) Encode(e *atree.Encoder) error

Encode encodes UInt256Value as

cbor.Tag{
		Number:  CBORTagUInt256Value,
		Content: *big.Int(v.BigInt),
}

func (UInt256Value) Equal

func (v UInt256Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (UInt256Value) GetMember added in v0.3.0

func (v UInt256Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (UInt256Value) Greater

func (v UInt256Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt256Value) GreaterEqual

func (v UInt256Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt256Value) HashInput added in v0.20.0

func (v UInt256Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeUInt256 (1 byte) - big int encoded in big endian (n bytes)

func (UInt256Value) IsImportable added in v0.24.0

func (UInt256Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UInt256Value) IsResourceKinded added in v0.20.0

func (UInt256Value) IsResourceKinded(_ *Interpreter) bool

func (UInt256Value) IsStorable added in v0.16.0

func (UInt256Value) IsStorable() bool

func (UInt256Value) Less

func (v UInt256Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt256Value) LessEqual

func (v UInt256Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt256Value) MeteredString added in v0.24.0

func (v UInt256Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (UInt256Value) Minus

func (v UInt256Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) Mod

func (v UInt256Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) Mul

func (v UInt256Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) NeedsStoreTo added in v0.20.0

func (UInt256Value) NeedsStoreTo(_ atree.Address) bool

func (UInt256Value) Negate

func (UInt256Value) Plus

func (v UInt256Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) RecursiveString added in v0.17.0

func (v UInt256Value) RecursiveString(_ SeenReferences) string

func (UInt256Value) RemoveMember added in v0.20.0

func (UInt256Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UInt256Value) SaturatingDiv added in v0.15.0

func (v UInt256Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) SaturatingMinus added in v0.15.0

func (v UInt256Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) SaturatingMul added in v0.15.0

func (v UInt256Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) SaturatingPlus added in v0.15.0

func (v UInt256Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) SetMember added in v0.3.0

func (UInt256Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UInt256Value) StaticType added in v0.12.0

func (UInt256Value) StaticType(interpreter *Interpreter) StaticType

func (UInt256Value) Storable added in v0.20.0

func (UInt256Value) StoredValue added in v0.20.0

func (v UInt256Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UInt256Value) String

func (v UInt256Value) String() string

func (UInt256Value) ToBigEndianBytes added in v0.5.0

func (v UInt256Value) ToBigEndianBytes() []byte

func (UInt256Value) ToBigInt

func (v UInt256Value) ToBigInt(memoryGauge common.MemoryGauge) *big.Int

func (UInt256Value) ToInt

func (v UInt256Value) ToInt(locationRange LocationRange) int

func (UInt256Value) Transfer added in v0.20.0

func (v UInt256Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt256Value) Walk added in v0.19.0

func (UInt256Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type UInt32Value

type UInt32Value uint32

func ConvertUInt32

func ConvertUInt32(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) UInt32Value

func NewUInt32Value added in v0.24.0

func NewUInt32Value(gauge common.MemoryGauge, uint32Constructor func() uint32) UInt32Value

func NewUnmeteredUInt32Value added in v0.24.0

func NewUnmeteredUInt32Value(value uint32) UInt32Value

func (UInt32Value) Accept added in v0.12.0

func (v UInt32Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UInt32Value) BitwiseAnd added in v0.2.0

func (v UInt32Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt32Value) BitwiseLeftShift added in v0.2.0

func (v UInt32Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt32Value) BitwiseOr added in v0.2.0

func (v UInt32Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt32Value) BitwiseRightShift added in v0.2.0

func (v UInt32Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt32Value) BitwiseXor added in v0.2.0

func (v UInt32Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt32Value) ByteSize added in v0.20.0

func (v UInt32Value) ByteSize() uint32

func (UInt32Value) ChildStorables added in v0.20.0

func (UInt32Value) ChildStorables() []atree.Storable

func (UInt32Value) Clone added in v0.24.0

func (v UInt32Value) Clone(_ *Interpreter) Value

func (UInt32Value) ConformsToStaticType added in v0.24.0

func (v UInt32Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UInt32Value) DeepRemove added in v0.20.0

func (UInt32Value) DeepRemove(_ *Interpreter, _ bool)

func (UInt32Value) Div

func (v UInt32Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) Encode added in v0.20.0

func (v UInt32Value) Encode(e *atree.Encoder) error

Encode encodes UInt32Value as

cbor.Tag{
		Number:  CBORTagUInt32Value,
		Content: uint32(v),
}

func (UInt32Value) Equal

func (v UInt32Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (UInt32Value) GetMember added in v0.3.0

func (v UInt32Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (UInt32Value) Greater

func (v UInt32Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt32Value) GreaterEqual

func (v UInt32Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt32Value) HashInput added in v0.20.0

func (v UInt32Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeUInt32 (1 byte) - uint32 value encoded in big-endian (4 bytes)

func (UInt32Value) IsImportable added in v0.24.0

func (UInt32Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UInt32Value) IsResourceKinded added in v0.20.0

func (UInt32Value) IsResourceKinded(_ *Interpreter) bool

func (UInt32Value) IsStorable added in v0.16.0

func (UInt32Value) IsStorable() bool

func (UInt32Value) Less

func (v UInt32Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt32Value) LessEqual

func (v UInt32Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt32Value) MeteredString added in v0.24.0

func (v UInt32Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (UInt32Value) Minus

func (v UInt32Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) Mod

func (v UInt32Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) Mul

func (v UInt32Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) NeedsStoreTo added in v0.20.0

func (UInt32Value) NeedsStoreTo(_ atree.Address) bool

func (UInt32Value) Negate

func (UInt32Value) Plus

func (v UInt32Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) RecursiveString added in v0.17.0

func (v UInt32Value) RecursiveString(_ SeenReferences) string

func (UInt32Value) RemoveMember added in v0.20.0

func (UInt32Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UInt32Value) SaturatingDiv added in v0.15.0

func (v UInt32Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) SaturatingMinus added in v0.15.0

func (v UInt32Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) SaturatingMul added in v0.15.0

func (v UInt32Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) SaturatingPlus added in v0.15.0

func (v UInt32Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) SetMember added in v0.3.0

func (UInt32Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UInt32Value) StaticType added in v0.12.0

func (UInt32Value) StaticType(interpreter *Interpreter) StaticType

func (UInt32Value) Storable added in v0.20.0

func (UInt32Value) StoredValue added in v0.20.0

func (v UInt32Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UInt32Value) String

func (v UInt32Value) String() string

func (UInt32Value) ToBigEndianBytes added in v0.5.0

func (v UInt32Value) ToBigEndianBytes() []byte

func (UInt32Value) ToInt

func (v UInt32Value) ToInt(_ LocationRange) int

func (UInt32Value) Transfer added in v0.20.0

func (v UInt32Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt32Value) Walk added in v0.19.0

func (UInt32Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type UInt64Value

type UInt64Value uint64
const InvalidCapabilityID UInt64Value = 0

func ConvertUInt64

func ConvertUInt64(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) UInt64Value

func NewUInt64Value added in v0.24.0

func NewUInt64Value(gauge common.MemoryGauge, uint64Constructor func() uint64) UInt64Value

func NewUnmeteredUInt64Value added in v0.24.0

func NewUnmeteredUInt64Value(value uint64) UInt64Value

func (UInt64Value) Accept added in v0.12.0

func (v UInt64Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UInt64Value) BitwiseAnd added in v0.2.0

func (v UInt64Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt64Value) BitwiseLeftShift added in v0.2.0

func (v UInt64Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt64Value) BitwiseOr added in v0.2.0

func (v UInt64Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt64Value) BitwiseRightShift added in v0.2.0

func (v UInt64Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt64Value) BitwiseXor added in v0.2.0

func (v UInt64Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt64Value) ByteLength added in v0.24.0

func (v UInt64Value) ByteLength() int

func (UInt64Value) ByteSize added in v0.20.0

func (v UInt64Value) ByteSize() uint32

func (UInt64Value) ChildStorables added in v0.20.0

func (UInt64Value) ChildStorables() []atree.Storable

func (UInt64Value) Clone added in v0.24.0

func (v UInt64Value) Clone(_ *Interpreter) Value

func (UInt64Value) ConformsToStaticType added in v0.24.0

func (v UInt64Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UInt64Value) DeepRemove added in v0.20.0

func (UInt64Value) DeepRemove(_ *Interpreter, _ bool)

func (UInt64Value) Div

func (v UInt64Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) Encode added in v0.20.0

func (v UInt64Value) Encode(e *atree.Encoder) error

Encode encodes UInt64Value as

cbor.Tag{
		Number:  CBORTagUInt64Value,
		Content: uint64(v),
}

func (UInt64Value) Equal

func (v UInt64Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (UInt64Value) GetMember added in v0.3.0

func (v UInt64Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (UInt64Value) Greater

func (v UInt64Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt64Value) GreaterEqual

func (v UInt64Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt64Value) HashInput added in v0.20.0

func (v UInt64Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeUInt64 (1 byte) - uint64 value encoded in big-endian (8 bytes)

func (UInt64Value) IsImportable added in v0.24.0

func (UInt64Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UInt64Value) IsResourceKinded added in v0.20.0

func (UInt64Value) IsResourceKinded(_ *Interpreter) bool

func (UInt64Value) IsStorable added in v0.16.0

func (UInt64Value) IsStorable() bool

func (UInt64Value) Less

func (v UInt64Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt64Value) LessEqual

func (v UInt64Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt64Value) MeteredString added in v0.24.0

func (v UInt64Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (UInt64Value) Minus

func (v UInt64Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) Mod

func (v UInt64Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) Mul

func (v UInt64Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) NeedsStoreTo added in v0.20.0

func (UInt64Value) NeedsStoreTo(_ atree.Address) bool

func (UInt64Value) Negate

func (UInt64Value) Plus

func (v UInt64Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) RecursiveString added in v0.17.0

func (v UInt64Value) RecursiveString(_ SeenReferences) string

func (UInt64Value) RemoveMember added in v0.20.0

func (UInt64Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UInt64Value) SaturatingDiv added in v0.15.0

func (v UInt64Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) SaturatingMinus added in v0.15.0

func (v UInt64Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) SaturatingMul added in v0.15.0

func (v UInt64Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) SaturatingPlus added in v0.15.0

func (v UInt64Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) SetMember added in v0.3.0

func (UInt64Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UInt64Value) StaticType added in v0.12.0

func (UInt64Value) StaticType(interpreter *Interpreter) StaticType

func (UInt64Value) Storable added in v0.20.0

func (UInt64Value) StoredValue added in v0.20.0

func (v UInt64Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UInt64Value) String

func (v UInt64Value) String() string

func (UInt64Value) ToBigEndianBytes added in v0.5.0

func (v UInt64Value) ToBigEndianBytes() []byte

func (UInt64Value) ToBigInt added in v0.21.0

func (v UInt64Value) ToBigInt(memoryGauge common.MemoryGauge) *big.Int

ToBigInt

NOTE: important, do *NOT* remove: UInt64 values > math.MaxInt64 overflow int. Implementing BigNumberValue ensures conversion functions call ToBigInt instead of ToInt.

func (UInt64Value) ToInt

func (v UInt64Value) ToInt(locationRange LocationRange) int

func (UInt64Value) Transfer added in v0.20.0

func (v UInt64Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt64Value) Walk added in v0.19.0

func (UInt64Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type UInt8Value

type UInt8Value uint8

func ConvertUInt8

func ConvertUInt8(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) UInt8Value

func NewUInt8Value added in v0.24.0

func NewUInt8Value(gauge common.MemoryGauge, uint8Constructor func() uint8) UInt8Value

func NewUnmeteredUInt8Value added in v0.24.0

func NewUnmeteredUInt8Value(value uint8) UInt8Value

func (UInt8Value) Accept added in v0.12.0

func (v UInt8Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UInt8Value) BitwiseAnd added in v0.2.0

func (v UInt8Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt8Value) BitwiseLeftShift added in v0.2.0

func (v UInt8Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt8Value) BitwiseOr added in v0.2.0

func (v UInt8Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt8Value) BitwiseRightShift added in v0.2.0

func (v UInt8Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt8Value) BitwiseXor added in v0.2.0

func (v UInt8Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt8Value) ByteSize added in v0.20.0

func (v UInt8Value) ByteSize() uint32

func (UInt8Value) ChildStorables added in v0.20.0

func (UInt8Value) ChildStorables() []atree.Storable

func (UInt8Value) Clone added in v0.24.0

func (v UInt8Value) Clone(_ *Interpreter) Value

func (UInt8Value) ConformsToStaticType added in v0.24.0

func (v UInt8Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UInt8Value) DeepRemove added in v0.20.0

func (UInt8Value) DeepRemove(_ *Interpreter, _ bool)

func (UInt8Value) Div

func (v UInt8Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) Encode added in v0.20.0

func (v UInt8Value) Encode(e *atree.Encoder) error

Encode encodes UInt8Value as

cbor.Tag{
		Number:  CBORTagUInt8Value,
		Content: uint8(v),
}

func (UInt8Value) Equal

func (v UInt8Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (UInt8Value) GetMember added in v0.3.0

func (v UInt8Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (UInt8Value) Greater

func (v UInt8Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt8Value) GreaterEqual

func (v UInt8Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt8Value) HashInput added in v0.20.0

func (v UInt8Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeUInt8 (1 byte) - uint8 value (1 byte)

func (UInt8Value) IsImportable added in v0.24.0

func (UInt8Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UInt8Value) IsResourceKinded added in v0.20.0

func (UInt8Value) IsResourceKinded(_ *Interpreter) bool

func (UInt8Value) Less

func (v UInt8Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt8Value) LessEqual

func (v UInt8Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UInt8Value) MeteredString added in v0.24.0

func (v UInt8Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (UInt8Value) Minus

func (v UInt8Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) Mod

func (v UInt8Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) Mul

func (v UInt8Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) NeedsStoreTo added in v0.20.0

func (UInt8Value) NeedsStoreTo(_ atree.Address) bool

func (UInt8Value) Negate

func (UInt8Value) Plus

func (v UInt8Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) RecursiveString added in v0.17.0

func (v UInt8Value) RecursiveString(_ SeenReferences) string

func (UInt8Value) RemoveMember added in v0.20.0

func (UInt8Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UInt8Value) SaturatingDiv added in v0.15.0

func (v UInt8Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) SaturatingMinus added in v0.15.0

func (v UInt8Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) SaturatingMul added in v0.15.0

func (v UInt8Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) SaturatingPlus added in v0.15.0

func (v UInt8Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) SetMember added in v0.3.0

func (UInt8Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UInt8Value) StaticType added in v0.12.0

func (UInt8Value) StaticType(interpreter *Interpreter) StaticType

func (UInt8Value) Storable added in v0.20.0

func (UInt8Value) StoredValue added in v0.20.0

func (v UInt8Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UInt8Value) String

func (v UInt8Value) String() string

func (UInt8Value) ToBigEndianBytes added in v0.5.0

func (v UInt8Value) ToBigEndianBytes() []byte

func (UInt8Value) ToInt

func (v UInt8Value) ToInt(_ LocationRange) int

func (UInt8Value) Transfer added in v0.20.0

func (v UInt8Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt8Value) Walk added in v0.19.0

func (UInt8Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type UIntValue

type UIntValue struct {
	BigInt *big.Int
}

func ConvertUInt

func ConvertUInt(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) UIntValue

func NewUIntValueFromBigInt

func NewUIntValueFromBigInt(
	memoryGauge common.MemoryGauge,
	memoryUsage common.MemoryUsage,
	bigIntConstructor func() *big.Int,
) UIntValue

func NewUIntValueFromUint64

func NewUIntValueFromUint64(memoryGauge common.MemoryGauge, value uint64) UIntValue

func NewUnmeteredUIntValueFromBigInt added in v0.24.0

func NewUnmeteredUIntValueFromBigInt(value *big.Int) UIntValue

func NewUnmeteredUIntValueFromUint64 added in v0.24.0

func NewUnmeteredUIntValueFromUint64(value uint64) UIntValue

func (UIntValue) Accept added in v0.12.0

func (v UIntValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UIntValue) BitwiseAnd added in v0.2.0

func (v UIntValue) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UIntValue) BitwiseLeftShift added in v0.2.0

func (v UIntValue) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UIntValue) BitwiseOr added in v0.2.0

func (v UIntValue) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UIntValue) BitwiseRightShift added in v0.2.0

func (v UIntValue) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UIntValue) BitwiseXor added in v0.2.0

func (v UIntValue) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UIntValue) ByteLength added in v0.24.0

func (v UIntValue) ByteLength() int

func (UIntValue) ByteSize added in v0.20.0

func (v UIntValue) ByteSize() uint32

func (UIntValue) ChildStorables added in v0.20.0

func (UIntValue) ChildStorables() []atree.Storable

func (UIntValue) Clone added in v0.24.0

func (v UIntValue) Clone(_ *Interpreter) Value

func (UIntValue) ConformsToStaticType added in v0.24.0

func (v UIntValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UIntValue) DeepRemove added in v0.20.0

func (UIntValue) DeepRemove(_ *Interpreter, _ bool)

func (UIntValue) Div

func (v UIntValue) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) Encode added in v0.20.0

func (v UIntValue) Encode(e *atree.Encoder) error

Encode encodes UIntValue as

cbor.Tag{
		Number:  CBORTagUIntValue,
		Content: *big.Int(v.BigInt),
}

func (UIntValue) Equal

func (v UIntValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (UIntValue) GetMember added in v0.3.0

func (v UIntValue) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (UIntValue) Greater

func (v UIntValue) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UIntValue) GreaterEqual

func (v UIntValue) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UIntValue) HashInput added in v0.20.0

func (v UIntValue) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeUInt (1 byte) - big int value encoded in big-endian (n bytes)

func (UIntValue) IsImportable added in v0.24.0

func (v UIntValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UIntValue) IsResourceKinded added in v0.20.0

func (UIntValue) IsResourceKinded(_ *Interpreter) bool

func (UIntValue) Less

func (v UIntValue) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UIntValue) LessEqual

func (v UIntValue) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (UIntValue) MeteredString added in v0.24.0

func (v UIntValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (UIntValue) Minus

func (v UIntValue) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) Mod

func (v UIntValue) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) Mul

func (v UIntValue) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) NeedsStoreTo added in v0.20.0

func (UIntValue) NeedsStoreTo(_ atree.Address) bool

func (UIntValue) Negate

func (UIntValue) Plus

func (v UIntValue) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) RecursiveString added in v0.17.0

func (v UIntValue) RecursiveString(_ SeenReferences) string

func (UIntValue) RemoveMember added in v0.20.0

func (UIntValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UIntValue) SaturatingDiv added in v0.15.0

func (v UIntValue) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) SaturatingMinus added in v0.15.0

func (v UIntValue) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) SaturatingMul added in v0.15.0

func (v UIntValue) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) SaturatingPlus added in v0.15.0

func (v UIntValue) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) SetMember added in v0.3.0

func (UIntValue) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UIntValue) StaticType added in v0.12.0

func (UIntValue) StaticType(interpreter *Interpreter) StaticType

func (UIntValue) Storable added in v0.20.0

func (v UIntValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint64) (atree.Storable, error)

func (UIntValue) StoredValue added in v0.20.0

func (v UIntValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UIntValue) String

func (v UIntValue) String() string

func (UIntValue) ToBigEndianBytes added in v0.5.0

func (v UIntValue) ToBigEndianBytes() []byte

func (UIntValue) ToBigInt

func (v UIntValue) ToBigInt(memoryGauge common.MemoryGauge) *big.Int

func (UIntValue) ToInt

func (v UIntValue) ToInt(locationRange LocationRange) int

func (UIntValue) Transfer added in v0.20.0

func (v UIntValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UIntValue) Walk added in v0.19.0

func (UIntValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type UUIDHandlerFunc

type UUIDHandlerFunc func() (uint64, error)

UUIDHandlerFunc is a function that handles the generation of UUIDs.

type UUIDUnavailableError added in v0.10.4

type UUIDUnavailableError struct {
	LocationRange
}

UUIDUnavailableError

func (UUIDUnavailableError) Error added in v0.10.4

func (e UUIDUnavailableError) Error() string

func (UUIDUnavailableError) IsUserError added in v0.25.0

func (UUIDUnavailableError) IsUserError()

type Uint64AtreeValue added in v0.39.0

type Uint64AtreeValue uint64

func NewUint64AtreeValue added in v0.39.0

func NewUint64AtreeValue(gauge common.MemoryGauge, s uint64) Uint64AtreeValue

func (Uint64AtreeValue) ByteSize added in v0.39.0

func (v Uint64AtreeValue) ByteSize() uint32

func (Uint64AtreeValue) ChildStorables added in v0.39.0

func (Uint64AtreeValue) ChildStorables() []atree.Storable

func (Uint64AtreeValue) Encode added in v0.39.0

func (v Uint64AtreeValue) Encode(e *atree.Encoder) error

Encode encodes the value as a CBOR unsigned integer

func (Uint64AtreeValue) Storable added in v0.39.0

func (v Uint64AtreeValue) Storable(
	_ atree.SlabStorage,
	_ atree.Address,
	_ uint64,
) (
	atree.Storable,
	error,
)

func (Uint64AtreeValue) StoredValue added in v0.39.0

func (v Uint64AtreeValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

type Uint64StorageMapKey added in v0.39.0

type Uint64StorageMapKey Uint64AtreeValue

Uint64StorageMapKey is a StorageMapKey backed by a simple Uint64AtreeValue

func (Uint64StorageMapKey) AtreeValue added in v0.39.0

func (k Uint64StorageMapKey) AtreeValue() atree.Value

func (Uint64StorageMapKey) AtreeValueCompare added in v0.39.0

func (Uint64StorageMapKey) AtreeValueCompare(
	slabStorage atree.SlabStorage,
	value atree.Value,
	otherStorable atree.Storable,
) (bool, error)

func (Uint64StorageMapKey) AtreeValueHashInput added in v0.39.0

func (Uint64StorageMapKey) AtreeValueHashInput(v atree.Value, scratch []byte) ([]byte, error)

type Unauthorized added in v1.0.0

type Unauthorized struct{}

func (Unauthorized) Encode added in v1.0.0

func (t Unauthorized) Encode(e *cbor.StreamEncoder) error

func (Unauthorized) Equal added in v1.0.0

func (Unauthorized) Equal(auth Authorization) bool

func (Unauthorized) ID added in v1.0.0

func (Unauthorized) ID() TypeID

func (Unauthorized) MeteredString added in v1.0.0

func (a Unauthorized) MeteredString(_ common.MemoryGauge) string

func (Unauthorized) String added in v1.0.0

func (Unauthorized) String() string

type UnderflowError

type UnderflowError struct {
	LocationRange
}

func (UnderflowError) Error

func (e UnderflowError) Error() string

func (UnderflowError) IsUserError added in v0.25.0

func (UnderflowError) IsUserError()

type UnexpectedMappedEntitlementError added in v1.0.0

type UnexpectedMappedEntitlementError struct {
	Type sema.Type
	LocationRange
}

UnexpectedMappedEntitlementError

func (UnexpectedMappedEntitlementError) Error added in v1.0.0

func (UnexpectedMappedEntitlementError) IsInternalError added in v1.0.0

func (UnexpectedMappedEntitlementError) IsInternalError()

type Unsigned added in v0.25.0

type Unsigned interface {
	~uint8 | ~uint16 | ~uint32 | ~uint64
}

type UnsupportedTagDecodingError added in v0.19.0

type UnsupportedTagDecodingError struct {
	Tag uint64
}

func (UnsupportedTagDecodingError) Error added in v0.19.0

func (UnsupportedTagDecodingError) IsInternalError added in v0.25.0

func (UnsupportedTagDecodingError) IsInternalError()

type UseBeforeInitializationError added in v0.32.0

type UseBeforeInitializationError struct {
	LocationRange
	Name string
}

UseBeforeInitializationError

func (UseBeforeInitializationError) Error added in v0.32.0

func (UseBeforeInitializationError) IsUserError added in v0.32.0

func (UseBeforeInitializationError) IsUserError()

type ValidateAccountCapabilitiesGetHandlerFunc added in v1.0.0

type ValidateAccountCapabilitiesGetHandlerFunc func(
	inter *Interpreter,
	locationRange LocationRange,
	address AddressValue,
	path PathValue,
	wantedBorrowType *sema.ReferenceType,
	capabilityBorrowType *sema.ReferenceType,
) (bool, error)

ValidateAccountCapabilitiesGetHandlerFunc is a function that is used to handle when a capability of an account is got.

type ValidateAccountCapabilitiesPublishHandlerFunc added in v1.0.0

type ValidateAccountCapabilitiesPublishHandlerFunc func(
	inter *Interpreter,
	locationRange LocationRange,
	address AddressValue,
	path PathValue,
	capabilityBorrowType *ReferenceStaticType,
) (bool, error)

ValidateAccountCapabilitiesPublishHandlerFunc is a function that is used to handle when a capability of an account is got.

type Value

type Value interface {
	atree.Value
	// Stringer provides `func String() string`
	// NOTE: important, error messages rely on values to implement String
	fmt.Stringer

	Accept(interpreter *Interpreter, visitor Visitor, locationRange LocationRange)
	Walk(interpreter *Interpreter, walkChild func(Value), locationRange LocationRange)
	StaticType(interpreter *Interpreter) StaticType
	// ConformsToStaticType returns true if the value (i.e. its dynamic type)
	// conforms to its own static type.
	// Non-container values trivially always conform to their own static type.
	// Container values conform to their own static type,
	// and this function recursively checks conformance for nested values.
	// If the container contains static type information about nested values,
	// e.g. the element type of an array, it also ensures the nested values'
	// static types are subtypes.
	ConformsToStaticType(
		interpreter *Interpreter,
		locationRange LocationRange,
		results TypeConformanceResults,
	) bool
	RecursiveString(seenReferences SeenReferences) string
	MeteredString(interpreter *Interpreter, seenReferences SeenReferences, locationRange LocationRange) string
	IsResourceKinded(interpreter *Interpreter) bool
	NeedsStoreTo(address atree.Address) bool
	Transfer(
		interpreter *Interpreter,
		locationRange LocationRange,
		address atree.Address,
		remove bool,
		storable atree.Storable,
		preventTransfer map[atree.ValueID]struct{},
		hasNoParentContainer bool,
	) Value
	DeepRemove(
		interpreter *Interpreter,
		hasNoParentContainer bool,
	)
	// Clone returns a new value that is equal to this value.
	// NOTE: not used by interpreter, but used externally (e.g. state migration)
	// NOTE: memory metering is unnecessary for Clone methods
	Clone(interpreter *Interpreter) Value
	IsImportable(interpreter *Interpreter, locationRange LocationRange) bool
	// contains filtered or unexported methods
}

Value is the Cadence value hierarchy which is heavily tied to the interpreter and persistent storage, and has lots of implementation details.

We do not want to expose those details to users (for example, Cadence is used as a library in flow-go (FVM), in the Flow Go SDK, etc.), because we want to be able to change the API and implementation details; nor do we want to require users to Cadence (the library) to write lots of low-level/boilerplate code (e.g. setting up storage).

To accomplish this, cadence.Value is the "user-facing" hierarchy that is easy to work with: simple Go types that can be used without an interpreter or storage.

cadence.Value can be converted to an interpreter.Value by "importing" it with importValue, and interpreter.Value can be "exported" to a cadence.Value with ExportValue.

var Nil Value = NilValue{}
var Void Value = VoidValue{}

func AddressFromBytes added in v0.39.0

func AddressFromBytes(invocation Invocation) Value

func AddressFromString added in v0.39.0

func AddressFromString(invocation Invocation) Value

func ConvertStoredValue added in v0.20.0

func ConvertStoredValue(gauge common.MemoryGauge, value atree.Value) (Value, error)

func ConvertUInt128

func ConvertUInt128(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Value

func ConvertWord128 added in v0.39.0

func ConvertWord128(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Value

func ConvertWord256 added in v0.39.0

func ConvertWord256(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Value

func DereferenceValue added in v1.0.0

func DereferenceValue(
	inter *Interpreter,
	locationRange LocationRange,
	referenceValue ReferenceValue,
) Value

func MustConvertStoredValue added in v0.20.0

func MustConvertStoredValue(gauge common.MemoryGauge, value atree.Value) Value

func MustConvertUnmeteredStoredValue added in v0.24.0

func MustConvertUnmeteredStoredValue(value atree.Value) Value

func NewAccountCapabilitiesValue added in v1.0.0

func NewAccountCapabilitiesValue(
	gauge common.MemoryGauge,
	address AddressValue,
	getFunction BoundFunctionGenerator,
	borrowFunction BoundFunctionGenerator,
	existsFunction BoundFunctionGenerator,
	publishFunction BoundFunctionGenerator,
	unpublishFunction BoundFunctionGenerator,
	storageCapabilitiesConstructor func() Value,
	accountCapabilitiesConstructor func() Value,
) Value

func NewAccountContractsValue added in v1.0.0

func NewAccountContractsValue(
	gauge common.MemoryGauge,
	address AddressValue,
	addFunction BoundFunctionGenerator,
	updateFunction BoundFunctionGenerator,
	tryUpdateFunction BoundFunctionGenerator,
	getFunction BoundFunctionGenerator,
	borrowFunction BoundFunctionGenerator,
	removeFunction BoundFunctionGenerator,
	namesGetter ContractNamesGetter,
) Value

func NewAccountInboxValue added in v1.0.0

func NewAccountInboxValue(
	gauge common.MemoryGauge,
	addressValue AddressValue,
	publishFunction BoundFunctionGenerator,
	unpublishFunction BoundFunctionGenerator,
	claimFunction BoundFunctionGenerator,
) Value

NewAccountInboxValue constructs an Account.Inbox value.

func NewAccountKeysValue added in v1.0.0

func NewAccountKeysValue(
	gauge common.MemoryGauge,
	address AddressValue,
	addFunction BoundFunctionGenerator,
	getFunction BoundFunctionGenerator,
	revokeFunction BoundFunctionGenerator,
	forEachFunction BoundFunctionGenerator,
	getKeysCount AccountKeysCountGetter,
) Value

NewAccountKeysValue constructs an Account.Keys value.

func NewAccountStorageCapabilitiesValue added in v1.0.0

func NewAccountStorageCapabilitiesValue(
	gauge common.MemoryGauge,
	address AddressValue,
	getControllerFunction BoundFunctionGenerator,
	getControllersFunction BoundFunctionGenerator,
	forEachControllerFunction BoundFunctionGenerator,
	issueFunction BoundFunctionGenerator,
	issueWithTypeFunction BoundFunctionGenerator,
) Value

func NewAccountStorageValue added in v1.0.0

func NewAccountStorageValue(
	gauge common.MemoryGauge,
	address AddressValue,
	storageUsedGet func(interpreter *Interpreter) UInt64Value,
	storageCapacityGet func(interpreter *Interpreter) UInt64Value,
) Value

NewAccountStorageValue constructs an Account.Storage value.

func NewAccountValue added in v1.0.0

func NewAccountValue(
	gauge common.MemoryGauge,
	address AddressValue,
	accountBalanceGet func() UFix64Value,
	accountAvailableBalanceGet func() UFix64Value,
	storageConstructor func() Value,
	contractsConstructor func() Value,
	keysConstructor func() Value,
	inboxConstructor func() Value,
	capabilitiesConstructor func() Value,
) Value

NewAccountValue constructs an account value.

func NewDeploymentResultValue added in v0.42.7

func NewDeploymentResultValue(
	gauge common.MemoryGauge,
	deployedContract OptionalValue,
) Value

func StoredValue added in v0.20.0

func StoredValue(gauge common.MemoryGauge, storable atree.Storable, storage atree.SlabStorage) Value

type ValueConverterDeclaration added in v0.21.2

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

type ValueDeclaration added in v0.12.0

type ValueDeclaration interface {
	ValueDeclarationName() string
	ValueDeclarationValue() Value
}

type ValueIndexableValue

type ValueIndexableValue interface {
	Value
	GetKey(interpreter *Interpreter, locationRange LocationRange, key Value) Value
	SetKey(interpreter *Interpreter, locationRange LocationRange, key Value, value Value)
	RemoveKey(interpreter *Interpreter, locationRange LocationRange, key Value) Value
	InsertKey(interpreter *Interpreter, locationRange LocationRange, key Value, value Value)
}

type ValueIterator added in v0.29.0

type ValueIterator interface {
	Next(interpreter *Interpreter, locationRange LocationRange) Value
}

ValueIterator is an iterator which returns values. When Next returns nil, it signals the end of the iterator.

type ValueTransferTypeError added in v0.15.0

type ValueTransferTypeError struct {
	ExpectedType sema.Type
	ActualType   sema.Type
	LocationRange
}

ValueTransferTypeError

func (ValueTransferTypeError) Error added in v0.15.0

func (e ValueTransferTypeError) Error() string

func (ValueTransferTypeError) IsInternalError added in v0.32.0

func (ValueTransferTypeError) IsInternalError()

type ValueWalker added in v0.19.0

type ValueWalker interface {
	WalkValue(interpreter *Interpreter, value Value) ValueWalker
}

type Variable

type Variable interface {
	GetValue(interpreter *Interpreter) Value
	SetValue(interpreter *Interpreter, locationRange LocationRange, value Value)
	InitializeWithValue(value Value)
	InitializeWithGetter(getter func() Value)
}

func NewSelfVariableWithValue added in v1.0.0

func NewSelfVariableWithValue(interpreter *Interpreter, value Value, locationRange LocationRange) Variable

func NewVariableWithGetter added in v0.13.9

func NewVariableWithGetter(gauge common.MemoryGauge, getter func() Value) Variable

func NewVariableWithValue added in v0.13.9

func NewVariableWithValue(gauge common.MemoryGauge, value Value) Variable

type VariableActivation added in v0.14.0

type VariableActivation = activations.Activation[Variable]
var BaseActivation *VariableActivation

BaseActivation is the activation which contains all base declarations. It is reused across all interpreters.

type VariableActivations added in v0.14.0

type VariableActivations = activations.Activations[Variable]

type VariableSizedStaticType

type VariableSizedStaticType struct {
	Type StaticType
}

func NewVariableSizedStaticType added in v0.24.0

func NewVariableSizedStaticType(
	memoryGauge common.MemoryGauge,
	elementType StaticType,
) *VariableSizedStaticType

func (*VariableSizedStaticType) Copy added in v1.0.0

func (*VariableSizedStaticType) ElementType added in v0.19.0

func (t *VariableSizedStaticType) ElementType() StaticType

func (*VariableSizedStaticType) Encode added in v0.20.0

func (t *VariableSizedStaticType) Encode(e *cbor.StreamEncoder) error

Encode encodes VariableSizedStaticType as

cbor.Tag{
		Number:  CBORTagVariableSizedStaticType,
		Content: StaticType(v.Type),
}

func (*VariableSizedStaticType) Equal added in v0.15.0

func (t *VariableSizedStaticType) Equal(other StaticType) bool

func (*VariableSizedStaticType) ID added in v0.41.0

func (*VariableSizedStaticType) Identifier added in v1.0.0

func (t *VariableSizedStaticType) Identifier() string

func (*VariableSizedStaticType) IsComposite added in v1.0.0

func (*VariableSizedStaticType) IsComposite() bool

func (*VariableSizedStaticType) IsDeprecated added in v1.0.0

func (t *VariableSizedStaticType) IsDeprecated() bool

func (*VariableSizedStaticType) MeteredString added in v0.24.0

func (t *VariableSizedStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (*VariableSizedStaticType) String

func (t *VariableSizedStaticType) String() string

type VirtualImport added in v0.5.0

type VirtualImport struct {
	TypeCodes   TypeCodes
	Elaboration *sema.Elaboration
	Globals     []VirtualImportGlobal
}

type VirtualImportGlobal added in v0.31.0

type VirtualImportGlobal struct {
	Value Value
	Name  string
}

type Visitor added in v0.12.0

type Visitor interface {
	VisitSimpleCompositeValue(interpreter *Interpreter, value *SimpleCompositeValue)
	VisitTypeValue(interpreter *Interpreter, value TypeValue)
	VisitVoidValue(interpreter *Interpreter, value VoidValue)
	VisitBoolValue(interpreter *Interpreter, value BoolValue)
	VisitStringValue(interpreter *Interpreter, value *StringValue)
	VisitCharacterValue(interpreter *Interpreter, value CharacterValue)
	VisitArrayValue(interpreter *Interpreter, value *ArrayValue) bool
	VisitIntValue(interpreter *Interpreter, value IntValue)
	VisitInt8Value(interpreter *Interpreter, value Int8Value)
	VisitInt16Value(interpreter *Interpreter, value Int16Value)
	VisitInt32Value(interpreter *Interpreter, value Int32Value)
	VisitInt64Value(interpreter *Interpreter, value Int64Value)
	VisitInt128Value(interpreter *Interpreter, value Int128Value)
	VisitInt256Value(interpreter *Interpreter, value Int256Value)
	VisitUIntValue(interpreter *Interpreter, value UIntValue)
	VisitUInt8Value(interpreter *Interpreter, value UInt8Value)
	VisitUInt16Value(interpreter *Interpreter, value UInt16Value)
	VisitUInt32Value(interpreter *Interpreter, value UInt32Value)
	VisitUInt64Value(interpreter *Interpreter, value UInt64Value)
	VisitUInt128Value(interpreter *Interpreter, value UInt128Value)
	VisitUInt256Value(interpreter *Interpreter, value UInt256Value)
	VisitWord8Value(interpreter *Interpreter, value Word8Value)
	VisitWord16Value(interpreter *Interpreter, value Word16Value)
	VisitWord32Value(interpreter *Interpreter, value Word32Value)
	VisitWord64Value(interpreter *Interpreter, value Word64Value)
	VisitWord128Value(interpreter *Interpreter, value Word128Value)
	VisitWord256Value(interpreter *Interpreter, value Word256Value)
	VisitFix64Value(interpreter *Interpreter, value Fix64Value)
	VisitUFix64Value(interpreter *Interpreter, value UFix64Value)
	VisitCompositeValue(interpreter *Interpreter, value *CompositeValue) bool
	VisitDictionaryValue(interpreter *Interpreter, value *DictionaryValue) bool
	VisitNilValue(interpreter *Interpreter, value NilValue)
	VisitSomeValue(interpreter *Interpreter, value *SomeValue) bool
	VisitStorageReferenceValue(interpreter *Interpreter, value *StorageReferenceValue)
	VisitEphemeralReferenceValue(interpreter *Interpreter, value *EphemeralReferenceValue)
	VisitAddressValue(interpreter *Interpreter, value AddressValue)
	VisitPathValue(interpreter *Interpreter, value PathValue)
	VisitCapabilityValue(interpreter *Interpreter, value *IDCapabilityValue)
	VisitPublishedValue(interpreter *Interpreter, value *PublishedValue)
	VisitInterpretedFunctionValue(interpreter *Interpreter, value *InterpretedFunctionValue)
	VisitHostFunctionValue(interpreter *Interpreter, value *HostFunctionValue)
	VisitBoundFunctionValue(interpreter *Interpreter, value BoundFunctionValue)
	VisitStorageCapabilityControllerValue(interpreter *Interpreter, v *StorageCapabilityControllerValue)
	VisitAccountCapabilityControllerValue(interpreter *Interpreter, v *AccountCapabilityControllerValue)
}

type VoidValue

type VoidValue struct{}

func (VoidValue) Accept added in v0.12.0

func (v VoidValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (VoidValue) ByteSize added in v0.20.0

func (VoidValue) ByteSize() uint32

func (VoidValue) ChildStorables added in v0.20.0

func (VoidValue) ChildStorables() []atree.Storable

func (VoidValue) Clone added in v0.24.0

func (v VoidValue) Clone(_ *Interpreter) Value

func (VoidValue) ConformsToStaticType added in v0.24.0

func (v VoidValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (VoidValue) DeepRemove added in v0.20.0

func (VoidValue) DeepRemove(_ *Interpreter, _ bool)

func (VoidValue) Encode added in v0.20.0

func (VoidValue) Encode(e *atree.Encoder) error

Encode writes a value of type Void to the encoder

func (VoidValue) Equal added in v0.20.0

func (v VoidValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (VoidValue) IsImportable added in v0.24.0

func (VoidValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (VoidValue) IsResourceKinded added in v0.20.0

func (VoidValue) IsResourceKinded(_ *Interpreter) bool

func (VoidValue) MeteredString added in v0.24.0

func (v VoidValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (VoidValue) NeedsStoreTo added in v0.20.0

func (VoidValue) NeedsStoreTo(_ atree.Address) bool

func (VoidValue) RecursiveString added in v0.17.0

func (v VoidValue) RecursiveString(_ SeenReferences) string

func (VoidValue) StaticType added in v0.12.0

func (VoidValue) StaticType(interpreter *Interpreter) StaticType

func (VoidValue) Storable added in v0.20.0

func (VoidValue) StoredValue added in v0.20.0

func (v VoidValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (VoidValue) String

func (VoidValue) String() string

func (VoidValue) Transfer added in v0.20.0

func (v VoidValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (VoidValue) Walk added in v0.19.0

func (VoidValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Word128Value added in v0.39.0

type Word128Value struct {
	BigInt *big.Int
}

func NewUnmeteredWord128ValueFromBigInt added in v0.39.0

func NewUnmeteredWord128ValueFromBigInt(value *big.Int) Word128Value

func NewUnmeteredWord128ValueFromUint64 added in v0.39.0

func NewUnmeteredWord128ValueFromUint64(value uint64) Word128Value

func NewWord128ValueFromBigInt added in v0.39.0

func NewWord128ValueFromBigInt(memoryGauge common.MemoryGauge, bigIntConstructor func() *big.Int) Word128Value

func NewWord128ValueFromUint64 added in v0.39.0

func NewWord128ValueFromUint64(memoryGauge common.MemoryGauge, value int64) Word128Value

func (Word128Value) Accept added in v0.39.0

func (v Word128Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Word128Value) BitwiseAnd added in v0.39.0

func (v Word128Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word128Value) BitwiseLeftShift added in v0.39.0

func (v Word128Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word128Value) BitwiseOr added in v0.39.0

func (v Word128Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word128Value) BitwiseRightShift added in v0.39.0

func (v Word128Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word128Value) BitwiseXor added in v0.39.0

func (v Word128Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word128Value) ByteLength added in v0.39.0

func (v Word128Value) ByteLength() int

func (Word128Value) ByteSize added in v0.39.0

func (v Word128Value) ByteSize() uint32

func (Word128Value) ChildStorables added in v0.39.0

func (Word128Value) ChildStorables() []atree.Storable

func (Word128Value) Clone added in v0.39.0

func (v Word128Value) Clone(_ *Interpreter) Value

func (Word128Value) ConformsToStaticType added in v0.39.0

func (v Word128Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Word128Value) DeepRemove added in v0.39.0

func (Word128Value) DeepRemove(_ *Interpreter, _ bool)

func (Word128Value) Div added in v0.39.0

func (v Word128Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word128Value) Encode added in v0.39.0

func (v Word128Value) Encode(e *atree.Encoder) error

Encode encodes Word128Value as

cbor.Tag{
		Number:  CBORTagWord128Value,
		Content: *big.Int(v.BigInt),
}

func (Word128Value) Equal added in v0.39.0

func (v Word128Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Word128Value) GetMember added in v0.39.0

func (v Word128Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Word128Value) Greater added in v0.39.0

func (v Word128Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word128Value) GreaterEqual added in v0.39.0

func (v Word128Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word128Value) HashInput added in v0.39.0

func (v Word128Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeWord128 (1 byte) - big int encoded in big endian (n bytes)

func (Word128Value) IsImportable added in v0.39.0

func (Word128Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Word128Value) IsResourceKinded added in v0.39.0

func (Word128Value) IsResourceKinded(_ *Interpreter) bool

func (Word128Value) IsStorable added in v0.39.0

func (Word128Value) IsStorable() bool

func (Word128Value) Less added in v0.39.0

func (v Word128Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word128Value) LessEqual added in v0.39.0

func (v Word128Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word128Value) MeteredString added in v0.39.0

func (v Word128Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Word128Value) Minus added in v0.39.0

func (v Word128Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word128Value) Mod added in v0.39.0

func (v Word128Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word128Value) Mul added in v0.39.0

func (v Word128Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word128Value) NeedsStoreTo added in v0.39.0

func (Word128Value) NeedsStoreTo(_ atree.Address) bool

func (Word128Value) Negate added in v0.39.0

func (Word128Value) Plus added in v0.39.0

func (v Word128Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word128Value) RecursiveString added in v0.39.0

func (v Word128Value) RecursiveString(_ SeenReferences) string

func (Word128Value) RemoveMember added in v0.39.0

func (Word128Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Word128Value) SaturatingDiv added in v0.39.0

func (v Word128Value) SaturatingDiv(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word128Value) SaturatingMinus added in v0.39.0

func (v Word128Value) SaturatingMinus(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word128Value) SaturatingMul added in v0.39.0

func (v Word128Value) SaturatingMul(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word128Value) SaturatingPlus added in v0.39.0

func (v Word128Value) SaturatingPlus(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word128Value) SetMember added in v0.39.0

func (Word128Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Word128Value) StaticType added in v0.39.0

func (Word128Value) StaticType(interpreter *Interpreter) StaticType

func (Word128Value) Storable added in v0.39.0

func (Word128Value) StoredValue added in v0.39.0

func (v Word128Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Word128Value) String added in v0.39.0

func (v Word128Value) String() string

func (Word128Value) ToBigEndianBytes added in v0.39.0

func (v Word128Value) ToBigEndianBytes() []byte

func (Word128Value) ToBigInt added in v0.39.0

func (v Word128Value) ToBigInt(memoryGauge common.MemoryGauge) *big.Int

func (Word128Value) ToInt added in v0.39.0

func (v Word128Value) ToInt(locationRange LocationRange) int

func (Word128Value) Transfer added in v0.39.0

func (v Word128Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word128Value) Walk added in v0.39.0

func (Word128Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Word16Value

type Word16Value uint16

func ConvertWord16

func ConvertWord16(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Word16Value

func NewUnmeteredWord16Value added in v0.24.0

func NewUnmeteredWord16Value(value uint16) Word16Value

func NewWord16Value added in v0.24.0

func NewWord16Value(gauge common.MemoryGauge, valueGetter func() uint16) Word16Value

func (Word16Value) Accept added in v0.12.0

func (v Word16Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Word16Value) BitwiseAnd added in v0.2.0

func (v Word16Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word16Value) BitwiseLeftShift added in v0.2.0

func (v Word16Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word16Value) BitwiseOr added in v0.2.0

func (v Word16Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word16Value) BitwiseRightShift added in v0.2.0

func (v Word16Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word16Value) BitwiseXor added in v0.2.0

func (v Word16Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word16Value) ByteSize added in v0.20.0

func (v Word16Value) ByteSize() uint32

func (Word16Value) ChildStorables added in v0.20.0

func (Word16Value) ChildStorables() []atree.Storable

func (Word16Value) Clone added in v0.24.0

func (v Word16Value) Clone(_ *Interpreter) Value

func (Word16Value) ConformsToStaticType added in v0.24.0

func (v Word16Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Word16Value) DeepRemove added in v0.20.0

func (Word16Value) DeepRemove(_ *Interpreter, _ bool)

func (Word16Value) Div

func (v Word16Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word16Value) Encode added in v0.20.0

func (v Word16Value) Encode(e *atree.Encoder) error

Encode encodes Word16Value as

cbor.Tag{
		Number:  CBORTagWord16Value,
		Content: uint16(v),
}

func (Word16Value) Equal

func (v Word16Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Word16Value) GetMember added in v0.3.0

func (v Word16Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Word16Value) Greater

func (v Word16Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word16Value) GreaterEqual

func (v Word16Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word16Value) HashInput added in v0.20.0

func (v Word16Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeWord16 (1 byte) - uint16 value encoded in big-endian (2 bytes)

func (Word16Value) IsImportable added in v0.24.0

func (Word16Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Word16Value) IsResourceKinded added in v0.20.0

func (Word16Value) IsResourceKinded(_ *Interpreter) bool

func (Word16Value) IsStorable added in v0.16.0

func (Word16Value) IsStorable() bool

func (Word16Value) Less

func (v Word16Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word16Value) LessEqual

func (v Word16Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word16Value) MeteredString added in v0.24.0

func (v Word16Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Word16Value) Minus

func (v Word16Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word16Value) Mod

func (v Word16Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word16Value) Mul

func (v Word16Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word16Value) NeedsStoreTo added in v0.20.0

func (Word16Value) NeedsStoreTo(_ atree.Address) bool

func (Word16Value) Negate

func (Word16Value) Plus

func (v Word16Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word16Value) RecursiveString added in v0.17.0

func (v Word16Value) RecursiveString(_ SeenReferences) string

func (Word16Value) RemoveMember added in v0.20.0

func (Word16Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Word16Value) SaturatingDiv added in v0.15.0

func (Word16Value) SaturatingMinus added in v0.15.0

func (Word16Value) SaturatingMul added in v0.15.0

func (Word16Value) SaturatingPlus added in v0.15.0

func (Word16Value) SetMember added in v0.3.0

func (Word16Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Word16Value) StaticType added in v0.12.0

func (Word16Value) StaticType(interpreter *Interpreter) StaticType

func (Word16Value) Storable added in v0.20.0

func (Word16Value) StoredValue added in v0.20.0

func (v Word16Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Word16Value) String

func (v Word16Value) String() string

func (Word16Value) ToBigEndianBytes added in v0.5.0

func (v Word16Value) ToBigEndianBytes() []byte

func (Word16Value) ToInt

func (v Word16Value) ToInt(_ LocationRange) int

func (Word16Value) Transfer added in v0.20.0

func (v Word16Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word16Value) Walk added in v0.19.0

func (Word16Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Word256Value added in v0.39.0

type Word256Value struct {
	BigInt *big.Int
}

func NewUnmeteredWord256ValueFromBigInt added in v0.39.0

func NewUnmeteredWord256ValueFromBigInt(value *big.Int) Word256Value

func NewUnmeteredWord256ValueFromUint64 added in v0.39.0

func NewUnmeteredWord256ValueFromUint64(value uint64) Word256Value

func NewWord256ValueFromBigInt added in v0.39.0

func NewWord256ValueFromBigInt(memoryGauge common.MemoryGauge, bigIntConstructor func() *big.Int) Word256Value

func NewWord256ValueFromUint64 added in v0.39.0

func NewWord256ValueFromUint64(memoryGauge common.MemoryGauge, value int64) Word256Value

func (Word256Value) Accept added in v0.39.0

func (v Word256Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Word256Value) BitwiseAnd added in v0.39.0

func (v Word256Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word256Value) BitwiseLeftShift added in v0.39.0

func (v Word256Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word256Value) BitwiseOr added in v0.39.0

func (v Word256Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word256Value) BitwiseRightShift added in v0.39.0

func (v Word256Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word256Value) BitwiseXor added in v0.39.0

func (v Word256Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word256Value) ByteLength added in v0.39.0

func (v Word256Value) ByteLength() int

func (Word256Value) ByteSize added in v0.39.0

func (v Word256Value) ByteSize() uint32

func (Word256Value) ChildStorables added in v0.39.0

func (Word256Value) ChildStorables() []atree.Storable

func (Word256Value) Clone added in v0.39.0

func (v Word256Value) Clone(_ *Interpreter) Value

func (Word256Value) ConformsToStaticType added in v0.39.0

func (v Word256Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Word256Value) DeepRemove added in v0.39.0

func (Word256Value) DeepRemove(_ *Interpreter, _ bool)

func (Word256Value) Div added in v0.39.0

func (v Word256Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word256Value) Encode added in v0.39.0

func (v Word256Value) Encode(e *atree.Encoder) error

Encode encodes Word256Value as

cbor.Tag{
		Number:  CBORTagWord256Value,
		Content: *big.Int(v.BigInt),
}

func (Word256Value) Equal added in v0.39.0

func (v Word256Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Word256Value) GetMember added in v0.39.0

func (v Word256Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Word256Value) Greater added in v0.39.0

func (v Word256Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word256Value) GreaterEqual added in v0.39.0

func (v Word256Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word256Value) HashInput added in v0.39.0

func (v Word256Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeWord256 (1 byte) - big int encoded in big endian (n bytes)

func (Word256Value) IsImportable added in v0.39.0

func (Word256Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Word256Value) IsResourceKinded added in v0.39.0

func (Word256Value) IsResourceKinded(_ *Interpreter) bool

func (Word256Value) IsStorable added in v0.39.0

func (Word256Value) IsStorable() bool

func (Word256Value) Less added in v0.39.0

func (v Word256Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word256Value) LessEqual added in v0.39.0

func (v Word256Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word256Value) MeteredString added in v0.39.0

func (v Word256Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Word256Value) Minus added in v0.39.0

func (v Word256Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word256Value) Mod added in v0.39.0

func (v Word256Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word256Value) Mul added in v0.39.0

func (v Word256Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word256Value) NeedsStoreTo added in v0.39.0

func (Word256Value) NeedsStoreTo(_ atree.Address) bool

func (Word256Value) Negate added in v0.39.0

func (Word256Value) Plus added in v0.39.0

func (v Word256Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word256Value) RecursiveString added in v0.39.0

func (v Word256Value) RecursiveString(_ SeenReferences) string

func (Word256Value) RemoveMember added in v0.39.0

func (Word256Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Word256Value) SaturatingDiv added in v0.39.0

func (v Word256Value) SaturatingDiv(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word256Value) SaturatingMinus added in v0.39.0

func (v Word256Value) SaturatingMinus(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word256Value) SaturatingMul added in v0.39.0

func (v Word256Value) SaturatingMul(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word256Value) SaturatingPlus added in v0.39.0

func (v Word256Value) SaturatingPlus(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word256Value) SetMember added in v0.39.0

func (Word256Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Word256Value) StaticType added in v0.39.0

func (Word256Value) StaticType(interpreter *Interpreter) StaticType

func (Word256Value) Storable added in v0.39.0

func (Word256Value) StoredValue added in v0.39.0

func (v Word256Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Word256Value) String added in v0.39.0

func (v Word256Value) String() string

func (Word256Value) ToBigEndianBytes added in v0.39.0

func (v Word256Value) ToBigEndianBytes() []byte

func (Word256Value) ToBigInt added in v0.39.0

func (v Word256Value) ToBigInt(memoryGauge common.MemoryGauge) *big.Int

func (Word256Value) ToInt added in v0.39.0

func (v Word256Value) ToInt(locationRange LocationRange) int

func (Word256Value) Transfer added in v0.39.0

func (v Word256Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word256Value) Walk added in v0.39.0

func (Word256Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Word32Value

type Word32Value uint32

func ConvertWord32

func ConvertWord32(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Word32Value

func NewUnmeteredWord32Value added in v0.24.0

func NewUnmeteredWord32Value(value uint32) Word32Value

func NewWord32Value added in v0.24.0

func NewWord32Value(gauge common.MemoryGauge, valueGetter func() uint32) Word32Value

func (Word32Value) Accept added in v0.12.0

func (v Word32Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Word32Value) BitwiseAnd added in v0.2.0

func (v Word32Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word32Value) BitwiseLeftShift added in v0.2.0

func (v Word32Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word32Value) BitwiseOr added in v0.2.0

func (v Word32Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word32Value) BitwiseRightShift added in v0.2.0

func (v Word32Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word32Value) BitwiseXor added in v0.2.0

func (v Word32Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word32Value) ByteSize added in v0.20.0

func (v Word32Value) ByteSize() uint32

func (Word32Value) ChildStorables added in v0.20.0

func (Word32Value) ChildStorables() []atree.Storable

func (Word32Value) Clone added in v0.24.0

func (v Word32Value) Clone(_ *Interpreter) Value

func (Word32Value) ConformsToStaticType added in v0.24.0

func (v Word32Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Word32Value) DeepRemove added in v0.20.0

func (Word32Value) DeepRemove(_ *Interpreter, _ bool)

func (Word32Value) Div

func (v Word32Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word32Value) Encode added in v0.20.0

func (v Word32Value) Encode(e *atree.Encoder) error

Encode encodes Word32Value as

cbor.Tag{
		Number:  CBORTagWord32Value,
		Content: uint32(v),
}

func (Word32Value) Equal

func (v Word32Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Word32Value) GetMember added in v0.3.0

func (v Word32Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Word32Value) Greater

func (v Word32Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word32Value) GreaterEqual

func (v Word32Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word32Value) HashInput added in v0.20.0

func (v Word32Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeWord32 (1 byte) - uint32 value encoded in big-endian (4 bytes)

func (Word32Value) IsImportable added in v0.24.0

func (Word32Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Word32Value) IsResourceKinded added in v0.20.0

func (Word32Value) IsResourceKinded(_ *Interpreter) bool

func (Word32Value) IsStorable added in v0.16.0

func (Word32Value) IsStorable() bool

func (Word32Value) Less

func (v Word32Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word32Value) LessEqual

func (v Word32Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word32Value) MeteredString added in v0.24.0

func (v Word32Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Word32Value) Minus

func (v Word32Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word32Value) Mod

func (v Word32Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word32Value) Mul

func (v Word32Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word32Value) NeedsStoreTo added in v0.20.0

func (Word32Value) NeedsStoreTo(_ atree.Address) bool

func (Word32Value) Negate

func (Word32Value) Plus

func (v Word32Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word32Value) RecursiveString added in v0.17.0

func (v Word32Value) RecursiveString(_ SeenReferences) string

func (Word32Value) RemoveMember added in v0.20.0

func (Word32Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Word32Value) SaturatingDiv added in v0.15.0

func (Word32Value) SaturatingMinus added in v0.15.0

func (Word32Value) SaturatingMul added in v0.15.0

func (Word32Value) SaturatingPlus added in v0.15.0

func (Word32Value) SetMember added in v0.3.0

func (Word32Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Word32Value) StaticType added in v0.12.0

func (Word32Value) StaticType(interpreter *Interpreter) StaticType

func (Word32Value) Storable added in v0.20.0

func (Word32Value) StoredValue added in v0.20.0

func (v Word32Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Word32Value) String

func (v Word32Value) String() string

func (Word32Value) ToBigEndianBytes added in v0.5.0

func (v Word32Value) ToBigEndianBytes() []byte

func (Word32Value) ToInt

func (v Word32Value) ToInt(_ LocationRange) int

func (Word32Value) Transfer added in v0.20.0

func (v Word32Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word32Value) Walk added in v0.19.0

func (Word32Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Word64Value

type Word64Value uint64

func ConvertWord64

func ConvertWord64(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Word64Value

func NewUnmeteredWord64Value added in v0.24.0

func NewUnmeteredWord64Value(value uint64) Word64Value

func NewWord64Value added in v0.24.0

func NewWord64Value(gauge common.MemoryGauge, valueGetter func() uint64) Word64Value

func (Word64Value) Accept added in v0.12.0

func (v Word64Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Word64Value) BitwiseAnd added in v0.2.0

func (v Word64Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word64Value) BitwiseLeftShift added in v0.2.0

func (v Word64Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word64Value) BitwiseOr added in v0.2.0

func (v Word64Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word64Value) BitwiseRightShift added in v0.2.0

func (v Word64Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word64Value) BitwiseXor added in v0.2.0

func (v Word64Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word64Value) ByteLength added in v0.24.0

func (v Word64Value) ByteLength() int

func (Word64Value) ByteSize added in v0.20.0

func (v Word64Value) ByteSize() uint32

func (Word64Value) ChildStorables added in v0.20.0

func (Word64Value) ChildStorables() []atree.Storable

func (Word64Value) Clone added in v0.24.0

func (v Word64Value) Clone(_ *Interpreter) Value

func (Word64Value) ConformsToStaticType added in v0.24.0

func (v Word64Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Word64Value) DeepRemove added in v0.20.0

func (Word64Value) DeepRemove(_ *Interpreter, _ bool)

func (Word64Value) Div

func (v Word64Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word64Value) Encode added in v0.20.0

func (v Word64Value) Encode(e *atree.Encoder) error

Encode encodes Word64Value as

cbor.Tag{
		Number:  CBORTagWord64Value,
		Content: uint64(v),
}

func (Word64Value) Equal

func (v Word64Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Word64Value) GetMember added in v0.3.0

func (v Word64Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Word64Value) Greater

func (v Word64Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word64Value) GreaterEqual

func (v Word64Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word64Value) HashInput added in v0.20.0

func (v Word64Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeWord64 (1 byte) - uint64 value encoded in big-endian (8 bytes)

func (Word64Value) IsImportable added in v0.24.0

func (Word64Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Word64Value) IsResourceKinded added in v0.20.0

func (Word64Value) IsResourceKinded(_ *Interpreter) bool

func (Word64Value) IsStorable added in v0.16.0

func (Word64Value) IsStorable() bool

func (Word64Value) Less

func (v Word64Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word64Value) LessEqual

func (v Word64Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word64Value) MeteredString added in v0.24.0

func (v Word64Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Word64Value) Minus

func (v Word64Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word64Value) Mod

func (v Word64Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word64Value) Mul

func (v Word64Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word64Value) NeedsStoreTo added in v0.20.0

func (Word64Value) NeedsStoreTo(_ atree.Address) bool

func (Word64Value) Negate

func (Word64Value) Plus

func (v Word64Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word64Value) RecursiveString added in v0.17.0

func (v Word64Value) RecursiveString(_ SeenReferences) string

func (Word64Value) RemoveMember added in v0.20.0

func (Word64Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Word64Value) SaturatingDiv added in v0.15.0

func (Word64Value) SaturatingMinus added in v0.15.0

func (Word64Value) SaturatingMul added in v0.15.0

func (Word64Value) SaturatingPlus added in v0.15.0

func (Word64Value) SetMember added in v0.3.0

func (Word64Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Word64Value) StaticType added in v0.12.0

func (Word64Value) StaticType(interpreter *Interpreter) StaticType

func (Word64Value) Storable added in v0.20.0

func (Word64Value) StoredValue added in v0.20.0

func (v Word64Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Word64Value) String

func (v Word64Value) String() string

func (Word64Value) ToBigEndianBytes added in v0.5.0

func (v Word64Value) ToBigEndianBytes() []byte

func (Word64Value) ToBigInt added in v0.21.0

func (v Word64Value) ToBigInt(memoryGauge common.MemoryGauge) *big.Int

ToBigInt

NOTE: important, do *NOT* remove: Word64 values > math.MaxInt64 overflow int. Implementing BigNumberValue ensures conversion functions call ToBigInt instead of ToInt.

func (Word64Value) ToInt

func (v Word64Value) ToInt(locationRange LocationRange) int

func (Word64Value) Transfer added in v0.20.0

func (v Word64Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word64Value) Walk added in v0.19.0

func (Word64Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Word8Value

type Word8Value uint8

func ConvertWord8

func ConvertWord8(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Word8Value

func NewUnmeteredWord8Value added in v0.24.0

func NewUnmeteredWord8Value(value uint8) Word8Value

func NewWord8Value added in v0.24.0

func NewWord8Value(gauge common.MemoryGauge, valueGetter func() uint8) Word8Value

func (Word8Value) Accept added in v0.12.0

func (v Word8Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Word8Value) BitwiseAnd added in v0.2.0

func (v Word8Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word8Value) BitwiseLeftShift added in v0.2.0

func (v Word8Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word8Value) BitwiseOr added in v0.2.0

func (v Word8Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word8Value) BitwiseRightShift added in v0.2.0

func (v Word8Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word8Value) BitwiseXor added in v0.2.0

func (v Word8Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word8Value) ByteSize added in v0.20.0

func (v Word8Value) ByteSize() uint32

func (Word8Value) ChildStorables added in v0.20.0

func (Word8Value) ChildStorables() []atree.Storable

func (Word8Value) Clone added in v0.24.0

func (v Word8Value) Clone(_ *Interpreter) Value

func (Word8Value) ConformsToStaticType added in v0.24.0

func (v Word8Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Word8Value) DeepRemove added in v0.20.0

func (Word8Value) DeepRemove(_ *Interpreter, _ bool)

func (Word8Value) Div

func (v Word8Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word8Value) Encode added in v0.20.0

func (v Word8Value) Encode(e *atree.Encoder) error

Encode encodes Word8Value as

cbor.Tag{
		Number:  CBORTagWord8Value,
		Content: uint8(v),
}

func (Word8Value) Equal

func (v Word8Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Word8Value) GetMember added in v0.3.0

func (v Word8Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Word8Value) Greater

func (v Word8Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word8Value) GreaterEqual

func (v Word8Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word8Value) HashInput added in v0.20.0

func (v Word8Value) HashInput(_ *Interpreter, _ LocationRange, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeWord8 (1 byte) - uint8 value (1 byte)

func (Word8Value) IsImportable added in v0.24.0

func (Word8Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Word8Value) IsResourceKinded added in v0.20.0

func (Word8Value) IsResourceKinded(_ *Interpreter) bool

func (Word8Value) IsStorable added in v0.16.0

func (Word8Value) IsStorable() bool

func (Word8Value) Less

func (v Word8Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word8Value) LessEqual

func (v Word8Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word8Value) MeteredString added in v0.24.0

func (v Word8Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Word8Value) Minus

func (v Word8Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word8Value) Mod

func (v Word8Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word8Value) Mul

func (v Word8Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word8Value) NeedsStoreTo added in v0.20.0

func (Word8Value) NeedsStoreTo(_ atree.Address) bool

func (Word8Value) Negate

func (Word8Value) Plus

func (v Word8Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word8Value) RecursiveString added in v0.17.0

func (v Word8Value) RecursiveString(_ SeenReferences) string

func (Word8Value) RemoveMember added in v0.20.0

func (Word8Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Word8Value) SaturatingDiv added in v0.15.0

func (Word8Value) SaturatingMinus added in v0.15.0

func (Word8Value) SaturatingMul added in v0.15.0

func (Word8Value) SaturatingPlus added in v0.15.0

func (Word8Value) SetMember added in v0.3.0

func (Word8Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Word8Value) StaticType added in v0.12.0

func (Word8Value) StaticType(interpreter *Interpreter) StaticType

func (Word8Value) Storable added in v0.20.0

func (Word8Value) StoredValue added in v0.20.0

func (v Word8Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Word8Value) String

func (v Word8Value) String() string

func (Word8Value) ToBigEndianBytes added in v0.5.0

func (v Word8Value) ToBigEndianBytes() []byte

func (Word8Value) ToInt

func (v Word8Value) ToInt(_ LocationRange) int

func (Word8Value) Transfer added in v0.20.0

func (v Word8Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word8Value) Walk added in v0.19.0

func (Word8Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type WrapperCode added in v0.5.0

type WrapperCode struct {
	InitializerFunctionWrapper     FunctionWrapper
	FunctionWrappers               map[string]FunctionWrapper
	Functions                      *FunctionOrderedMap
	DefaultDestroyEventConstructor FunctionValue
}

WrapperCode contains the "prepared" / "callable" "code" for inherited types.

These are "branch" nodes in the call chain, and are function wrappers, i.e. they wrap the functions / function wrappers that inherit them.

Jump to

Keyboard shortcuts

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