interpreter

package
v1.2.1 Latest Latest
Warning

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

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

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

func ArrayElementSize(staticType ArrayStaticType) uint

func AttachmentMemberName

func AttachmentMemberName(typeID string) string

func BigEndianBytesToSignedBigInt

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

func BigEndianBytesToUnsignedBigInt

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

func ByteArrayValueToByteSlice

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

func ByteValueToByte

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

func ConvertStaticAuthorizationToSemaAccess

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

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

func ConvertWord

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

func Declare

func Declare(a *VariableActivation, declaration ValueDeclaration)

func DecodeStorable

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

func DecodeTypeInfo

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

func DictionaryElementSize

func DictionaryElementSize(staticType *DictionaryStaticType) uint

func GetNativeCompositeValueComputedFields

func GetNativeCompositeValueComputedFields(qualifiedIdentifier string) map[string]ComputedField

func InspectValue

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

func NewCompositeTypeInfo

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

func OverEstimateBigIntStringLength

func OverEstimateBigIntStringLength(n *big.Int) int

func OverEstimateFixedPointStringLength

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

func OverEstimateIntStringLength

func OverEstimateIntStringLength(n int) int

func OverEstimateNumberStringLength

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

func OverEstimateUintStringLength

func OverEstimateUintStringLength(n uint) int

func ReturnEmptyRange

func ReturnEmptyRange() ast.Range

func SignedBigIntToBigEndianBytes

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

func SignedBigIntToSizedBigEndianBytes

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

func StaticTypeToBytes

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

func StorableSize

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

StorableSize returns the size of the storable in bytes.

func StorageMapKeyAtreeValueComparator

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

func StorageMapKeyAtreeValueHashInput

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

func StringAtreeValueComparator

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

func StringAtreeValueHashInput

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

func Uint64AtreeValueComparator

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

func Uint64AtreeValueHashInput

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

func UnsignedBigIntToBigEndianBytes

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

func UnsignedBigIntToSizedBigEndianBytes

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

func WalkValue

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

func WrappedExternalError(err error) error

Types

type AccountCapabilityControllerValue

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

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

func NewUnmeteredAccountCapabilityControllerValue

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

func (*AccountCapabilityControllerValue) Accept

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

func (*AccountCapabilityControllerValue) ByteSize

func (*AccountCapabilityControllerValue) CapabilityControllerBorrowType

func (v *AccountCapabilityControllerValue) CapabilityControllerBorrowType() *ReferenceStaticType

func (*AccountCapabilityControllerValue) ChildStorables

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

func (*AccountCapabilityControllerValue) Clone

func (*AccountCapabilityControllerValue) ConformsToStaticType

func (*AccountCapabilityControllerValue) ControllerCapabilityID

func (v *AccountCapabilityControllerValue) ControllerCapabilityID() UInt64Value

func (*AccountCapabilityControllerValue) DeepRemove

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

func (*AccountCapabilityControllerValue) Encode

Encode encodes AccountCapabilityControllerValue as

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

func (*AccountCapabilityControllerValue) Equal

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

func (*AccountCapabilityControllerValue) GetMember

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

func (*AccountCapabilityControllerValue) IsImportable

func (*AccountCapabilityControllerValue) IsResourceKinded

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

func (*AccountCapabilityControllerValue) IsStorable

func (*AccountCapabilityControllerValue) IsStorable() bool

func (*AccountCapabilityControllerValue) MeteredString

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

func (*AccountCapabilityControllerValue) NeedsStoreTo

func (*AccountCapabilityControllerValue) RecursiveString

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

func (*AccountCapabilityControllerValue) ReferenceValue

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

func (*AccountCapabilityControllerValue) RemoveMember

func (*AccountCapabilityControllerValue) SetMember

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

func (*AccountCapabilityControllerValue) StaticType

func (*AccountCapabilityControllerValue) Storable

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

func (*AccountCapabilityControllerValue) StoredValue

func (*AccountCapabilityControllerValue) String

func (*AccountCapabilityControllerValue) Transfer

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

func (*AccountCapabilityControllerValue) Walk

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

type AccountHandlerFunc

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

type AccountKeysCountGetter func() UInt64Value

type AccountLinkValue deprecated

type AccountLinkValue struct{}

Deprecated: AccountLinkValue

func (AccountLinkValue) Accept

func (AccountLinkValue) ByteSize

func (v AccountLinkValue) ByteSize() uint32

func (AccountLinkValue) ChildStorables

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

func (AccountLinkValue) Clone

func (AccountLinkValue) ConformsToStaticType

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

func (AccountLinkValue) DeepRemove

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

func (AccountLinkValue) Encode

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

Encode writes a value of type AccountValue to the encoder

func (AccountLinkValue) Equal

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

func (AccountLinkValue) IsImportable

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

func (AccountLinkValue) IsResourceKinded

func (AccountLinkValue) IsResourceKinded(_ *Interpreter) bool

func (AccountLinkValue) IsStorable

func (AccountLinkValue) IsStorable() bool

func (AccountLinkValue) MeteredString

func (AccountLinkValue) NeedsStoreTo

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

func (AccountLinkValue) RecursiveString

func (v AccountLinkValue) RecursiveString(_ SeenReferences) string

func (AccountLinkValue) StaticType

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

func (AccountLinkValue) Storable

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

func (AccountLinkValue) StoredValue

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

func (AccountLinkValue) String

func (v AccountLinkValue) String() string

func (AccountLinkValue) Transfer

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

func (AccountLinkValue) Walk

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

type AddressPath

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

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

func NewUnmeteredAddressValueFromBytes

func NewUnmeteredAddressValueFromBytes(b []byte) AddressValue

func (AddressValue) Accept

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

func (AddressValue) ByteSize

func (v AddressValue) ByteSize() uint32

func (AddressValue) ChildStorables

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

func (AddressValue) Clone

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

func (AddressValue) ConformsToStaticType

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

func (AddressValue) DeepRemove

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

func (AddressValue) Encode

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

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

func (AddressValue) HashInput

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

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

func (AddressValue) IsResourceKinded

func (AddressValue) IsResourceKinded(_ *Interpreter) bool

func (AddressValue) IsStorable

func (AddressValue) IsStorable() bool

func (AddressValue) MeteredString

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

func (AddressValue) NeedsStoreTo

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

func (AddressValue) RecursiveString

func (v AddressValue) RecursiveString(_ SeenReferences) string

func (AddressValue) RemoveMember

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

func (AddressValue) SetMember

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

func (AddressValue) StaticType

func (AddressValue) StaticType(interpreter *Interpreter) StaticType

func (AddressValue) Storable

func (AddressValue) StoredValue

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

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

func (AddressValue) Walk

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

func (ArgumentCountError) IsUserError()

type ArrayIndexOutOfBoundsError

type ArrayIndexOutOfBoundsError struct {
	LocationRange
	Index int
	Size  int
}

ArrayIndexOutOfBoundsError

func (ArrayIndexOutOfBoundsError) Error

func (ArrayIndexOutOfBoundsError) IsUserError

func (ArrayIndexOutOfBoundsError) IsUserError()

type ArraySliceIndicesError

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

ArraySliceIndicesError

func (ArraySliceIndicesError) Error

func (e ArraySliceIndicesError) Error() string

func (ArraySliceIndicesError) IsUserError

func (ArraySliceIndicesError) IsUserError()

type ArrayStaticType

type ArrayStaticType interface {
	StaticType

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

func ConvertSemaArrayTypeToStaticArrayType

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

type ArrayValue

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

func ByteSliceToByteArrayValue

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

func ByteSliceToConstantSizedByteArrayValue

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

func NewArrayValue

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

func NewArrayValueWithIterator

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

func (*ArrayValue) Accept

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

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

func (*ArrayValue) Clone

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

func (*ArrayValue) Concat

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

func (*ArrayValue) ConformsToStaticType

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

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

func (*ArrayValue) Destroy

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

func (*ArrayValue) Equal

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

func (*ArrayValue) Filter

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

func (*ArrayValue) FirstIndex

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

func (*ArrayValue) ForEach

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

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

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

func (*ArrayValue) InsertWithoutTransfer

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

func (*ArrayValue) IsDestroyed

func (v *ArrayValue) IsDestroyed() bool

func (*ArrayValue) IsImportable

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

func (*ArrayValue) IsReferenceTrackedResourceKindedValue

func (v *ArrayValue) IsReferenceTrackedResourceKindedValue()

func (*ArrayValue) IsResourceKinded

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

func (*ArrayValue) IsStaleResource

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

func (*ArrayValue) Iterate

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

func (*ArrayValue) IterateReadOnlyLoaded

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

func (*ArrayValue) Map

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

func (*ArrayValue) MeteredString

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

func (*ArrayValue) NeedsStoreTo

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

func (*ArrayValue) RecursiveString

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

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

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

func (*ArrayValue) RemoveWithoutTransfer

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

func (*ArrayValue) Reverse

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

func (*ArrayValue) SemaType

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

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

func (v *ArrayValue) SetType(staticType ArrayStaticType)

func (*ArrayValue) SlabID

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

func (*ArrayValue) Slice

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

func (*ArrayValue) StaticType

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

func (*ArrayValue) Storable

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

func (*ArrayValue) StorageAddress

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

func (*ArrayValue) String

func (v *ArrayValue) String() string

func (*ArrayValue) ToConstantSized

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

func (*ArrayValue) ToVariableSized

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

func (*ArrayValue) Transfer

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

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

func (*ArrayValue) Walk

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

type ArrayValueIterator

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

func (ArrayValueIterator) Next

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

type AttachmentIterationMutationError

type AttachmentIterationMutationError struct {
	Value *CompositeValue
	LocationRange
}

AttachmentIterationMutationError

func (AttachmentIterationMutationError) Error

func (AttachmentIterationMutationError) IsUserError

func (AttachmentIterationMutationError) IsUserError()

type Authorization

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

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

type AuthorizedValue

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

func AsBoolValue(v bool) BoolValue

func (BoolValue) Accept

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

func (BoolValue) ByteSize

func (v BoolValue) ByteSize() uint32

func (BoolValue) ChildStorables

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

func (BoolValue) Clone

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

func (BoolValue) ConformsToStaticType

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

func (BoolValue) DeepRemove

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

func (BoolValue) Encode

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

func (BoolValue) GreaterEqual

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

func (BoolValue) HashInput

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

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

func (BoolValue) IsResourceKinded

func (BoolValue) IsResourceKinded(_ *Interpreter) bool

func (BoolValue) Less

func (BoolValue) LessEqual

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

func (BoolValue) MeteredString

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

func (BoolValue) NeedsStoreTo

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

func (BoolValue) Negate

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

func (BoolValue) RecursiveString

func (v BoolValue) RecursiveString(_ SeenReferences) string

func (BoolValue) StaticType

func (BoolValue) StaticType(interpreter *Interpreter) StaticType

func (BoolValue) Storable

func (BoolValue) StoredValue

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

func (BoolValue) String

func (v BoolValue) String() string

func (BoolValue) Transfer

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

func (BoolValue) Walk

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

type BoundFunctionGenerator

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

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

func NewBoundFunctionValueFromSelfReference

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

func NewBoundHostFunctionValue

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

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

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

func (BoundFunctionValue) Clone

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

func (BoundFunctionValue) ConformsToStaticType

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

func (BoundFunctionValue) DeepRemove

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

func (BoundFunctionValue) FunctionType

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

func (BoundFunctionValue) IsImportable

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

func (BoundFunctionValue) IsResourceKinded

func (BoundFunctionValue) IsResourceKinded(_ *Interpreter) bool

func (BoundFunctionValue) MeteredString

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

func (BoundFunctionValue) NeedsStoreTo

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

func (BoundFunctionValue) RecursiveString

func (f BoundFunctionValue) RecursiveString(seenReferences SeenReferences) string

func (BoundFunctionValue) StaticType

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

func (BoundFunctionValue) Storable

func (BoundFunctionValue) String

func (f BoundFunctionValue) String() string

func (BoundFunctionValue) Transfer

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

func (BoundFunctionValue) Walk

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

type BreakResult

type BreakResult struct{}

type CallStack

type CallStack struct {
	Invocations []Invocation
}

CallStack is the stack of invocations (call stack).

func (*CallStack) Pop

func (i *CallStack) Pop()

func (*CallStack) Push

func (i *CallStack) Push(invocation Invocation)

type CapabilityAddressPublishingError

type CapabilityAddressPublishingError struct {
	LocationRange
	CapabilityAddress AddressValue
	AccountAddress    AddressValue
}

CapabilityAddressPublishingError

func (CapabilityAddressPublishingError) Error

func (CapabilityAddressPublishingError) IsUserError

func (CapabilityAddressPublishingError) IsUserError()

type CapabilityBorrowHandlerFunc

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

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

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

type CapabilityStaticType struct {
	BorrowType StaticType
}

func NewCapabilityStaticType

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

func (*CapabilityStaticType) Encode

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

Encode encodes CapabilityStaticType as

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

func (*CapabilityStaticType) Equal

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

func (*CapabilityStaticType) ID

func (t *CapabilityStaticType) ID() TypeID

func (*CapabilityStaticType) IsDeprecated

func (t *CapabilityStaticType) IsDeprecated() bool

func (*CapabilityStaticType) MeteredString

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

func (*CapabilityStaticType) String

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

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

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

func NewCharacterValue_Unsafe deprecated

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

func NewUnmeteredCharacterValue(str string) CharacterValue

func (CharacterValue) Accept

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

func (CharacterValue) ByteSize

func (v CharacterValue) ByteSize() uint32

func (CharacterValue) ChildStorables

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

func (CharacterValue) Clone

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

func (CharacterValue) ConformsToStaticType

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

func (CharacterValue) DeepRemove

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

func (CharacterValue) Encode

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

Encode encodes the value as a CBOR string

func (CharacterValue) Equal

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

func (CharacterValue) GetMember

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

func (CharacterValue) Greater

func (CharacterValue) GreaterEqual

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

func (CharacterValue) HashInput

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

func (CharacterValue) IsImportable

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

func (CharacterValue) IsResourceKinded

func (CharacterValue) IsResourceKinded(_ *Interpreter) bool

func (CharacterValue) Less

func (CharacterValue) LessEqual

func (CharacterValue) MeteredString

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

func (CharacterValue) NeedsStoreTo

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

func (CharacterValue) RecursiveString

func (v CharacterValue) RecursiveString(_ SeenReferences) string

func (CharacterValue) RemoveMember

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

func (CharacterValue) SetMember

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

func (CharacterValue) StaticType

func (CharacterValue) StaticType(interpreter *Interpreter) StaticType

func (CharacterValue) Storable

func (CharacterValue) StoredValue

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

func (CharacterValue) String

func (v CharacterValue) String() string

func (CharacterValue) Transfer

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

func (CharacterValue) Walk

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

type ComparableValue

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

type CompositeField struct {
	Value Value
	Name  string
}

func NewCompositeField

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

func NewUnmeteredCompositeField

func NewUnmeteredCompositeField(name string, value Value) CompositeField

type CompositeStaticType

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

func ConvertSemaCompositeTypeToStaticCompositeType

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

func NewCompositeStaticType

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

func NewCompositeStaticTypeComputeTypeID

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

func (*CompositeStaticType) Encode

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

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

func (*CompositeStaticType) ID

func (t *CompositeStaticType) ID() TypeID

func (*CompositeStaticType) IsDeprecated

func (*CompositeStaticType) IsDeprecated() bool

func (*CompositeStaticType) MeteredString

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

func (*CompositeStaticType) String

func (t *CompositeStaticType) String() string

type CompositeTypeCode

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

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

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

func NewCompositeValueWithStaticType

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

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

func NewInclusiveRangeValue

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

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

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

NewPublicKeyValue constructs a PublicKey value.

func (*CompositeValue) Accept

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

func (*CompositeValue) Clone

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

func (*CompositeValue) CompositeStaticTypeConformsToStaticType

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

func (*CompositeValue) ConformsToStaticType

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

func (*CompositeValue) DeepRemove

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

func (*CompositeValue) Destroy

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

func (*CompositeValue) Equal

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

func (*CompositeValue) FieldCount

func (v *CompositeValue) FieldCount() int

func (*CompositeValue) ForEach

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

func (*CompositeValue) ForEachField

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

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

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

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

func (*CompositeValue) GetComputedField

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

func (*CompositeValue) GetComputedFields

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

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

func (*CompositeValue) GetInjectedField

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

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

func (*CompositeValue) HashInput

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

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

func (*CompositeValue) IsDestroyed

func (v *CompositeValue) IsDestroyed() bool

func (*CompositeValue) IsImportable

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

func (*CompositeValue) IsReferenceTrackedResourceKindedValue

func (v *CompositeValue) IsReferenceTrackedResourceKindedValue()

func (*CompositeValue) IsResourceKinded

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

func (*CompositeValue) IsStaleResource

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

func (*CompositeValue) IsStorable

func (v *CompositeValue) IsStorable() bool

func (*CompositeValue) Iterator

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

func (*CompositeValue) MeteredString

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

func (*CompositeValue) NeedsStoreTo

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

func (*CompositeValue) OwnerValue

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

func (*CompositeValue) RecursiveString

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

func (*CompositeValue) RemoveField

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

func (*CompositeValue) RemoveMember

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

func (*CompositeValue) RemoveTypeKey

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

func (*CompositeValue) ResourceUUID

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

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

func (*CompositeValue) SetNestedVariables

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

func (*CompositeValue) SetTypeKey

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

func (*CompositeValue) SlabID

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

func (*CompositeValue) StaticType

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

func (*CompositeValue) Storable

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

func (*CompositeValue) StorageAddress

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

func (*CompositeValue) String

func (v *CompositeValue) String() string

func (*CompositeValue) Transfer

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

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

func (*CompositeValue) Walk

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

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

CompositeValueFunctionsHandlerFunc is a function that loads composite value functions.

type ComputedField

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

func (ConditionError) IsUserError()

type Config

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

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

func (*ConstantSizedStaticType) Copy

func (*ConstantSizedStaticType) ElementType

func (t *ConstantSizedStaticType) ElementType() StaticType

func (*ConstantSizedStaticType) Encode

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

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

func (*ConstantSizedStaticType) ID

func (*ConstantSizedStaticType) Identifier

func (t *ConstantSizedStaticType) Identifier() string

func (*ConstantSizedStaticType) IsComposite

func (*ConstantSizedStaticType) IsComposite() bool

func (*ConstantSizedStaticType) IsDeprecated

func (t *ConstantSizedStaticType) IsDeprecated() bool

func (*ConstantSizedStaticType) MeteredString

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

func (*ConstantSizedStaticType) String

func (t *ConstantSizedStaticType) String() string

type ContainerMutatedDuringIterationError

type ContainerMutatedDuringIterationError struct {
	LocationRange
}

ContainerMutatedDuringIterationError

func (ContainerMutatedDuringIterationError) Error

func (ContainerMutatedDuringIterationError) IsUserError

type ContainerMutationError

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

ContainerMutationError

func (ContainerMutationError) Error

func (e ContainerMutationError) Error() string

func (ContainerMutationError) IsUserError

func (ContainerMutationError) IsUserError()

type ContinueResult

type ContinueResult struct{}

type ContractNamesGetter

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

type ContractValue

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

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

func NewDebugger

func NewDebugger() *Debugger

func (*Debugger) AddBreakpoint

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

func (*Debugger) ClearBreakpoints

func (d *Debugger) ClearBreakpoints()

func (*Debugger) ClearBreakpointsForLocation

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

func (*Debugger) Continue

func (d *Debugger) Continue()

func (*Debugger) CurrentActivation

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

func (*Debugger) Next

func (d *Debugger) Next() Stop

func (*Debugger) Pause

func (d *Debugger) Pause() Stop

func (*Debugger) RemoveBreakpoint

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

func (*Debugger) RequestPause

func (d *Debugger) RequestPause()

func (*Debugger) Stops

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

func (DereferenceError) IsUserError()

func (DereferenceError) SecondaryError

func (e DereferenceError) SecondaryError() string

type DestroyedResourceError

type DestroyedResourceError struct {
	LocationRange
}

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

func (DestroyedResourceError) Error

func (e DestroyedResourceError) Error() string

func (DestroyedResourceError) IsUserError

func (DestroyedResourceError) IsUserError()

type DictionaryEntryValues

type DictionaryEntryValues struct {
	Key   Value
	Value Value
}

type DictionaryKeyIterator

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

func (DictionaryKeyIterator) Next

func (DictionaryKeyIterator) NextKey

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

func (DictionaryKeyIterator) NextKeyUnconverted

func (i DictionaryKeyIterator) NextKeyUnconverted() atree.Value

type DictionaryStaticType

type DictionaryStaticType struct {
	KeyType   StaticType
	ValueType StaticType
}

func ConvertSemaDictionaryTypeToStaticDictionaryType

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

func NewDictionaryStaticType

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

func (*DictionaryStaticType) Copy

func (*DictionaryStaticType) Encode

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

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

func (*DictionaryStaticType) ID

func (t *DictionaryStaticType) ID() TypeID

func (*DictionaryStaticType) Identifier

func (t *DictionaryStaticType) Identifier() string

func (*DictionaryStaticType) IsComposite

func (*DictionaryStaticType) IsComposite() bool

func (*DictionaryStaticType) IsDeprecated

func (t *DictionaryStaticType) IsDeprecated() bool

func (*DictionaryStaticType) MeteredString

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

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

func NewDictionaryValueWithAddress

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

func (*DictionaryValue) Accept

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

func (*DictionaryValue) Clone

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

func (*DictionaryValue) ConformsToStaticType

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

func (*DictionaryValue) ContainsKey

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

func (*DictionaryValue) Count

func (v *DictionaryValue) Count() int

func (*DictionaryValue) DeepRemove

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

func (*DictionaryValue) Destroy

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

func (*DictionaryValue) Equal

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

func (*DictionaryValue) ForEachKey

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

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

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

func (*DictionaryValue) InsertWithoutTransfer

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

func (*DictionaryValue) IsDestroyed

func (v *DictionaryValue) IsDestroyed() bool

func (*DictionaryValue) IsImportable

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

func (*DictionaryValue) IsReferenceTrackedResourceKindedValue

func (v *DictionaryValue) IsReferenceTrackedResourceKindedValue()

func (*DictionaryValue) IsResourceKinded

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

func (*DictionaryValue) IsStaleResource

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

func (*DictionaryValue) Iterate

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

func (*DictionaryValue) IterateKeys

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

func (*DictionaryValue) IterateReadOnly

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

func (*DictionaryValue) IterateReadOnlyLoaded

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

func (v *DictionaryValue) Iterator() DictionaryKeyIterator

func (*DictionaryValue) MeteredString

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

func (*DictionaryValue) NeedsStoreTo

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

func (*DictionaryValue) RecursiveString

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

func (*DictionaryValue) Remove

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

func (*DictionaryValue) RemoveKey

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

func (*DictionaryValue) RemoveMember

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

func (*DictionaryValue) RemoveWithoutTransfer

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

func (*DictionaryValue) SemaType

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

func (*DictionaryValue) SetKey

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

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

func (*DictionaryValue) SlabID

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

func (*DictionaryValue) StaticType

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

func (*DictionaryValue) Storable

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

func (*DictionaryValue) StorageAddress

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

func (*DictionaryValue) String

func (v *DictionaryValue) String() string

func (*DictionaryValue) Transfer

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

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

func (*DictionaryValue) Walk

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

func (DivisionByZeroError) IsUserError()

type DuplicateAttachmentError

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

DuplicateAttachmentError

func (DuplicateAttachmentError) Error

func (e DuplicateAttachmentError) Error() string

func (DuplicateAttachmentError) IsUserError

func (DuplicateAttachmentError) IsUserError()

type DuplicateKeyInResourceDictionaryError

type DuplicateKeyInResourceDictionaryError struct {
	LocationRange
}

DuplicateKeyInResourceDictionaryError

func (DuplicateKeyInResourceDictionaryError) Error

func (DuplicateKeyInResourceDictionaryError) IsUserError

type EmptyTypeInfo

type EmptyTypeInfo struct{}

EmptyTypeInfo

func (EmptyTypeInfo) Copy

func (e EmptyTypeInfo) Copy() atree.TypeInfo

func (EmptyTypeInfo) Encode

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

func (EmptyTypeInfo) Identifier

func (e EmptyTypeInfo) Identifier() string

func (EmptyTypeInfo) IsComposite

func (e EmptyTypeInfo) IsComposite() bool

type EmptyVisitor

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

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

func (EmptyVisitor) VisitAddressValue

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

func (EmptyVisitor) VisitArrayValue

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

func (EmptyVisitor) VisitBoolValue

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

func (EmptyVisitor) VisitBoundFunctionValue

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

func (EmptyVisitor) VisitCapabilityValue

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

func (EmptyVisitor) VisitCharacterValue

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

func (EmptyVisitor) VisitCompositeValue

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

func (EmptyVisitor) VisitDictionaryValue

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

func (EmptyVisitor) VisitEphemeralReferenceValue

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

func (EmptyVisitor) VisitFix64Value

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

func (EmptyVisitor) VisitHostFunctionValue

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

func (EmptyVisitor) VisitInt128Value

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

func (EmptyVisitor) VisitInt16Value

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

func (EmptyVisitor) VisitInt256Value

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

func (EmptyVisitor) VisitInt32Value

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

func (EmptyVisitor) VisitInt64Value

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

func (EmptyVisitor) VisitInt8Value

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

func (EmptyVisitor) VisitIntValue

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

func (EmptyVisitor) VisitInterpretedFunctionValue

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

func (EmptyVisitor) VisitNilValue

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

func (EmptyVisitor) VisitPathValue

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

func (EmptyVisitor) VisitPublishedValue

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

func (EmptyVisitor) VisitSimpleCompositeValue

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

func (EmptyVisitor) VisitSomeValue

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

func (EmptyVisitor) VisitStorageCapabilityControllerValue

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

func (EmptyVisitor) VisitStorageReferenceValue

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

func (EmptyVisitor) VisitStringValue

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

func (EmptyVisitor) VisitTypeValue

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

func (EmptyVisitor) VisitUFix64Value

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

func (EmptyVisitor) VisitUInt128Value

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

func (EmptyVisitor) VisitUInt16Value

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

func (EmptyVisitor) VisitUInt256Value

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

func (EmptyVisitor) VisitUInt32Value

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

func (EmptyVisitor) VisitUInt64Value

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

func (EmptyVisitor) VisitUInt8Value

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

func (EmptyVisitor) VisitUIntValue

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

func (EmptyVisitor) VisitVoidValue

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

func (EmptyVisitor) VisitWord128Value

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

func (EmptyVisitor) VisitWord16Value

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

func (EmptyVisitor) VisitWord256Value

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

func (EmptyVisitor) VisitWord32Value

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

func (EmptyVisitor) VisitWord64Value

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

func (EmptyVisitor) VisitWord8Value

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

type EntitledCapabilityPublishingError

type EntitledCapabilityPublishingError struct {
	LocationRange
	BorrowType *ReferenceStaticType
	Path       PathValue
}

EntitledCapabilityPublishingError

func (EntitledCapabilityPublishingError) Error

func (EntitledCapabilityPublishingError) IsUserError

func (EntitledCapabilityPublishingError) IsUserError()

type EntitlementMapAuthorization

type EntitlementMapAuthorization struct {
	TypeID common.TypeID
}

func NewEntitlementMapAuthorization

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

func (EntitlementMapAuthorization) Encode

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

func (EntitlementMapAuthorization) Equal

func (EntitlementMapAuthorization) ID

func (EntitlementMapAuthorization) MeteredString

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

func (EntitlementMapAuthorization) String

type EntitlementSetAuthorization

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

func NewEntitlementSetAuthorization

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

func (EntitlementSetAuthorization) Encode

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

func (EntitlementSetAuthorization) Equal

func (EntitlementSetAuthorization) ID

func (EntitlementSetAuthorization) MeteredString

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

func (EntitlementSetAuthorization) String

type EnumCase

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

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

func NewUnmeteredEphemeralReferenceValue

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

func (*EphemeralReferenceValue) Accept

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

func (*EphemeralReferenceValue) BorrowType

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

func (*EphemeralReferenceValue) Clone

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

func (*EphemeralReferenceValue) ConformsToStaticType

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

func (*EphemeralReferenceValue) DeepRemove

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

func (*EphemeralReferenceValue) Equal

func (*EphemeralReferenceValue) ForEach

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

func (*EphemeralReferenceValue) GetAuthorization

func (v *EphemeralReferenceValue) GetAuthorization() Authorization

func (*EphemeralReferenceValue) GetKey

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

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

func (*EphemeralReferenceValue) InsertKey

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

func (*EphemeralReferenceValue) IsImportable

func (*EphemeralReferenceValue) IsResourceKinded

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

func (*EphemeralReferenceValue) IsStorable

func (*EphemeralReferenceValue) IsStorable() bool

func (*EphemeralReferenceValue) Iterator

func (*EphemeralReferenceValue) MeteredString

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

func (*EphemeralReferenceValue) NeedsStoreTo

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

func (*EphemeralReferenceValue) RecursiveString

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

func (*EphemeralReferenceValue) ReferencedValue

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

func (*EphemeralReferenceValue) RemoveKey

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

func (*EphemeralReferenceValue) RemoveMember

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

func (*EphemeralReferenceValue) RemoveTypeKey

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

func (*EphemeralReferenceValue) SetKey

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

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

func (*EphemeralReferenceValue) StaticType

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

func (*EphemeralReferenceValue) Storable

func (*EphemeralReferenceValue) String

func (v *EphemeralReferenceValue) String() string

func (*EphemeralReferenceValue) Transfer

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

func (*EphemeralReferenceValue) Walk

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

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

func (e Error) ChildErrors() []error

func (Error) Error

func (e Error) Error() string

func (Error) ImportLocation

func (e Error) ImportLocation() common.Location

func (Error) Unwrap

func (e Error) Unwrap() error

type EventEmissionUnavailableError

type EventEmissionUnavailableError struct {
	LocationRange
}

EventEmissionUnavailableError

func (EventEmissionUnavailableError) Error

func (EventEmissionUnavailableError) IsUserError

func (EventEmissionUnavailableError) IsUserError()

type ExpressionResult

type ExpressionResult struct {
	Value
}

type Fix64Value

type Fix64Value int64

Fix64Value

func ConvertFix64

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

func NewFix64Value

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

func NewFix64ValueWithInteger

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

func NewUnmeteredFix64Value

func NewUnmeteredFix64Value(integer int64) Fix64Value

func NewUnmeteredFix64ValueWithInteger

func NewUnmeteredFix64ValueWithInteger(integer int64, locationRange LocationRange) Fix64Value

func (Fix64Value) Accept

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

func (Fix64Value) ByteSize

func (v Fix64Value) ByteSize() uint32

func (Fix64Value) ChildStorables

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

func (Fix64Value) Clone

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

func (Fix64Value) ConformsToStaticType

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

func (Fix64Value) DeepRemove

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

func (Fix64Value) Div

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

func (Fix64Value) Encode

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

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

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

func (v Fix64Value) IntegerPart() NumberValue

func (Fix64Value) IsImportable

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

func (Fix64Value) IsResourceKinded

func (Fix64Value) IsResourceKinded(_ *Interpreter) bool

func (Fix64Value) IsStorable

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

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

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

func (v Fix64Value) RecursiveString(_ SeenReferences) string

func (Fix64Value) RemoveMember

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

func (Fix64Value) SaturatingDiv

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

func (Fix64Value) SaturatingMinus

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

func (Fix64Value) SaturatingMul

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

func (Fix64Value) SaturatingPlus

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

func (Fix64Value) Scale

func (Fix64Value) Scale() int

func (Fix64Value) SetMember

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

func (Fix64Value) StaticType

func (Fix64Value) StaticType(interpreter *Interpreter) StaticType

func (Fix64Value) Storable

func (Fix64Value) StoredValue

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

func (Fix64Value) String

func (v Fix64Value) String() string

func (Fix64Value) ToBigEndianBytes

func (v Fix64Value) ToBigEndianBytes() []byte

func (Fix64Value) ToInt

func (v Fix64Value) ToInt(_ LocationRange) int

func (Fix64Value) Transfer

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

func (Fix64Value) Walk

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

type FixedPointValue

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

FixedPointValue is a fixed-point number value

type ForceCastTypeMismatchError

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

ForceCastTypeMismatchError

func (ForceCastTypeMismatchError) Error

func (ForceCastTypeMismatchError) IsUserError

func (ForceCastTypeMismatchError) IsUserError()

type ForceNilError

type ForceNilError struct {
	LocationRange
}

ForceNilError

func (ForceNilError) Error

func (e ForceNilError) Error() string

func (ForceNilError) IsUserError

func (ForceNilError) IsUserError()

type FunctionOrderedMap

type FunctionOrderedMap = orderedmap.OrderedMap[string, FunctionValue]

type FunctionStaticType

type FunctionStaticType struct {
	Type *sema.FunctionType
}

func NewFunctionStaticType

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

func (FunctionStaticType) Encode

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

func (FunctionStaticType) Equal

func (t FunctionStaticType) Equal(other StaticType) bool

func (FunctionStaticType) ID

func (t FunctionStaticType) ID() TypeID

func (FunctionStaticType) IsDeprecated

func (FunctionStaticType) IsDeprecated() bool

func (FunctionStaticType) MeteredString

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

func (FunctionStaticType) ReturnType

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

func (FunctionStaticType) String

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

type GetCapabilityError struct {
	LocationRange
}

GetCapabilityError

func (GetCapabilityError) Error

func (e GetCapabilityError) Error() string

func (GetCapabilityError) IsUserError

func (GetCapabilityError) IsUserError()

type GlobalVariables

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

GlobalVariables represents global variables defined in a program.

func (*GlobalVariables) Contains

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

func (*GlobalVariables) Get

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

func (*GlobalVariables) Set

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

type HashInputType

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

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

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

func NewStaticHostFunctionValue

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

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

func (*HostFunctionValue) Accept

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

func (*HostFunctionValue) Clone

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

func (*HostFunctionValue) ConformsToStaticType

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

func (*HostFunctionValue) DeepRemove

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

func (*HostFunctionValue) FunctionType

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

func (*HostFunctionValue) GetMember

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

func (*HostFunctionValue) IsImportable

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

func (*HostFunctionValue) IsResourceKinded

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

func (*HostFunctionValue) MeteredString

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

func (*HostFunctionValue) NeedsStoreTo

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

func (*HostFunctionValue) RecursiveString

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

func (*HostFunctionValue) RemoveMember

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

func (*HostFunctionValue) SetMember

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

func (*HostFunctionValue) SetNestedVariables

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

func (*HostFunctionValue) StaticType

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

func (*HostFunctionValue) Storable

func (*HostFunctionValue) String

func (f *HostFunctionValue) String() string

func (*HostFunctionValue) Transfer

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

func (*HostFunctionValue) Walk

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

type IDCapabilityValue

type IDCapabilityValue struct {
	BorrowType StaticType

	ID UInt64Value
	// contains filtered or unexported fields
}

func NewCapabilityValue

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

func NewInvalidCapabilityValue

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

func NewUnmeteredCapabilityValue

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

func (*IDCapabilityValue) Accept

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

func (*IDCapabilityValue) Address

func (v *IDCapabilityValue) Address() AddressValue

func (*IDCapabilityValue) ByteSize

func (v *IDCapabilityValue) ByteSize() uint32

func (*IDCapabilityValue) ChildStorables

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

func (*IDCapabilityValue) Clone

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

func (*IDCapabilityValue) ConformsToStaticType

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

func (*IDCapabilityValue) DeepRemove

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

func (*IDCapabilityValue) Encode

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

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

func (*IDCapabilityValue) GetMember

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

func (*IDCapabilityValue) IsImportable

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

func (*IDCapabilityValue) IsResourceKinded

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

func (*IDCapabilityValue) IsStorable

func (*IDCapabilityValue) IsStorable() bool

func (*IDCapabilityValue) MeteredString

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

func (*IDCapabilityValue) NeedsStoreTo

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

func (*IDCapabilityValue) RecursiveString

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

func (*IDCapabilityValue) RemoveMember

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

func (*IDCapabilityValue) SetMember

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

func (*IDCapabilityValue) StaticType

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

func (*IDCapabilityValue) Storable

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

func (*IDCapabilityValue) StoredValue

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

func (*IDCapabilityValue) String

func (v *IDCapabilityValue) String() string

func (*IDCapabilityValue) Transfer

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

func (*IDCapabilityValue) Walk

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

type Import

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

type ImportLocationHandlerFunc

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

ImportLocationHandlerFunc is a function that handles imports of locations.

type InMemoryStorage

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

InMemoryStorage

func NewInMemoryStorage

func NewInMemoryStorage(memoryGauge common.MemoryGauge) InMemoryStorage

func (InMemoryStorage) CheckHealth

func (i InMemoryStorage) CheckHealth() error

func (InMemoryStorage) GetStorageMap

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

type Inaccessible

type Inaccessible struct{}

func (Inaccessible) Encode

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

func (Inaccessible) Equal

func (Inaccessible) Equal(auth Authorization) bool

func (Inaccessible) ID

func (Inaccessible) ID() TypeID

func (Inaccessible) MeteredString

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

func (Inaccessible) String

func (Inaccessible) String() string

type InclusiveRangeConstructionError

type InclusiveRangeConstructionError struct {
	LocationRange
	Message string
}

func (InclusiveRangeConstructionError) Error

func (InclusiveRangeConstructionError) IsUserError

func (InclusiveRangeConstructionError) IsUserError()

type InclusiveRangeIterator

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

func NewInclusiveRangeIterator

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

func (*InclusiveRangeIterator) Next

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

type InclusiveRangeStaticType

type InclusiveRangeStaticType struct {
	ElementType StaticType
}

func NewInclusiveRangeStaticType

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

func (InclusiveRangeStaticType) Encode

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

Encode encodes InclusiveRangeStaticType as

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

func (InclusiveRangeStaticType) Equal

func (t InclusiveRangeStaticType) Equal(other StaticType) bool

func (InclusiveRangeStaticType) ID

func (InclusiveRangeStaticType) IsDeprecated

func (t InclusiveRangeStaticType) IsDeprecated() bool

func (InclusiveRangeStaticType) MeteredString

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

func (InclusiveRangeStaticType) String

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

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

func NewUnmeteredInt128ValueFromBigInt

func NewUnmeteredInt128ValueFromBigInt(value *big.Int) Int128Value

func NewUnmeteredInt128ValueFromInt64

func NewUnmeteredInt128ValueFromInt64(value int64) Int128Value

func (Int128Value) Accept

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

func (Int128Value) BitwiseAnd

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

func (Int128Value) BitwiseLeftShift

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

func (Int128Value) BitwiseOr

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

func (Int128Value) BitwiseRightShift

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

func (Int128Value) BitwiseXor

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

func (Int128Value) ByteLength

func (v Int128Value) ByteLength() int

func (Int128Value) ByteSize

func (v Int128Value) ByteSize() uint32

func (Int128Value) ChildStorables

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

func (Int128Value) Clone

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

func (Int128Value) ConformsToStaticType

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

func (Int128Value) DeepRemove

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

func (Int128Value) Div

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

func (Int128Value) Encode

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

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

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

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

func (Int128Value) IsResourceKinded

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

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

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

func (v Int128Value) RecursiveString(_ SeenReferences) string

func (Int128Value) RemoveMember

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

func (Int128Value) SaturatingDiv

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

func (Int128Value) SaturatingMinus

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

func (Int128Value) SaturatingMul

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

func (Int128Value) SaturatingPlus

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

func (Int128Value) SetMember

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

func (Int128Value) StaticType

func (Int128Value) StaticType(interpreter *Interpreter) StaticType

func (Int128Value) Storable

func (Int128Value) StoredValue

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

func (Int128Value) String

func (v Int128Value) String() string

func (Int128Value) ToBigEndianBytes

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

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

func (Int128Value) Walk

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

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

func NewUnmeteredInt16Value

func NewUnmeteredInt16Value(value int16) Int16Value

func (Int16Value) Accept

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

func (Int16Value) BitwiseAnd

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

func (Int16Value) BitwiseLeftShift

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

func (Int16Value) BitwiseOr

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

func (Int16Value) BitwiseRightShift

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

func (Int16Value) BitwiseXor

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

func (Int16Value) ByteSize

func (v Int16Value) ByteSize() uint32

func (Int16Value) ChildStorables

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

func (Int16Value) Clone

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

func (Int16Value) ConformsToStaticType

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

func (Int16Value) DeepRemove

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

func (Int16Value) Div

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

func (Int16Value) Encode

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

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

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

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

func (Int16Value) IsResourceKinded

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

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

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

func (v Int16Value) RecursiveString(_ SeenReferences) string

func (Int16Value) RemoveMember

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

func (Int16Value) SaturatingDiv

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

func (Int16Value) SaturatingMinus

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

func (Int16Value) SaturatingMul

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

func (Int16Value) SaturatingPlus

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

func (Int16Value) SetMember

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

func (Int16Value) StaticType

func (Int16Value) StaticType(interpreter *Interpreter) StaticType

func (Int16Value) Storable

func (Int16Value) StoredValue

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

func (Int16Value) String

func (v Int16Value) String() string

func (Int16Value) ToBigEndianBytes

func (v Int16Value) ToBigEndianBytes() []byte

func (Int16Value) ToInt

func (v Int16Value) ToInt(_ LocationRange) int

func (Int16Value) Transfer

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

func (Int16Value) Walk

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

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

func NewUnmeteredInt256ValueFromBigInt

func NewUnmeteredInt256ValueFromBigInt(value *big.Int) Int256Value

func NewUnmeteredInt256ValueFromInt64

func NewUnmeteredInt256ValueFromInt64(value int64) Int256Value

func (Int256Value) Accept

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

func (Int256Value) BitwiseAnd

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

func (Int256Value) BitwiseLeftShift

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

func (Int256Value) BitwiseOr

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

func (Int256Value) BitwiseRightShift

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

func (Int256Value) BitwiseXor

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

func (Int256Value) ByteLength

func (v Int256Value) ByteLength() int

func (Int256Value) ByteSize

func (v Int256Value) ByteSize() uint32

func (Int256Value) ChildStorables

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

func (Int256Value) Clone

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

func (Int256Value) ConformsToStaticType

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

func (Int256Value) DeepRemove

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

func (Int256Value) Div

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

func (Int256Value) Encode

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

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

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

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

func (Int256Value) IsResourceKinded

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

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

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

func (v Int256Value) RecursiveString(_ SeenReferences) string

func (Int256Value) RemoveMember

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

func (Int256Value) SaturatingDiv

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

func (Int256Value) SaturatingMinus

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

func (Int256Value) SaturatingMul

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

func (Int256Value) SaturatingPlus

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

func (Int256Value) SetMember

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

func (Int256Value) StaticType

func (Int256Value) StaticType(interpreter *Interpreter) StaticType

func (Int256Value) Storable

func (Int256Value) StoredValue

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

func (Int256Value) String

func (v Int256Value) String() string

func (Int256Value) ToBigEndianBytes

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

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

func (Int256Value) Walk

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

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

func NewUnmeteredInt32Value

func NewUnmeteredInt32Value(value int32) Int32Value

func (Int32Value) Accept

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

func (Int32Value) BitwiseAnd

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

func (Int32Value) BitwiseLeftShift

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

func (Int32Value) BitwiseOr

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

func (Int32Value) BitwiseRightShift

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

func (Int32Value) BitwiseXor

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

func (Int32Value) ByteSize

func (v Int32Value) ByteSize() uint32

func (Int32Value) ChildStorables

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

func (Int32Value) Clone

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

func (Int32Value) ConformsToStaticType

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

func (Int32Value) DeepRemove

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

func (Int32Value) Div

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

func (Int32Value) Encode

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

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

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

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

func (Int32Value) IsResourceKinded

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

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

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

func (v Int32Value) RecursiveString(_ SeenReferences) string

func (Int32Value) RemoveMember

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

func (Int32Value) SaturatingDiv

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

func (Int32Value) SaturatingMinus

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

func (Int32Value) SaturatingMul

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

func (Int32Value) SaturatingPlus

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

func (Int32Value) SetMember

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

func (Int32Value) StaticType

func (Int32Value) StaticType(interpreter *Interpreter) StaticType

func (Int32Value) Storable

func (Int32Value) StoredValue

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

func (Int32Value) String

func (v Int32Value) String() string

func (Int32Value) ToBigEndianBytes

func (v Int32Value) ToBigEndianBytes() []byte

func (Int32Value) ToInt

func (v Int32Value) ToInt(_ LocationRange) int

func (Int32Value) Transfer

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

func (Int32Value) Walk

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

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

func NewUnmeteredInt64Value

func NewUnmeteredInt64Value(value int64) Int64Value

func (Int64Value) Accept

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

func (Int64Value) BitwiseAnd

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

func (Int64Value) BitwiseLeftShift

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

func (Int64Value) BitwiseOr

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

func (Int64Value) BitwiseRightShift

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

func (Int64Value) BitwiseXor

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

func (Int64Value) ByteSize

func (v Int64Value) ByteSize() uint32

func (Int64Value) ChildStorables

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

func (Int64Value) Clone

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

func (Int64Value) ConformsToStaticType

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

func (Int64Value) DeepRemove

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

func (Int64Value) Div

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

func (Int64Value) Encode

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

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

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

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

func (Int64Value) IsResourceKinded

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

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

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

func (v Int64Value) RecursiveString(_ SeenReferences) string

func (Int64Value) RemoveMember

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

func (Int64Value) SaturatingDiv

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

func (Int64Value) SaturatingMinus

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

func (Int64Value) SaturatingMul

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

func (Int64Value) SaturatingPlus

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

func (Int64Value) SetMember

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

func (Int64Value) StaticType

func (Int64Value) StaticType(interpreter *Interpreter) StaticType

func (Int64Value) Storable

func (Int64Value) StoredValue

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

func (Int64Value) String

func (v Int64Value) String() string

func (Int64Value) ToBigEndianBytes

func (v Int64Value) ToBigEndianBytes() []byte

func (Int64Value) ToInt

func (v Int64Value) ToInt(_ LocationRange) int

func (Int64Value) Transfer

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

func (Int64Value) Walk

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

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

func NewUnmeteredInt8Value

func NewUnmeteredInt8Value(value int8) Int8Value

func (Int8Value) Accept

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

func (Int8Value) BitwiseAnd

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

func (Int8Value) BitwiseLeftShift

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

func (Int8Value) BitwiseOr

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

func (Int8Value) BitwiseRightShift

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

func (Int8Value) BitwiseXor

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

func (Int8Value) ByteSize

func (v Int8Value) ByteSize() uint32

func (Int8Value) ChildStorables

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

func (Int8Value) Clone

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

func (Int8Value) ConformsToStaticType

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

func (Int8Value) DeepRemove

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

func (Int8Value) Div

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

func (Int8Value) Encode

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

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

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

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

func (Int8Value) IsResourceKinded

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

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

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

func (v Int8Value) RecursiveString(_ SeenReferences) string

func (Int8Value) RemoveMember

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

func (Int8Value) SaturatingDiv

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

func (Int8Value) SaturatingMinus

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

func (Int8Value) SaturatingMul

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

func (Int8Value) SaturatingPlus

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

func (Int8Value) SetMember

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

func (Int8Value) StaticType

func (Int8Value) StaticType(interpreter *Interpreter) StaticType

func (Int8Value) Storable

func (Int8Value) StoredValue

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

func (Int8Value) String

func (v Int8Value) String() string

func (Int8Value) ToBigEndianBytes

func (v Int8Value) ToBigEndianBytes() []byte

func (Int8Value) ToInt

func (v Int8Value) ToInt(_ LocationRange) int

func (Int8Value) Transfer

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

func (Int8Value) Walk

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

func NewUnmeteredIntValueFromBigInt(value *big.Int) IntValue

func NewUnmeteredIntValueFromInt64

func NewUnmeteredIntValueFromInt64(value int64) IntValue

func (IntValue) Accept

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

func (IntValue) BitwiseAnd

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

func (IntValue) BitwiseLeftShift

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

func (IntValue) BitwiseOr

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

func (IntValue) BitwiseRightShift

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

func (IntValue) BitwiseXor

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

func (IntValue) ByteLength

func (v IntValue) ByteLength() int

func (IntValue) ByteSize

func (v IntValue) ByteSize() uint32

func (IntValue) ChildStorables

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

func (IntValue) Clone

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

func (IntValue) ConformsToStaticType

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

func (IntValue) DeepRemove

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

func (IntValue) Div

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

func (IntValue) Encode

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

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

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

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

func (IntValue) IsResourceKinded

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

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

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

func (v IntValue) RecursiveString(_ SeenReferences) string

func (IntValue) RemoveMember

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

func (IntValue) SaturatingDiv

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

func (IntValue) SaturatingMinus

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

func (IntValue) SaturatingMul

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

func (IntValue) SaturatingPlus

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

func (IntValue) SetMember

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

func (IntValue) StaticType

func (IntValue) StaticType(interpreter *Interpreter) StaticType

func (IntValue) Storable

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

func (IntValue) StoredValue

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

func (IntValue) String

func (v IntValue) String() string

func (IntValue) ToBigEndianBytes

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

func (v IntValue) ToUint32(locationRange LocationRange) uint32

func (IntValue) Transfer

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

func (IntValue) Walk

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

type IntegerValue

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

func GetSmallIntegerValue(value int8, staticType StaticType) IntegerValue

type InterfaceMissingLocationError

type InterfaceMissingLocationError struct {
	QualifiedIdentifier string
}

InterfaceMissingLocation is reported during interface lookup, if an interface is looked up without a location

func (InterfaceMissingLocationError) Error

func (InterfaceMissingLocationError) IsUserError

func (InterfaceMissingLocationError) IsUserError()

type InterfaceStaticType

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

func ConvertSemaInterfaceTypeToStaticInterfaceType

func ConvertSemaInterfaceTypeToStaticInterfaceType(
	memoryGauge common.MemoryGauge,
	t *sema.InterfaceType,
) *InterfaceStaticType

func NewInterfaceStaticType

func NewInterfaceStaticType(
	memoryGauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
	typeID common.TypeID,
) *InterfaceStaticType

func NewInterfaceStaticTypeComputeTypeID

func NewInterfaceStaticTypeComputeTypeID(
	memoryGauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
) *InterfaceStaticType

func (*InterfaceStaticType) Encode

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

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

func (*InterfaceStaticType) ID

func (t *InterfaceStaticType) ID() TypeID

func (*InterfaceStaticType) IsDeprecated

func (*InterfaceStaticType) IsDeprecated() bool

func (*InterfaceStaticType) MeteredString

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

func (*InterfaceStaticType) String

func (t *InterfaceStaticType) String() string

type InterfaceTypeHandlerFunc

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.Condition
	Statements       []ast.Statement
	PostConditions   []ast.Condition
}

InterpretedFunctionValue

func NewInterpretedFunctionValue

func NewInterpretedFunctionValue(
	interpreter *Interpreter,
	parameterList *ast.ParameterList,
	functionType *sema.FunctionType,
	lexicalScope *VariableActivation,
	beforeStatements []ast.Statement,
	preConditions []ast.Condition,
	statements []ast.Statement,
	postConditions []ast.Condition,
) *InterpretedFunctionValue

func (*InterpretedFunctionValue) Accept

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

func (*InterpretedFunctionValue) Clone

func (*InterpretedFunctionValue) ConformsToStaticType

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

func (*InterpretedFunctionValue) DeepRemove

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

func (*InterpretedFunctionValue) FunctionType

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

func (*InterpretedFunctionValue) IsImportable

func (*InterpretedFunctionValue) IsResourceKinded

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

func (*InterpretedFunctionValue) MeteredString

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

func (*InterpretedFunctionValue) NeedsStoreTo

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

func (*InterpretedFunctionValue) RecursiveString

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

func (*InterpretedFunctionValue) StaticType

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

func (*InterpretedFunctionValue) Storable

func (*InterpretedFunctionValue) String

func (f *InterpretedFunctionValue) String() string

func (*InterpretedFunctionValue) Transfer

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

func (*InterpretedFunctionValue) Walk

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

func NewInterpreterWithSharedState(
	program *Program,
	location common.Location,
	sharedState *SharedState,
) (*Interpreter, error)

func (*Interpreter) AllElaborations

func (interpreter *Interpreter) AllElaborations() (elaborations map[common.Location]*sema.Elaboration)

func (*Interpreter) BoxOptional

func (interpreter *Interpreter) BoxOptional(
	locationRange LocationRange,
	value Value,
	targetType sema.Type,
) Value

BoxOptional boxes a value in optionals, if necessary

func (*Interpreter) CallStack

func (interpreter *Interpreter) CallStack() []Invocation

func (*Interpreter) ConvertAndBox

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

func (interpreter *Interpreter) ConvertStaticToSemaType(staticType StaticType) (sema.Type, error)

func (*Interpreter) DecodeStorable

func (interpreter *Interpreter) DecodeStorable(
	decoder *cbor.StreamDecoder,
	slabID atree.SlabID,
	inlinedExtraData []atree.ExtraData,
) (
	atree.Storable,
	error,
)

func (*Interpreter) DecodeTypeInfo

func (interpreter *Interpreter) DecodeTypeInfo(decoder *cbor.StreamDecoder) (atree.TypeInfo, error)

func (*Interpreter) EnsureLoaded

func (interpreter *Interpreter) EnsureLoaded(
	location common.Location,
) *Interpreter

func (*Interpreter) ExpectType

func (interpreter *Interpreter) ExpectType(
	value Value,
	expectedType sema.Type,
	locationRange LocationRange,
)

func (*Interpreter) FindVariable

func (interpreter *Interpreter) FindVariable(name string) Variable

func (*Interpreter) GetCompositeType

func (interpreter *Interpreter) GetCompositeType(
	location common.Location,
	qualifiedIdentifier string,
	typeID TypeID,
) (*sema.CompositeType, error)

func (*Interpreter) GetCompositeValueComputedFields

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

func (*Interpreter) GetCompositeValueFunctions

func (interpreter *Interpreter) GetCompositeValueFunctions(
	v *CompositeValue,
	locationRange LocationRange,
) *FunctionOrderedMap

func (*Interpreter) GetCompositeValueInjectedFields

func (interpreter *Interpreter) GetCompositeValueInjectedFields(v *CompositeValue) map[string]Value

func (*Interpreter) GetContractComposite

func (interpreter *Interpreter) GetContractComposite(contractLocation common.AddressLocation) (*CompositeValue, error)

GetContractComposite gets the composite value of the contract at the address location.

func (*Interpreter) GetEntitlementMapType

func (interpreter *Interpreter) GetEntitlementMapType(typeID common.TypeID) (*sema.EntitlementMapType, error)

func (*Interpreter) GetEntitlementType

func (interpreter *Interpreter) GetEntitlementType(typeID common.TypeID) (*sema.EntitlementType, error)

func (*Interpreter) GetInterfaceType

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

func (interpreter *Interpreter) InvokeExternally(
	functionValue FunctionValue,
	functionType *sema.FunctionType,
	arguments []Value,
) (
	result Value,
	err error,
)

func (*Interpreter) InvokeFunction

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

func (interpreter *Interpreter) IsSubTypeOfSemaType(staticSubType StaticType, superType sema.Type) bool

func (*Interpreter) MeterMemory

func (interpreter *Interpreter) MeterMemory(usage common.MemoryUsage) error

MeterMemory delegates the memory usage to the interpreter's memory gauge, if any.

func (*Interpreter) MustConvertStaticAuthorizationToSemaAccess

func (interpreter *Interpreter) MustConvertStaticAuthorizationToSemaAccess(auth Authorization) sema.Access

func (*Interpreter) MustConvertStaticToSemaType

func (interpreter *Interpreter) MustConvertStaticToSemaType(staticType StaticType) sema.Type

func (*Interpreter) MustSemaTypeOfValue

func (interpreter *Interpreter) MustSemaTypeOfValue(value Value) sema.Type

func (*Interpreter) NewIntegerValueFromBigInt

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

func (interpreter *Interpreter) NewSubInterpreter(
	program *Program,
	location common.Location,
) (
	*Interpreter,
	error,
)

func (*Interpreter) ReadStored

func (interpreter *Interpreter) ReadStored(
	storageAddress common.Address,
	domain string,
	identifier StorageMapKey,
) Value

func (*Interpreter) RecoverErrors

func (interpreter *Interpreter) RecoverErrors(onError func(error))

func (*Interpreter) RemoveReferencedSlab

func (interpreter *Interpreter) RemoveReferencedSlab(storable atree.Storable)

func (*Interpreter) ReportComputation

func (interpreter *Interpreter) ReportComputation(compKind common.ComputationKind, intensity uint)

func (*Interpreter) Storage

func (interpreter *Interpreter) Storage() Storage

func (*Interpreter) StoredValueExists

func (interpreter *Interpreter) StoredValueExists(
	storageAddress common.Address,
	domain string,
	identifier StorageMapKey,
) bool

func (*Interpreter) SubstituteMappedEntitlements

func (interpreter *Interpreter) SubstituteMappedEntitlements(ty sema.Type) sema.Type

func (*Interpreter) Unbox

func (interpreter *Interpreter) Unbox(locationRange LocationRange, value Value) Value

func (*Interpreter) ValidateAtreeValue

func (interpreter *Interpreter) ValidateAtreeValue(value atree.Value)

func (*Interpreter) ValueIsSubtypeOfSemaType

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

func (interpreter *Interpreter) VisitAttachExpression(attachExpression *ast.AttachExpression) Value

func (*Interpreter) VisitAttachmentDeclaration

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

func (interpreter *Interpreter) VisitEntitlementDeclaration(_ *ast.EntitlementDeclaration) StatementResult

func (*Interpreter) VisitEntitlementMappingDeclaration

func (interpreter *Interpreter) VisitEntitlementMappingDeclaration(_ *ast.EntitlementMappingDeclaration) StatementResult

func (*Interpreter) VisitEnumCaseDeclaration

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

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

func (interpreter *Interpreter) VisitRemoveStatement(removeStatement *ast.RemoveStatement) StatementResult

func (*Interpreter) VisitReturnStatement

func (interpreter *Interpreter) VisitReturnStatement(statement *ast.ReturnStatement) StatementResult

func (*Interpreter) VisitSpecialFunctionDeclaration

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

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

func (interpreter *Interpreter) VisitVoidExpression(_ *ast.VoidExpression) Value

func (*Interpreter) VisitWhileStatement

func (interpreter *Interpreter) VisitWhileStatement(statement *ast.WhileStatement) StatementResult

func (*Interpreter) WriteStored

func (interpreter *Interpreter) WriteStored(
	storageAddress common.Address,
	domain string,
	key StorageMapKey,
	value Value,
) (existed bool)

type InterpreterImport

type InterpreterImport struct {
	Interpreter *Interpreter
}

type IntersectionStaticType

type IntersectionStaticType struct {
	Types      []*InterfaceStaticType
	LegacyType StaticType
}

func NewIntersectionStaticType

func NewIntersectionStaticType(
	memoryGauge common.MemoryGauge,
	types []*InterfaceStaticType,
) *IntersectionStaticType

func (*IntersectionStaticType) Encode

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

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

func (*IntersectionStaticType) ID

func (*IntersectionStaticType) IsDeprecated

func (t *IntersectionStaticType) IsDeprecated() bool

func (*IntersectionStaticType) MeteredString

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

func (*IntersectionStaticType) String

func (t *IntersectionStaticType) String() string

type InvalidAttachmentOperationTargetError

type InvalidAttachmentOperationTargetError struct {
	Value Value
	LocationRange
}

InvalidAttachmentOperationTargetError

func (InvalidAttachmentOperationTargetError) Error

func (InvalidAttachmentOperationTargetError) IsInternalError

func (InvalidAttachmentOperationTargetError) IsInternalError()

type InvalidCapabilityIDError

type InvalidCapabilityIDError struct{}

func (InvalidCapabilityIDError) Error

func (e InvalidCapabilityIDError) Error() string

func (InvalidCapabilityIDError) IsInternalError

func (InvalidCapabilityIDError) IsInternalError()

type InvalidCapabilityIssueTypeError

type InvalidCapabilityIssueTypeError struct {
	ExpectedTypeDescription string
	ActualType              sema.Type
	LocationRange
}

InvalidCapabilityIssueTypeError

func (InvalidCapabilityIssueTypeError) Error

func (InvalidCapabilityIssueTypeError) IsUserError

func (InvalidCapabilityIssueTypeError) IsUserError()

type InvalidHexByteError

type InvalidHexByteError struct {
	LocationRange
	Byte byte
}

InvalidHexByteError

func (InvalidHexByteError) Error

func (e InvalidHexByteError) Error() string

func (InvalidHexByteError) IsUserError

func (InvalidHexByteError) IsUserError()

type InvalidHexLengthError

type InvalidHexLengthError struct {
	LocationRange
}

InvalidHexLengthError

func (InvalidHexLengthError) Error

func (InvalidHexLengthError) Error() string

func (InvalidHexLengthError) IsUserError

func (InvalidHexLengthError) IsUserError()

type InvalidMemberReferenceError

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

InvalidMemberReferenceError

func (InvalidMemberReferenceError) Error

func (InvalidMemberReferenceError) IsUserError

func (InvalidMemberReferenceError) IsUserError()

type InvalidOperandsError

type InvalidOperandsError struct {
	LocationRange
	LeftType     StaticType
	RightType    StaticType
	FunctionName string
	Operation    ast.Operation
}

InvalidOperandsError

func (InvalidOperandsError) Error

func (e InvalidOperandsError) Error() string

func (InvalidOperandsError) IsUserError

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

func (InvalidPathDomainError) IsUserError()

func (InvalidPathDomainError) SecondaryError

func (e InvalidPathDomainError) SecondaryError() string

type InvalidPublicKeyError

type InvalidPublicKeyError struct {
	PublicKey *ArrayValue
	Err       error
	LocationRange
}

InvalidPublicKeyError is reported during PublicKey creation, if the PublicKey is invalid.

func (InvalidPublicKeyError) Error

func (e InvalidPublicKeyError) Error() string

func (InvalidPublicKeyError) IsUserError

func (InvalidPublicKeyError) IsUserError()

func (InvalidPublicKeyError) Unwrap

func (e InvalidPublicKeyError) Unwrap() error

type InvalidSliceIndexError

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

func (e InvalidSliceIndexError) Error() string

func (InvalidSliceIndexError) IsUserError

func (InvalidSliceIndexError) IsUserError()

type InvalidStringLengthError

type InvalidStringLengthError struct {
	Length uint64
}

func (InvalidStringLengthError) Error

func (e InvalidStringLengthError) Error() string

func (InvalidStringLengthError) IsInternalError

func (InvalidStringLengthError) IsInternalError()

type InvalidatedResourceError

type InvalidatedResourceError struct {
	LocationRange
}

InvalidatedResourceError

func (InvalidatedResourceError) Error

func (e InvalidatedResourceError) Error() string

func (InvalidatedResourceError) IsInternalError

func (InvalidatedResourceError) IsInternalError()

type InvalidatedResourceReferenceError

type InvalidatedResourceReferenceError struct {
	LocationRange
}

InvalidatedResourceReferenceError is reported when accessing a reference value that is pointing to a moved or destroyed resource.

func (InvalidatedResourceReferenceError) Error

func (InvalidatedResourceReferenceError) IsUserError

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

func NewInvocation(
	interpreter *Interpreter,
	self *Value,
	base *EphemeralReferenceValue,
	boundAuth Authorization,
	arguments []Value,
	argumentTypes []sema.Type,
	typeParameterTypes *sema.TypeParameterTypeOrderedMap,
	locationRange LocationRange,
) Invocation

type IterableValue

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

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

func NewLocationDecoder

func NewLocationDecoder(
	decoder *cbor.StreamDecoder,
	memoryGauge common.MemoryGauge,
) LocationDecoder

func (LocationDecoder) DecodeLocation

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

func (r LocationRange) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (LocationRange) ImportLocation

func (r LocationRange) ImportLocation() common.Location

func (LocationRange) StartPosition

func (r LocationRange) StartPosition() ast.Position

type MemberAccessTypeError

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

MemberAccessTypeError

func (MemberAccessTypeError) Error

func (e MemberAccessTypeError) Error() string

func (MemberAccessTypeError) IsInternalError

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

type NestedReferenceError struct {
	Value ReferenceValue
	LocationRange
}

NestedReferenceError

func (NestedReferenceError) Error

func (e NestedReferenceError) Error() string

func (NestedReferenceError) IsUserError

func (NestedReferenceError) IsUserError()

type NilValue

type NilValue struct{}

func (NilValue) Accept

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

func (NilValue) ByteSize

func (v NilValue) ByteSize() uint32

func (NilValue) ChildStorables

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

func (NilValue) Clone

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

func (NilValue) ConformsToStaticType

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

func (NilValue) DeepRemove

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

func (NilValue) Destroy

func (v NilValue) Destroy(_ *Interpreter, _ LocationRange)

func (NilValue) Encode

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

Encode encodes the value as a CBOR nil

func (NilValue) Equal

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

func (NilValue) GetMember

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

func (NilValue) IsDestroyed

func (NilValue) IsDestroyed() bool

func (NilValue) IsImportable

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

func (NilValue) IsResourceKinded

func (NilValue) IsResourceKinded(_ *Interpreter) bool

func (NilValue) IsStorable

func (NilValue) IsStorable() bool

func (NilValue) MeteredString

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

func (NilValue) NeedsStoreTo

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

func (NilValue) RecursiveString

func (v NilValue) RecursiveString(_ SeenReferences) string

func (NilValue) RemoveMember

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

func (NilValue) SetMember

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

func (NilValue) StaticType

func (NilValue) StaticType(interpreter *Interpreter) StaticType

func (NilValue) Storable

func (v NilValue) Storable(_ atree.SlabStorage, _ atree.Address, _ uint64) (atree.Storable, error)

func (NilValue) StoredValue

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

func (NilValue) String

func (NilValue) String() string

func (NilValue) Transfer

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

func (NilValue) Walk

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

type NonStorable

type NonStorable struct {
	Value Value
}

NonStorable represents a value that cannot be stored

func (NonStorable) ByteSize

func (s NonStorable) ByteSize() uint32

func (NonStorable) ChildStorables

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

func (NonStorable) Encode

func (s NonStorable) Encode(_ *atree.Encoder) error

func (NonStorable) StoredValue

func (s NonStorable) StoredValue(_ atree.SlabStorage) (atree.Value, error)

type NonStorableStaticTypeError

type NonStorableStaticTypeError struct {
	Type sema.Type
}

NonStorableStaticTypeError

func (NonStorableStaticTypeError) Error

func (NonStorableStaticTypeError) IsUserError

func (NonStorableStaticTypeError) IsUserError()

type NonStorableValueError

type NonStorableValueError struct {
	Value Value
}

NonStorableValueError

func (NonStorableValueError) Error

func (e NonStorableValueError) Error() string

func (NonStorableValueError) IsUserError

func (NonStorableValueError) IsUserError()

type NonTransferableValueError

type NonTransferableValueError struct {
	Value Value
}

NonTransferableValueError

func (NonTransferableValueError) Error

func (NonTransferableValueError) IsUserError

func (NonTransferableValueError) IsUserError()

type NotDeclaredError

type NotDeclaredError struct {
	Name         string
	ExpectedKind common.DeclarationKind
}

func (NotDeclaredError) Error

func (e NotDeclaredError) Error() string

func (NotDeclaredError) IsUserError

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

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

type OnFunctionInvocationFunc func(inter *Interpreter)

OnFunctionInvocationFunc is a function that is triggered when a function is about to be invoked.

type OnInvokedFunctionReturnFunc

type OnInvokedFunctionReturnFunc func(inter *Interpreter)

OnInvokedFunctionReturnFunc is a function that is triggered when an invoked function returned.

type OnLoopIterationFunc

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

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

type OnRecordTraceFunc func(
	inter *Interpreter,
	operationName string,
	duration time.Duration,
	attrs []attribute.KeyValue,
)

OnRecordTraceFunc is a function that records a trace.

type OnResourceOwnerChangeFunc

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

func NewOptionalStaticType(
	memoryGauge common.MemoryGauge,
	typ StaticType,
) *OptionalStaticType

func (*OptionalStaticType) Encode

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

Encode encodes OptionalStaticType as

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

func (*OptionalStaticType) Equal

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

func (*OptionalStaticType) ID

func (t *OptionalStaticType) ID() TypeID

func (*OptionalStaticType) IsDeprecated

func (t *OptionalStaticType) IsDeprecated() bool

func (*OptionalStaticType) MeteredString

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

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

func (OverwriteError) IsUserError()

type OwnedValue

type OwnedValue interface {
	Value
	GetOwner() common.Address
}

OwnedValue is a value which has an owner

type PathCapabilityValue deprecated

type PathCapabilityValue struct {
	BorrowType StaticType
	Path       PathValue
	// contains filtered or unexported fields
}

Deprecated: PathCapabilityValue

func NewUnmeteredPathCapabilityValue deprecated

func NewUnmeteredPathCapabilityValue(
	borrowType StaticType,
	address AddressValue,
	path PathValue,
) *PathCapabilityValue

Deprecated: NewUnmeteredPathCapabilityValue

func (*PathCapabilityValue) Accept

func (*PathCapabilityValue) Address

func (v *PathCapabilityValue) Address() AddressValue

func (*PathCapabilityValue) AddressPath

func (v *PathCapabilityValue) AddressPath() AddressPath

func (*PathCapabilityValue) ByteSize

func (v *PathCapabilityValue) ByteSize() uint32

func (*PathCapabilityValue) ChildStorables

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

func (*PathCapabilityValue) Clone

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

func (*PathCapabilityValue) ConformsToStaticType

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

func (*PathCapabilityValue) DeepRemove

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

func (*PathCapabilityValue) Encode

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

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

func (*PathCapabilityValue) GetMember

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

func (*PathCapabilityValue) IsImportable

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

func (*PathCapabilityValue) IsResourceKinded

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

func (*PathCapabilityValue) IsStorable

func (*PathCapabilityValue) IsStorable() bool

func (*PathCapabilityValue) MeteredString

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

func (*PathCapabilityValue) NeedsStoreTo

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

func (*PathCapabilityValue) RecursiveString

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

func (*PathCapabilityValue) RemoveMember

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

func (*PathCapabilityValue) SetMember

func (*PathCapabilityValue) StaticType

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

func (*PathCapabilityValue) Storable

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

func (*PathCapabilityValue) StoredValue

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

func (*PathCapabilityValue) String

func (v *PathCapabilityValue) String() string

func (*PathCapabilityValue) Transfer

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

func (*PathCapabilityValue) Walk

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

type PathLinkValue deprecated

type PathLinkValue struct {
	Type       StaticType
	TargetPath PathValue
}

Deprecated: PathLinkValue

func (PathLinkValue) Accept

func (v PathLinkValue) Accept(_ *Interpreter, _ Visitor, _ LocationRange)

func (PathLinkValue) ByteSize

func (v PathLinkValue) ByteSize() uint32

func (PathLinkValue) ChildStorables

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

func (PathLinkValue) Clone

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

func (PathLinkValue) ConformsToStaticType

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

func (PathLinkValue) DeepRemove

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

func (PathLinkValue) Encode

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

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

func (PathLinkValue) IsImportable

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

func (PathLinkValue) IsResourceKinded

func (PathLinkValue) IsResourceKinded(_ *Interpreter) bool

func (PathLinkValue) IsStorable

func (PathLinkValue) IsStorable() bool

func (PathLinkValue) MeteredString

func (v PathLinkValue) MeteredString(_ *Interpreter, _ SeenReferences, _ LocationRange) string

func (PathLinkValue) NeedsStoreTo

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

func (PathLinkValue) RecursiveString

func (v PathLinkValue) RecursiveString(seenReferences SeenReferences) string

func (PathLinkValue) StaticType

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

func (PathLinkValue) Storable

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

func (PathLinkValue) StoredValue

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

func (PathLinkValue) String

func (v PathLinkValue) String() string

func (PathLinkValue) Transfer

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

func (PathLinkValue) Walk

func (v PathLinkValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type PathValue

type PathValue struct {
	Identifier string
	Domain     common.PathDomain
}

func NewPathValue

func NewPathValue(
	memoryGauge common.MemoryGauge,
	domain common.PathDomain,
	identifier string,
) PathValue

func NewUnmeteredPathValue

func NewUnmeteredPathValue(domain common.PathDomain, identifier string) PathValue

func (PathValue) Accept

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

func (PathValue) ByteSize

func (v PathValue) ByteSize() uint32

func (PathValue) ChildStorables

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

func (PathValue) Clone

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

func (PathValue) ConformsToStaticType

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

func (PathValue) DeepRemove

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

func (PathValue) Encode

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

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

func (PathValue) GetMember

func (v PathValue) GetMember(inter *Interpreter, locationRange LocationRange, name string) Value

func (PathValue) HashInput

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

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

func (PathValue) IsResourceKinded

func (PathValue) IsResourceKinded(_ *Interpreter) bool

func (PathValue) IsStorable

func (PathValue) IsStorable() bool

func (PathValue) MeteredString

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

func (PathValue) NeedsStoreTo

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

func (PathValue) RecursiveString

func (v PathValue) RecursiveString(_ SeenReferences) string

func (PathValue) RemoveMember

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

func (PathValue) SetMember

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

func (PathValue) StaticType

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

func (PathValue) Storable

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

func (PathValue) StoredValue

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

func (PathValue) String

func (v PathValue) String() string

func (PathValue) Transfer

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

func (PathValue) Walk

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

type PositionedError

type PositionedError struct {
	Err error
	ast.Range
}

PositionedError wraps an unpositioned error with position info

func (PositionedError) Error

func (e PositionedError) Error() string

func (PositionedError) IsUserError

func (PositionedError) IsUserError()

func (PositionedError) Unwrap

func (e PositionedError) Unwrap() error

type PrimitiveStaticType

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

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

func NewPrimitiveStaticType(
	memoryGauge common.MemoryGauge,
	staticType PrimitiveStaticType,
) PrimitiveStaticType

func PrimitiveStaticTypeFromTypeID

func PrimitiveStaticTypeFromTypeID(typeID TypeID) PrimitiveStaticType

func (PrimitiveStaticType) Encode

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

Encode encodes PrimitiveStaticType as

cbor.Tag{
		Number:  CBORTagPrimitiveStaticType,
		Content: uint(v),
}

func (PrimitiveStaticType) Equal

func (t PrimitiveStaticType) Equal(other StaticType) bool

func (PrimitiveStaticType) ID

func (t PrimitiveStaticType) ID() TypeID

func (PrimitiveStaticType) IsDefined

func (t PrimitiveStaticType) IsDefined() bool

func (PrimitiveStaticType) IsDeprecated deprecated

func (t PrimitiveStaticType) IsDeprecated() bool

Deprecated: IsDeprecated only exists for migration purposes.

func (PrimitiveStaticType) MeteredString

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

func (PrimitiveStaticType) SemaType

func (t PrimitiveStaticType) SemaType() sema.Type

func (PrimitiveStaticType) String

func (i PrimitiveStaticType) String() string

type Program

type Program struct {
	Program     *ast.Program
	Elaboration *sema.Elaboration
}

func ProgramFromChecker

func ProgramFromChecker(checker *sema.Checker) *Program

type PublicKeyValidationHandlerFunc

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

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

func NewPublishedValue(memoryGauge common.MemoryGauge, recipient AddressValue, value CapabilityValue) *PublishedValue

func (*PublishedValue) Accept

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

func (*PublishedValue) ByteSize

func (v *PublishedValue) ByteSize() uint32

func (*PublishedValue) ChildStorables

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

func (*PublishedValue) Clone

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

func (*PublishedValue) ConformsToStaticType

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

func (*PublishedValue) DeepRemove

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

func (*PublishedValue) Encode

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

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

func (*PublishedValue) IsImportable

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

func (*PublishedValue) IsResourceKinded

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

func (*PublishedValue) IsStorable

func (*PublishedValue) IsStorable() bool

func (*PublishedValue) MeteredString

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

func (*PublishedValue) NeedsStoreTo

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

func (*PublishedValue) RecursiveString

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

func (*PublishedValue) StaticType

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

func (*PublishedValue) Storable

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

func (*PublishedValue) StoredValue

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

func (*PublishedValue) String

func (v *PublishedValue) String() string

func (*PublishedValue) Transfer

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

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

type RecursiveTransferError

type RecursiveTransferError struct {
	LocationRange
}

RecursiveTransferError

func (RecursiveTransferError) Error

func (RecursiveTransferError) IsUserError

func (RecursiveTransferError) IsUserError()

type RedeclarationError

type RedeclarationError struct {
	Name string
}

func (RedeclarationError) Error

func (e RedeclarationError) Error() string

func (RedeclarationError) IsUserError

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

func ConvertSemaReferenceTypeToStaticReferenceType(
	memoryGauge common.MemoryGauge,
	t *sema.ReferenceType,
) *ReferenceStaticType

func NewReferenceStaticType

func NewReferenceStaticType(
	memoryGauge common.MemoryGauge,
	authorization Authorization,
	referencedType StaticType,
) *ReferenceStaticType

func (*ReferenceStaticType) Encode

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

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

func (*ReferenceStaticType) ID

func (t *ReferenceStaticType) ID() TypeID

func (*ReferenceStaticType) IsDeprecated

func (t *ReferenceStaticType) IsDeprecated() bool

func (*ReferenceStaticType) MeteredString

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

func (*ReferenceStaticType) String

func (t *ReferenceStaticType) String() string

type ReferenceTrackedResourceKindedValue

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

type ReferenceValue interface {
	Value
	AuthorizedValue

	ReferencedValue(interpreter *Interpreter, locationRange LocationRange, errorOnFailedDereference bool) *Value
	BorrowType() sema.Type
	// contains filtered or unexported methods
}

type ReferencedResourceKindedValues

type ReferencedResourceKindedValues map[atree.ValueID]map[*EphemeralReferenceValue]struct{}

type ReferencedValueChangedError

type ReferencedValueChangedError struct {
	LocationRange
}

ReferencedValueChangedError

func (ReferencedValueChangedError) Error

func (ReferencedValueChangedError) IsUserError

func (ReferencedValueChangedError) IsUserError()

type ResourceConstructionError

type ResourceConstructionError struct {
	CompositeType *sema.CompositeType
	LocationRange
}

ResourceConstructionError

func (ResourceConstructionError) Error

func (ResourceConstructionError) IsInternalError

func (ResourceConstructionError) IsInternalError()

type ResourceKindedValue

type ResourceKindedValue interface {
	Value
	Destroy(interpreter *Interpreter, locationRange LocationRange)
	IsDestroyed() bool
	// contains filtered or unexported methods
}

type ResourceLossError

type ResourceLossError struct {
	LocationRange
}

ResourceLossError

func (ResourceLossError) Error

func (e ResourceLossError) Error() string

func (ResourceLossError) IsUserError

func (ResourceLossError) IsUserError()

type ResourceReferenceDereferenceError

type ResourceReferenceDereferenceError struct {
	LocationRange
}

ResourceReferenceDereferenceError

func (ResourceReferenceDereferenceError) Error

func (ResourceReferenceDereferenceError) IsInternalError

func (ResourceReferenceDereferenceError) IsInternalError()

type ReturnResult

type ReturnResult struct {
	Value
}

type SeenReferences

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

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

func (*SelfVariable) GetValue

func (v *SelfVariable) GetValue(interpreter *Interpreter) Value

func (*SelfVariable) InitializeWithGetter

func (v *SelfVariable) InitializeWithGetter(func() Value)

func (*SelfVariable) InitializeWithValue

func (v *SelfVariable) InitializeWithValue(Value)

func (*SelfVariable) SetValue

func (v *SelfVariable) SetValue(*Interpreter, LocationRange, Value)

type SharedState

type SharedState struct {
	Config *Config

	CapabilityControllerIterations              map[AddressPath]int
	MutationDuringCapabilityControllerIteration bool
	// contains filtered or unexported fields
}

func NewSharedState

func NewSharedState(config *Config) *SharedState

type SimpleCompositeValue

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

func NewAccountAccountCapabilitiesValue(
	gauge common.MemoryGauge,
	address AddressValue,
	getControllerFunction BoundFunctionGenerator,
	getControllersFunction BoundFunctionGenerator,
	forEachControllerFunction BoundFunctionGenerator,
	issueFunction BoundFunctionGenerator,
	issueWithTypeFunction BoundFunctionGenerator,
) *SimpleCompositeValue

func NewAccountKeyValue

func NewAccountKeyValue(
	inter *Interpreter,
	keyIndex IntValue,
	publicKey *CompositeValue,
	hashAlgo Value,
	weight UFix64Value,
	isRevoked BoolValue,
) *SimpleCompositeValue

NewAccountKeyValue constructs an AccountKey value.

func NewBlockValue

func NewBlockValue(
	inter *Interpreter,
	height UInt64Value,
	view UInt64Value,
	id *ArrayValue,
	timestamp UFix64Value,
) *SimpleCompositeValue

func NewDeployedContractValue

func NewDeployedContractValue(
	inter *Interpreter,
	address AddressValue,
	name *StringValue,
	code *ArrayValue,
) *SimpleCompositeValue

func NewSimpleCompositeValue

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

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

func (*SimpleCompositeValue) Clone

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

func (*SimpleCompositeValue) ConformsToStaticType

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

func (*SimpleCompositeValue) DeepRemove

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

func (*SimpleCompositeValue) ForEachField

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

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

func (*SimpleCompositeValue) IsImportable

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

func (*SimpleCompositeValue) IsResourceKinded

func (v *SimpleCompositeValue) IsResourceKinded(_ *Interpreter) bool

func (*SimpleCompositeValue) MeteredString

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

func (*SimpleCompositeValue) NeedsStoreTo

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

func (*SimpleCompositeValue) RecursiveString

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

func (*SimpleCompositeValue) RemoveMember

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

func (*SimpleCompositeValue) SetMember

func (v *SimpleCompositeValue) SetMember(_ *Interpreter, _ LocationRange, name string, value Value) bool

func (*SimpleCompositeValue) StaticType

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

func (*SimpleCompositeValue) Storable

func (*SimpleCompositeValue) String

func (v *SimpleCompositeValue) String() string

func (*SimpleCompositeValue) Transfer

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

func (*SimpleCompositeValue) Walk

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

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

func (*SimpleVariable) GetValue

func (v *SimpleVariable) GetValue(*Interpreter) Value

func (*SimpleVariable) InitializeWithGetter

func (v *SimpleVariable) InitializeWithGetter(getter func() Value)

func (*SimpleVariable) InitializeWithValue

func (v *SimpleVariable) InitializeWithValue(value Value)

func (*SimpleVariable) SetValue

func (v *SimpleVariable) SetValue(interpreter *Interpreter, locationRange LocationRange, value Value)

type SomeStorable

type SomeStorable struct {
	Storable atree.Storable
	// contains filtered or unexported fields
}

func (SomeStorable) ByteSize

func (s SomeStorable) ByteSize() uint32

func (SomeStorable) ChildStorables

func (s SomeStorable) ChildStorables() []atree.Storable

func (SomeStorable) Encode

func (s SomeStorable) Encode(e *atree.Encoder) error

func (SomeStorable) HasPointer

func (s SomeStorable) HasPointer() bool

func (SomeStorable) StoredValue

func (s SomeStorable) StoredValue(storage atree.SlabStorage) (atree.Value, error)

type SomeValue

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

func NewSomeValueNonCopying

func NewSomeValueNonCopying(memoryGauge common.MemoryGauge, value Value) *SomeValue

func NewUnmeteredSomeValueNonCopying

func NewUnmeteredSomeValueNonCopying(value Value) *SomeValue

func (*SomeValue) Accept

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

func (*SomeValue) Clone

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

func (*SomeValue) ConformsToStaticType

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

func (*SomeValue) DeepRemove

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

func (*SomeValue) Destroy

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

func (*SomeValue) Equal

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

func (*SomeValue) GetMember

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

func (*SomeValue) InnerValue

func (v *SomeValue) InnerValue(_ *Interpreter, _ LocationRange) Value

func (*SomeValue) IsDestroyed

func (v *SomeValue) IsDestroyed() bool

func (*SomeValue) IsImportable

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

func (*SomeValue) IsResourceKinded

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

func (*SomeValue) MeteredString

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

func (*SomeValue) NeedsStoreTo

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

func (*SomeValue) RecursiveString

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

func (*SomeValue) RemoveMember

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

func (*SomeValue) SetMember

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

func (*SomeValue) StaticType

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

func (*SomeValue) Storable

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

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

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

type StackTraceError

type StackTraceError struct {
	LocationRange
}

func (StackTraceError) Error

func (e StackTraceError) Error() string

func (StackTraceError) ImportLocation

func (e StackTraceError) ImportLocation() common.Location

func (StackTraceError) Prefix

func (e StackTraceError) Prefix() string

type StatementResult

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

type StaticAuthorizationConversionHandler

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

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

type Stop struct {
	Interpreter *Interpreter
	Statement   ast.Statement
}

type StorableDecoder

type StorableDecoder struct {
	TypeDecoder
	// contains filtered or unexported fields
}

func NewStorableDecoder

func NewStorableDecoder(
	decoder *cbor.StreamDecoder,
	slabID atree.SlabID,
	inlinedExtraData []atree.ExtraData,
	memoryGauge common.MemoryGauge,
) StorableDecoder

type Storage

type Storage interface {
	atree.SlabStorage
	GetStorageMap(address common.Address, domain string, createIfNotExists bool) *StorageMap
	CheckHealth() error
}

type StorageCapabilityControllerValue

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

func NewStorageCapabilityControllerValue(
	memoryGauge common.MemoryGauge,
	borrowType *ReferenceStaticType,
	capabilityID UInt64Value,
	targetPath PathValue,
) *StorageCapabilityControllerValue

func NewUnmeteredStorageCapabilityControllerValue

func NewUnmeteredStorageCapabilityControllerValue(
	borrowType *ReferenceStaticType,
	capabilityID UInt64Value,
	targetPath PathValue,
) *StorageCapabilityControllerValue

func (*StorageCapabilityControllerValue) Accept

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

func (*StorageCapabilityControllerValue) ByteSize

func (*StorageCapabilityControllerValue) CapabilityControllerBorrowType

func (v *StorageCapabilityControllerValue) CapabilityControllerBorrowType() *ReferenceStaticType

func (*StorageCapabilityControllerValue) ChildStorables

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

func (*StorageCapabilityControllerValue) Clone

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

func (*StorageCapabilityControllerValue) ConformsToStaticType

func (*StorageCapabilityControllerValue) ControllerCapabilityID

func (v *StorageCapabilityControllerValue) ControllerCapabilityID() UInt64Value

func (*StorageCapabilityControllerValue) DeepRemove

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

func (*StorageCapabilityControllerValue) Encode

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

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

func (*StorageCapabilityControllerValue) GetMember

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

func (*StorageCapabilityControllerValue) IsImportable

func (*StorageCapabilityControllerValue) IsResourceKinded

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

func (*StorageCapabilityControllerValue) IsStorable

func (*StorageCapabilityControllerValue) IsStorable() bool

func (*StorageCapabilityControllerValue) MeteredString

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

func (*StorageCapabilityControllerValue) NeedsStoreTo

func (*StorageCapabilityControllerValue) RecursiveString

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

func (*StorageCapabilityControllerValue) ReferenceValue

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

func (*StorageCapabilityControllerValue) RemoveMember

func (*StorageCapabilityControllerValue) SetMember

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

func (*StorageCapabilityControllerValue) StaticType

func (*StorageCapabilityControllerValue) Storable

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

func (*StorageCapabilityControllerValue) StoredValue

func (*StorageCapabilityControllerValue) String

func (*StorageCapabilityControllerValue) Transfer

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

func (*StorageCapabilityControllerValue) Walk

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

type StorageKey

type StorageKey struct {
	Key     string
	Address common.Address
}

func NewStorageKey

func NewStorageKey(memoryGauge common.MemoryGauge, address common.Address, key string) StorageKey

func (StorageKey) IsLess

func (k StorageKey) IsLess(o StorageKey) bool

type StorageMap

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

StorageMap is an ordered map which stores values in an account.

func NewStorageMap

func NewStorageMap(memoryGauge common.MemoryGauge, storage atree.SlabStorage, address atree.Address) *StorageMap

func NewStorageMapWithRootID

func NewStorageMapWithRootID(storage atree.SlabStorage, slabID atree.SlabID) *StorageMap

func (StorageMap) Count

func (s StorageMap) Count() uint64

func (StorageMap) Iterator

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

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

func (s StorageMap) RemoveValue(interpreter *Interpreter, key StorageMapKey) (existed bool)

RemoveValue removes a value in the storage map, if it exists.

func (StorageMap) SetValue

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

func (s StorageMap) SlabID() atree.SlabID

func (StorageMap) ValueExists

func (s StorageMap) ValueExists(key StorageMapKey) bool

ValueExists returns true if the given key exists in the storage map.

func (StorageMap) WriteValue

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

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

StorageMapIterator is an iterator over StorageMap

func (StorageMapIterator) Next

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

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

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

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

type StorageMutatedDuringIterationError struct {
	LocationRange
}

StorageMutatedDuringIterationError

func (StorageMutatedDuringIterationError) Error

func (StorageMutatedDuringIterationError) IsUserError

func (StorageMutatedDuringIterationError) IsUserError()

type StorageReferenceValue

type StorageReferenceValue struct {
	BorrowedType         sema.Type
	TargetPath           PathValue
	TargetStorageAddress common.Address
	Authorization        Authorization
}

StorageReferenceValue

func NewStorageReferenceValue

func NewStorageReferenceValue(
	memoryGauge common.MemoryGauge,
	authorization Authorization,
	targetStorageAddress common.Address,
	targetPath PathValue,
	borrowedType sema.Type,
) *StorageReferenceValue

func NewUnmeteredStorageReferenceValue

func NewUnmeteredStorageReferenceValue(
	authorization Authorization,
	targetStorageAddress common.Address,
	targetPath PathValue,
	borrowedType sema.Type,
) *StorageReferenceValue

func (*StorageReferenceValue) Accept

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

func (*StorageReferenceValue) BorrowType

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

func (*StorageReferenceValue) Clone

func (*StorageReferenceValue) ConformsToStaticType

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

func (*StorageReferenceValue) DeepRemove

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

func (*StorageReferenceValue) Equal

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

func (*StorageReferenceValue) ForEach

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

func (*StorageReferenceValue) GetAuthorization

func (v *StorageReferenceValue) GetAuthorization() Authorization

func (*StorageReferenceValue) GetKey

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

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

func (*StorageReferenceValue) InsertKey

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

func (*StorageReferenceValue) IsImportable

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

func (*StorageReferenceValue) IsResourceKinded

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

func (*StorageReferenceValue) IsStorable

func (*StorageReferenceValue) IsStorable() bool

func (*StorageReferenceValue) Iterator

func (*StorageReferenceValue) MeteredString

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

func (*StorageReferenceValue) NeedsStoreTo

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

func (*StorageReferenceValue) RecursiveString

func (v *StorageReferenceValue) RecursiveString(_ SeenReferences) string

func (*StorageReferenceValue) ReferencedValue

func (v *StorageReferenceValue) ReferencedValue(interpreter *Interpreter, locationRange LocationRange, errorOnFailedDereference bool) *Value

func (*StorageReferenceValue) RemoveKey

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

func (*StorageReferenceValue) RemoveMember

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

func (*StorageReferenceValue) RemoveTypeKey

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

func (*StorageReferenceValue) SetKey

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

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

func (*StorageReferenceValue) StaticType

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

func (*StorageReferenceValue) Storable

func (*StorageReferenceValue) String

func (*StorageReferenceValue) String() string

func (*StorageReferenceValue) Transfer

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

func (*StorageReferenceValue) Walk

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

type StringAtreeValue

type StringAtreeValue string

func NewStringAtreeValue

func NewStringAtreeValue(gauge common.MemoryGauge, s string) StringAtreeValue

func (StringAtreeValue) ByteSize

func (v StringAtreeValue) ByteSize() uint32

func (StringAtreeValue) ChildStorables

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

func (StringAtreeValue) Copy

func (v StringAtreeValue) Copy() atree.Storable

func (StringAtreeValue) Encode

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

Encode encodes the value as a CBOR string

func (StringAtreeValue) Equal

func (v StringAtreeValue) Equal(other atree.Storable) bool

Equal returns true if the given storable is equal to this StringAtreeValue.

func (StringAtreeValue) ID

func (v StringAtreeValue) ID() string

ID returns a unique identifier.

func (StringAtreeValue) Less

func (v StringAtreeValue) Less(other atree.Storable) bool

Less returns true if the given storable is less than StringAtreeValue.

func (StringAtreeValue) Storable

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

func (StringAtreeValue) StoredValue

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

type StringIndexOutOfBoundsError

type StringIndexOutOfBoundsError struct {
	LocationRange
	Index  int
	Length int
}

StringIndexOutOfBoundsError

func (StringIndexOutOfBoundsError) Error

func (StringIndexOutOfBoundsError) IsUserError

func (StringIndexOutOfBoundsError) IsUserError()

type StringSliceIndicesError

type StringSliceIndicesError struct {
	LocationRange
	FromIndex int
	UpToIndex int
	Length    int
}

StringSliceIndicesError

func (StringSliceIndicesError) Error

func (e StringSliceIndicesError) Error() string

func (StringSliceIndicesError) IsUserError

func (StringSliceIndicesError) IsUserError()

type StringStorageMapKey

type StringStorageMapKey StringAtreeValue

StringStorageMapKey is a StorageMapKey backed by a simple StringAtreeValue

func (StringStorageMapKey) AtreeValue

func (k StringStorageMapKey) AtreeValue() atree.Value

func (StringStorageMapKey) AtreeValueCompare

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

func (StringStorageMapKey) AtreeValueHashInput

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

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

func NewUnmeteredStringValue(str string) *StringValue

func (*StringValue) Accept

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

func (*StringValue) ByteSize

func (v *StringValue) ByteSize() uint32

func (*StringValue) ChildStorables

func (*StringValue) ChildStorables() []atree.Storable

func (*StringValue) Clone

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

func (*StringValue) Concat

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

func (*StringValue) ConformsToStaticType

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

func (*StringValue) Contains

func (v *StringValue) Contains(inter *Interpreter, other *StringValue) BoolValue

func (*StringValue) Count

func (v *StringValue) Count(inter *Interpreter, locationRange LocationRange, other *StringValue) IntValue

func (*StringValue) DecodeHex

func (v *StringValue) DecodeHex(interpreter *Interpreter, locationRange LocationRange) *ArrayValue

DecodeHex hex-decodes this string and returns an array of UInt8 values

func (*StringValue) DeepRemove

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

func (*StringValue) Encode

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

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

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

func (*StringValue) GetKey

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

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

func (*StringValue) GreaterEqual

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

func (*StringValue) HashInput

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

func (v *StringValue) IndexOf(inter *Interpreter, other *StringValue) IntValue

func (*StringValue) InsertKey

func (*StringValue) InsertKey(_ *Interpreter, _ LocationRange, _ Value, _ Value)

func (*StringValue) IsGraphemeBoundaryEnd

func (v *StringValue) IsGraphemeBoundaryEnd(end int) bool

func (*StringValue) IsGraphemeBoundaryStart

func (v *StringValue) IsGraphemeBoundaryStart(startOffset int) bool

func (*StringValue) IsImportable

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

func (*StringValue) IsResourceKinded

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

func (*StringValue) Iterator

func (*StringValue) Length

func (v *StringValue) Length() int

Length returns the number of characters (grapheme clusters)

func (*StringValue) Less

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

func (*StringValue) LessEqual

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

func (*StringValue) MeteredString

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

func (*StringValue) NeedsStoreTo

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

func (*StringValue) RecursiveString

func (v *StringValue) RecursiveString(_ SeenReferences) string

func (*StringValue) RemoveKey

func (*StringValue) RemoveKey(_ *Interpreter, _ LocationRange, _ Value) Value

func (*StringValue) RemoveMember

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

func (*StringValue) ReplaceAll

func (v *StringValue) ReplaceAll(
	inter *Interpreter,
	locationRange LocationRange,
	original *StringValue,
	replacement *StringValue,
) *StringValue

func (*StringValue) SetKey

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

func (v *StringValue) Split(inter *Interpreter, locationRange LocationRange, separator *StringValue) *ArrayValue

func (*StringValue) StaticType

func (*StringValue) StaticType(interpreter *Interpreter) StaticType

func (*StringValue) Storable

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

func (*StringValue) StoredValue

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

func (*StringValue) String

func (v *StringValue) String() string

func (*StringValue) ToLower

func (v *StringValue) ToLower(interpreter *Interpreter) *StringValue

func (*StringValue) Transfer

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

func (*StringValue) Walk

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

type StringValueIterator

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

func (StringValueIterator) Next

type TransactionNotDeclaredError

type TransactionNotDeclaredError struct {
	Index int
}

func (TransactionNotDeclaredError) Error

func (TransactionNotDeclaredError) IsUserError

func (TransactionNotDeclaredError) IsUserError()

type TypeCodes

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

func (c TypeCodes) Merge(codes TypeCodes)

type TypeConformanceResults

type TypeConformanceResults map[typeConformanceResultEntry]bool

type TypeDecoder

type TypeDecoder struct {
	LocationDecoder
	// contains filtered or unexported fields
}

func NewTypeDecoder

func NewTypeDecoder(
	decoder *cbor.StreamDecoder,
	memoryGauge common.MemoryGauge,
) TypeDecoder

func (TypeDecoder) DecodeStaticType

func (d TypeDecoder) DecodeStaticType() (StaticType, error)

type TypeID

type TypeID = common.TypeID

type TypeIndexableValue

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

type TypeLoadingError struct {
	TypeID TypeID
}

TypeLoadingError

func (TypeLoadingError) Error

func (e TypeLoadingError) Error() string

func (TypeLoadingError) IsUserError

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

func (TypeMismatchError) IsUserError()

type TypeParameter

type TypeParameter struct {
	TypeBound StaticType
	Name      string
	Optional  bool
}

func (TypeParameter) Equal

func (p TypeParameter) Equal(other *TypeParameter) bool

func (TypeParameter) String

func (p TypeParameter) String() string

type TypeValue

type TypeValue struct {
	// Optional. nil represents "unknown"/"invalid" type
	Type StaticType
}

func NewTypeValue

func NewTypeValue(
	memoryGauge common.MemoryGauge,
	staticType StaticType,
) TypeValue

func NewUnmeteredTypeValue

func NewUnmeteredTypeValue(t StaticType) TypeValue

func (TypeValue) Accept

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

func (TypeValue) ByteSize

func (v TypeValue) ByteSize() uint32

func (TypeValue) ChildStorables

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

func (TypeValue) Clone

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

func (TypeValue) ConformsToStaticType

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

func (TypeValue) DeepRemove

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

func (TypeValue) Encode

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

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

func (TypeValue) GetMember

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

func (TypeValue) HashInput

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

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

func (TypeValue) IsResourceKinded

func (TypeValue) IsResourceKinded(_ *Interpreter) bool

func (TypeValue) MeteredString

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

func (TypeValue) NeedsStoreTo

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

func (TypeValue) RecursiveString

func (v TypeValue) RecursiveString(_ SeenReferences) string

func (TypeValue) RemoveMember

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

func (TypeValue) SetMember

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

func (TypeValue) StaticType

func (TypeValue) StaticType(interpreter *Interpreter) StaticType

func (TypeValue) Storable

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

func (TypeValue) StoredValue

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

func (TypeValue) String

func (v TypeValue) String() string

func (TypeValue) Transfer

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

func (TypeValue) Walk

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

func NewUFix64Value(gauge common.MemoryGauge, constructor func() uint64) UFix64Value

func NewUFix64ValueWithInteger

func NewUFix64ValueWithInteger(gauge common.MemoryGauge, constructor func() uint64, locationRange LocationRange) UFix64Value

func NewUnmeteredUFix64Value

func NewUnmeteredUFix64Value(integer uint64) UFix64Value

func NewUnmeteredUFix64ValueWithInteger

func NewUnmeteredUFix64ValueWithInteger(integer uint64, locationRange LocationRange) UFix64Value

func (UFix64Value) Accept

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

func (UFix64Value) ByteSize

func (v UFix64Value) ByteSize() uint32

func (UFix64Value) ChildStorables

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

func (UFix64Value) Clone

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

func (UFix64Value) ConformsToStaticType

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

func (UFix64Value) DeepRemove

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

func (UFix64Value) Div

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

func (UFix64Value) Encode

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

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

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

func (v UFix64Value) IntegerPart() NumberValue

func (UFix64Value) IsImportable

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

func (UFix64Value) IsResourceKinded

func (UFix64Value) IsResourceKinded(_ *Interpreter) bool

func (UFix64Value) IsStorable

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

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

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

func (v UFix64Value) RecursiveString(_ SeenReferences) string

func (UFix64Value) RemoveMember

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

func (UFix64Value) SaturatingDiv

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

func (UFix64Value) SaturatingMinus

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

func (UFix64Value) SaturatingMul

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

func (UFix64Value) SaturatingPlus

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

func (UFix64Value) Scale

func (UFix64Value) Scale() int

func (UFix64Value) SetMember

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

func (UFix64Value) StaticType

func (UFix64Value) StaticType(interpreter *Interpreter) StaticType

func (UFix64Value) Storable

func (UFix64Value) StoredValue

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

func (UFix64Value) String

func (v UFix64Value) String() string

func (UFix64Value) ToBigEndianBytes

func (v UFix64Value) ToBigEndianBytes() []byte

func (UFix64Value) ToInt

func (v UFix64Value) ToInt(_ LocationRange) int

func (UFix64Value) Transfer

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

func (UFix64Value) Walk

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

func NewUInt128ValueFromUint64(interpreter *Interpreter, value uint64) UInt128Value

func NewUnmeteredUInt128ValueFromBigInt

func NewUnmeteredUInt128ValueFromBigInt(value *big.Int) UInt128Value

func NewUnmeteredUInt128ValueFromUint64

func NewUnmeteredUInt128ValueFromUint64(value uint64) UInt128Value

func (UInt128Value) Accept

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

func (UInt128Value) BitwiseAnd

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

func (UInt128Value) BitwiseLeftShift

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

func (UInt128Value) BitwiseOr

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

func (UInt128Value) BitwiseRightShift

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

func (UInt128Value) BitwiseXor

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

func (UInt128Value) ByteLength

func (v UInt128Value) ByteLength() int

func (UInt128Value) ByteSize

func (v UInt128Value) ByteSize() uint32

func (UInt128Value) ChildStorables

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

func (UInt128Value) Clone

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

func (UInt128Value) ConformsToStaticType

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

func (UInt128Value) DeepRemove

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

func (UInt128Value) Div

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

func (UInt128Value) Encode

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

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

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

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

func (UInt128Value) IsResourceKinded

func (UInt128Value) IsResourceKinded(_ *Interpreter) bool

func (UInt128Value) IsStorable

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

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

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

func (v UInt128Value) RecursiveString(_ SeenReferences) string

func (UInt128Value) RemoveMember

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

func (UInt128Value) SaturatingDiv

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

func (UInt128Value) SaturatingMinus

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

func (UInt128Value) SaturatingMul

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

func (UInt128Value) SaturatingPlus

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

func (UInt128Value) SetMember

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

func (UInt128Value) StaticType

func (UInt128Value) StaticType(interpreter *Interpreter) StaticType

func (UInt128Value) Storable

func (UInt128Value) StoredValue

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

func (UInt128Value) String

func (v UInt128Value) String() string

func (UInt128Value) ToBigEndianBytes

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

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

func (UInt128Value) Walk

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

func NewUInt16Value(gauge common.MemoryGauge, uint16Constructor func() uint16) UInt16Value

func NewUnmeteredUInt16Value

func NewUnmeteredUInt16Value(value uint16) UInt16Value

func (UInt16Value) Accept

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

func (UInt16Value) BitwiseAnd

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

func (UInt16Value) BitwiseLeftShift

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

func (UInt16Value) BitwiseOr

func (v UInt16Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt16Value) BitwiseRightShift

func (v UInt16Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt16Value) BitwiseXor

func (v UInt16Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt16Value) ByteSize

func (v UInt16Value) ByteSize() uint32

func (UInt16Value) ChildStorables

func (UInt16Value) ChildStorables() []atree.Storable

func (UInt16Value) Clone

func (v UInt16Value) Clone(_ *Interpreter) Value

func (UInt16Value) ConformsToStaticType

func (v UInt16Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UInt16Value) DeepRemove

func (UInt16Value) DeepRemove(_ *Interpreter, _ bool)

func (UInt16Value) Div

func (v UInt16Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) Encode

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

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

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

func (UInt16Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UInt16Value) IsResourceKinded

func (UInt16Value) IsResourceKinded(_ *Interpreter) bool

func (UInt16Value) IsStorable

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

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

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

func (v UInt16Value) RecursiveString(_ SeenReferences) string

func (UInt16Value) RemoveMember

func (UInt16Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UInt16Value) SaturatingDiv

func (v UInt16Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) SaturatingMinus

func (v UInt16Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) SaturatingMul

func (v UInt16Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) SaturatingPlus

func (v UInt16Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt16Value) SetMember

func (UInt16Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UInt16Value) StaticType

func (UInt16Value) StaticType(interpreter *Interpreter) StaticType

func (UInt16Value) Storable

func (UInt16Value) StoredValue

func (v UInt16Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UInt16Value) String

func (v UInt16Value) String() string

func (UInt16Value) ToBigEndianBytes

func (v UInt16Value) ToBigEndianBytes() []byte

func (UInt16Value) ToInt

func (v UInt16Value) ToInt(_ LocationRange) int

func (UInt16Value) Transfer

func (v UInt16Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt16Value) Walk

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

func NewUInt256ValueFromUint64(interpreter *Interpreter, value uint64) UInt256Value

func NewUnmeteredUInt256ValueFromBigInt

func NewUnmeteredUInt256ValueFromBigInt(value *big.Int) UInt256Value

func NewUnmeteredUInt256ValueFromUint64

func NewUnmeteredUInt256ValueFromUint64(value uint64) UInt256Value

func (UInt256Value) Accept

func (v UInt256Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UInt256Value) BitwiseAnd

func (v UInt256Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt256Value) BitwiseLeftShift

func (v UInt256Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt256Value) BitwiseOr

func (v UInt256Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt256Value) BitwiseRightShift

func (v UInt256Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt256Value) BitwiseXor

func (v UInt256Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt256Value) ByteLength

func (v UInt256Value) ByteLength() int

func (UInt256Value) ByteSize

func (v UInt256Value) ByteSize() uint32

func (UInt256Value) ChildStorables

func (UInt256Value) ChildStorables() []atree.Storable

func (UInt256Value) Clone

func (v UInt256Value) Clone(_ *Interpreter) Value

func (UInt256Value) ConformsToStaticType

func (v UInt256Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UInt256Value) DeepRemove

func (UInt256Value) DeepRemove(_ *Interpreter, _ bool)

func (UInt256Value) Div

func (v UInt256Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) Encode

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

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

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

func (UInt256Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UInt256Value) IsResourceKinded

func (UInt256Value) IsResourceKinded(_ *Interpreter) bool

func (UInt256Value) IsStorable

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

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

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

func (v UInt256Value) RecursiveString(_ SeenReferences) string

func (UInt256Value) RemoveMember

func (UInt256Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UInt256Value) SaturatingDiv

func (v UInt256Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) SaturatingMinus

func (v UInt256Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) SaturatingMul

func (v UInt256Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) SaturatingPlus

func (v UInt256Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt256Value) SetMember

func (UInt256Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UInt256Value) StaticType

func (UInt256Value) StaticType(interpreter *Interpreter) StaticType

func (UInt256Value) Storable

func (UInt256Value) StoredValue

func (v UInt256Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UInt256Value) String

func (v UInt256Value) String() string

func (UInt256Value) ToBigEndianBytes

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

func (v UInt256Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt256Value) Walk

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

func NewUInt32Value(gauge common.MemoryGauge, uint32Constructor func() uint32) UInt32Value

func NewUnmeteredUInt32Value

func NewUnmeteredUInt32Value(value uint32) UInt32Value

func (UInt32Value) Accept

func (v UInt32Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UInt32Value) BitwiseAnd

func (v UInt32Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt32Value) BitwiseLeftShift

func (v UInt32Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt32Value) BitwiseOr

func (v UInt32Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt32Value) BitwiseRightShift

func (v UInt32Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt32Value) BitwiseXor

func (v UInt32Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt32Value) ByteSize

func (v UInt32Value) ByteSize() uint32

func (UInt32Value) ChildStorables

func (UInt32Value) ChildStorables() []atree.Storable

func (UInt32Value) Clone

func (v UInt32Value) Clone(_ *Interpreter) Value

func (UInt32Value) ConformsToStaticType

func (v UInt32Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UInt32Value) DeepRemove

func (UInt32Value) DeepRemove(_ *Interpreter, _ bool)

func (UInt32Value) Div

func (v UInt32Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) Encode

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

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

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

func (UInt32Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UInt32Value) IsResourceKinded

func (UInt32Value) IsResourceKinded(_ *Interpreter) bool

func (UInt32Value) IsStorable

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

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

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

func (v UInt32Value) RecursiveString(_ SeenReferences) string

func (UInt32Value) RemoveMember

func (UInt32Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UInt32Value) SaturatingDiv

func (v UInt32Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) SaturatingMinus

func (v UInt32Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) SaturatingMul

func (v UInt32Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) SaturatingPlus

func (v UInt32Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt32Value) SetMember

func (UInt32Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UInt32Value) StaticType

func (UInt32Value) StaticType(interpreter *Interpreter) StaticType

func (UInt32Value) Storable

func (UInt32Value) StoredValue

func (v UInt32Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UInt32Value) String

func (v UInt32Value) String() string

func (UInt32Value) ToBigEndianBytes

func (v UInt32Value) ToBigEndianBytes() []byte

func (UInt32Value) ToInt

func (v UInt32Value) ToInt(_ LocationRange) int

func (UInt32Value) Transfer

func (v UInt32Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt32Value) Walk

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

func NewUInt64Value(gauge common.MemoryGauge, uint64Constructor func() uint64) UInt64Value

func NewUnmeteredUInt64Value

func NewUnmeteredUInt64Value(value uint64) UInt64Value

func (UInt64Value) Accept

func (v UInt64Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UInt64Value) BitwiseAnd

func (v UInt64Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt64Value) BitwiseLeftShift

func (v UInt64Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt64Value) BitwiseOr

func (v UInt64Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt64Value) BitwiseRightShift

func (v UInt64Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt64Value) BitwiseXor

func (v UInt64Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt64Value) ByteLength

func (v UInt64Value) ByteLength() int

func (UInt64Value) ByteSize

func (v UInt64Value) ByteSize() uint32

func (UInt64Value) ChildStorables

func (UInt64Value) ChildStorables() []atree.Storable

func (UInt64Value) Clone

func (v UInt64Value) Clone(_ *Interpreter) Value

func (UInt64Value) ConformsToStaticType

func (v UInt64Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UInt64Value) DeepRemove

func (UInt64Value) DeepRemove(_ *Interpreter, _ bool)

func (UInt64Value) Div

func (v UInt64Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) Encode

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

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

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

func (UInt64Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UInt64Value) IsResourceKinded

func (UInt64Value) IsResourceKinded(_ *Interpreter) bool

func (UInt64Value) IsStorable

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

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

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

func (v UInt64Value) RecursiveString(_ SeenReferences) string

func (UInt64Value) RemoveMember

func (UInt64Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UInt64Value) SaturatingDiv

func (v UInt64Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) SaturatingMinus

func (v UInt64Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) SaturatingMul

func (v UInt64Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) SaturatingPlus

func (v UInt64Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt64Value) SetMember

func (UInt64Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UInt64Value) StaticType

func (UInt64Value) StaticType(interpreter *Interpreter) StaticType

func (UInt64Value) Storable

func (UInt64Value) StoredValue

func (v UInt64Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UInt64Value) String

func (v UInt64Value) String() string

func (UInt64Value) ToBigEndianBytes

func (v UInt64Value) ToBigEndianBytes() []byte

func (UInt64Value) ToBigInt

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

func (v UInt64Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt64Value) Walk

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

func NewUInt8Value(gauge common.MemoryGauge, uint8Constructor func() uint8) UInt8Value

func NewUnmeteredUInt8Value

func NewUnmeteredUInt8Value(value uint8) UInt8Value

func (UInt8Value) Accept

func (v UInt8Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UInt8Value) BitwiseAnd

func (v UInt8Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt8Value) BitwiseLeftShift

func (v UInt8Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt8Value) BitwiseOr

func (v UInt8Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt8Value) BitwiseRightShift

func (v UInt8Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt8Value) BitwiseXor

func (v UInt8Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UInt8Value) ByteSize

func (v UInt8Value) ByteSize() uint32

func (UInt8Value) ChildStorables

func (UInt8Value) ChildStorables() []atree.Storable

func (UInt8Value) Clone

func (v UInt8Value) Clone(_ *Interpreter) Value

func (UInt8Value) ConformsToStaticType

func (v UInt8Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UInt8Value) DeepRemove

func (UInt8Value) DeepRemove(_ *Interpreter, _ bool)

func (UInt8Value) Div

func (v UInt8Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) Encode

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

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

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

func (UInt8Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UInt8Value) IsResourceKinded

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

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

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

func (v UInt8Value) RecursiveString(_ SeenReferences) string

func (UInt8Value) RemoveMember

func (UInt8Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UInt8Value) SaturatingDiv

func (v UInt8Value) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) SaturatingMinus

func (v UInt8Value) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) SaturatingMul

func (v UInt8Value) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) SaturatingPlus

func (v UInt8Value) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UInt8Value) SetMember

func (UInt8Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UInt8Value) StaticType

func (UInt8Value) StaticType(interpreter *Interpreter) StaticType

func (UInt8Value) Storable

func (UInt8Value) StoredValue

func (v UInt8Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UInt8Value) String

func (v UInt8Value) String() string

func (UInt8Value) ToBigEndianBytes

func (v UInt8Value) ToBigEndianBytes() []byte

func (UInt8Value) ToInt

func (v UInt8Value) ToInt(_ LocationRange) int

func (UInt8Value) Transfer

func (v UInt8Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt8Value) Walk

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

func NewUnmeteredUIntValueFromBigInt(value *big.Int) UIntValue

func NewUnmeteredUIntValueFromUint64

func NewUnmeteredUIntValueFromUint64(value uint64) UIntValue

func (UIntValue) Accept

func (v UIntValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (UIntValue) BitwiseAnd

func (v UIntValue) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UIntValue) BitwiseLeftShift

func (v UIntValue) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UIntValue) BitwiseOr

func (v UIntValue) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UIntValue) BitwiseRightShift

func (v UIntValue) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UIntValue) BitwiseXor

func (v UIntValue) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (UIntValue) ByteLength

func (v UIntValue) ByteLength() int

func (UIntValue) ByteSize

func (v UIntValue) ByteSize() uint32

func (UIntValue) ChildStorables

func (UIntValue) ChildStorables() []atree.Storable

func (UIntValue) Clone

func (v UIntValue) Clone(_ *Interpreter) Value

func (UIntValue) ConformsToStaticType

func (v UIntValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (UIntValue) DeepRemove

func (UIntValue) DeepRemove(_ *Interpreter, _ bool)

func (UIntValue) Div

func (v UIntValue) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) Encode

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

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

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

func (v UIntValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (UIntValue) IsResourceKinded

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

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

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

func (v UIntValue) RecursiveString(_ SeenReferences) string

func (UIntValue) RemoveMember

func (UIntValue) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (UIntValue) SaturatingDiv

func (v UIntValue) SaturatingDiv(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) SaturatingMinus

func (v UIntValue) SaturatingMinus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) SaturatingMul

func (v UIntValue) SaturatingMul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) SaturatingPlus

func (v UIntValue) SaturatingPlus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (UIntValue) SetMember

func (UIntValue) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (UIntValue) StaticType

func (UIntValue) StaticType(interpreter *Interpreter) StaticType

func (UIntValue) Storable

func (v UIntValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint64) (atree.Storable, error)

func (UIntValue) StoredValue

func (v UIntValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (UIntValue) String

func (v UIntValue) String() string

func (UIntValue) ToBigEndianBytes

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

func (v UIntValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UIntValue) Walk

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

type UUIDUnavailableError struct {
	LocationRange
}

UUIDUnavailableError

func (UUIDUnavailableError) Error

func (e UUIDUnavailableError) Error() string

func (UUIDUnavailableError) IsUserError

func (UUIDUnavailableError) IsUserError()

type Uint64AtreeValue

type Uint64AtreeValue uint64

func NewUint64AtreeValue

func NewUint64AtreeValue(gauge common.MemoryGauge, s uint64) Uint64AtreeValue

func (Uint64AtreeValue) ByteSize

func (v Uint64AtreeValue) ByteSize() uint32

func (Uint64AtreeValue) ChildStorables

func (Uint64AtreeValue) ChildStorables() []atree.Storable

func (Uint64AtreeValue) Encode

func (v Uint64AtreeValue) Encode(e *atree.Encoder) error

Encode encodes the value as a CBOR unsigned integer

func (Uint64AtreeValue) Storable

func (v Uint64AtreeValue) Storable(
	_ atree.SlabStorage,
	_ atree.Address,
	_ uint64,
) (
	atree.Storable,
	error,
)

func (Uint64AtreeValue) StoredValue

func (v Uint64AtreeValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

type Uint64StorageMapKey

type Uint64StorageMapKey Uint64AtreeValue

Uint64StorageMapKey is a StorageMapKey backed by a simple Uint64AtreeValue

func (Uint64StorageMapKey) AtreeValue

func (k Uint64StorageMapKey) AtreeValue() atree.Value

func (Uint64StorageMapKey) AtreeValueCompare

func (Uint64StorageMapKey) AtreeValueCompare(
	slabStorage atree.SlabStorage,
	value atree.Value,
	otherStorable atree.Storable,
) (bool, error)

func (Uint64StorageMapKey) AtreeValueHashInput

func (Uint64StorageMapKey) AtreeValueHashInput(v atree.Value, scratch []byte) ([]byte, error)

type Unauthorized

type Unauthorized struct{}

func (Unauthorized) Encode

func (t Unauthorized) Encode(e *cbor.StreamEncoder) error

func (Unauthorized) Equal

func (Unauthorized) Equal(auth Authorization) bool

func (Unauthorized) ID

func (Unauthorized) ID() TypeID

func (Unauthorized) MeteredString

func (a Unauthorized) MeteredString(_ common.MemoryGauge) string

func (Unauthorized) String

func (Unauthorized) String() string

type UnderflowError

type UnderflowError struct {
	LocationRange
}

func (UnderflowError) Error

func (e UnderflowError) Error() string

func (UnderflowError) IsUserError

func (UnderflowError) IsUserError()

type UnexpectedMappedEntitlementError

type UnexpectedMappedEntitlementError struct {
	Type sema.Type
	LocationRange
}

UnexpectedMappedEntitlementError

func (UnexpectedMappedEntitlementError) Error

func (UnexpectedMappedEntitlementError) IsInternalError

func (UnexpectedMappedEntitlementError) IsInternalError()

type Unsigned

type Unsigned interface {
	~uint8 | ~uint16 | ~uint32 | ~uint64
}

type UnsupportedTagDecodingError

type UnsupportedTagDecodingError struct {
	Tag uint64
}

func (UnsupportedTagDecodingError) Error

func (UnsupportedTagDecodingError) IsInternalError

func (UnsupportedTagDecodingError) IsInternalError()

type UseBeforeInitializationError

type UseBeforeInitializationError struct {
	LocationRange
	Name string
}

UseBeforeInitializationError

func (UseBeforeInitializationError) Error

func (UseBeforeInitializationError) IsUserError

func (UseBeforeInitializationError) IsUserError()

type ValidateAccountCapabilitiesGetHandlerFunc

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

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

func AddressFromBytes(invocation Invocation) Value

func AddressFromString

func AddressFromString(invocation Invocation) Value

func ConvertStoredValue

func ConvertStoredValue(gauge common.MemoryGauge, value atree.Value) (Value, error)

func ConvertUInt128

func ConvertUInt128(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Value

func ConvertWord128

func ConvertWord128(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Value

func ConvertWord256

func ConvertWord256(memoryGauge common.MemoryGauge, value Value, locationRange LocationRange) Value

func DereferenceValue

func DereferenceValue(
	inter *Interpreter,
	locationRange LocationRange,
	referenceValue ReferenceValue,
) Value

func MustConvertStoredValue

func MustConvertStoredValue(gauge common.MemoryGauge, value atree.Value) Value

func MustConvertUnmeteredStoredValue

func MustConvertUnmeteredStoredValue(value atree.Value) Value

func NewAccountCapabilitiesValue

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

func NewAccountContractsValue(
	gauge common.MemoryGauge,
	address AddressValue,
	addFunction BoundFunctionGenerator,
	updateFunction BoundFunctionGenerator,
	tryUpdateFunction BoundFunctionGenerator,
	getFunction BoundFunctionGenerator,
	borrowFunction BoundFunctionGenerator,
	removeFunction BoundFunctionGenerator,
	namesGetter ContractNamesGetter,
) Value

func NewAccountInboxValue

func NewAccountInboxValue(
	gauge common.MemoryGauge,
	addressValue AddressValue,
	publishFunction BoundFunctionGenerator,
	unpublishFunction BoundFunctionGenerator,
	claimFunction BoundFunctionGenerator,
) Value

NewAccountInboxValue constructs an Account.Inbox value.

func NewAccountKeysValue

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

func NewAccountStorageCapabilitiesValue(
	gauge common.MemoryGauge,
	address AddressValue,
	getControllerFunction BoundFunctionGenerator,
	getControllersFunction BoundFunctionGenerator,
	forEachControllerFunction BoundFunctionGenerator,
	issueFunction BoundFunctionGenerator,
	issueWithTypeFunction BoundFunctionGenerator,
) Value

func NewAccountStorageValue

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

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

func NewDeploymentResultValue(
	gauge common.MemoryGauge,
	deployedContract OptionalValue,
) Value

func StoredValue

func StoredValue(gauge common.MemoryGauge, storable atree.Storable, storage atree.SlabStorage) Value

type ValueConverterDeclaration

type ValueConverterDeclaration struct {
	// contains filtered or unexported fields
}

type ValueDeclaration

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

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

type ValueTransferTypeError struct {
	ExpectedType sema.Type
	ActualType   sema.Type
	LocationRange
}

ValueTransferTypeError

func (ValueTransferTypeError) Error

func (e ValueTransferTypeError) Error() string

func (ValueTransferTypeError) IsInternalError

func (ValueTransferTypeError) IsInternalError()

type ValueWalker

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

func NewSelfVariableWithValue(interpreter *Interpreter, value Value, locationRange LocationRange) Variable

func NewVariableWithGetter

func NewVariableWithGetter(gauge common.MemoryGauge, getter func() Value) Variable

func NewVariableWithValue

func NewVariableWithValue(gauge common.MemoryGauge, value Value) Variable

type VariableActivation

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

type VariableActivations = activations.Activations[Variable]

type VariableSizedStaticType

type VariableSizedStaticType struct {
	Type StaticType
}

func NewVariableSizedStaticType

func NewVariableSizedStaticType(
	memoryGauge common.MemoryGauge,
	elementType StaticType,
) *VariableSizedStaticType

func (*VariableSizedStaticType) Copy

func (*VariableSizedStaticType) ElementType

func (t *VariableSizedStaticType) ElementType() StaticType

func (*VariableSizedStaticType) Encode

func (t *VariableSizedStaticType) Encode(e *cbor.StreamEncoder) error

Encode encodes VariableSizedStaticType as

cbor.Tag{
		Number:  CBORTagVariableSizedStaticType,
		Content: StaticType(v.Type),
}

func (*VariableSizedStaticType) Equal

func (t *VariableSizedStaticType) Equal(other StaticType) bool

func (*VariableSizedStaticType) ID

func (*VariableSizedStaticType) Identifier

func (t *VariableSizedStaticType) Identifier() string

func (*VariableSizedStaticType) IsComposite

func (*VariableSizedStaticType) IsComposite() bool

func (*VariableSizedStaticType) IsDeprecated

func (t *VariableSizedStaticType) IsDeprecated() bool

func (*VariableSizedStaticType) MeteredString

func (t *VariableSizedStaticType) MeteredString(memoryGauge common.MemoryGauge) string

func (*VariableSizedStaticType) String

func (t *VariableSizedStaticType) String() string

type VirtualImport

type VirtualImport struct {
	TypeCodes   TypeCodes
	Elaboration *sema.Elaboration
	Globals     []VirtualImportGlobal
}

type VirtualImportGlobal

type VirtualImportGlobal struct {
	Value Value
	Name  string
}

type Visitor

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

func (v VoidValue) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (VoidValue) ByteSize

func (VoidValue) ByteSize() uint32

func (VoidValue) ChildStorables

func (VoidValue) ChildStorables() []atree.Storable

func (VoidValue) Clone

func (v VoidValue) Clone(_ *Interpreter) Value

func (VoidValue) ConformsToStaticType

func (v VoidValue) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (VoidValue) DeepRemove

func (VoidValue) DeepRemove(_ *Interpreter, _ bool)

func (VoidValue) Encode

func (VoidValue) Encode(e *atree.Encoder) error

Encode writes a value of type Void to the encoder

func (VoidValue) Equal

func (v VoidValue) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (VoidValue) IsImportable

func (VoidValue) IsImportable(_ *Interpreter, _ LocationRange) bool

func (VoidValue) IsResourceKinded

func (VoidValue) IsResourceKinded(_ *Interpreter) bool

func (VoidValue) MeteredString

func (v VoidValue) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (VoidValue) NeedsStoreTo

func (VoidValue) NeedsStoreTo(_ atree.Address) bool

func (VoidValue) RecursiveString

func (v VoidValue) RecursiveString(_ SeenReferences) string

func (VoidValue) StaticType

func (VoidValue) StaticType(interpreter *Interpreter) StaticType

func (VoidValue) Storable

func (VoidValue) StoredValue

func (v VoidValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (VoidValue) String

func (VoidValue) String() string

func (VoidValue) Transfer

func (v VoidValue) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (VoidValue) Walk

func (VoidValue) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Word128Value

type Word128Value struct {
	BigInt *big.Int
}

func NewUnmeteredWord128ValueFromBigInt

func NewUnmeteredWord128ValueFromBigInt(value *big.Int) Word128Value

func NewUnmeteredWord128ValueFromUint64

func NewUnmeteredWord128ValueFromUint64(value uint64) Word128Value

func NewWord128ValueFromBigInt

func NewWord128ValueFromBigInt(memoryGauge common.MemoryGauge, bigIntConstructor func() *big.Int) Word128Value

func NewWord128ValueFromUint64

func NewWord128ValueFromUint64(memoryGauge common.MemoryGauge, value int64) Word128Value

func (Word128Value) Accept

func (v Word128Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Word128Value) BitwiseAnd

func (v Word128Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word128Value) BitwiseLeftShift

func (v Word128Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word128Value) BitwiseOr

func (v Word128Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word128Value) BitwiseRightShift

func (v Word128Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word128Value) BitwiseXor

func (v Word128Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word128Value) ByteLength

func (v Word128Value) ByteLength() int

func (Word128Value) ByteSize

func (v Word128Value) ByteSize() uint32

func (Word128Value) ChildStorables

func (Word128Value) ChildStorables() []atree.Storable

func (Word128Value) Clone

func (v Word128Value) Clone(_ *Interpreter) Value

func (Word128Value) ConformsToStaticType

func (v Word128Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Word128Value) DeepRemove

func (Word128Value) DeepRemove(_ *Interpreter, _ bool)

func (Word128Value) Div

func (v Word128Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word128Value) Encode

func (v Word128Value) Encode(e *atree.Encoder) error

Encode encodes Word128Value as

cbor.Tag{
		Number:  CBORTagWord128Value,
		Content: *big.Int(v.BigInt),
}

func (Word128Value) Equal

func (v Word128Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Word128Value) GetMember

func (v Word128Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Word128Value) Greater

func (v Word128Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word128Value) GreaterEqual

func (v Word128Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word128Value) HashInput

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

func (Word128Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Word128Value) IsResourceKinded

func (Word128Value) IsResourceKinded(_ *Interpreter) bool

func (Word128Value) IsStorable

func (Word128Value) IsStorable() bool

func (Word128Value) Less

func (v Word128Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word128Value) LessEqual

func (v Word128Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word128Value) MeteredString

func (v Word128Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Word128Value) Minus

func (v Word128Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word128Value) Mod

func (v Word128Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word128Value) Mul

func (v Word128Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word128Value) NeedsStoreTo

func (Word128Value) NeedsStoreTo(_ atree.Address) bool

func (Word128Value) Negate

func (Word128Value) Plus

func (v Word128Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word128Value) RecursiveString

func (v Word128Value) RecursiveString(_ SeenReferences) string

func (Word128Value) RemoveMember

func (Word128Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Word128Value) SaturatingDiv

func (v Word128Value) SaturatingDiv(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word128Value) SaturatingMinus

func (v Word128Value) SaturatingMinus(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word128Value) SaturatingMul

func (v Word128Value) SaturatingMul(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word128Value) SaturatingPlus

func (v Word128Value) SaturatingPlus(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word128Value) SetMember

func (Word128Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Word128Value) StaticType

func (Word128Value) StaticType(interpreter *Interpreter) StaticType

func (Word128Value) Storable

func (Word128Value) StoredValue

func (v Word128Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Word128Value) String

func (v Word128Value) String() string

func (Word128Value) ToBigEndianBytes

func (v Word128Value) ToBigEndianBytes() []byte

func (Word128Value) ToBigInt

func (v Word128Value) ToBigInt(memoryGauge common.MemoryGauge) *big.Int

func (Word128Value) ToInt

func (v Word128Value) ToInt(locationRange LocationRange) int

func (Word128Value) Transfer

func (v Word128Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word128Value) Walk

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

func NewUnmeteredWord16Value(value uint16) Word16Value

func NewWord16Value

func NewWord16Value(gauge common.MemoryGauge, valueGetter func() uint16) Word16Value

func (Word16Value) Accept

func (v Word16Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Word16Value) BitwiseAnd

func (v Word16Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word16Value) BitwiseLeftShift

func (v Word16Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word16Value) BitwiseOr

func (v Word16Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word16Value) BitwiseRightShift

func (v Word16Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word16Value) BitwiseXor

func (v Word16Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word16Value) ByteSize

func (v Word16Value) ByteSize() uint32

func (Word16Value) ChildStorables

func (Word16Value) ChildStorables() []atree.Storable

func (Word16Value) Clone

func (v Word16Value) Clone(_ *Interpreter) Value

func (Word16Value) ConformsToStaticType

func (v Word16Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Word16Value) DeepRemove

func (Word16Value) DeepRemove(_ *Interpreter, _ bool)

func (Word16Value) Div

func (v Word16Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word16Value) Encode

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

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

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

func (Word16Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Word16Value) IsResourceKinded

func (Word16Value) IsResourceKinded(_ *Interpreter) bool

func (Word16Value) IsStorable

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

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

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

func (v Word16Value) RecursiveString(_ SeenReferences) string

func (Word16Value) RemoveMember

func (Word16Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Word16Value) SaturatingDiv

func (Word16Value) SaturatingMinus

func (Word16Value) SaturatingMul

func (Word16Value) SaturatingPlus

func (Word16Value) SetMember

func (Word16Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Word16Value) StaticType

func (Word16Value) StaticType(interpreter *Interpreter) StaticType

func (Word16Value) Storable

func (Word16Value) StoredValue

func (v Word16Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Word16Value) String

func (v Word16Value) String() string

func (Word16Value) ToBigEndianBytes

func (v Word16Value) ToBigEndianBytes() []byte

func (Word16Value) ToInt

func (v Word16Value) ToInt(_ LocationRange) int

func (Word16Value) Transfer

func (v Word16Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word16Value) Walk

func (Word16Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type Word256Value

type Word256Value struct {
	BigInt *big.Int
}

func NewUnmeteredWord256ValueFromBigInt

func NewUnmeteredWord256ValueFromBigInt(value *big.Int) Word256Value

func NewUnmeteredWord256ValueFromUint64

func NewUnmeteredWord256ValueFromUint64(value uint64) Word256Value

func NewWord256ValueFromBigInt

func NewWord256ValueFromBigInt(memoryGauge common.MemoryGauge, bigIntConstructor func() *big.Int) Word256Value

func NewWord256ValueFromUint64

func NewWord256ValueFromUint64(memoryGauge common.MemoryGauge, value int64) Word256Value

func (Word256Value) Accept

func (v Word256Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Word256Value) BitwiseAnd

func (v Word256Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word256Value) BitwiseLeftShift

func (v Word256Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word256Value) BitwiseOr

func (v Word256Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word256Value) BitwiseRightShift

func (v Word256Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word256Value) BitwiseXor

func (v Word256Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word256Value) ByteLength

func (v Word256Value) ByteLength() int

func (Word256Value) ByteSize

func (v Word256Value) ByteSize() uint32

func (Word256Value) ChildStorables

func (Word256Value) ChildStorables() []atree.Storable

func (Word256Value) Clone

func (v Word256Value) Clone(_ *Interpreter) Value

func (Word256Value) ConformsToStaticType

func (v Word256Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Word256Value) DeepRemove

func (Word256Value) DeepRemove(_ *Interpreter, _ bool)

func (Word256Value) Div

func (v Word256Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word256Value) Encode

func (v Word256Value) Encode(e *atree.Encoder) error

Encode encodes Word256Value as

cbor.Tag{
		Number:  CBORTagWord256Value,
		Content: *big.Int(v.BigInt),
}

func (Word256Value) Equal

func (v Word256Value) Equal(_ *Interpreter, _ LocationRange, other Value) bool

func (Word256Value) GetMember

func (v Word256Value) GetMember(interpreter *Interpreter, locationRange LocationRange, name string) Value

func (Word256Value) Greater

func (v Word256Value) Greater(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word256Value) GreaterEqual

func (v Word256Value) GreaterEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word256Value) HashInput

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

func (Word256Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Word256Value) IsResourceKinded

func (Word256Value) IsResourceKinded(_ *Interpreter) bool

func (Word256Value) IsStorable

func (Word256Value) IsStorable() bool

func (Word256Value) Less

func (v Word256Value) Less(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word256Value) LessEqual

func (v Word256Value) LessEqual(interpreter *Interpreter, other ComparableValue, locationRange LocationRange) BoolValue

func (Word256Value) MeteredString

func (v Word256Value) MeteredString(interpreter *Interpreter, _ SeenReferences, locationRange LocationRange) string

func (Word256Value) Minus

func (v Word256Value) Minus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word256Value) Mod

func (v Word256Value) Mod(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word256Value) Mul

func (v Word256Value) Mul(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word256Value) NeedsStoreTo

func (Word256Value) NeedsStoreTo(_ atree.Address) bool

func (Word256Value) Negate

func (Word256Value) Plus

func (v Word256Value) Plus(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word256Value) RecursiveString

func (v Word256Value) RecursiveString(_ SeenReferences) string

func (Word256Value) RemoveMember

func (Word256Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Word256Value) SaturatingDiv

func (v Word256Value) SaturatingDiv(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word256Value) SaturatingMinus

func (v Word256Value) SaturatingMinus(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word256Value) SaturatingMul

func (v Word256Value) SaturatingMul(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word256Value) SaturatingPlus

func (v Word256Value) SaturatingPlus(_ *Interpreter, _ NumberValue, _ LocationRange) NumberValue

func (Word256Value) SetMember

func (Word256Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Word256Value) StaticType

func (Word256Value) StaticType(interpreter *Interpreter) StaticType

func (Word256Value) Storable

func (Word256Value) StoredValue

func (v Word256Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Word256Value) String

func (v Word256Value) String() string

func (Word256Value) ToBigEndianBytes

func (v Word256Value) ToBigEndianBytes() []byte

func (Word256Value) ToBigInt

func (v Word256Value) ToBigInt(memoryGauge common.MemoryGauge) *big.Int

func (Word256Value) ToInt

func (v Word256Value) ToInt(locationRange LocationRange) int

func (Word256Value) Transfer

func (v Word256Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word256Value) Walk

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

func NewUnmeteredWord32Value(value uint32) Word32Value

func NewWord32Value

func NewWord32Value(gauge common.MemoryGauge, valueGetter func() uint32) Word32Value

func (Word32Value) Accept

func (v Word32Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Word32Value) BitwiseAnd

func (v Word32Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word32Value) BitwiseLeftShift

func (v Word32Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word32Value) BitwiseOr

func (v Word32Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word32Value) BitwiseRightShift

func (v Word32Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word32Value) BitwiseXor

func (v Word32Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word32Value) ByteSize

func (v Word32Value) ByteSize() uint32

func (Word32Value) ChildStorables

func (Word32Value) ChildStorables() []atree.Storable

func (Word32Value) Clone

func (v Word32Value) Clone(_ *Interpreter) Value

func (Word32Value) ConformsToStaticType

func (v Word32Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Word32Value) DeepRemove

func (Word32Value) DeepRemove(_ *Interpreter, _ bool)

func (Word32Value) Div

func (v Word32Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word32Value) Encode

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

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

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

func (Word32Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Word32Value) IsResourceKinded

func (Word32Value) IsResourceKinded(_ *Interpreter) bool

func (Word32Value) IsStorable

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

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

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

func (v Word32Value) RecursiveString(_ SeenReferences) string

func (Word32Value) RemoveMember

func (Word32Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Word32Value) SaturatingDiv

func (Word32Value) SaturatingMinus

func (Word32Value) SaturatingMul

func (Word32Value) SaturatingPlus

func (Word32Value) SetMember

func (Word32Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Word32Value) StaticType

func (Word32Value) StaticType(interpreter *Interpreter) StaticType

func (Word32Value) Storable

func (Word32Value) StoredValue

func (v Word32Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Word32Value) String

func (v Word32Value) String() string

func (Word32Value) ToBigEndianBytes

func (v Word32Value) ToBigEndianBytes() []byte

func (Word32Value) ToInt

func (v Word32Value) ToInt(_ LocationRange) int

func (Word32Value) Transfer

func (v Word32Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word32Value) Walk

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

func NewUnmeteredWord64Value(value uint64) Word64Value

func NewWord64Value

func NewWord64Value(gauge common.MemoryGauge, valueGetter func() uint64) Word64Value

func (Word64Value) Accept

func (v Word64Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Word64Value) BitwiseAnd

func (v Word64Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word64Value) BitwiseLeftShift

func (v Word64Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word64Value) BitwiseOr

func (v Word64Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word64Value) BitwiseRightShift

func (v Word64Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word64Value) BitwiseXor

func (v Word64Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word64Value) ByteLength

func (v Word64Value) ByteLength() int

func (Word64Value) ByteSize

func (v Word64Value) ByteSize() uint32

func (Word64Value) ChildStorables

func (Word64Value) ChildStorables() []atree.Storable

func (Word64Value) Clone

func (v Word64Value) Clone(_ *Interpreter) Value

func (Word64Value) ConformsToStaticType

func (v Word64Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Word64Value) DeepRemove

func (Word64Value) DeepRemove(_ *Interpreter, _ bool)

func (Word64Value) Div

func (v Word64Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word64Value) Encode

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

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

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

func (Word64Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Word64Value) IsResourceKinded

func (Word64Value) IsResourceKinded(_ *Interpreter) bool

func (Word64Value) IsStorable

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

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

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

func (v Word64Value) RecursiveString(_ SeenReferences) string

func (Word64Value) RemoveMember

func (Word64Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Word64Value) SaturatingDiv

func (Word64Value) SaturatingMinus

func (Word64Value) SaturatingMul

func (Word64Value) SaturatingPlus

func (Word64Value) SetMember

func (Word64Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Word64Value) StaticType

func (Word64Value) StaticType(interpreter *Interpreter) StaticType

func (Word64Value) Storable

func (Word64Value) StoredValue

func (v Word64Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Word64Value) String

func (v Word64Value) String() string

func (Word64Value) ToBigEndianBytes

func (v Word64Value) ToBigEndianBytes() []byte

func (Word64Value) ToBigInt

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

func (v Word64Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word64Value) Walk

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

func NewUnmeteredWord8Value(value uint8) Word8Value

func NewWord8Value

func NewWord8Value(gauge common.MemoryGauge, valueGetter func() uint8) Word8Value

func (Word8Value) Accept

func (v Word8Value) Accept(interpreter *Interpreter, visitor Visitor, _ LocationRange)

func (Word8Value) BitwiseAnd

func (v Word8Value) BitwiseAnd(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word8Value) BitwiseLeftShift

func (v Word8Value) BitwiseLeftShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word8Value) BitwiseOr

func (v Word8Value) BitwiseOr(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word8Value) BitwiseRightShift

func (v Word8Value) BitwiseRightShift(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word8Value) BitwiseXor

func (v Word8Value) BitwiseXor(interpreter *Interpreter, other IntegerValue, locationRange LocationRange) IntegerValue

func (Word8Value) ByteSize

func (v Word8Value) ByteSize() uint32

func (Word8Value) ChildStorables

func (Word8Value) ChildStorables() []atree.Storable

func (Word8Value) Clone

func (v Word8Value) Clone(_ *Interpreter) Value

func (Word8Value) ConformsToStaticType

func (v Word8Value) ConformsToStaticType(
	_ *Interpreter,
	_ LocationRange,
	_ TypeConformanceResults,
) bool

func (Word8Value) DeepRemove

func (Word8Value) DeepRemove(_ *Interpreter, _ bool)

func (Word8Value) Div

func (v Word8Value) Div(interpreter *Interpreter, other NumberValue, locationRange LocationRange) NumberValue

func (Word8Value) Encode

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

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

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

func (Word8Value) IsImportable(_ *Interpreter, _ LocationRange) bool

func (Word8Value) IsResourceKinded

func (Word8Value) IsResourceKinded(_ *Interpreter) bool

func (Word8Value) IsStorable

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

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

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

func (v Word8Value) RecursiveString(_ SeenReferences) string

func (Word8Value) RemoveMember

func (Word8Value) RemoveMember(_ *Interpreter, _ LocationRange, _ string) Value

func (Word8Value) SaturatingDiv

func (Word8Value) SaturatingMinus

func (Word8Value) SaturatingMul

func (Word8Value) SaturatingPlus

func (Word8Value) SetMember

func (Word8Value) SetMember(_ *Interpreter, _ LocationRange, _ string, _ Value) bool

func (Word8Value) StaticType

func (Word8Value) StaticType(interpreter *Interpreter) StaticType

func (Word8Value) Storable

func (Word8Value) StoredValue

func (v Word8Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)

func (Word8Value) String

func (v Word8Value) String() string

func (Word8Value) ToBigEndianBytes

func (v Word8Value) ToBigEndianBytes() []byte

func (Word8Value) ToInt

func (v Word8Value) ToInt(_ LocationRange) int

func (Word8Value) Transfer

func (v Word8Value) Transfer(
	interpreter *Interpreter,
	_ LocationRange,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word8Value) Walk

func (Word8Value) Walk(_ *Interpreter, _ func(Value), _ LocationRange)

type WrapperCode

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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL