interpreter

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 39 Imported by: 22

Documentation

Index

Constants

View Source
const AccountTypePrivateAddressFieldName = "address"
View Source
const FalseValue = BoolValue(false)
View Source
const Fix64MaxValue = math.MaxInt64
View Source
const Fix64MinValue = math.MinInt64
View Source
const TracingEnabled = false
View Source
const TrueValue = BoolValue(true)
View Source
const UFix64MaxValue = math.MaxUint64
View Source
const UnknownElementSize = 0

Variables

View Source
var BigEndianBytesConverters = func() map[string]TypedBigEndianBytesConverter {
	converters := map[string]TypedBigEndianBytesConverter{}

	for _, converter := range []TypedBigEndianBytesConverter{

		{
			ReceiverType: sema.Int8Type,
			ByteLength:   sema.Int8TypeSize,
			Converter:    NewInt8ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.Int16Type,
			ByteLength:   sema.Int16TypeSize,
			Converter:    NewInt16ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.Int32Type,
			ByteLength:   sema.Int32TypeSize,
			Converter:    NewInt32ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.Int64Type,
			ByteLength:   sema.Int64TypeSize,
			Converter:    NewInt64ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.Int128Type,
			ByteLength:   sema.Int128TypeSize,
			Converter:    NewInt128ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.Int256Type,
			ByteLength:   sema.Int256TypeSize,
			Converter:    NewInt256ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.IntType,
			Converter:    NewIntValueFromBigEndianBytes,
		},

		{
			ReceiverType: sema.UInt8Type,
			ByteLength:   sema.UInt8TypeSize,
			Converter:    NewUInt8ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.UInt16Type,
			ByteLength:   sema.UInt16TypeSize,
			Converter:    NewUInt16ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.UInt32Type,
			ByteLength:   sema.UInt32TypeSize,
			Converter:    NewUInt32ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.UInt64Type,
			ByteLength:   sema.UInt64TypeSize,
			Converter:    NewUInt64ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.UInt128Type,
			ByteLength:   sema.UInt128TypeSize,
			Converter:    NewUInt128ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.UInt256Type,
			ByteLength:   sema.UInt256TypeSize,
			Converter:    NewUInt256ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.UIntType,
			Converter:    NewUIntValueFromBigEndianBytes,
		},

		{
			ReceiverType: sema.Word8Type,
			ByteLength:   sema.Word8TypeSize,
			Converter:    NewWord8ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.Word16Type,
			ByteLength:   sema.Word16TypeSize,
			Converter:    NewWord16ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.Word32Type,
			ByteLength:   sema.Word32TypeSize,
			Converter:    NewWord32ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.Word64Type,
			ByteLength:   sema.Word64TypeSize,
			Converter:    NewWord64ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.Word128Type,
			ByteLength:   sema.Word128TypeSize,
			Converter:    NewWord128ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.Word256Type,
			ByteLength:   sema.Word256TypeSize,
			Converter:    NewWord256ValueFromBigEndianBytes,
		},

		{
			ReceiverType: sema.Fix64Type,
			ByteLength:   sema.Fix64TypeSize,
			Converter:    NewFix64ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.Fix128Type,
			ByteLength:   sema.Fix128TypeSize,
			Converter:    NewFix128ValueFromBigEndianBytes,
		},

		{
			ReceiverType: sema.UFix64Type,
			ByteLength:   sema.UFix64TypeSize,
			Converter:    NewUFix64ValueFromBigEndianBytes,
		},
		{
			ReceiverType: sema.UFix128Type,
			ByteLength:   sema.UFix128TypeSize,
			Converter:    NewUFix128ValueFromBigEndianBytes,
		},
	} {

		typeName := converter.ReceiverType.String()
		if _, ok := converters[typeName]; ok {
			panic(errors.NewUnexpectedError("duplicate from big-endian bytes converter for type %s", typeName))
		}
		converters[typeName] = converter
	}

	return converters
}()

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{
	{
		Name: sema.IntTypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertInt(gauge, value)
		},
	},
	{
		Name: sema.UIntTypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertUInt(gauge, value)
		},
		Min: NewUnmeteredUIntValueFromBigInt(sema.UIntTypeMin),
	},
	{
		Name: sema.Int8TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertInt8(gauge, value)
		},
		Min: NewUnmeteredInt8Value(math.MinInt8),
		Max: NewUnmeteredInt8Value(math.MaxInt8),
	},
	{
		Name: sema.Int16TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertInt16(gauge, value)
		},
		Min: NewUnmeteredInt16Value(math.MinInt16),
		Max: NewUnmeteredInt16Value(math.MaxInt16),
	},
	{
		Name: sema.Int32TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertInt32(gauge, value)
		},
		Min: NewUnmeteredInt32Value(math.MinInt32),
		Max: NewUnmeteredInt32Value(math.MaxInt32),
	},
	{
		Name: sema.Int64TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertInt64(gauge, value)
		},
		Min: NewUnmeteredInt64Value(math.MinInt64),
		Max: NewUnmeteredInt64Value(math.MaxInt64),
	},
	{
		Name: sema.Int128TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertInt128(gauge, value)
		},
		Min: NewUnmeteredInt128ValueFromBigInt(sema.Int128TypeMinIntBig),
		Max: NewUnmeteredInt128ValueFromBigInt(sema.Int128TypeMaxIntBig),
	},
	{
		Name: sema.Int256TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertInt256(gauge, value)
		},
		Min: NewUnmeteredInt256ValueFromBigInt(sema.Int256TypeMinIntBig),
		Max: NewUnmeteredInt256ValueFromBigInt(sema.Int256TypeMaxIntBig),
	},
	{
		Name: sema.UInt8TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertUInt8(gauge, value)
		},
		Min: NewUnmeteredUInt8Value(0),
		Max: NewUnmeteredUInt8Value(math.MaxUint8),
	},
	{
		Name: sema.UInt16TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertUInt16(gauge, value)
		},
		Min: NewUnmeteredUInt16Value(0),
		Max: NewUnmeteredUInt16Value(math.MaxUint16),
	},
	{
		Name: sema.UInt32TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertUInt32(gauge, value)
		},
		Min: NewUnmeteredUInt32Value(0),
		Max: NewUnmeteredUInt32Value(math.MaxUint32),
	},
	{
		Name: sema.UInt64TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertUInt64(gauge, value)
		},
		Min: NewUnmeteredUInt64Value(0),
		Max: NewUnmeteredUInt64Value(math.MaxUint64),
	},
	{
		Name:    sema.UInt128TypeName,
		Convert: ConvertUInt128,
		Min:     NewUnmeteredUInt128ValueFromUint64(0),
		Max:     NewUnmeteredUInt128ValueFromBigInt(sema.UInt128TypeMaxIntBig),
	},
	{
		Name: sema.UInt256TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertUInt256(gauge, value)
		},
		Min: NewUnmeteredUInt256ValueFromUint64(0),
		Max: NewUnmeteredUInt256ValueFromBigInt(sema.UInt256TypeMaxIntBig),
	},
	{
		Name: sema.Word8TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertWord8(gauge, value)
		},
		Min: NewUnmeteredWord8Value(0),
		Max: NewUnmeteredWord8Value(math.MaxUint8),
	},
	{
		Name: sema.Word16TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertWord16(gauge, value)
		},
		Min: NewUnmeteredWord16Value(0),
		Max: NewUnmeteredWord16Value(math.MaxUint16),
	},
	{
		Name: sema.Word32TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertWord32(gauge, value)
		},
		Min: NewUnmeteredWord32Value(0),
		Max: NewUnmeteredWord32Value(math.MaxUint32),
	},
	{
		Name: sema.Word64TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertWord64(gauge, value)
		},
		Min: NewUnmeteredWord64Value(0),
		Max: NewUnmeteredWord64Value(math.MaxUint64),
	},
	{
		Name:    sema.Word128TypeName,
		Convert: ConvertWord128,
		Min:     NewUnmeteredWord128ValueFromUint64(0),
		Max:     NewUnmeteredWord128ValueFromBigInt(sema.Word128TypeMaxIntBig),
	},
	{
		Name:    sema.Word256TypeName,
		Convert: ConvertWord256,
		Min:     NewUnmeteredWord256ValueFromUint64(0),
		Max:     NewUnmeteredWord256ValueFromBigInt(sema.Word256TypeMaxIntBig),
	},
	{
		Name: sema.Fix64TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertFix64(gauge, value)
		},
		Min: NewUnmeteredFix64Value(math.MinInt64),
		Max: NewUnmeteredFix64Value(math.MaxInt64),
	},
	{
		Name: sema.Fix128TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertFix128(gauge, value)
		},
		Min: NewUnmeteredFix128Value(fixedpoint.Fix128TypeMin),
		Max: NewUnmeteredFix128Value(fixedpoint.Fix128TypeMax),
	},
	{
		Name: sema.UFix64TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertUFix64(gauge, value)
		},
		Min: NewUnmeteredUFix64Value(0),
		Max: NewUnmeteredUFix64Value(math.MaxUint64),
	},
	{
		Name: sema.UFix128TypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertUFix128(gauge, value)
		},
		Min: NewUnmeteredUFix128Value(fixedpoint.UFix128TypeMin),
		Max: NewUnmeteredUFix128Value(fixedpoint.UFix128TypeMax),
	},
	{
		Name: sema.AddressTypeName,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return ConvertAddress(gauge, value)
		},
		// contains filtered or unexported fields
	},
	{
		Name: sema.PublicPathType.Name,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return newPathFromStringValue(gauge, common.PathDomainPublic, value)
		},
	},
	{
		Name: sema.PrivatePathType.Name,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return newPathFromStringValue(gauge, common.PathDomainPrivate, value)
		},
	},
	{
		Name: sema.StoragePathType.Name,
		Convert: func(gauge common.MemoryGauge, value Value) Value {
			return newPathFromStringValue(gauge, common.PathDomainStorage, value)
		},
	},
}

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

View Source
var EmptyPathLinkValue = PathLinkValue{}
View Source
var EmptyPathValue = PathValue{}
View Source
var EmptyString = NewUnmeteredStringValue("")
View Source
var EmptyTypeValue = TypeValue{}
View Source
var FunctionPurityView = sema.FunctionPurityView
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 NativeAccountCapabilityControllerDeleteFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		controller := AssertValueOfType[*AccountCapabilityControllerValue](receiver)
		controller.Delete(context)
		controller.deleted = true
		return Void
	},
)
View Source
var NativeAccountCapabilityControllerSetTagFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		controller := AssertValueOfType[*AccountCapabilityControllerValue](receiver)
		newTagValue := AssertValueOfType[*StringValue](args[0])
		controller.SetTag(context, newTagValue)
		return Void
	},
)
View Source
var NativeAddressFromBytesFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		args []Value,
	) Value {
		byteArray := AssertValueOfType[*ArrayValue](args[0])

		return AddressValueFromByteArray(context, byteArray)
	},
)
View Source
var NativeAddressFromStringFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		args []Value,
	) Value {
		string := AssertValueOfType[*StringValue](args[0])

		return AddressValueFromString(context, string)
	},
)
View Source
var NativeAddressToBytesFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		address := common.Address(AssertValueOfType[AddressValue](receiver))
		return ByteSliceToByteArrayValue(context, address[:])
	},
)
View Source
var NativeAddressToStringFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		address := AssertValueOfType[AddressValue](receiver)
		return AddressValueToStringFunction(context, address)
	},
)

Native address functions

View Source
var NativeArrayAppendAllFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)
		otherArray := AssertValueOfType[*ArrayValue](args[0])

		thisArray.AppendAll(context, otherArray)
		return Void
	},
)
View Source
var NativeArrayAppendFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)
		element := args[0]

		thisArray.Append(context, element)
		return Void
	},
)

define all native functions for array type

View Source
var NativeArrayConcatFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)
		otherArray := AssertValueOfType[*ArrayValue](args[0])

		return thisArray.Concat(context, otherArray)
	},
)
View Source
var NativeArrayContainsFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)
		element := args[0]

		return thisArray.Contains(context, element)
	},
)
View Source
var NativeArrayFilterFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)
		funcValue := AssertValueOfType[FunctionValue](args[0])

		return thisArray.Filter(context, funcValue)
	},
)
View Source
var NativeArrayFirstIndexFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)
		element := args[0]

		return thisArray.FirstIndex(context, element)
	},
)
View Source
var NativeArrayInsertFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)
		index := AssertValueOfType[NumberValue](args[0])
		element := args[1]

		thisArray.Insert(context, index.ToInt(), element)
		return Void
	},
)
View Source
var NativeArrayMapFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)
		funcValue := AssertValueOfType[FunctionValue](args[0])

		return thisArray.Map(context, funcValue)
	},
)
View Source
var NativeArrayRemoveFirstFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)

		return thisArray.RemoveFirst(context)
	},
)
View Source
var NativeArrayRemoveFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)
		index := AssertValueOfType[NumberValue](args[0])

		return thisArray.Remove(context, index.ToInt())
	},
)
View Source
var NativeArrayRemoveLastFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)

		return thisArray.RemoveLast(context)
	},
)
View Source
var NativeArrayReverseFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)
		return thisArray.Reverse(context)
	},
)
View Source
var NativeArraySliceFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)
		fromValue := AssertValueOfType[IntValue](args[0])
		toValue := AssertValueOfType[IntValue](args[1])

		return thisArray.Slice(context, fromValue, toValue)
	},
)
View Source
var NativeArrayToConstantSizedFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		typeArguments TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)
		constantSizedArrayType, ok := typeArguments.NextStatic().(*ConstantSizedStaticType)
		if !ok {
			panic(errors.NewUnreachableError())
		}

		return thisArray.ToConstantSized(context, constantSizedArrayType.Size)
	},
)
View Source
var NativeArrayToVariableSizedFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		thisArray := AssertValueOfType[*ArrayValue](receiver)

		return thisArray.ToVariableSized(context)
	},
)
View Source
var NativeCapabilityTypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		args []Value,
	) Value {
		typeValue := AssertValueOfType[TypeValue](args[0])

		return ConstructCapabilityTypeValue(context, typeValue)
	},
)
View Source
var NativeCharacterValueToStringFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		character := AssertValueOfType[CharacterValue](receiver)
		return CharacterValueToString(context, character)
	},
)
View Source
var NativeCompositeTypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		args []Value,
	) Value {
		typeIDValue := AssertValueOfType[*StringValue](args[0])

		return ConstructCompositeTypeValue(context, typeIDValue)
	},
)
View Source
var NativeConstantSizedArrayTypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		args []Value,
	) Value {
		typeValue := AssertValueOfType[TypeValue](args[0])
		sizeValue := AssertValueOfType[IntValue](args[1])

		return ConstructConstantSizedArrayTypeValue(
			context,
			typeValue,
			sizeValue,
		)
	},
)
View Source
var NativeDictionaryContainsKeyFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		keyValue := args[0]
		dictionary := AssertValueOfType[*DictionaryValue](receiver)
		return dictionary.ContainsKey(context, keyValue)
	},
)
View Source
var NativeDictionaryForEachKeyFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		funcArgument := AssertValueOfType[FunctionValue](args[0])
		dictionary := AssertValueOfType[*DictionaryValue](receiver)
		dictionary.ForEachKey(context, funcArgument)
		return Void
	},
)
View Source
var NativeDictionaryInsertFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		keyValue := args[0]
		newValue := args[1]
		dictionary := AssertValueOfType[*DictionaryValue](receiver)
		return dictionary.Insert(context, keyValue, newValue)
	},
)
View Source
var NativeDictionaryRemoveFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		keyValue := args[0]
		dictionary := AssertValueOfType[*DictionaryValue](receiver)
		return dictionary.Remove(context, keyValue)
	},
)
View Source
var NativeDictionaryTypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		args []Value,
	) Value {
		keyTypeValue := AssertValueOfType[TypeValue](args[0])
		valueTypeValue := AssertValueOfType[TypeValue](args[1])

		return ConstructDictionaryTypeValue(
			context,
			keyTypeValue,
			valueTypeValue,
		)
	},
)
View Source
var NativeForEachAttachmentFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		v := AssertValueOfType[*CompositeValue](receiver)
		functionValue := AssertValueOfType[FunctionValue](args[0])

		v.ForEachAttachment(context, functionValue)

		return Void
	},
)
View Source
var NativeFunctionTypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		args []Value,
	) Value {
		parameterTypeValues := AssertValueOfType[*ArrayValue](args[0])
		returnTypeValue := AssertValueOfType[TypeValue](args[1])

		return ConstructFunctionTypeValue(
			context,
			parameterTypeValues,
			returnTypeValue,
		)
	},
)
View Source
var NativeGetTypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		return ValueGetType(context, receiver)
	},
)
View Source
var NativeInclusiveRangeContainsFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		rangeValue := AssertValueOfType[*CompositeValue](receiver)
		needleInteger := convertAndAssertIntegerValue(args[0])
		rangeType, ok := rangeValue.StaticType(context).(InclusiveRangeStaticType)
		if !ok {
			panic(errors.NewUnreachableError())
		}
		return InclusiveRangeContains(
			rangeValue,
			rangeType,
			context,
			needleInteger,
		)
	},
)
View Source
var NativeInclusiveRangeTypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		args []Value,
	) Value {
		typeValue := AssertValueOfType[TypeValue](args[0])

		return ConstructInclusiveRangeTypeValue(context, typeValue)
	},
)
View Source
var NativeIntersectionTypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		args []Value,
	) Value {
		intersectionIDs := AssertValueOfType[*ArrayValue](args[0])

		return ConstructIntersectionTypeValue(
			context,
			intersectionIDs,
		)
	},
)
View Source
var NativeIsInstanceFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {

		typeValue := AssertValueOfType[TypeValue](args[len(args)-1])
		return IsInstance(context, receiver, typeValue)
	},
)
View Source
var NativeMetaTypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		typeArguments TypeArgumentsIterator,
		_ Value,
		_ []Value,
	) Value {
		staticType := typeArguments.NextStatic()

		return NewTypeValue(context, staticType)
	},
)
View Source
var NativeMetaTypeIsSubtypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		typeValue := AssertValueOfType[TypeValue](receiver)
		otherTypeValue := AssertValueOfType[TypeValue](args[0])
		return MetaTypeIsSubType(context, typeValue, otherTypeValue)
	},
)
View Source
var NativeNumberSaturatingAddFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		other := AssertValueOfType[NumberValue](args[0])
		return receiver.(NumberValue).SaturatingPlus(context, other)
	},
)
View Source
var NativeNumberSaturatingDivideFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		other := AssertValueOfType[NumberValue](args[0])
		return receiver.(NumberValue).SaturatingDiv(context, other)
	},
)
View Source
var NativeNumberSaturatingMultiplyFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		other := AssertValueOfType[NumberValue](args[0])
		return receiver.(NumberValue).SaturatingMul(context, other)
	},
)
View Source
var NativeNumberSaturatingSubtractFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		other := AssertValueOfType[NumberValue](args[0])
		return receiver.(NumberValue).SaturatingMinus(context, other)
	},
)
View Source
var NativeNumberToBigEndianBytesFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		return ByteSliceToByteArrayValue(context, receiver.(NumberValue).ToBigEndianBytes())
	},
)
View Source
var NativeNumberToStringFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		return NumberValueToString(context, receiver.(NumberValue))
	},
)

all native number functions

View Source
var NativeOptionalMapFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		optionalValue := AssertValueOfType[OptionalValue](receiver)
		innerValueType := optionalValue.InnerValueType(context)

		transformFunction := AssertValueOfType[FunctionValue](args[0])
		transformFunctionType := transformFunction.FunctionType(context)
		return OptionalValueMapFunction(
			context,
			optionalValue,
			transformFunctionType,
			transformFunction,
			innerValueType,
		)
	},
)
View Source
var NativeOptionalTypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		args []Value,
	) Value {
		typeValue := AssertValueOfType[TypeValue](args[0])

		return ConstructOptionalTypeValue(context, typeValue)
	},
)
View Source
var NativePathValueToStringFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		path := AssertValueOfType[PathValue](receiver)
		return PathValueToStringFunction(context, path)
	},
)
View Source
var NativeReferenceTypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		args []Value,
	) Value {
		entitlementValues := AssertValueOfType[*ArrayValue](args[0])
		typeValue := AssertValueOfType[TypeValue](args[1])

		return ConstructReferenceTypeValue(
			context,
			entitlementValues,
			typeValue,
		)
	},
)
View Source
var NativeStorageCapabilityControllerDeleteFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		controller := AssertValueOfType[*StorageCapabilityControllerValue](receiver)
		controller.Delete(context)
		controller.deleted = true

		return Void
	},
)
View Source
var NativeStorageCapabilityControllerRetargetFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		controller := AssertValueOfType[*StorageCapabilityControllerValue](receiver)

		newTargetPathValue := AssertValueOfType[PathValue](args[0])
		if newTargetPathValue.Domain != common.PathDomainStorage {
			panic(errors.NewUnreachableError())
		}

		controller.SetTarget(context, newTargetPathValue)
		controller.TargetPath = newTargetPathValue

		return Void
	},
)
View Source
var NativeStorageCapabilityControllerSetTagFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		controller := AssertValueOfType[*StorageCapabilityControllerValue](receiver)

		newTagValue := AssertValueOfType[*StringValue](args[0])

		controller.SetTag(context, newTagValue)

		return Void
	},
)
View Source
var NativeStorageCapabilityControllerTargetFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		_ []Value,
	) Value {
		controller := AssertValueOfType[*StorageCapabilityControllerValue](receiver)
		return controller.TargetPath
	},
)
View Source
var NativeStringConcatFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		this := AssertValueOfType[*StringValue](receiver)
		other := args[0]
		return StringConcat(
			context,
			this,
			other,
		)
	},
)
View Source
var NativeStringContainsFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		other := AssertValueOfType[*StringValue](args[0])
		stringValue := AssertValueOfType[*StringValue](receiver)
		return stringValue.Contains(context, other)
	},
)
View Source
var NativeStringCountFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		other := AssertValueOfType[*StringValue](args[0])
		stringValue := AssertValueOfType[*StringValue](receiver)
		return stringValue.Count(context, other)
	},
)
View Source
var NativeStringDecodeHexFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		stringValue := AssertValueOfType[*StringValue](receiver)
		return stringValue.DecodeHex(context)
	},
)
View Source
var NativeStringEncodeHexFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		argument := AssertValueOfType[*ArrayValue](args[0])
		return StringFunctionEncodeHex(context, argument)
	},
)
View Source
var NativeStringFromCharactersFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		argument := AssertValueOfType[*ArrayValue](args[0])
		return StringFunctionFromCharacters(context, argument)
	},
)
View Source
var NativeStringFromUtf8Function = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		argument := AssertValueOfType[*ArrayValue](args[0])
		return StringFunctionFromUtf8(context, argument)
	},
)
View Source
var NativeStringFunction = NativeFunction(
	func(
		_ NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		_ []Value,
	) Value {
		return EmptyString
	},
)
View Source
var NativeStringIndexFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		other := AssertValueOfType[*StringValue](args[0])
		stringValue := AssertValueOfType[*StringValue](receiver)
		return stringValue.IndexOf(context, other)
	},
)
View Source
var NativeStringJoinFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		stringArray := AssertValueOfType[*ArrayValue](args[0])
		separator := AssertValueOfType[*StringValue](args[1])
		return StringFunctionJoin(
			context,
			stringArray,
			separator,
		)
	},
)
View Source
var NativeStringReplaceAllFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		original := AssertValueOfType[*StringValue](args[0])
		replacement := AssertValueOfType[*StringValue](args[1])
		stringValue := AssertValueOfType[*StringValue](receiver)
		return stringValue.ReplaceAll(
			context,
			original,
			replacement,
		)
	},
)
View Source
var NativeStringSliceFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		from := AssertValueOfType[IntValue](args[0])
		to := AssertValueOfType[IntValue](args[1])
		stringValue := AssertValueOfType[*StringValue](receiver)
		return stringValue.Slice(
			context,
			from,
			to,
		)
	},
)
View Source
var NativeStringSplitFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		separator := AssertValueOfType[*StringValue](args[0])
		stringValue := AssertValueOfType[*StringValue](receiver)
		return stringValue.Split(context, separator)
	},
)
View Source
var NativeStringToLowerFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		receiver Value,
		args []Value,
	) Value {
		stringValue := AssertValueOfType[*StringValue](receiver)
		return stringValue.ToLower(context)
	},
)
View Source
var NativeVariableSizedArrayTypeFunction = NativeFunction(
	func(
		context NativeFunctionContext,
		_ TypeArgumentsIterator,
		_ Value,
		args []Value,
	) Value {
		typeValue := AssertValueOfType[TypeValue](args[0])

		return ConstructVariableSizedArrayTypeValue(context, typeValue)
	},
)
View Source
var NilStorable atree.Storable = NilValue{}
View Source
var PrimitiveStaticTypes = _PrimitiveStaticType_map
View Source
var StringValueParsers = func() map[string]TypedStringValueParser {
	parsers := map[string]TypedStringValueParser{}

	for _, parser := range []TypedStringValueParser{

		{
			ReceiverType: sema.Int8Type,
			Parser:       signedIntValueParser(8, NewInt8Value, func(n int64) int8 { return int8(n) }),
		},
		{
			ReceiverType: sema.Int16Type,
			Parser:       signedIntValueParser(16, NewInt16Value, func(n int64) int16 { return int16(n) }),
		},
		{
			ReceiverType: sema.Int32Type,
			Parser:       signedIntValueParser(32, NewInt32Value, func(n int64) int32 { return int32(n) }),
		},
		{
			ReceiverType: sema.Int64Type,
			Parser:       signedIntValueParser(64, NewInt64Value, func(n int64) int64 { return n }),
		},
		{
			ReceiverType: sema.Int128Type,
			Parser: bigIntValueParser(func(b *big.Int) (v Value, ok bool) {
				if ok = inRange(b, sema.Int128TypeMinIntBig, sema.Int128TypeMaxIntBig); ok {
					v = NewUnmeteredInt128ValueFromBigInt(b)
				}
				return
			}),
		},
		{
			ReceiverType: sema.Int256Type,
			Parser: bigIntValueParser(func(b *big.Int) (v Value, ok bool) {
				if ok = inRange(b, sema.Int256TypeMinIntBig, sema.Int256TypeMaxIntBig); ok {
					v = NewUnmeteredInt256ValueFromBigInt(b)
				}
				return
			}),
		},
		{
			ReceiverType: sema.IntType,
			Parser: bigIntValueParser(func(b *big.Int) (Value, bool) {
				return NewUnmeteredIntValueFromBigInt(b), true
			}),
		},

		{
			ReceiverType: sema.UInt8Type,
			Parser:       unsignedIntValueParser(8, NewUInt8Value, func(n uint64) uint8 { return uint8(n) }),
		},
		{
			ReceiverType: sema.UInt16Type,
			Parser:       unsignedIntValueParser(16, NewUInt16Value, func(n uint64) uint16 { return uint16(n) }),
		},
		{
			ReceiverType: sema.UInt32Type,
			Parser:       unsignedIntValueParser(32, NewUInt32Value, func(n uint64) uint32 { return uint32(n) }),
		},
		{
			ReceiverType: sema.UInt64Type,
			Parser:       unsignedIntValueParser(64, NewUInt64Value, func(n uint64) uint64 { return n }),
		},
		{
			ReceiverType: sema.UInt128Type,
			Parser: bigIntValueParser(func(b *big.Int) (v Value, ok bool) {
				if ok = inRange(b, sema.UInt128TypeMinIntBig, sema.UInt128TypeMaxIntBig); ok {
					v = NewUnmeteredUInt128ValueFromBigInt(b)
				}
				return
			}),
		},
		{
			ReceiverType: sema.UInt256Type,
			Parser: bigIntValueParser(func(b *big.Int) (v Value, ok bool) {
				if ok = inRange(b, sema.UInt256TypeMinIntBig, sema.UInt256TypeMaxIntBig); ok {
					v = NewUnmeteredUInt256ValueFromBigInt(b)
				}
				return
			}),
		},
		{
			ReceiverType: sema.UIntType,
			Parser: bigIntValueParser(func(b *big.Int) (Value, bool) {
				return NewUnmeteredUIntValueFromBigInt(b), true
			}),
		},

		{
			ReceiverType: sema.Word8Type,
			Parser:       unsignedIntValueParser(8, NewWord8Value, func(n uint64) uint8 { return uint8(n) }),
		},
		{
			ReceiverType: sema.Word16Type,
			Parser:       unsignedIntValueParser(16, NewWord16Value, func(n uint64) uint16 { return uint16(n) }),
		},
		{
			ReceiverType: sema.Word32Type,
			Parser:       unsignedIntValueParser(32, NewWord32Value, func(n uint64) uint32 { return uint32(n) }),
		},
		{
			ReceiverType: sema.Word64Type,
			Parser:       unsignedIntValueParser(64, NewWord64Value, func(n uint64) uint64 { return n }),
		},
		{
			ReceiverType: sema.Word128Type,
			Parser: bigIntValueParser(func(b *big.Int) (v Value, ok bool) {
				if ok = inRange(b, sema.Word128TypeMinIntBig, sema.Word128TypeMaxIntBig); ok {
					v = NewUnmeteredWord128ValueFromBigInt(b)
				}
				return
			}),
		},
		{
			ReceiverType: sema.Word256Type,
			Parser: bigIntValueParser(func(b *big.Int) (v Value, ok bool) {
				if ok = inRange(b, sema.Word256TypeMinIntBig, sema.Word256TypeMaxIntBig); ok {
					v = NewUnmeteredWord256ValueFromBigInt(b)
				}
				return
			}),
		},

		{
			ReceiverType: sema.Fix64Type,
			Parser: func(gauge common.Gauge, input string) OptionalValue {

				common.UseComputation(
					gauge,
					common.ComputationUsage{
						Kind:      common.ComputationKindFixParse,
						Intensity: uint64(len(input)),
					},
				)

				n, err := fixedpoint.ParseFix64(input)
				if err != nil {
					return NilOptionalValue
				}

				val := NewFix64Value(gauge, n.Int64)
				return NewSomeValueNonCopying(gauge, val)

			},
		},
		{
			ReceiverType: sema.Fix128Type,
			Parser: func(gauge common.Gauge, input string) OptionalValue {

				common.UseComputation(
					gauge,
					common.ComputationUsage{
						Kind:      common.ComputationKindFixParse,
						Intensity: uint64(len(input)),
					},
				)

				n, err := fixedpoint.ParseFix128(input)
				if err != nil {
					return NilOptionalValue
				}

				val := NewFix128ValueFromBigInt(gauge, n)
				return NewSomeValueNonCopying(gauge, val)

			},
		},

		{
			ReceiverType: sema.UFix64Type,
			Parser: func(gauge common.Gauge, input string) OptionalValue {

				common.UseComputation(
					gauge,
					common.ComputationUsage{
						Kind:      common.ComputationKindUfixParse,
						Intensity: uint64(len(input)),
					},
				)

				n, err := fixedpoint.ParseUFix64(input)
				if err != nil {
					return NilOptionalValue
				}

				val := NewUFix64Value(gauge, n.Uint64)
				return NewSomeValueNonCopying(gauge, val)
			},
		},
		{
			ReceiverType: sema.UFix128Type,
			Parser: func(gauge common.Gauge, input string) OptionalValue {

				common.UseComputation(
					gauge,
					common.ComputationUsage{
						Kind:      common.ComputationKindUfixParse,
						Intensity: uint64(len(input)),
					},
				)

				n, err := fixedpoint.ParseUFix128(input)
				if err != nil {
					return NilOptionalValue
				}

				val := NewUFix128ValueFromBigInt(gauge, n)
				return NewSomeValueNonCopying(gauge, val)

			},
		},
	} {

		typeName := parser.ReceiverType.String()
		if _, ok := parsers[typeName]; ok {
			panic(errors.NewUnexpectedError("duplicate string value parser for type %s", typeName))
		}
		parsers[typeName] = parser
	}

	return parsers
}()
View Source
var UFix128MemoryUsage = common.NewNumberMemoryUsage(ufix128Size)
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 AreReturnsCovariant added in v1.8.4

func AreReturnsCovariant(source, target FunctionStaticType) bool

func ArrayElementSize

func ArrayElementSize(staticType ArrayStaticType) uint

func AsCadenceError added in v1.7.0

func AsCadenceError(r any) error

func AssertValueOfType added in v1.8.0

func AssertValueOfType[T Value](val Value) T

AssertValueOfType asserts that the provided value is of a specific type. Useful for asserting receiver and argument types in native functions

func AttachmentBaseAndSelfValues added in v1.8.0

func AttachmentBaseAndSelfValues(
	context StaticTypeAndReferenceContext,
	fnAccess sema.Access,
	v *CompositeValue,
) (base *EphemeralReferenceValue, self *EphemeralReferenceValue)

func AttachmentMemberName

func AttachmentMemberName(typeID string) string

func ByteArrayValueToByteSlice

func ByteArrayValueToByteSlice(context ContainerMutationContext, value Value) ([]byte, error)

func ByteValueToByte

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

func CheckInvalidatedResourceOrResourceReference added in v1.5.0

func CheckInvalidatedResourceOrResourceReference(
	value Value,
	context ValueStaticTypeContext,
)

func CheckMemberAccessTargetType added in v1.7.0

func CheckMemberAccessTargetType(
	context ValueStaticTypeContext,
	target Value,
	expectedType sema.Type,
)

func CheckResourceLoss added in v1.6.2

func CheckResourceLoss(context ValueStaticTypeContext, value Value)

func CheckSubTypeWithoutEquality_gen added in v1.8.4

func CheckSubTypeWithoutEquality_gen(typeConverter TypeConverter, subType StaticType, superType StaticType) bool

func ConvertStaticAuthorizationToSemaAccess

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

ConvertStaticAuthorizationToSemaAccess converts authorization of static-types to the sema-type representation of the same.

**IMPORTANT**: Do not use this function directly. Instead, use the `SemaAccessFromStaticAuthorization` method of the `TypeConverter` interface, since it will cache and re-use the conversion results.

func ConvertStaticToSemaType

func ConvertStaticToSemaType(
	context TypeConverter,
	typ StaticType,
) (_ sema.Type, err error)

func ConvertUnsigned

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

func ConvertWord

func ConvertWord[T Unsigned](
	memoryGauge common.MemoryGauge,
	value Value,
) 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 EncodeLocation added in v1.4.0

func EncodeLocation(e *cbor.StreamEncoder, l common.Location) error

func ExpectType added in v1.4.0

func ExpectType(
	context ValueStaticTypeContext,
	value Value,
	expectedType sema.Type,
)

func GetAccessOfMember added in v1.8.0

func GetAccessOfMember(context ValueStaticTypeContext, self Value, identifier string) sema.Access

func GetAddress added in v1.8.0

func GetAddress(receiver Value, addressPointer *common.Address) common.Address

func GetCompositeValueComputedFields added in v1.4.0

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

func GetCompositeValueInjectedFields added in v1.4.0

func GetCompositeValueInjectedFields(context MemberAccessibleContext, v *CompositeValue) map[string]Value

func GetNativeCompositeValueComputedFields

func GetNativeCompositeValueComputedFields(qualifiedIdentifier string) map[string]ComputedField

func InspectValue

func InspectValue(context ValueWalkContext, value Value, f func(Value) bool)

func InvalidateReferencedResources added in v1.4.0

func InvalidateReferencedResources(
	context ContainerMutationContext,
	value Value,
)

TODO: Remove the `destroyed` flag

func IsHashableStructType added in v1.8.4

func IsHashableStructType(typeConverter TypeConverter, typ StaticType) bool

func IsIntersectionSubset added in v1.8.4

func IsIntersectionSubset(typeConverter TypeConverter, superType *IntersectionStaticType, subType StaticType) bool

func IsResourceType added in v1.8.4

func IsResourceType(typeConverter TypeConverter, typ StaticType) bool

func IsStorableType added in v1.8.4

func IsStorableType(typeConverter TypeConverter, typ StaticType) bool

func IsSubType added in v1.4.0

func IsSubType(typeConverter TypeConverter, subType StaticType, superType StaticType) bool

func IsSubTypeOfSemaType added in v1.4.0

func IsSubTypeOfSemaType(typeConverter TypeConverter, staticSubType StaticType, superType sema.Type) bool

func MaybeSetMutationDuringCapConIteration added in v1.4.0

func MaybeSetMutationDuringCapConIteration(context CapabilityControllerIterationContext, addressPath AddressPath)

func MustConvertStaticToSemaType added in v1.4.0

func MustConvertStaticToSemaType(staticType StaticType, typeConverter TypeConverter) sema.Type

func MustSemaTypeOfValue added in v1.4.0

func MustSemaTypeOfValue(value Value, context ValueStaticTypeContext) sema.Type

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 PermitsAccess added in v1.8.4

func PermitsAccess(typeConverter TypeConverter, superTypeAuth, subTypeAuth Authorization) bool

func RemoveReferencedSlab added in v1.4.0

func RemoveReferencedSlab(context StorageContext, storable atree.Storable)

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 StoredValueExists added in v1.4.0

func StoredValueExists(
	context StorageContext,
	storageAddress common.Address,
	domain common.StorageDomain,
	identifier StorageMapKey,
) bool

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 WalkValue

func WalkValue(context ValueWalkContext, walker ValueWalker, value Value)

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(common.MemoryGauge) *IDCapabilityValue
	GetTag        func(StorageReader) *StringValue
	SetTag        func(storageWriter StorageWriter, tag *StringValue)
	Delete        func(context CapabilityControllerContext)
	// 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(context ValueVisitContext, visitor Visitor)

func (*AccountCapabilityControllerValue) ByteSize

func (*AccountCapabilityControllerValue) CapabilityControllerBorrowType

func (v *AccountCapabilityControllerValue) CapabilityControllerBorrowType() *ReferenceStaticType

func (*AccountCapabilityControllerValue) CheckDeleted added in v1.7.0

func (v *AccountCapabilityControllerValue) CheckDeleted()

CheckDeleted checks if the controller is deleted, and panics if it is.

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 (*AccountCapabilityControllerValue) Encode

Encode encodes AccountCapabilityControllerValue as

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

func (*AccountCapabilityControllerValue) Equal

func (*AccountCapabilityControllerValue) GetMember

func (v *AccountCapabilityControllerValue) GetMember(context MemberAccessibleContext, name string) (result Value)

func (*AccountCapabilityControllerValue) GetMethod added in v1.4.0

func (*AccountCapabilityControllerValue) IsImportable

func (*AccountCapabilityControllerValue) IsResourceKinded

func (*AccountCapabilityControllerValue) IsStorable

func (*AccountCapabilityControllerValue) IsStorable() bool

func (*AccountCapabilityControllerValue) IsValue added in v1.4.0

func (*AccountCapabilityControllerValue) MeteredString

func (v *AccountCapabilityControllerValue) MeteredString(
	context ValueStringContext,
	seenReferences SeenReferences,
) string

func (*AccountCapabilityControllerValue) NeedsStoreTo

func (*AccountCapabilityControllerValue) RecursiveString

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

func (*AccountCapabilityControllerValue) ReferenceValue

func (v *AccountCapabilityControllerValue) ReferenceValue(
	context ValueCapabilityControllerReferenceValueContext,
	capabilityAddress common.Address,
	resultBorrowType *sema.ReferenceType,
) ReferenceValue

func (*AccountCapabilityControllerValue) RemoveMember

func (*AccountCapabilityControllerValue) SetMember

func (v *AccountCapabilityControllerValue) SetMember(context ValueTransferContext, name string, value Value) bool

func (*AccountCapabilityControllerValue) StaticType

func (*AccountCapabilityControllerValue) Storable

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

func (*AccountCapabilityControllerValue) StoredValue

func (*AccountCapabilityControllerValue) String

func (*AccountCapabilityControllerValue) Transfer

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

func (*AccountCapabilityControllerValue) Walk

func (v *AccountCapabilityControllerValue) Walk(_ ValueWalkContext, walkChild func(Value))

type AccountCapabilityCreationContext added in v1.4.0

type AccountCapabilityCreationContext interface {
	StorageCapabilityCreationContext
}

type AccountCapabilityGetValidationContext added in v1.4.0

type AccountCapabilityGetValidationContext interface {
}

TODO: This is used by the FVM.

Check and the functionalities needed.

type AccountCapabilityPublishValidationContext added in v1.4.0

type AccountCapabilityPublishValidationContext interface {
}

TODO: This is used by the FVM.

Check and the functionalities needed.

type AccountContractBorrowContext added in v1.4.0

type AccountContractBorrowContext interface {
	FunctionCreationContext
	GetContractValue(contractLocation common.AddressLocation) *CompositeValue
}

type AccountContractCreationContext added in v1.4.0

type AccountContractCreationContext interface {
	AccountContractBorrowContext
}

type AccountCreationContext added in v1.4.0

type AccountCreationContext interface {
	AccountKeyCreationContext
	AccountContractCreationContext
}

type AccountHandlerContext added in v1.4.0

type AccountHandlerContext interface {
	GetAccountHandlerFunc() AccountHandlerFunc
}

type AccountHandlerFunc

type AccountHandlerFunc func(
	context AccountCreationContext,
	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 AccountKeyCreationContext added in v1.4.0

type AccountKeyCreationContext interface {
	PublicKeyCreationContext
	AccountCapabilityCreationContext
}

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 (AccountLinkValue) DeepRemove

func (AccountLinkValue) DeepRemove(_ ValueRemoveContext, _ 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 (AccountLinkValue) IsImportable

func (AccountLinkValue) IsResourceKinded

func (AccountLinkValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (AccountLinkValue) IsStorable

func (AccountLinkValue) IsStorable() bool

func (AccountLinkValue) IsValue added in v1.4.0

func (AccountLinkValue) IsValue()

func (AccountLinkValue) MeteredString

func (v AccountLinkValue) MeteredString(
	_ ValueStringContext,
	_ SeenReferences,
) string

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(context ValueStaticTypeContext) StaticType

func (AccountLinkValue) Storable

func (v AccountLinkValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint32) (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(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (AccountLinkValue) Walk

func (AccountLinkValue) Walk(_ ValueWalkContext, _ func(Value))

type AccountStorageMap added in v1.3.0

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

AccountStorageMap stores domain storage maps in an account.

func NewAccountStorageMap added in v1.3.0

func NewAccountStorageMap(
	memoryGauge common.MemoryGauge,
	computationGauge common.ComputationGauge,
	storage atree.SlabStorage,
	address atree.Address,
) *AccountStorageMap

NewAccountStorageMap creates account storage map.

func NewAccountStorageMapWithRootID added in v1.3.0

func NewAccountStorageMapWithRootID(
	memoryGauge common.MemoryGauge,
	storage atree.SlabStorage,
	slabID atree.SlabID,
) *AccountStorageMap

NewAccountStorageMapWithRootID loads existing account storage map with given atree SlabID.

func (*AccountStorageMap) Count added in v1.3.0

func (s *AccountStorageMap) Count() uint64

func (*AccountStorageMap) DomainExists added in v1.3.0

func (s *AccountStorageMap) DomainExists(gauge common.ComputationGauge, domain common.StorageDomain) bool

DomainExists returns true if the given domain exists in the account storage map.

func (*AccountStorageMap) Domains added in v1.3.0

func (s *AccountStorageMap) Domains(gauge common.Gauge) map[common.StorageDomain]struct{}

Domains returns a set of domains in account storage map

func (*AccountStorageMap) GetDomain added in v1.3.0

func (s *AccountStorageMap) GetDomain(
	memoryGauge common.MemoryGauge,
	computationGauge common.ComputationGauge,
	storageMutationTracker StorageMutationTracker,
	domain common.StorageDomain,
	createIfNotExists bool,
) *DomainStorageMap

GetDomain returns domain storage map for the given domain. If createIfNotExists is true and domain doesn't exist, new domain storage map is created and inserted into account storage map with given domain as key.

func (*AccountStorageMap) Iterator added in v1.3.0

Iterator returns a mutable iterator (AccountStorageMapIterator), which allows iterating over the domain and domain storage map.

func (*AccountStorageMap) NewDomain added in v1.3.0

func (s *AccountStorageMap) NewDomain(
	memoryGauge common.MemoryGauge,
	computationGauge common.ComputationGauge,
	storageMutationTracker StorageMutationTracker,
	domain common.StorageDomain,
) *DomainStorageMap

NewDomain creates new domain storage map and inserts it to AccountStorageMap with given domain as key.

func (*AccountStorageMap) SlabID added in v1.3.0

func (s *AccountStorageMap) SlabID() atree.SlabID

func (*AccountStorageMap) WriteDomain added in v1.3.0

func (s *AccountStorageMap) WriteDomain(
	context ValueTransferContext,
	domain common.StorageDomain,
	domainStorageMap *DomainStorageMap,
) (existed bool)

WriteDomain sets or removes domain storage map in account storage map. If the given storage map is nil, domain is removed. If the given storage map is non-nil, domain is added/updated. Returns true if domain storage map previously existed at the given domain.

type AccountStorageMapIterator added in v1.3.0

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

AccountStorageMapIterator is an iterator over AccountStorageMap.

func (*AccountStorageMapIterator) Next added in v1.3.0

Next returns the next domain and domain storage map. If there is no more domain, (common.StorageDomainUnknown, nil) is returned.

type AddressPath

type AddressPath struct {
	Address common.Address
	Path    PathValue
}

type AddressValue

type AddressValue common.Address

AddressValue

func AddressValueFromByteArray added in v1.6.2

func AddressValueFromByteArray(context ContainerMutationContext, byteArray *ArrayValue) AddressValue

func ConvertAddress

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

func GetAccountTypePrivateAddressValue added in v1.8.0

func GetAccountTypePrivateAddressValue(receiver Value) AddressValue

func GetAddressValue added in v1.8.0

func GetAddressValue(receiver Value, addressPointer *AddressValue) 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(context ValueVisitContext, visitor Visitor)

func (AddressValue) ByteSize

func (v AddressValue) ByteSize() uint32

func (AddressValue) ChildStorables

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

func (AddressValue) Clone

func (AddressValue) ConformsToStaticType

func (AddressValue) DeepRemove

func (AddressValue) DeepRemove(_ ValueRemoveContext, _ 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(_ ValueComparisonContext, other Value) bool

func (AddressValue) GetMember

func (v AddressValue) GetMember(context MemberAccessibleContext, name string) Value

func (AddressValue) GetMethod added in v1.4.0

func (v AddressValue) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (AddressValue) HashInput

func (v AddressValue) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (AddressValue) IsResourceKinded

func (AddressValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (AddressValue) IsStorable

func (AddressValue) IsStorable() bool

func (AddressValue) IsValue added in v1.4.0

func (AddressValue) IsValue()

func (AddressValue) MeteredString

func (v AddressValue) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) 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(_ ValueTransferContext, _ string) Value

func (AddressValue) SetMember

func (AddressValue) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (AddressValue) StaticType

func (AddressValue) StaticType(context ValueStaticTypeContext) 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(
	transferContext ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (AddressValue) Walk

func (AddressValue) Walk(_ ValueWalkContext, _ func(Value))

type ArgumentCountError

type ArgumentCountError struct {
	ParameterCount int
	ArgumentCount  int
}

func (ArgumentCountError) Error

func (e ArgumentCountError) Error() string

func (ArgumentCountError) IsUserError

func (ArgumentCountError) IsUserError()

type ArrayCreationContext added in v1.4.0

type ArrayCreationContext interface {
	ValueTransferContext
}

type ArrayIndexOutOfBoundsError

type ArrayIndexOutOfBoundsError struct {
	LocationRange
	Index int
	Size  int
}

ArrayIndexOutOfBoundsError

func (*ArrayIndexOutOfBoundsError) Error

func (*ArrayIndexOutOfBoundsError) IsUserError

func (*ArrayIndexOutOfBoundsError) IsUserError()

func (*ArrayIndexOutOfBoundsError) SetLocationRange added in v1.5.0

func (e *ArrayIndexOutOfBoundsError) SetLocationRange(locationRange LocationRange)

type ArrayIterator added in v1.4.0

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

func (*ArrayIterator) HasNext added in v1.4.0

func (i *ArrayIterator) HasNext(context ValueIteratorContext) bool

func (*ArrayIterator) Next added in v1.4.0

func (i *ArrayIterator) Next(context ValueIteratorContext) Value

func (*ArrayIterator) ValueID added in v1.7.0

func (i *ArrayIterator) ValueID() (atree.ValueID, bool)

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()

func (*ArraySliceIndicesError) SetLocationRange added in v1.5.0

func (e *ArraySliceIndicesError) SetLocationRange(locationRange LocationRange)

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(context ArrayCreationContext, bytes []byte) *ArrayValue

func ByteSliceToConstantSizedByteArrayValue

func ByteSliceToConstantSizedByteArrayValue(context ArrayCreationContext, bytes []byte) *ArrayValue

func DeployedContractPublicTypes added in v1.7.0

func DeployedContractPublicTypes(
	context InvocationContext,
	address common.Address,
	name *StringValue,
) *ArrayValue

func NewArrayValue

func NewArrayValue(
	context ArrayCreationContext,
	arrayType ArrayStaticType,
	address common.Address,
	values ...Value,
) *ArrayValue

func NewArrayValueWithIterator

func NewArrayValueWithIterator(
	context ArrayCreationContext,
	arrayType ArrayStaticType,
	address common.Address,
	countOverestimate uint64,
	values func() Value,
) (v *ArrayValue)

func (*ArrayValue) Accept

func (v *ArrayValue) Accept(context ValueVisitContext, visitor Visitor)

func (*ArrayValue) Append

func (v *ArrayValue) Append(context ValueTransferContext, element Value)

func (*ArrayValue) AppendAll

func (v *ArrayValue) AppendAll(context ValueTransferContext, other *ArrayValue)

func (*ArrayValue) Clone

func (v *ArrayValue) Clone(context ValueCloneContext) Value

func (*ArrayValue) Concat

func (v *ArrayValue) Concat(context ValueTransferContext, other *ArrayValue) Value

func (*ArrayValue) ConformsToStaticType

func (v *ArrayValue) ConformsToStaticType(
	context ValueStaticTypeConformanceContext,
	results TypeConformanceResults,
) bool

func (*ArrayValue) Contains

func (v *ArrayValue) Contains(
	context ContainerMutationContext,
	needleValue Value,
) BoolValue

func (*ArrayValue) Count

func (v *ArrayValue) Count() int

func (*ArrayValue) DeepRemove

func (v *ArrayValue) DeepRemove(context ValueRemoveContext, hasNoParentContainer bool)

func (*ArrayValue) Destroy

func (v *ArrayValue) Destroy(context ResourceDestructionContext)

func (*ArrayValue) Equal

func (v *ArrayValue) Equal(context ValueComparisonContext, other Value) bool

func (*ArrayValue) Filter

func (v *ArrayValue) Filter(
	context InvocationContext,
	procedure FunctionValue,
) Value

func (*ArrayValue) FirstIndex

func (v *ArrayValue) FirstIndex(interpreter ContainerMutationContext, needleValue Value) OptionalValue

func (*ArrayValue) ForEach

func (v *ArrayValue) ForEach(
	context IterableValueForeachContext,
	_ sema.Type,
	function func(value Value) (resume bool),
	transferElements bool,
)

func (*ArrayValue) Get

func (v *ArrayValue) Get(gauge common.Gauge, index int) Value

func (*ArrayValue) GetKey

func (v *ArrayValue) GetKey(context ContainerReadContext, key Value) Value

func (*ArrayValue) GetMember

func (v *ArrayValue) GetMember(context MemberAccessibleContext, name string) Value

func (*ArrayValue) GetMethod added in v1.4.0

func (v *ArrayValue) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (*ArrayValue) GetOwner

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

func (*ArrayValue) Inlined added in v1.3.1

func (v *ArrayValue) Inlined() bool

func (*ArrayValue) Insert

func (v *ArrayValue) Insert(context ContainerMutationContext, index int, element Value)

func (*ArrayValue) InsertKey

func (v *ArrayValue) InsertKey(context ContainerMutationContext, key Value, value Value)

func (*ArrayValue) InsertWithoutTransfer

func (v *ArrayValue) InsertWithoutTransfer(
	context ContainerMutationContext,
	index int,
	element Value,
)

func (*ArrayValue) IsDestroyed

func (v *ArrayValue) IsDestroyed() bool

func (*ArrayValue) IsImportable

func (v *ArrayValue) IsImportable(context ValueImportableContext) bool

func (*ArrayValue) IsReferenceTrackedResourceKindedValue

func (v *ArrayValue) IsReferenceTrackedResourceKindedValue()

func (*ArrayValue) IsResourceKinded

func (v *ArrayValue) IsResourceKinded(context ValueStaticTypeContext) bool

func (*ArrayValue) IsStaleResource

func (v *ArrayValue) IsStaleResource(context ValueStaticTypeContext) bool

func (*ArrayValue) IsValue added in v1.4.0

func (*ArrayValue) IsValue()

func (*ArrayValue) Iterate

func (v *ArrayValue) Iterate(
	context ValueTransferContext,
	f func(element Value) (resume bool),
	transferElements bool,
)

func (*ArrayValue) IterateReadOnlyLoaded

func (v *ArrayValue) IterateReadOnlyLoaded(
	context ValueTransferContext,
	f func(element Value) (resume bool),
)

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

func (*ArrayValue) Iterator

func (v *ArrayValue) Iterator(context ValueStaticTypeContext) ValueIterator

func (*ArrayValue) Map

func (v *ArrayValue) Map(
	context InvocationContext,
	procedure FunctionValue,
) Value

func (*ArrayValue) MeteredString

func (v *ArrayValue) MeteredString(
	context ValueStringContext,
	seenReferences SeenReferences,
) 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(context ContainerMutationContext, index int) Value

func (*ArrayValue) RemoveFirst

func (v *ArrayValue) RemoveFirst(context ContainerMutationContext) Value

func (*ArrayValue) RemoveKey

func (v *ArrayValue) RemoveKey(context ContainerMutationContext, key Value) Value

func (*ArrayValue) RemoveLast

func (v *ArrayValue) RemoveLast(context ContainerMutationContext) Value

func (*ArrayValue) RemoveMember

func (v *ArrayValue) RemoveMember(_ ValueTransferContext, _ string) Value

func (*ArrayValue) RemoveWithoutTransfer

func (v *ArrayValue) RemoveWithoutTransfer(
	context ContainerMutationContext,
	index int,
) atree.Storable

func (*ArrayValue) Reverse

func (v *ArrayValue) Reverse(
	context ArrayCreationContext,
) Value

func (*ArrayValue) SemaType

func (v *ArrayValue) SemaType(typeConverter TypeConverter) sema.ArrayType

func (*ArrayValue) Set

func (v *ArrayValue) Set(context ContainerMutationContext, index int, element Value)

func (*ArrayValue) SetKey

func (v *ArrayValue) SetKey(context ContainerMutationContext, key Value, value Value)

func (*ArrayValue) SetMember

func (v *ArrayValue) SetMember(_ ValueTransferContext, _ 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(
	context ArrayCreationContext,
	from IntValue,
	to IntValue,
) Value

func (*ArrayValue) StaticType

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

func (*ArrayValue) Storable

func (v *ArrayValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint32,
) (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(
	context ArrayCreationContext,
	expectedConstantSizedArraySize int64,
) OptionalValue

func (*ArrayValue) ToVariableSized

func (v *ArrayValue) ToVariableSized(
	context ArrayCreationContext,
) Value

func (*ArrayValue) Transfer

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

func (*ArrayValue) UnwrapAtreeValue added in v1.3.1

func (v *ArrayValue) UnwrapAtreeValue() (atree.Value, uint32)

func (*ArrayValue) ValueID

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

func (*ArrayValue) Walk

func (v *ArrayValue) Walk(context ValueWalkContext, walkChild func(Value))

type AttachmentContext added in v1.4.0

type AttachmentContext interface {
	ValueStaticTypeContext
	ReferenceCreationContext
	SetAttachmentIteration(composite *CompositeValue, state bool) bool
}

type AttachmentIterationMutationError

type AttachmentIterationMutationError struct {
	Value *CompositeValue
	LocationRange
}

AttachmentIterationMutationError

func (*AttachmentIterationMutationError) Error

func (*AttachmentIterationMutationError) IsUserError

func (*AttachmentIterationMutationError) IsUserError()

func (*AttachmentIterationMutationError) SetLocationRange added in v1.5.0

func (e *AttachmentIterationMutationError) SetLocationRange(locationRange LocationRange)

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 BigEndianBytesConverter added in v1.6.0

type BigEndianBytesConverter func(common.MemoryGauge, []byte) Value

BigEndianBytesConverter is a function that attempts to create a Number from big-endian bytes.

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 values.BoolValue

func InclusiveRangeContains added in v1.7.0

func InclusiveRangeContains(
	rangeValue *CompositeValue,
	rangeType InclusiveRangeStaticType,
	context ValueComparisonContext,
	needleValue IntegerValue,
) BoolValue

func TestValueEqual added in v1.5.0

func TestValueEqual(
	context ValueComparisonContext,
	left, right Value,
) BoolValue

func (BoolValue) Accept

func (v BoolValue) Accept(context ValueVisitContext, visitor Visitor)

func (BoolValue) Clone

func (v BoolValue) Clone(_ ValueCloneContext) Value

func (BoolValue) ConformsToStaticType

func (BoolValue) DeepRemove

func (BoolValue) DeepRemove(_ ValueRemoveContext, _ bool)

func (BoolValue) Equal

func (v BoolValue) Equal(context ValueComparisonContext, other Value) bool

func (BoolValue) Greater

func (v BoolValue) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (BoolValue) GreaterEqual

func (v BoolValue) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (BoolValue) HashInput

func (v BoolValue) HashInput(_ common.Gauge, scratch []byte) []byte

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

func (BoolValue) IsImportable

func (BoolValue) IsImportable(_ ValueImportableContext) bool

func (BoolValue) IsResourceKinded

func (BoolValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (BoolValue) IsValue added in v1.4.0

func (BoolValue) IsValue()

func (BoolValue) Less

func (BoolValue) LessEqual

func (v BoolValue) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (BoolValue) MeteredString

func (v BoolValue) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) 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(context ValueStaticTypeContext) StaticType

func (BoolValue) Storable

func (BoolValue) String

func (v BoolValue) String() string

func (BoolValue) Transfer

func (v BoolValue) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (BoolValue) Walk

func (BoolValue) Walk(_ ValueWalkContext, _ func(Value))

type BorrowCapabilityControllerContext added in v1.4.0

type BorrowCapabilityControllerContext interface {
	GetCapabilityControllerReferenceContext
}

type BoundFunctionGenerator

type BoundFunctionGenerator func(MemberAccessibleValue) BoundFunctionValue

type BoundFunctionValue

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

BoundFunctionValue

func NewBoundFunctionValue

func NewBoundFunctionValue(
	context FunctionCreationContext,
	function FunctionValue,
	self *Value,
	base *EphemeralReferenceValue,
) BoundFunctionValue

func NewBoundFunctionValueFromSelfReference

func NewBoundFunctionValueFromSelfReference(
	gauge common.MemoryGauge,
	function FunctionValue,
	selfReference ReferenceValue,
	selfIsReference bool,
	base *EphemeralReferenceValue,
) BoundFunctionValue

func NewBoundHostFunctionValue

func NewBoundHostFunctionValue(
	context FunctionCreationContext,
	self Value,
	funcType *sema.FunctionType,
	function NativeFunction,
) BoundFunctionValue

func NewUnmeteredBoundHostFunctionValue

func NewUnmeteredBoundHostFunctionValue(
	context FunctionCreationContext,
	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(context ValueVisitContext, visitor Visitor)

func (BoundFunctionValue) Clone

func (BoundFunctionValue) ConformsToStaticType

func (f BoundFunctionValue) ConformsToStaticType(
	context ValueStaticTypeConformanceContext,
	results TypeConformanceResults,
) bool

func (BoundFunctionValue) DeepRemove

func (BoundFunctionValue) DeepRemove(_ ValueRemoveContext, _ bool)

func (BoundFunctionValue) FunctionType

func (BoundFunctionValue) Invoke added in v1.4.0

func (f BoundFunctionValue) Invoke(invocation Invocation) Value

func (BoundFunctionValue) IsFunctionValue added in v1.4.0

func (BoundFunctionValue) IsFunctionValue()

func (BoundFunctionValue) IsImportable

func (BoundFunctionValue) IsResourceKinded

func (BoundFunctionValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (BoundFunctionValue) IsValue added in v1.4.0

func (BoundFunctionValue) IsValue()

func (BoundFunctionValue) MeteredString

func (f BoundFunctionValue) MeteredString(
	context ValueStringContext,
	seenReferences SeenReferences,
) string

func (BoundFunctionValue) NeedsStoreTo

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

func (BoundFunctionValue) RecursiveString

func (f BoundFunctionValue) RecursiveString(seenReferences SeenReferences) string

func (BoundFunctionValue) StaticType

func (BoundFunctionValue) Storable

func (BoundFunctionValue) String

func (f BoundFunctionValue) String() string

func (BoundFunctionValue) Transfer

func (f BoundFunctionValue) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (BoundFunctionValue) Walk

func (f BoundFunctionValue) Walk(_ ValueWalkContext, _ func(Value))

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 CallStackLimitExceededError added in v1.7.0

type CallStackLimitExceededError struct {
	Limit uint64
	LocationRange
}

func (*CallStackLimitExceededError) Error added in v1.7.0

func (*CallStackLimitExceededError) IsUserError added in v1.7.0

func (*CallStackLimitExceededError) IsUserError()

func (*CallStackLimitExceededError) SetLocationRange added in v1.7.0

func (e *CallStackLimitExceededError) SetLocationRange(locationRange LocationRange)

type CallbackTracer added in v1.7.0

type CallbackTracer OnRecordTraceFunc

func (CallbackTracer) ReportArrayValueConformsToStaticTypeTrace added in v1.7.0

func (t CallbackTracer) ReportArrayValueConformsToStaticTypeTrace(
	valueID string,
	typeID string,
	duration time.Duration,
)

func (CallbackTracer) ReportArrayValueConstructTrace added in v1.7.0

func (t CallbackTracer) ReportArrayValueConstructTrace(
	valueID string,
	typeID string,
	duration time.Duration,
)

func (CallbackTracer) ReportArrayValueDeepRemoveTrace added in v1.7.0

func (t CallbackTracer) ReportArrayValueDeepRemoveTrace(
	valueID string,
	typeID string,
	duration time.Duration,
)

func (CallbackTracer) ReportArrayValueDestroyTrace added in v1.7.0

func (t CallbackTracer) ReportArrayValueDestroyTrace(
	valueID string,
	typeID string,
	duration time.Duration,
)

func (CallbackTracer) ReportArrayValueTransferTrace added in v1.7.0

func (t CallbackTracer) ReportArrayValueTransferTrace(
	valueID string,
	typeID string,
	duration time.Duration,
)

func (CallbackTracer) ReportAtreeNewArrayFromBatchDataTrace added in v1.8.0

func (t CallbackTracer) ReportAtreeNewArrayFromBatchDataTrace(
	valueID string,
	typeID string,
	duration time.Duration,
)

func (CallbackTracer) ReportAtreeNewMapFromBatchDataTrace added in v1.8.0

func (t CallbackTracer) ReportAtreeNewMapFromBatchDataTrace(
	valueID string,
	typeID string,
	seed uint64,
	duration time.Duration,
)

func (CallbackTracer) ReportAtreeNewMapTrace added in v1.8.0

func (t CallbackTracer) ReportAtreeNewMapTrace(
	valueID string,
	typeID string,
	seed uint64,
	duration time.Duration,
)

func (CallbackTracer) ReportCompositeValueConformsToStaticTypeTrace added in v1.7.0

func (t CallbackTracer) ReportCompositeValueConformsToStaticTypeTrace(
	valueID string,
	typeID string,
	kind string,
	duration time.Duration,
)

func (CallbackTracer) ReportCompositeValueConstructTrace added in v1.7.0

func (t CallbackTracer) ReportCompositeValueConstructTrace(
	valueID string,
	typeID string,
	kind string,
	duration time.Duration,
)

func (CallbackTracer) ReportCompositeValueDeepRemoveTrace added in v1.7.0

func (t CallbackTracer) ReportCompositeValueDeepRemoveTrace(
	valueID string,
	typeID string,
	kind string,
	duration time.Duration,
)

func (CallbackTracer) ReportCompositeValueDestroyTrace added in v1.7.0

func (t CallbackTracer) ReportCompositeValueDestroyTrace(
	valueID string,
	typeID string,
	kind string,
	duration time.Duration,
)

func (CallbackTracer) ReportCompositeValueGetMemberTrace added in v1.7.0

func (t CallbackTracer) ReportCompositeValueGetMemberTrace(
	valueID string,
	typeID string,
	kind string,
	name string,
	duration time.Duration,
)

func (CallbackTracer) ReportCompositeValueRemoveMemberTrace added in v1.7.0

func (t CallbackTracer) ReportCompositeValueRemoveMemberTrace(
	valueID string,
	typeID string,
	kind string,
	name string,
	duration time.Duration,
)

func (CallbackTracer) ReportCompositeValueSetMemberTrace added in v1.7.0

func (t CallbackTracer) ReportCompositeValueSetMemberTrace(
	valueID string,
	typeID string,
	kind string,
	name string,
	duration time.Duration,
)

func (CallbackTracer) ReportCompositeValueTransferTrace added in v1.7.0

func (t CallbackTracer) ReportCompositeValueTransferTrace(
	valueID string,
	typeID string,
	kind string,
	duration time.Duration,
)

func (CallbackTracer) ReportDictionaryValueConformsToStaticTypeTrace added in v1.7.0

func (t CallbackTracer) ReportDictionaryValueConformsToStaticTypeTrace(
	valueID string,
	typeID string,
	duration time.Duration,
)

func (CallbackTracer) ReportDictionaryValueConstructTrace added in v1.7.0

func (t CallbackTracer) ReportDictionaryValueConstructTrace(
	valueID string,
	typeID string,
	duration time.Duration,
)

func (CallbackTracer) ReportDictionaryValueDeepRemoveTrace added in v1.7.0

func (t CallbackTracer) ReportDictionaryValueDeepRemoveTrace(
	valueID string,
	typeID string,
	duration time.Duration,
)

func (CallbackTracer) ReportDictionaryValueDestroyTrace added in v1.7.0

func (t CallbackTracer) ReportDictionaryValueDestroyTrace(
	valueID string,
	typeID string,
	duration time.Duration,
)

func (CallbackTracer) ReportDictionaryValueTransferTrace added in v1.7.0

func (t CallbackTracer) ReportDictionaryValueTransferTrace(
	valueID string,
	typeID string,
	duration time.Duration,
)

func (CallbackTracer) ReportEmitEventTrace added in v1.8.0

func (t CallbackTracer) ReportEmitEventTrace(eventType string, duration time.Duration)

func (CallbackTracer) ReportImportTrace added in v1.7.0

func (t CallbackTracer) ReportImportTrace(location string, duration time.Duration)

func (CallbackTracer) ReportInvokeTrace added in v1.8.0

func (t CallbackTracer) ReportInvokeTrace(functionType string, functionName string, duration time.Duration)

type CapabilityAddressPublishingError

type CapabilityAddressPublishingError struct {
	LocationRange
	CapabilityAddress AddressValue
	AccountAddress    AddressValue
}

CapabilityAddressPublishingError

func (*CapabilityAddressPublishingError) Error

func (*CapabilityAddressPublishingError) IsUserError

func (*CapabilityAddressPublishingError) IsUserError()

func (*CapabilityAddressPublishingError) SetLocationRange added in v1.5.0

func (e *CapabilityAddressPublishingError) SetLocationRange(locationRange LocationRange)

type CapabilityBorrowHandlerFunc

type CapabilityBorrowHandlerFunc func(
	context BorrowCapabilityControllerContext,
	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(
	context CheckCapabilityControllerContext,
	address AddressValue,
	capabilityID UInt64Value,
	wantedBorrowType *sema.ReferenceType,
	capabilityBorrowType *sema.ReferenceType,
) BoolValue

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

type CapabilityControllerIterationContext added in v1.4.0

type CapabilityControllerIterationContext interface {
	GetCapabilityControllerIterations() map[AddressPath]int
	SetMutationDuringCapabilityControllerIteration()
	MutationDuringCapabilityControllerIteration() bool
}

type CapabilityControllerReferenceContext added in v1.4.0

type CapabilityControllerReferenceContext interface {
	StorageReader
	ReferenceCreationContext
}

type CapabilityControllerValue

type CapabilityControllerValue interface {
	Value

	CapabilityControllerBorrowType() *ReferenceStaticType
	ReferenceValue(
		context ValueCapabilityControllerReferenceValueContext,
		capabilityAddress common.Address,
		resultBorrowType *sema.ReferenceType,
	) ReferenceValue
	ControllerCapabilityID() UInt64Value
	// contains filtered or unexported methods
}

type CapabilityHandlers added in v1.4.0

type CapabilityHandlers interface {
	GetValidateAccountCapabilitiesGetHandler() ValidateAccountCapabilitiesGetHandlerFunc
	GetValidateAccountCapabilitiesPublishHandler() ValidateAccountCapabilitiesPublishHandlerFunc
	GetCapabilityBorrowHandler() CapabilityBorrowHandlerFunc
}

type CapabilityStaticType

type CapabilityStaticType struct {
	BorrowType StaticType
}

func NewCapabilityStaticType

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

func (*CapabilityStaticType) BaseType added in v1.8.4

func (t *CapabilityStaticType) BaseType() StaticType

func (*CapabilityStaticType) Encode

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

func (*CapabilityStaticType) TypeArguments added in v1.8.4

func (t *CapabilityStaticType) TypeArguments() []StaticType

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(context ValueVisitContext, visitor Visitor)

func (CharacterValue) ByteSize

func (v CharacterValue) ByteSize() uint32

func (CharacterValue) ChildStorables

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

func (CharacterValue) Clone

func (CharacterValue) ConformsToStaticType

func (CharacterValue) DeepRemove

func (CharacterValue) DeepRemove(_ ValueRemoveContext, _ 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(context ValueComparisonContext, other Value) bool

func (CharacterValue) GetMember

func (v CharacterValue) GetMember(context MemberAccessibleContext, name string) Value

func (CharacterValue) GetMethod added in v1.4.0

func (v CharacterValue) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (CharacterValue) Greater

func (CharacterValue) GreaterEqual

func (v CharacterValue) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (CharacterValue) HashInput

func (v CharacterValue) HashInput(_ common.Gauge, scratch []byte) []byte

func (CharacterValue) IsImportable

func (CharacterValue) IsImportable(_ ValueImportableContext) bool

func (CharacterValue) IsResourceKinded

func (CharacterValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (CharacterValue) IsValue added in v1.4.0

func (CharacterValue) IsValue()

func (CharacterValue) Less

func (CharacterValue) LessEqual

func (v CharacterValue) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (CharacterValue) MeteredString

func (v CharacterValue) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) 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(_ ValueTransferContext, _ string) Value

func (CharacterValue) SetMember

func (CharacterValue) StaticType

func (CharacterValue) StaticType(context ValueStaticTypeContext) 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(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (CharacterValue) Walk

func (CharacterValue) Walk(_ ValueWalkContext, _ func(Value))

type CheckCapabilityControllerContext added in v1.4.0

type CheckCapabilityControllerContext interface {
	GetCapabilityControllerReferenceContext
}

type ComparableValue

type ComparableValue interface {
	EquatableValue
	Less(context ValueComparisonContext, other ComparableValue) BoolValue
	LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue
	Greater(context ValueComparisonContext, other ComparableValue) BoolValue
	GreaterEqual(context ValueComparisonContext, other ComparableValue) 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 CompositeFunctionContext added in v1.4.0

type CompositeFunctionContext interface {
	GetCompositeValueFunctions(v *CompositeValue) *FunctionOrderedMap
}

type CompositeStaticType

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

func ConvertSemaCompositeTypeToStaticCompositeType

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

func ConvertSemaTransactionToStaticTransactionType added in v1.7.0

func ConvertSemaTransactionToStaticTransactionType(
	memoryGauge common.MemoryGauge,
	t *sema.TransactionType,
) *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

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 CompositeTypeInfo added in v1.4.0

type CompositeTypeInfo struct {
	Location            common.Location
	QualifiedIdentifier string
	Kind                common.CompositeKind
}

CompositeTypeInfo

func NewCompositeTypeInfo

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

func (CompositeTypeInfo) Copy added in v1.4.0

func (c CompositeTypeInfo) Copy() atree.TypeInfo

func (CompositeTypeInfo) Encode added in v1.4.0

func (CompositeTypeInfo) Equal added in v1.4.0

func (c CompositeTypeInfo) Equal(o atree.TypeInfo) bool

func (CompositeTypeInfo) IsComposite added in v1.4.0

func (c CompositeTypeInfo) IsComposite() bool

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(
	context MemberAccessibleContext,
	location common.Location,
	qualifiedIdentifier string,
	kind common.CompositeKind,
	fields []CompositeField,
	address common.Address,
) *CompositeValue

func NewCompositeValueFromAtreeMap added in v1.7.0

func NewCompositeValueFromAtreeMap(
	gauge common.MemoryGauge,
	typeInfo CompositeTypeInfo,
	atreeOrderedMap *atree.OrderedMap,
) *CompositeValue

func NewCompositeValueWithStaticType

func NewCompositeValueWithStaticType(
	context MemberAccessibleContext,
	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(
	context MemberAccessibleContext,
	enumType *sema.CompositeType,
	rawValue NumberValue,
	functions *FunctionOrderedMap,
) *CompositeValue

func NewInclusiveRangeValue

func NewInclusiveRangeValue(
	context MemberAccessibleContext,
	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(
	context MemberAccessibleContext,
	start IntegerValue,
	end IntegerValue,
	step IntegerValue,
	rangeType InclusiveRangeStaticType,
	rangeSemaType *sema.InclusiveRangeType,
) *CompositeValue

NewInclusiveRangeValueWithStep 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(
	context PublicKeyCreationContext,
	publicKey *ArrayValue,
	signAlgo Value,
	validatePublicKey PublicKeyValidationHandlerFunc,
) *CompositeValue

NewPublicKeyValue constructs a PublicKey value.

func (*CompositeValue) Accept

func (v *CompositeValue) Accept(context ValueVisitContext, visitor Visitor)

func (*CompositeValue) AtreeMap added in v1.7.0

func (v *CompositeValue) AtreeMap() *atree.OrderedMap

func (*CompositeValue) Clone

func (v *CompositeValue) Clone(context ValueCloneContext) Value

func (*CompositeValue) CompositeStaticTypeConformsToStaticType

func (v *CompositeValue) CompositeStaticTypeConformsToStaticType(
	context ValueStaticTypeConformanceContext,
	results TypeConformanceResults,
	semaType sema.Type,
) bool

func (*CompositeValue) ConformsToStaticType

func (v *CompositeValue) ConformsToStaticType(
	context ValueStaticTypeConformanceContext,
	results TypeConformanceResults,
) bool

func (*CompositeValue) DeepRemove

func (v *CompositeValue) DeepRemove(context ValueRemoveContext, hasNoParentContainer bool)

func (*CompositeValue) DefaultDestroyEvents added in v1.7.0

func (v *CompositeValue) DefaultDestroyEvents(
	context ResourceDestructionContext,
) []*CompositeValue

func (*CompositeValue) Destroy

func (v *CompositeValue) Destroy(context ResourceDestructionContext)

func (*CompositeValue) Equal

func (v *CompositeValue) Equal(context ValueComparisonContext, other Value) bool

func (*CompositeValue) FieldCount

func (v *CompositeValue) FieldCount() int

func (*CompositeValue) ForEach

func (v *CompositeValue) ForEach(
	context IterableValueForeachContext,
	_ sema.Type,
	function func(value Value) (resume bool),
	transferElements bool,
)

func (*CompositeValue) ForEachAttachment added in v1.8.0

func (v *CompositeValue) ForEachAttachment(
	context InvocationContext,
	functionValue FunctionValue,
)

func (*CompositeValue) ForEachField

func (v *CompositeValue) ForEachField(
	context ContainerMutationContext,
	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 (*CompositeValue) ForEachFieldName

func (v *CompositeValue) ForEachFieldName(
	gauge common.ComputationGauge,
	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(
	context ContainerMutationContext,
	f func(fieldName string, fieldValue Value) (resume bool),
)

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(context AttachmentContext) []*CompositeValue

func (*CompositeValue) GetComputedField

func (v *CompositeValue) GetComputedField(context ValueTransferContext, name string) Value

func (*CompositeValue) GetComputedFields

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

func (*CompositeValue) GetField

func (v *CompositeValue) GetField(gauge common.Gauge, name string) Value

func (*CompositeValue) GetInjectedField

func (v *CompositeValue) GetInjectedField(context MemberAccessibleContext, name string) Value

func (*CompositeValue) GetMember

func (v *CompositeValue) GetMember(context MemberAccessibleContext, name string) Value

func (*CompositeValue) GetMethod added in v1.4.0

func (v *CompositeValue) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (*CompositeValue) GetOwner

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

func (*CompositeValue) GetTypeKey

func (v *CompositeValue) GetTypeKey(context MemberAccessibleContext, ty sema.Type) Value

func (*CompositeValue) HashInput

func (v *CompositeValue) HashInput(gauge common.Gauge, 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(
	context ValueStaticTypeConformanceContext,
	results TypeConformanceResults,
	semaType sema.Type,
) bool

func (*CompositeValue) Inlined added in v1.3.1

func (v *CompositeValue) Inlined() bool

func (*CompositeValue) IsDestroyed

func (v *CompositeValue) IsDestroyed() bool

func (*CompositeValue) IsImportable

func (v *CompositeValue) IsImportable(context ValueImportableContext) bool

func (*CompositeValue) IsReferenceTrackedResourceKindedValue

func (v *CompositeValue) IsReferenceTrackedResourceKindedValue()

func (*CompositeValue) IsResourceKinded

func (v *CompositeValue) IsResourceKinded(context ValueStaticTypeContext) bool

func (*CompositeValue) IsStaleResource

func (v *CompositeValue) IsStaleResource(context ValueStaticTypeContext) bool

func (*CompositeValue) IsStorable

func (v *CompositeValue) IsStorable() bool

func (*CompositeValue) IsValue added in v1.4.0

func (*CompositeValue) IsValue()

func (*CompositeValue) Iterator

func (*CompositeValue) MeteredString

func (v *CompositeValue) MeteredString(
	context ValueStringContext,
	seenReferences SeenReferences,
) string

func (*CompositeValue) NeedsStoreTo

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

func (*CompositeValue) OwnerValue

func (v *CompositeValue) OwnerValue(context MemberAccessibleContext) OptionalValue

func (*CompositeValue) RecursiveString

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

func (*CompositeValue) RemoveField

func (v *CompositeValue) RemoveField(
	context ValueRemoveContext,
	name string,
)

func (*CompositeValue) RemoveMember

func (v *CompositeValue) RemoveMember(context ValueTransferContext, name string) Value

func (*CompositeValue) RemoveTypeKey

func (v *CompositeValue) RemoveTypeKey(
	context ValueTransferContext,
	attachmentType sema.Type,
) Value

func (*CompositeValue) ResourceUUID

func (v *CompositeValue) ResourceUUID(interpreter *Interpreter) *UInt64Value

func (*CompositeValue) SetBaseValue added in v1.8.0

func (v *CompositeValue) SetBaseValue(base *CompositeValue)

func (*CompositeValue) SetMember

func (v *CompositeValue) SetMember(context ValueTransferContext, name string, value Value) bool

func (*CompositeValue) SetMemberWithoutTransfer

func (v *CompositeValue) SetMemberWithoutTransfer(
	context ValueTransferContext,
	name string,
	value Value,
) bool

func (*CompositeValue) SetNestedVariables

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

func (*CompositeValue) SetTypeKey

func (v *CompositeValue) SetTypeKey(
	context ValueTransferContext,
	attachmentType sema.Type,
	attachment Value,
)

func (*CompositeValue) SlabID

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

func (*CompositeValue) StaticType

func (v *CompositeValue) StaticType(context ValueStaticTypeContext) StaticType

func (*CompositeValue) Storable

func (v *CompositeValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint32,
) (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(
	context ValueTransferContext,
	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) UnwrapAtreeValue added in v1.3.1

func (v *CompositeValue) UnwrapAtreeValue() (atree.Value, uint32)

func (*CompositeValue) ValueID

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

func (*CompositeValue) Walk

func (v *CompositeValue) Walk(context ValueWalkContext, walkChild func(Value))

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

type CompositeValueExportContext added in v1.4.0

type CompositeValueExportContext interface {
	MemberAccessibleContext
	AttachmentContext
}

type CompositeValueFunctionsHandlerFunc

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

CompositeValueFunctionsHandlerFunc is a function that loads composite value functions.

type ComputedField

type ComputedField func(ValueTransferContext, *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()

func (*ConditionError) SetLocationRange added in v1.5.0

func (e *ConditionError) SetLocationRange(locationRange LocationRange)

type Config

type Config struct {
	MemoryGauge      common.MemoryGauge
	ComputationGauge common.ComputationGauge
	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
	// 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
	// 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
	// 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 ConformingStaticType added in v1.8.4

type ConformingStaticType interface {
	StaticType
	// contains filtered or unexported methods
}

ConformingStaticType is any static type that conforms to some interface. This is the static-type counterpart of `sema.ConformingType`.

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

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) 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

func (*ContainerMutatedDuringIterationError) IsUserError()

func (*ContainerMutatedDuringIterationError) SetLocationRange added in v1.5.0

func (e *ContainerMutatedDuringIterationError) SetLocationRange(locationRange LocationRange)

type ContainerMutationContext added in v1.4.0

type ContainerMutationContext interface {
	ValueTransferContext
}

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()

func (*ContainerMutationError) SetLocationRange added in v1.5.0

func (e *ContainerMutationError) SetLocationRange(locationRange LocationRange)

type ContainerReadContext added in v1.7.2

type ContainerReadContext interface {
	common.ComputationGauge
	ValueComparisonContext
}

type ContinueResult

type ContinueResult struct{}

type ContractNamesGetter

type ContractNamesGetter func(context MemberAccessibleContext) *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,
) 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

func (*DereferenceError) SetLocationRange added in v1.5.0

func (e *DereferenceError) SetLocationRange(locationRange LocationRange)

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()

func (*DestroyedResourceError) SetLocationRange added in v1.5.0

func (e *DestroyedResourceError) SetLocationRange(locationRange LocationRange)

type DictionaryCreationContext added in v1.4.0

type DictionaryCreationContext interface {
	ContainerMutationContext
}

type DictionaryEntryValues

type DictionaryEntryValues struct {
	Key   Value
	Value Value
}

type DictionaryKeyIterator

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

func NewDictionaryKeyIterator added in v1.7.2

func NewDictionaryKeyIterator(gauge common.MemoryGauge, v *DictionaryValue) DictionaryKeyIterator

func (DictionaryKeyIterator) Next

func (i DictionaryKeyIterator) Next(gauge common.Gauge) (Value, Value)

func (DictionaryKeyIterator) NextKey

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

func (DictionaryKeyIterator) NextKeyUnconverted

func (i DictionaryKeyIterator) NextKeyUnconverted(gauge common.ComputationGauge) 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

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) 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(
	context DictionaryCreationContext,
	dictionaryType *DictionaryStaticType,
	keysAndValues ...Value,
) *DictionaryValue

func NewDictionaryValueWithAddress

func NewDictionaryValueWithAddress(
	context DictionaryCreationContext,
	dictionaryType *DictionaryStaticType,
	address common.Address,
	keysAndValues ...Value,
) *DictionaryValue

func (*DictionaryValue) Accept

func (v *DictionaryValue) Accept(context ValueVisitContext, visitor Visitor)

func (*DictionaryValue) AtreeMap added in v1.7.0

func (v *DictionaryValue) AtreeMap() *atree.OrderedMap

func (*DictionaryValue) Clone

func (v *DictionaryValue) Clone(context ValueCloneContext) Value

func (*DictionaryValue) ConformsToStaticType

func (v *DictionaryValue) ConformsToStaticType(
	context ValueStaticTypeConformanceContext,
	results TypeConformanceResults,
) bool

func (*DictionaryValue) ContainsKey

func (v *DictionaryValue) ContainsKey(
	context ValueComparisonContext,
	keyValue Value,
) BoolValue

func (*DictionaryValue) Count

func (v *DictionaryValue) Count() int

func (*DictionaryValue) DeepRemove

func (v *DictionaryValue) DeepRemove(context ValueRemoveContext, hasNoParentContainer bool)

func (*DictionaryValue) Destroy

func (v *DictionaryValue) Destroy(context ResourceDestructionContext)

func (*DictionaryValue) ElementSize added in v1.7.0

func (v *DictionaryValue) ElementSize() uint

func (*DictionaryValue) Equal

func (v *DictionaryValue) Equal(context ValueComparisonContext, other Value) bool

func (*DictionaryValue) ForEachKey

func (v *DictionaryValue) ForEachKey(
	context InvocationContext,
	procedure FunctionValue,
)

func (*DictionaryValue) Get

func (v *DictionaryValue) Get(
	context ValueComparisonContext,
	keyValue Value,
) (Value, bool)

func (*DictionaryValue) GetKey

func (v *DictionaryValue) GetKey(context ContainerReadContext, keyValue Value) Value

func (*DictionaryValue) GetMember

func (v *DictionaryValue) GetMember(context MemberAccessibleContext, name string) Value

func (*DictionaryValue) GetMethod added in v1.4.0

func (v *DictionaryValue) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (*DictionaryValue) GetOwner

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

func (*DictionaryValue) Inlined added in v1.3.1

func (v *DictionaryValue) Inlined() bool

func (*DictionaryValue) Insert

func (v *DictionaryValue) Insert(
	context ContainerMutationContext,
	keyValue, value Value,
) OptionalValue

func (*DictionaryValue) InsertKey

func (v *DictionaryValue) InsertKey(context ContainerMutationContext, key Value, value Value)

func (*DictionaryValue) InsertWithoutTransfer

func (v *DictionaryValue) InsertWithoutTransfer(
	context ContainerMutationContext,
	keyValue, value atree.Value,
) (existingValueStorable atree.Storable)

func (*DictionaryValue) IsDestroyed

func (v *DictionaryValue) IsDestroyed() bool

func (*DictionaryValue) IsImportable

func (v *DictionaryValue) IsImportable(context ValueImportableContext) bool

func (*DictionaryValue) IsReferenceTrackedResourceKindedValue

func (v *DictionaryValue) IsReferenceTrackedResourceKindedValue()

func (*DictionaryValue) IsResourceKinded

func (v *DictionaryValue) IsResourceKinded(context ValueStaticTypeContext) bool

func (*DictionaryValue) IsStaleResource

func (v *DictionaryValue) IsStaleResource(context ValueStaticTypeContext) bool

func (*DictionaryValue) IsValue added in v1.4.0

func (*DictionaryValue) IsValue()

func (*DictionaryValue) Iterate

func (v *DictionaryValue) Iterate(
	context ContainerMutationContext,
	f func(key, value Value) (resume bool),
)

func (*DictionaryValue) IterateKeys

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

func (*DictionaryValue) IterateReadOnly

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

func (*DictionaryValue) IterateReadOnlyLoaded

func (v *DictionaryValue) IterateReadOnlyLoaded(
	context ContainerMutationContext,
	f func(key, value Value) (resume bool),
)

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

func (*DictionaryValue) Iterator

func (*DictionaryValue) MeteredString

func (v *DictionaryValue) MeteredString(
	context ValueStringContext,
	seenReferences SeenReferences,
) 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(
	context ContainerMutationContext,
	keyValue Value,
) OptionalValue

func (*DictionaryValue) RemoveKey

func (v *DictionaryValue) RemoveKey(context ContainerMutationContext, key Value) Value

func (*DictionaryValue) RemoveMember

func (v *DictionaryValue) RemoveMember(_ ValueTransferContext, _ string) Value

func (*DictionaryValue) RemoveWithoutTransfer

func (v *DictionaryValue) RemoveWithoutTransfer(
	context ContainerMutationContext,
	keyValue atree.Value,
) (
	existingKeyStorable,
	existingValueStorable atree.Storable,
)

func (*DictionaryValue) SemaType

func (v *DictionaryValue) SemaType(typeConverter TypeConverter) *sema.DictionaryType

func (*DictionaryValue) SetKey

func (v *DictionaryValue) SetKey(context ContainerMutationContext, keyValue Value, value Value)

func (*DictionaryValue) SetMember

func (v *DictionaryValue) SetMember(_ ValueTransferContext, _ 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 (*DictionaryValue) Storable

func (v *DictionaryValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint32,
) (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(
	context ValueTransferContext,
	address atree.Address,
	remove bool,
	storable atree.Storable,
	preventTransfer map[atree.ValueID]struct{},
	hasNoParentContainer bool,
) Value

func (*DictionaryValue) UnwrapAtreeValue added in v1.3.1

func (v *DictionaryValue) UnwrapAtreeValue() (atree.Value, uint32)

func (*DictionaryValue) ValueID

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

func (*DictionaryValue) Walk

func (v *DictionaryValue) Walk(context ValueWalkContext, walkChild func(Value))

type DivisionByZeroError

type DivisionByZeroError struct {
	LocationRange
}

func (*DivisionByZeroError) Error

func (e *DivisionByZeroError) Error() string

func (*DivisionByZeroError) IsUserError

func (*DivisionByZeroError) IsUserError()

func (*DivisionByZeroError) SetLocationRange added in v1.5.0

func (e *DivisionByZeroError) SetLocationRange(locationRange LocationRange)

type DomainStorageMap added in v1.3.0

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

DomainStorageMap is an ordered map which stores values in an account domain.

func NewDomainStorageMap added in v1.3.0

func NewDomainStorageMap(
	memoryGauge common.MemoryGauge,
	computationGauge common.ComputationGauge,
	storage atree.SlabStorage,
	address atree.Address,
) *DomainStorageMap

NewDomainStorageMap creates new domain storage map for given address.

func NewDomainStorageMapWithAtreeValue added in v1.3.0

func NewDomainStorageMapWithAtreeValue(value atree.Value) *DomainStorageMap

NewDomainStorageMapWithAtreeValue loads domain storage map with given atree.Value. This function is used by migrated account to load domain as an element of AccountStorageMap.

func NewDomainStorageMapWithRootID added in v1.3.0

func NewDomainStorageMapWithRootID(
	gauge common.Gauge,
	storage atree.SlabStorage,
	slabID atree.SlabID,
) *DomainStorageMap

NewDomainStorageMapWithRootID loads domain storage map with given slabID. This function is only used with legacy domain registers for unmigrated accounts. For migrated accounts, NewDomainStorageMapWithAtreeValue() is used to load domain storage map as an element of AccountStorageMap.

func (*DomainStorageMap) Count added in v1.3.0

func (s *DomainStorageMap) Count() uint64

func (*DomainStorageMap) DeepRemove added in v1.3.0

func (s *DomainStorageMap) DeepRemove(context ValueRemoveContext, hasNoParentContainer bool)

DeepRemove removes all elements (and their slabs) of domain storage map.

func (*DomainStorageMap) Inlined added in v1.3.0

func (s *DomainStorageMap) Inlined() bool

func (*DomainStorageMap) Iterator added in v1.3.0

Iterator returns an iterator (StorageMapIterator), which allows iterating over the keys and values of the storage map

func (*DomainStorageMap) ReadValue added in v1.3.0

func (s *DomainStorageMap) ReadValue(gauge common.Gauge, key StorageMapKey) Value

ReadValue returns the value for the given key. Returns nil if the key does not exist.

func (*DomainStorageMap) RemoveValue added in v1.3.0

func (s *DomainStorageMap) RemoveValue(context ValueRemoveContext, key StorageMapKey) (existed bool)

RemoveValue removes a value in the storage map, if it exists.

func (*DomainStorageMap) SetValue added in v1.3.0

func (s *DomainStorageMap) SetValue(context ValueTransferContext, 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 given key already exists and existing value is overwritten.

func (*DomainStorageMap) SlabID added in v1.3.0

func (s *DomainStorageMap) SlabID() atree.SlabID

func (*DomainStorageMap) ValueExists added in v1.3.0

func (s *DomainStorageMap) ValueExists(gauge common.ComputationGauge, key StorageMapKey) bool

ValueExists returns true if the given key exists in the storage map.

func (*DomainStorageMap) ValueID added in v1.3.0

func (s *DomainStorageMap) ValueID() atree.ValueID

func (*DomainStorageMap) WriteValue added in v1.3.0

func (s *DomainStorageMap) WriteValue(context ValueTransferContext, 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 DomainStorageMapIterator added in v1.3.0

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

DomainStorageMapIterator is an iterator over DomainStorageMap

func (DomainStorageMapIterator) Next added in v1.3.0

Next returns the next key and value of the storage map iterator. If there is no further key-value pair, (nil, nil) is returned.

func (DomainStorageMapIterator) NextKey added in v1.3.0

func (i DomainStorageMapIterator) NextKey(gauge common.Gauge) atree.Value

NextKey returns the next key of the storage map iterator. If there is no further key, "" is returned.

func (DomainStorageMapIterator) NextValue added in v1.3.0

func (i DomainStorageMapIterator) NextValue(gauge common.Gauge) Value

NextValue returns the next value in the storage map iterator. If there is no further value, nil is returned.

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()

func (*DuplicateAttachmentError) SetLocationRange added in v1.5.0

func (e *DuplicateAttachmentError) SetLocationRange(locationRange LocationRange)

type DuplicateKeyInResourceDictionaryError

type DuplicateKeyInResourceDictionaryError struct {
	LocationRange
}

DuplicateKeyInResourceDictionaryError

func (*DuplicateKeyInResourceDictionaryError) Error

func (*DuplicateKeyInResourceDictionaryError) IsUserError

func (*DuplicateKeyInResourceDictionaryError) SetLocationRange added in v1.5.0

func (e *DuplicateKeyInResourceDictionaryError) SetLocationRange(locationRange LocationRange)

type EmptyTypeArgumentsIterator added in v1.8.0

type EmptyTypeArgumentsIterator struct{}

func (EmptyTypeArgumentsIterator) NextSema added in v1.8.0

func (EmptyTypeArgumentsIterator) NextStatic added in v1.8.0

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) IsComposite

func (e EmptyTypeInfo) IsComposite() bool

type EmptyVisitor

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

func (EmptyVisitor) VisitAccountCapabilityControllerValue

func (v EmptyVisitor) VisitAccountCapabilityControllerValue(context ValueVisitContext, value *AccountCapabilityControllerValue)

func (EmptyVisitor) VisitAddressValue

func (v EmptyVisitor) VisitAddressValue(context ValueVisitContext, value AddressValue)

func (EmptyVisitor) VisitArrayValue

func (v EmptyVisitor) VisitArrayValue(context ValueVisitContext, value *ArrayValue) bool

func (EmptyVisitor) VisitBoolValue

func (v EmptyVisitor) VisitBoolValue(context ValueVisitContext, value BoolValue)

func (EmptyVisitor) VisitBoundFunctionValue

func (v EmptyVisitor) VisitBoundFunctionValue(context ValueVisitContext, value BoundFunctionValue)

func (EmptyVisitor) VisitCapabilityValue

func (v EmptyVisitor) VisitCapabilityValue(context ValueVisitContext, value *IDCapabilityValue)

func (EmptyVisitor) VisitCharacterValue

func (v EmptyVisitor) VisitCharacterValue(context ValueVisitContext, value CharacterValue)

func (EmptyVisitor) VisitCompositeValue

func (v EmptyVisitor) VisitCompositeValue(context ValueVisitContext, value *CompositeValue) bool

func (EmptyVisitor) VisitDictionaryValue

func (v EmptyVisitor) VisitDictionaryValue(context ValueVisitContext, value *DictionaryValue) bool

func (EmptyVisitor) VisitEphemeralReferenceValue

func (v EmptyVisitor) VisitEphemeralReferenceValue(context ValueVisitContext, value *EphemeralReferenceValue)

func (EmptyVisitor) VisitFix128Value added in v1.7.0

func (v EmptyVisitor) VisitFix128Value(context ValueVisitContext, value Fix128Value)

func (EmptyVisitor) VisitFix64Value

func (v EmptyVisitor) VisitFix64Value(context ValueVisitContext, value Fix64Value)

func (EmptyVisitor) VisitHostFunctionValue

func (v EmptyVisitor) VisitHostFunctionValue(context ValueVisitContext, value *HostFunctionValue)

func (EmptyVisitor) VisitInt128Value

func (v EmptyVisitor) VisitInt128Value(context ValueVisitContext, value Int128Value)

func (EmptyVisitor) VisitInt16Value

func (v EmptyVisitor) VisitInt16Value(context ValueVisitContext, value Int16Value)

func (EmptyVisitor) VisitInt256Value

func (v EmptyVisitor) VisitInt256Value(context ValueVisitContext, value Int256Value)

func (EmptyVisitor) VisitInt32Value

func (v EmptyVisitor) VisitInt32Value(context ValueVisitContext, value Int32Value)

func (EmptyVisitor) VisitInt64Value

func (v EmptyVisitor) VisitInt64Value(context ValueVisitContext, value Int64Value)

func (EmptyVisitor) VisitInt8Value

func (v EmptyVisitor) VisitInt8Value(context ValueVisitContext, value Int8Value)

func (EmptyVisitor) VisitIntValue

func (v EmptyVisitor) VisitIntValue(context ValueVisitContext, value IntValue)

func (EmptyVisitor) VisitInterpretedFunctionValue

func (v EmptyVisitor) VisitInterpretedFunctionValue(context ValueVisitContext, value *InterpretedFunctionValue)

func (EmptyVisitor) VisitNilValue

func (v EmptyVisitor) VisitNilValue(context ValueVisitContext, value NilValue)

func (EmptyVisitor) VisitPathValue

func (v EmptyVisitor) VisitPathValue(context ValueVisitContext, value PathValue)

func (EmptyVisitor) VisitPublishedValue

func (v EmptyVisitor) VisitPublishedValue(context ValueVisitContext, value *PublishedValue)

func (EmptyVisitor) VisitSimpleCompositeValue

func (v EmptyVisitor) VisitSimpleCompositeValue(context ValueVisitContext, value *SimpleCompositeValue)

func (EmptyVisitor) VisitSomeValue

func (v EmptyVisitor) VisitSomeValue(context ValueVisitContext, value *SomeValue) bool

func (EmptyVisitor) VisitStorageCapabilityControllerValue

func (v EmptyVisitor) VisitStorageCapabilityControllerValue(context ValueVisitContext, value *StorageCapabilityControllerValue)

func (EmptyVisitor) VisitStorageReferenceValue

func (v EmptyVisitor) VisitStorageReferenceValue(context ValueVisitContext, value *StorageReferenceValue)

func (EmptyVisitor) VisitStringValue

func (v EmptyVisitor) VisitStringValue(context ValueVisitContext, value *StringValue)

func (EmptyVisitor) VisitTypeValue

func (v EmptyVisitor) VisitTypeValue(context ValueVisitContext, value TypeValue)

func (EmptyVisitor) VisitUFix128Value added in v1.7.0

func (v EmptyVisitor) VisitUFix128Value(context ValueVisitContext, value UFix128Value)

func (EmptyVisitor) VisitUFix64Value

func (v EmptyVisitor) VisitUFix64Value(context ValueVisitContext, value UFix64Value)

func (EmptyVisitor) VisitUInt128Value

func (v EmptyVisitor) VisitUInt128Value(context ValueVisitContext, value UInt128Value)

func (EmptyVisitor) VisitUInt16Value

func (v EmptyVisitor) VisitUInt16Value(context ValueVisitContext, value UInt16Value)

func (EmptyVisitor) VisitUInt256Value

func (v EmptyVisitor) VisitUInt256Value(context ValueVisitContext, value UInt256Value)

func (EmptyVisitor) VisitUInt32Value

func (v EmptyVisitor) VisitUInt32Value(context ValueVisitContext, value UInt32Value)

func (EmptyVisitor) VisitUInt64Value

func (v EmptyVisitor) VisitUInt64Value(context ValueVisitContext, value UInt64Value)

func (EmptyVisitor) VisitUInt8Value

func (v EmptyVisitor) VisitUInt8Value(context ValueVisitContext, value UInt8Value)

func (EmptyVisitor) VisitUIntValue

func (v EmptyVisitor) VisitUIntValue(context ValueVisitContext, value UIntValue)

func (EmptyVisitor) VisitVoidValue

func (v EmptyVisitor) VisitVoidValue(context ValueVisitContext, value VoidValue)

func (EmptyVisitor) VisitWord128Value

func (v EmptyVisitor) VisitWord128Value(context ValueVisitContext, value Word128Value)

func (EmptyVisitor) VisitWord16Value

func (v EmptyVisitor) VisitWord16Value(context ValueVisitContext, value Word16Value)

func (EmptyVisitor) VisitWord256Value

func (v EmptyVisitor) VisitWord256Value(context ValueVisitContext, value Word256Value)

func (EmptyVisitor) VisitWord32Value

func (v EmptyVisitor) VisitWord32Value(context ValueVisitContext, value Word32Value)

func (EmptyVisitor) VisitWord64Value

func (v EmptyVisitor) VisitWord64Value(context ValueVisitContext, value Word64Value)

func (EmptyVisitor) VisitWord8Value

func (v EmptyVisitor) VisitWord8Value(context ValueVisitContext, value Word8Value)

type EntitledCapabilityPublishingError

type EntitledCapabilityPublishingError struct {
	LocationRange
	BorrowType *ReferenceStaticType
	Path       PathValue
}

EntitledCapabilityPublishingError

func (*EntitledCapabilityPublishingError) Error

func (*EntitledCapabilityPublishingError) IsUserError

func (*EntitledCapabilityPublishingError) IsUserError()

func (*EntitledCapabilityPublishingError) SetLocationRange added in v1.5.0

func (e *EntitledCapabilityPublishingError) SetLocationRange(locationRange LocationRange)

type EntitlementMapAuthorization

type EntitlementMapAuthorization struct {
	TypeID common.TypeID
}

func NewEntitlementMapAuthorization

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

func (EntitlementMapAuthorization) Encode

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 (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(
	context ReferenceCreationContext,
	authorization Authorization,
	value Value,
	borrowedType sema.Type,
) *EphemeralReferenceValue

func NewUnmeteredEphemeralReferenceValue

func NewUnmeteredEphemeralReferenceValue(
	referenceTracker ReferenceTracker,
	authorization Authorization,
	value Value,
	borrowedType sema.Type,
) *EphemeralReferenceValue

func (*EphemeralReferenceValue) Accept

func (v *EphemeralReferenceValue) Accept(context ValueVisitContext, visitor Visitor)

func (*EphemeralReferenceValue) BorrowType

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

func (*EphemeralReferenceValue) Clone

func (*EphemeralReferenceValue) ConformsToStaticType

func (v *EphemeralReferenceValue) ConformsToStaticType(
	context ValueStaticTypeConformanceContext,
	results TypeConformanceResults,
) bool

func (*EphemeralReferenceValue) DeepRemove

func (*EphemeralReferenceValue) Equal

func (*EphemeralReferenceValue) ForEach

func (v *EphemeralReferenceValue) ForEach(
	context IterableValueForeachContext,
	elementType sema.Type,
	function func(value Value) (resume bool),
	_ bool,
)

func (*EphemeralReferenceValue) GetAuthorization

func (v *EphemeralReferenceValue) GetAuthorization() Authorization

func (*EphemeralReferenceValue) GetKey

func (v *EphemeralReferenceValue) GetKey(context ContainerReadContext, key Value) Value

func (*EphemeralReferenceValue) GetMember

func (v *EphemeralReferenceValue) GetMember(context MemberAccessibleContext, name string) Value

func (*EphemeralReferenceValue) GetMethod added in v1.4.0

func (*EphemeralReferenceValue) GetTypeKey

func (v *EphemeralReferenceValue) GetTypeKey(context MemberAccessibleContext, key sema.Type) Value

func (*EphemeralReferenceValue) InsertKey

func (v *EphemeralReferenceValue) InsertKey(context ContainerMutationContext, key Value, value Value)

func (*EphemeralReferenceValue) IsImportable

func (*EphemeralReferenceValue) IsResourceKinded

func (*EphemeralReferenceValue) IsStorable

func (*EphemeralReferenceValue) IsStorable() bool

func (*EphemeralReferenceValue) IsValue added in v1.4.0

func (*EphemeralReferenceValue) IsValue()

func (*EphemeralReferenceValue) Iterator

func (*EphemeralReferenceValue) MeteredString

func (v *EphemeralReferenceValue) MeteredString(
	context ValueStringContext,
	seenReferences SeenReferences,
) 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(_ ValueStaticTypeContext, _ bool) *Value

func (*EphemeralReferenceValue) RemoveKey

func (v *EphemeralReferenceValue) RemoveKey(context ContainerMutationContext, key Value) Value

func (*EphemeralReferenceValue) RemoveMember

func (v *EphemeralReferenceValue) RemoveMember(context ValueTransferContext, name string) Value

func (*EphemeralReferenceValue) RemoveTypeKey

func (v *EphemeralReferenceValue) RemoveTypeKey(context ValueTransferContext, key sema.Type) Value

func (*EphemeralReferenceValue) SetKey

func (v *EphemeralReferenceValue) SetKey(context ContainerMutationContext, key Value, value Value)

func (*EphemeralReferenceValue) SetMember

func (v *EphemeralReferenceValue) SetMember(context ValueTransferContext, name string, value Value) bool

func (*EphemeralReferenceValue) SetTypeKey

func (v *EphemeralReferenceValue) SetTypeKey(context ValueTransferContext, key sema.Type, value Value)

func (*EphemeralReferenceValue) StaticType

func (*EphemeralReferenceValue) Storable

func (*EphemeralReferenceValue) String

func (v *EphemeralReferenceValue) String() string

func (*EphemeralReferenceValue) Transfer

func (v *EphemeralReferenceValue) Transfer(
	context ValueTransferContext,
	_ 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.
	Equal(context ValueComparisonContext, other Value) bool
}

type Error

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

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 ErrorHandler added in v1.4.0

type ErrorHandler interface {
	RecoverErrors(onError func(error))
}

type EventContext added in v1.4.0

type EventContext interface {
	EmitEvent(
		context ValueExportContext,
		eventType *sema.CompositeType,
		eventFields []Value,
	)
}

type EventEmissionUnavailableError

type EventEmissionUnavailableError struct {
	LocationRange
}

EventEmissionUnavailableError

func (*EventEmissionUnavailableError) Error

func (*EventEmissionUnavailableError) IsUserError

func (*EventEmissionUnavailableError) IsUserError()

func (*EventEmissionUnavailableError) SetLocationRange added in v1.5.0

func (e *EventEmissionUnavailableError) SetLocationRange(locationRange LocationRange)

type ExpressionResult

type ExpressionResult struct {
	Value
}

type Fix128Value added in v1.7.0

type Fix128Value fix.Fix128

Fix128Value

func ConvertFix128 added in v1.7.0

func ConvertFix128(memoryGauge common.MemoryGauge, value Value) Fix128Value

func NewFix128Value added in v1.7.0

func NewFix128Value(gauge common.MemoryGauge, valueGetter func() fix.Fix128) Fix128Value

func NewFix128ValueFromBigInt added in v1.7.0

func NewFix128ValueFromBigInt(gauge common.MemoryGauge, v *big.Int) Fix128Value

func NewFix128ValueFromBigIntWithRangeCheck added in v1.7.0

func NewFix128ValueFromBigIntWithRangeCheck(gauge common.MemoryGauge, v *big.Int) Fix128Value

func NewUnmeteredFix128Value added in v1.7.0

func NewUnmeteredFix128Value(fix128 fix.Fix128) Fix128Value

func NewUnmeteredFix128ValueWithInteger added in v1.7.0

func NewUnmeteredFix128ValueWithInteger(integer int64) Fix128Value

NewUnmeteredFix128ValueWithInteger construct a Fix128Value from an int64. Note that this function uses the default scaling of 24.

func NewUnmeteredFix128ValueWithIntegerAndScale added in v1.7.0

func NewUnmeteredFix128ValueWithIntegerAndScale(integer int64, scale int64) Fix128Value

func (Fix128Value) Accept added in v1.7.0

func (v Fix128Value) Accept(context ValueVisitContext, visitor Visitor)

func (Fix128Value) ByteSize added in v1.7.0

func (v Fix128Value) ByteSize() uint32

func (Fix128Value) ChildStorables added in v1.7.0

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

func (Fix128Value) Clone added in v1.7.0

func (v Fix128Value) Clone(_ ValueCloneContext) Value

func (Fix128Value) ConformsToStaticType added in v1.7.0

func (Fix128Value) DeepRemove added in v1.7.0

func (Fix128Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Fix128Value) Div added in v1.7.0

func (Fix128Value) Encode added in v1.7.0

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

Encode encodes Fix128Value as

cbor.Tag{
		Number:  CBORTagFix128Value,
		Content: []any {
		    int64(hi),
		    int64(lo),
		}
}

func (Fix128Value) Equal added in v1.7.0

func (v Fix128Value) Equal(_ ValueComparisonContext, other Value) bool

func (Fix128Value) GetMember added in v1.7.0

func (v Fix128Value) GetMember(context MemberAccessibleContext, name string) Value

func (Fix128Value) GetMethod added in v1.7.0

func (v Fix128Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Fix128Value) Greater added in v1.7.0

func (v Fix128Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (Fix128Value) GreaterEqual added in v1.7.0

func (v Fix128Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Fix128Value) HashInput added in v1.7.0

func (v Fix128Value) HashInput(_ common.Gauge, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeFix128 (1 byte) - high 64 bits encoded in big-endian (8 bytes) - low 64 bits encoded in big-endian (8 bytes)

func (Fix128Value) IntegerPart added in v1.7.0

func (v Fix128Value) IntegerPart() NumberValue

func (Fix128Value) IsImportable added in v1.7.0

func (Fix128Value) IsImportable(_ ValueImportableContext) bool

func (Fix128Value) IsResourceKinded added in v1.7.0

func (Fix128Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Fix128Value) IsStorable added in v1.7.0

func (Fix128Value) IsStorable() bool

func (Fix128Value) IsValue added in v1.7.0

func (Fix128Value) IsValue()

func (Fix128Value) Less added in v1.7.0

func (Fix128Value) LessEqual added in v1.7.0

func (v Fix128Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Fix128Value) MeteredString added in v1.7.0

func (v Fix128Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Fix128Value) Minus added in v1.7.0

func (Fix128Value) Mod added in v1.7.0

func (Fix128Value) Mul added in v1.7.0

func (Fix128Value) NeedsStoreTo added in v1.7.0

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

func (Fix128Value) Negate added in v1.7.0

func (Fix128Value) Plus added in v1.7.0

func (Fix128Value) RecursiveString added in v1.7.0

func (v Fix128Value) RecursiveString(_ SeenReferences) string

func (Fix128Value) RemoveMember added in v1.7.0

func (Fix128Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Fix128Value) SaturatingDiv added in v1.7.0

func (v Fix128Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Fix128Value) SaturatingMinus added in v1.7.0

func (v Fix128Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Fix128Value) SaturatingMul added in v1.7.0

func (v Fix128Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Fix128Value) SaturatingPlus added in v1.7.0

func (v Fix128Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Fix128Value) Scale added in v1.7.0

func (Fix128Value) Scale() int

func (Fix128Value) SetMember added in v1.7.0

func (Fix128Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Fix128Value) StaticType added in v1.7.0

func (Fix128Value) StaticType(context ValueStaticTypeContext) StaticType

func (Fix128Value) Storable added in v1.7.0

func (Fix128Value) StoredValue added in v1.7.0

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

func (Fix128Value) String added in v1.7.0

func (v Fix128Value) String() string

func (Fix128Value) ToBigEndianBytes added in v1.7.0

func (v Fix128Value) ToBigEndianBytes() []byte

func (Fix128Value) ToBigInt added in v1.7.0

func (v Fix128Value) ToBigInt() *big.Int

func (Fix128Value) ToInt added in v1.7.0

func (v Fix128Value) ToInt() int

func (Fix128Value) Transfer added in v1.7.0

func (v Fix128Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Fix128Value) Walk added in v1.7.0

func (Fix128Value) Walk(_ ValueWalkContext, _ func(Value))

type Fix64Value

type Fix64Value int64

Fix64Value

func ConvertFix64

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

func NewFix64Value

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

func NewFix64ValueWithInteger

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

func NewUnmeteredFix64Value

func NewUnmeteredFix64Value(integer int64) Fix64Value

func NewUnmeteredFix64ValueWithInteger

func NewUnmeteredFix64ValueWithInteger(integer int64) Fix64Value

func (Fix64Value) Accept

func (v Fix64Value) Accept(context ValueVisitContext, visitor Visitor)

func (Fix64Value) ByteSize

func (v Fix64Value) ByteSize() uint32

func (Fix64Value) ChildStorables

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

func (Fix64Value) Clone

func (v Fix64Value) Clone(_ ValueCloneContext) Value

func (Fix64Value) ConformsToStaticType

func (Fix64Value) DeepRemove

func (Fix64Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Fix64Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Fix64Value) GetMember

func (v Fix64Value) GetMember(context MemberAccessibleContext, name string) Value

func (Fix64Value) GetMethod added in v1.4.0

func (v Fix64Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Fix64Value) Greater

func (v Fix64Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (Fix64Value) GreaterEqual

func (v Fix64Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Fix64Value) HashInput

func (v Fix64Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (Fix64Value) IsResourceKinded

func (Fix64Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Fix64Value) IsStorable

func (Fix64Value) IsStorable() bool

func (Fix64Value) IsValue added in v1.4.0

func (Fix64Value) IsValue()

func (Fix64Value) Less

func (Fix64Value) LessEqual

func (v Fix64Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Fix64Value) MeteredString

func (v Fix64Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Fix64Value) Minus

func (Fix64Value) Mod

func (Fix64Value) Mul

func (Fix64Value) NeedsStoreTo

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

func (Fix64Value) Negate

func (Fix64Value) Plus

func (Fix64Value) RecursiveString

func (v Fix64Value) RecursiveString(_ SeenReferences) string

func (Fix64Value) RemoveMember

func (Fix64Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Fix64Value) SaturatingDiv

func (v Fix64Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Fix64Value) SaturatingMinus

func (v Fix64Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Fix64Value) SaturatingMul

func (v Fix64Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Fix64Value) SaturatingPlus

func (v Fix64Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Fix64Value) Scale

func (Fix64Value) Scale() int

func (Fix64Value) SetMember

func (Fix64Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Fix64Value) StaticType

func (Fix64Value) StaticType(context ValueStaticTypeContext) 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() int

func (Fix64Value) Transfer

func (v Fix64Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Fix64Value) Walk

func (Fix64Value) Walk(_ ValueWalkContext, _ func(Value))

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()

func (*ForceCastTypeMismatchError) SetLocationRange added in v1.5.0

func (e *ForceCastTypeMismatchError) SetLocationRange(locationRange LocationRange)

type ForceNilError

type ForceNilError struct {
	LocationRange
}

ForceNilError

func (*ForceNilError) Error

func (e *ForceNilError) Error() string

func (*ForceNilError) IsUserError

func (*ForceNilError) IsUserError()

func (*ForceNilError) SetLocationRange added in v1.5.0

func (e *ForceNilError) SetLocationRange(locationRange LocationRange)

type FunctionCreationContext added in v1.4.0

type FunctionCreationContext interface {
	StaticTypeAndReferenceContext
	CompositeFunctionContext
}

type FunctionOrderedMap

type FunctionOrderedMap = orderedmap.OrderedMap[string, FunctionValue]

type FunctionStaticType

type FunctionStaticType struct {
	*sema.FunctionType
}

func NewFunctionStaticType

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

func (FunctionStaticType) Encode

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
	IsFunctionValue()
	FunctionType(context ValueStaticTypeContext) *sema.FunctionType
	// invoke evaluates the function.
	// Only used internally by the interpreter.
	// Use Interpreter.InvokeFunctionValue if you want to invoke the function externally
	Invoke(Invocation) Value
}

FunctionValue

type FunctionWrapper

type FunctionWrapper = func(inner FunctionValue) FunctionValue

type GetCapabilityControllerContext added in v1.4.0

type GetCapabilityControllerContext interface {
	TypeConverter
	StorageReader
}

type GetCapabilityControllerReferenceContext added in v1.4.0

type GetCapabilityControllerReferenceContext interface {
	GetCapabilityControllerContext
	ValueCapabilityControllerReferenceValueContext
}

type GetCapabilityError

type GetCapabilityError struct {
	LocationRange
}

GetCapabilityError

func (*GetCapabilityError) Error

func (e *GetCapabilityError) Error() string

func (*GetCapabilityError) IsUserError

func (*GetCapabilityError) IsUserError()

func (*GetCapabilityError) SetLocationRange added in v1.5.0

func (e *GetCapabilityError) SetLocationRange(locationRange LocationRange)

type GetReferenceContext added in v1.4.0

type GetReferenceContext interface {
	ReferenceCreationContext
}

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 HasLocationRange added in v1.5.0

type HasLocationRange interface {
	SetLocationRange(locationRange LocationRange)
}

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
	HashInputTypeFix128

	HashInputTypeUFix64
	HashInputTypeUFix128

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

type HashableValue

type HashableValue interface {
	Value
	HashInput(gauge common.Gauge, scratch []byte) []byte
}

HashableValue is an immutable value that can be hashed

type HostFunction

type HostFunction func(invocation Invocation) Value

HostFunctionValue

func AdaptNativeFunctionForInterpreter added in v1.8.0

func AdaptNativeFunctionForInterpreter(fn NativeFunction) HostFunction

type HostFunctionValue

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

func EnumLookupFunction added in v1.6.2

func EnumLookupFunction(
	gauge common.MemoryGauge,
	functionType *sema.FunctionType,
	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

func NewStaticHostFunctionValueFromNativeFunction added in v1.8.0

func NewStaticHostFunctionValueFromNativeFunction(
	gauge common.MemoryGauge,
	functionType *sema.FunctionType,
	fn NativeFunction,
) *HostFunctionValue

func NewUnmeteredStaticHostFunctionValue

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

func NewUnmeteredStaticHostFunctionValueFromNativeFunction added in v1.8.0

func NewUnmeteredStaticHostFunctionValueFromNativeFunction(
	functionType *sema.FunctionType,
	fn NativeFunction,
) *HostFunctionValue

func (*HostFunctionValue) Accept

func (f *HostFunctionValue) Accept(context ValueVisitContext, visitor Visitor)

func (*HostFunctionValue) Clone

func (*HostFunctionValue) ConformsToStaticType

func (*HostFunctionValue) DeepRemove

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

func (*HostFunctionValue) FunctionType

func (*HostFunctionValue) GetMember

func (f *HostFunctionValue) GetMember(context MemberAccessibleContext, name string) Value

func (*HostFunctionValue) GetMethod added in v1.4.0

func (*HostFunctionValue) Invoke added in v1.4.0

func (f *HostFunctionValue) Invoke(invocation Invocation) Value

func (*HostFunctionValue) IsFunctionValue added in v1.4.0

func (*HostFunctionValue) IsFunctionValue()

func (*HostFunctionValue) IsImportable

func (*HostFunctionValue) IsResourceKinded

func (*HostFunctionValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (*HostFunctionValue) IsValue added in v1.4.0

func (*HostFunctionValue) IsValue()

func (*HostFunctionValue) MeteredString

func (f *HostFunctionValue) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) 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(_ ValueTransferContext, _ string) Value

func (*HostFunctionValue) SetMember

func (*HostFunctionValue) SetNestedVariables

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

func (*HostFunctionValue) StaticType

func (f *HostFunctionValue) StaticType(context ValueStaticTypeContext) StaticType

func (*HostFunctionValue) Storable

func (*HostFunctionValue) String

func (f *HostFunctionValue) String() string

func (*HostFunctionValue) Transfer

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

func (*HostFunctionValue) Walk

func (f *HostFunctionValue) Walk(_ ValueWalkContext, _ func(Value))

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(context ValueVisitContext, visitor Visitor)

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(context ValueCloneContext) Value

func (*IDCapabilityValue) ConformsToStaticType

func (*IDCapabilityValue) DeepRemove

func (v *IDCapabilityValue) DeepRemove(context ValueRemoveContext, _ 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(context ValueComparisonContext, other Value) bool

func (*IDCapabilityValue) GetMember

func (v *IDCapabilityValue) GetMember(context MemberAccessibleContext, name string) Value

func (*IDCapabilityValue) GetMethod added in v1.4.0

func (v *IDCapabilityValue) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (*IDCapabilityValue) IsImportable

func (v *IDCapabilityValue) IsImportable(_ ValueImportableContext) bool

func (*IDCapabilityValue) IsResourceKinded

func (*IDCapabilityValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (*IDCapabilityValue) IsStorable

func (*IDCapabilityValue) IsStorable() bool

func (*IDCapabilityValue) IsValue added in v1.4.0

func (*IDCapabilityValue) IsValue()

func (*IDCapabilityValue) MeteredString

func (v *IDCapabilityValue) MeteredString(
	context ValueStringContext,
	seenReferences SeenReferences,
) 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(_ ValueTransferContext, _ string) Value

func (*IDCapabilityValue) SetMember

func (*IDCapabilityValue) StaticType

func (v *IDCapabilityValue) StaticType(context ValueStaticTypeContext) StaticType

func (*IDCapabilityValue) Storable

func (v *IDCapabilityValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint32,
) (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(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*IDCapabilityValue) Walk

func (v *IDCapabilityValue) Walk(_ ValueWalkContext, walkChild func(Value))

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
	DomainStorageMaps map[StorageDomainKey]*DomainStorageMap
	// contains filtered or unexported fields
}

InMemoryStorage

func NewInMemoryStorage

func NewInMemoryStorage(
	memoryGauge common.MemoryGauge,
	computationGauge common.ComputationGauge,
) InMemoryStorage

func (InMemoryStorage) CheckHealth

func (i InMemoryStorage) CheckHealth() error

func (InMemoryStorage) GetDomainStorageMap added in v1.3.0

func (i InMemoryStorage) GetDomainStorageMap(
	_ StorageMutationTracker,
	address common.Address,
	domain common.StorageDomain,
	createIfNotExists bool,
) (
	domainStorageMap *DomainStorageMap,
)

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()

func (*InclusiveRangeConstructionError) SetLocationRange added in v1.5.0

func (e *InclusiveRangeConstructionError) SetLocationRange(locationRange LocationRange)

type InclusiveRangeIterator

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

func (*InclusiveRangeIterator) HasNext added in v1.4.0

func (*InclusiveRangeIterator) Next

func (*InclusiveRangeIterator) ValueID added in v1.7.0

func (*InclusiveRangeIterator) ValueID() (atree.ValueID, bool)

type InclusiveRangeIteratorContext added in v1.4.0

type InclusiveRangeIteratorContext interface {
	common.Gauge
	NumberValueArithmeticContext
}

type InclusiveRangeStaticType

type InclusiveRangeStaticType struct {
	ElementType StaticType
}

func NewInclusiveRangeStaticType

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

func (InclusiveRangeStaticType) BaseType added in v1.8.4

func (t InclusiveRangeStaticType) BaseType() StaticType

func (InclusiveRangeStaticType) Encode

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

func (InclusiveRangeStaticType) TypeArguments added in v1.8.4

func (t InclusiveRangeStaticType) TypeArguments() []StaticType

type InjectedCompositeFieldsHandlerFunc

type InjectedCompositeFieldsHandlerFunc func(
	context AccountCreationContext,
	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) Int128Value

func NewInt128ValueFromBigInt

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

func NewInt128ValueFromInt64 added in v1.5.0

func NewInt128ValueFromInt64(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(context ValueVisitContext, visitor Visitor)

func (Int128Value) BitwiseAnd

func (v Int128Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int128Value) BitwiseLeftShift

func (v Int128Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int128Value) BitwiseOr

func (v Int128Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int128Value) BitwiseRightShift

func (v Int128Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int128Value) BitwiseXor

func (v Int128Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) 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(_ ValueCloneContext) Value

func (Int128Value) ConformsToStaticType

func (Int128Value) DeepRemove

func (Int128Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Int128Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Int128Value) GetMember

func (v Int128Value) GetMember(context MemberAccessibleContext, name string) Value

func (Int128Value) GetMethod added in v1.4.0

func (v Int128Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Int128Value) Greater

func (v Int128Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int128Value) GreaterEqual

func (v Int128Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int128Value) HashInput

func (v Int128Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (Int128Value) IsResourceKinded

func (Int128Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Int128Value) IsValue added in v1.4.0

func (Int128Value) IsValue()

func (Int128Value) Less

func (Int128Value) LessEqual

func (v Int128Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int128Value) MeteredString

func (v Int128Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Int128Value) Minus

func (Int128Value) Mod

func (Int128Value) Mul

func (Int128Value) NeedsStoreTo

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

func (Int128Value) Negate

func (Int128Value) Plus

func (Int128Value) RecursiveString

func (v Int128Value) RecursiveString(_ SeenReferences) string

func (Int128Value) RemoveMember

func (Int128Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Int128Value) SaturatingDiv

func (v Int128Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int128Value) SaturatingMinus

func (v Int128Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int128Value) SaturatingMul

func (v Int128Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int128Value) SaturatingPlus

func (v Int128Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int128Value) SetMember

func (Int128Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Int128Value) StaticType

func (Int128Value) StaticType(context ValueStaticTypeContext) 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() int

func (Int128Value) Transfer

func (v Int128Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Int128Value) Walk

func (Int128Value) Walk(_ ValueWalkContext, _ func(Value))

type Int16Value

type Int16Value int16

func ConvertInt16

func ConvertInt16(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (Int16Value) BitwiseAnd

func (v Int16Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int16Value) BitwiseLeftShift

func (v Int16Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int16Value) BitwiseOr

func (v Int16Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int16Value) BitwiseRightShift

func (v Int16Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int16Value) BitwiseXor

func (v Int16Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int16Value) ByteSize

func (v Int16Value) ByteSize() uint32

func (Int16Value) ChildStorables

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

func (Int16Value) Clone

func (v Int16Value) Clone(_ ValueCloneContext) Value

func (Int16Value) ConformsToStaticType

func (Int16Value) DeepRemove

func (Int16Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Int16Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Int16Value) GetMember

func (v Int16Value) GetMember(context MemberAccessibleContext, name string) Value

func (Int16Value) GetMethod added in v1.4.0

func (v Int16Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Int16Value) Greater

func (v Int16Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int16Value) GreaterEqual

func (v Int16Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int16Value) HashInput

func (v Int16Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (Int16Value) IsResourceKinded

func (Int16Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Int16Value) IsValue added in v1.4.0

func (Int16Value) IsValue()

func (Int16Value) Less

func (Int16Value) LessEqual

func (v Int16Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int16Value) MeteredString

func (v Int16Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Int16Value) Minus

func (Int16Value) Mod

func (Int16Value) Mul

func (Int16Value) NeedsStoreTo

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

func (Int16Value) Negate

func (Int16Value) Plus

func (Int16Value) RecursiveString

func (v Int16Value) RecursiveString(_ SeenReferences) string

func (Int16Value) RemoveMember

func (Int16Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Int16Value) SaturatingDiv

func (v Int16Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int16Value) SaturatingMinus

func (v Int16Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int16Value) SaturatingMul

func (v Int16Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int16Value) SaturatingPlus

func (v Int16Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int16Value) SetMember

func (Int16Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Int16Value) StaticType

func (Int16Value) StaticType(context ValueStaticTypeContext) 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() int

func (Int16Value) Transfer

func (v Int16Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Int16Value) Walk

func (Int16Value) Walk(_ ValueWalkContext, _ func(Value))

type Int256Value

type Int256Value struct {
	BigInt *big.Int
}

func ConvertInt256

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

func NewInt256ValueFromBigInt

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

func NewInt256ValueFromInt64 added in v1.5.0

func NewInt256ValueFromInt64(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(context ValueVisitContext, visitor Visitor)

func (Int256Value) BitwiseAnd

func (v Int256Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int256Value) BitwiseLeftShift

func (v Int256Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int256Value) BitwiseOr

func (v Int256Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int256Value) BitwiseRightShift

func (v Int256Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int256Value) BitwiseXor

func (v Int256Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) 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(_ ValueCloneContext) Value

func (Int256Value) ConformsToStaticType

func (Int256Value) DeepRemove

func (Int256Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Int256Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Int256Value) GetMember

func (v Int256Value) GetMember(context MemberAccessibleContext, name string) Value

func (Int256Value) GetMethod added in v1.4.0

func (v Int256Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Int256Value) Greater

func (v Int256Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int256Value) GreaterEqual

func (v Int256Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int256Value) HashInput

func (v Int256Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (Int256Value) IsResourceKinded

func (Int256Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Int256Value) IsValue added in v1.4.0

func (Int256Value) IsValue()

func (Int256Value) Less

func (Int256Value) LessEqual

func (v Int256Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int256Value) MeteredString

func (v Int256Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Int256Value) Minus

func (Int256Value) Mod

func (Int256Value) Mul

func (Int256Value) NeedsStoreTo

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

func (Int256Value) Negate

func (Int256Value) Plus

func (Int256Value) RecursiveString

func (v Int256Value) RecursiveString(_ SeenReferences) string

func (Int256Value) RemoveMember

func (Int256Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Int256Value) SaturatingDiv

func (v Int256Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int256Value) SaturatingMinus

func (v Int256Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int256Value) SaturatingMul

func (v Int256Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int256Value) SaturatingPlus

func (v Int256Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int256Value) SetMember

func (Int256Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Int256Value) StaticType

func (Int256Value) StaticType(context ValueStaticTypeContext) 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() int

func (Int256Value) Transfer

func (v Int256Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Int256Value) Walk

func (Int256Value) Walk(_ ValueWalkContext, _ func(Value))

type Int32Value

type Int32Value int32

func ConvertInt32

func ConvertInt32(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (Int32Value) BitwiseAnd

func (v Int32Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int32Value) BitwiseLeftShift

func (v Int32Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int32Value) BitwiseOr

func (v Int32Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int32Value) BitwiseRightShift

func (v Int32Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int32Value) BitwiseXor

func (v Int32Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int32Value) ByteSize

func (v Int32Value) ByteSize() uint32

func (Int32Value) ChildStorables

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

func (Int32Value) Clone

func (v Int32Value) Clone(_ ValueCloneContext) Value

func (Int32Value) ConformsToStaticType

func (Int32Value) DeepRemove

func (Int32Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Int32Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Int32Value) GetMember

func (v Int32Value) GetMember(context MemberAccessibleContext, name string) Value

func (Int32Value) GetMethod added in v1.4.0

func (v Int32Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Int32Value) Greater

func (v Int32Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int32Value) GreaterEqual

func (v Int32Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int32Value) HashInput

func (v Int32Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (Int32Value) IsResourceKinded

func (Int32Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Int32Value) IsValue added in v1.4.0

func (Int32Value) IsValue()

func (Int32Value) Less

func (Int32Value) LessEqual

func (v Int32Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int32Value) MeteredString

func (v Int32Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Int32Value) Minus

func (Int32Value) Mod

func (Int32Value) Mul

func (Int32Value) NeedsStoreTo

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

func (Int32Value) Negate

func (Int32Value) Plus

func (Int32Value) RecursiveString

func (v Int32Value) RecursiveString(_ SeenReferences) string

func (Int32Value) RemoveMember

func (Int32Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Int32Value) SaturatingDiv

func (v Int32Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int32Value) SaturatingMinus

func (v Int32Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int32Value) SaturatingMul

func (v Int32Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int32Value) SaturatingPlus

func (v Int32Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int32Value) SetMember

func (Int32Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Int32Value) StaticType

func (Int32Value) StaticType(context ValueStaticTypeContext) 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() int

func (Int32Value) Transfer

func (v Int32Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Int32Value) Walk

func (Int32Value) Walk(_ ValueWalkContext, _ func(Value))

type Int64Value

type Int64Value int64

func ConvertInt64

func ConvertInt64(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (Int64Value) BitwiseAnd

func (v Int64Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int64Value) BitwiseLeftShift

func (v Int64Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int64Value) BitwiseOr

func (v Int64Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int64Value) BitwiseRightShift

func (v Int64Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int64Value) BitwiseXor

func (v Int64Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int64Value) ByteSize

func (v Int64Value) ByteSize() uint32

func (Int64Value) ChildStorables

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

func (Int64Value) Clone

func (v Int64Value) Clone(_ ValueCloneContext) Value

func (Int64Value) ConformsToStaticType

func (Int64Value) DeepRemove

func (Int64Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Int64Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Int64Value) GetMember

func (v Int64Value) GetMember(context MemberAccessibleContext, name string) Value

func (Int64Value) GetMethod added in v1.4.0

func (v Int64Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Int64Value) Greater

func (v Int64Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int64Value) GreaterEqual

func (v Int64Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int64Value) HashInput

func (v Int64Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (Int64Value) IsResourceKinded

func (Int64Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Int64Value) IsValue added in v1.4.0

func (Int64Value) IsValue()

func (Int64Value) Less

func (Int64Value) LessEqual

func (v Int64Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int64Value) MeteredString

func (v Int64Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Int64Value) Minus

func (Int64Value) Mod

func (Int64Value) Mul

func (Int64Value) NeedsStoreTo

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

func (Int64Value) Negate

func (Int64Value) Plus

func (Int64Value) RecursiveString

func (v Int64Value) RecursiveString(_ SeenReferences) string

func (Int64Value) RemoveMember

func (Int64Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Int64Value) SaturatingDiv

func (v Int64Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int64Value) SaturatingMinus

func (v Int64Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int64Value) SaturatingMul

func (v Int64Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int64Value) SaturatingPlus

func (v Int64Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int64Value) SetMember

func (Int64Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Int64Value) StaticType

func (Int64Value) StaticType(context ValueStaticTypeContext) 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() int

func (Int64Value) Transfer

func (v Int64Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Int64Value) Walk

func (Int64Value) Walk(_ ValueWalkContext, _ func(Value))

type Int8Value

type Int8Value int8

func ConvertInt8

func ConvertInt8(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (Int8Value) BitwiseAnd

func (v Int8Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int8Value) BitwiseLeftShift

func (v Int8Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int8Value) BitwiseOr

func (v Int8Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int8Value) BitwiseRightShift

func (v Int8Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int8Value) BitwiseXor

func (v Int8Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Int8Value) ByteSize

func (v Int8Value) ByteSize() uint32

func (Int8Value) ChildStorables

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

func (Int8Value) Clone

func (v Int8Value) Clone(_ ValueCloneContext) Value

func (Int8Value) ConformsToStaticType

func (Int8Value) DeepRemove

func (Int8Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Int8Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Int8Value) GetMember

func (v Int8Value) GetMember(context MemberAccessibleContext, name string) Value

func (Int8Value) GetMethod added in v1.4.0

func (v Int8Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Int8Value) Greater

func (v Int8Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int8Value) GreaterEqual

func (v Int8Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int8Value) HashInput

func (v Int8Value) HashInput(_ common.Gauge, scratch []byte) []byte

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

func (Int8Value) IsImportable

func (Int8Value) IsImportable(_ ValueImportableContext) bool

func (Int8Value) IsResourceKinded

func (Int8Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Int8Value) IsValue added in v1.4.0

func (Int8Value) IsValue()

func (Int8Value) Less

func (Int8Value) LessEqual

func (v Int8Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Int8Value) MeteredString

func (v Int8Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Int8Value) Minus

func (Int8Value) Mod

func (Int8Value) Mul

func (Int8Value) NeedsStoreTo

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

func (Int8Value) Negate

func (Int8Value) Plus

func (Int8Value) RecursiveString

func (v Int8Value) RecursiveString(_ SeenReferences) string

func (Int8Value) RemoveMember

func (Int8Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Int8Value) SaturatingDiv

func (v Int8Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int8Value) SaturatingMinus

func (v Int8Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int8Value) SaturatingMul

func (v Int8Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int8Value) SaturatingPlus

func (v Int8Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (Int8Value) SetMember

func (Int8Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Int8Value) StaticType

func (Int8Value) StaticType(context ValueStaticTypeContext) 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() int

func (Int8Value) Transfer

func (v Int8Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Int8Value) Walk

func (Int8Value) Walk(_ ValueWalkContext, _ func(Value))

type IntValue

type IntValue struct {
	values.IntValue
}

func ConvertInt

func ConvertInt(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (IntValue) BitwiseAnd

func (v IntValue) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (IntValue) BitwiseLeftShift

func (v IntValue) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (IntValue) BitwiseOr

func (v IntValue) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (IntValue) BitwiseRightShift

func (v IntValue) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (IntValue) BitwiseXor

func (v IntValue) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (IntValue) ByteLength

func (v IntValue) ByteLength() int

func (IntValue) Clone

func (v IntValue) Clone(_ ValueCloneContext) Value

func (IntValue) ConformsToStaticType

func (IntValue) DeepRemove

func (IntValue) DeepRemove(_ ValueRemoveContext, _ bool)

func (IntValue) Div

func (IntValue) Equal

func (v IntValue) Equal(context ValueComparisonContext, other Value) bool

func (IntValue) GetMember

func (v IntValue) GetMember(context MemberAccessibleContext, name string) Value

func (IntValue) GetMethod added in v1.4.0

func (v IntValue) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (IntValue) Greater

func (v IntValue) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (IntValue) GreaterEqual

func (v IntValue) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (IntValue) HashInput

func (v IntValue) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (IntValue) IsResourceKinded

func (IntValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (IntValue) IsValue added in v1.4.0

func (IntValue) IsValue()

func (IntValue) Less

func (IntValue) LessEqual

func (v IntValue) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (IntValue) MeteredString

func (v IntValue) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (IntValue) Minus

func (IntValue) Mod

func (IntValue) Mul

func (IntValue) NeedsStoreTo

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

func (IntValue) Negate

func (IntValue) Plus

func (IntValue) RecursiveString

func (v IntValue) RecursiveString(_ SeenReferences) string

func (IntValue) RemoveMember

func (IntValue) RemoveMember(_ ValueTransferContext, _ string) Value

func (IntValue) SaturatingDiv

func (v IntValue) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (IntValue) SaturatingMinus

func (v IntValue) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (IntValue) SaturatingMul

func (v IntValue) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (IntValue) SaturatingPlus

func (v IntValue) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (IntValue) SetMember

func (IntValue) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (IntValue) StaticType

func (IntValue) StaticType(context ValueStaticTypeContext) StaticType

func (IntValue) ToBigInt

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

func (IntValue) ToInt

func (v IntValue) ToInt() int

func (IntValue) ToUint32

func (v IntValue) ToUint32() uint32

func (IntValue) Transfer

func (v IntValue) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (IntValue) Walk

func (IntValue) Walk(_ ValueWalkContext, _ func(Value))

type IntegerValue

type IntegerValue interface {
	NumberValue
	BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue
	BitwiseXor(context ValueStaticTypeContext, other IntegerValue) IntegerValue
	BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue
	BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue
	BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue
}

func GetSmallIntegerValue

func GetSmallIntegerValue(value int8, staticType StaticType) IntegerValue

type InterfaceMissingLocationError

type InterfaceMissingLocationError struct {
	QualifiedIdentifier string
	LocationRange
}

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

func (*InterfaceMissingLocationError) Error

func (*InterfaceMissingLocationError) IsUserError

func (*InterfaceMissingLocationError) IsUserError()

func (*InterfaceMissingLocationError) SetLocationRange added in v1.8.0

func (e *InterfaceMissingLocationError) SetLocationRange(locationRange LocationRange)

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

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(context ValueVisitContext, visitor Visitor)

func (*InterpretedFunctionValue) Clone

func (*InterpretedFunctionValue) ConformsToStaticType

func (*InterpretedFunctionValue) DeepRemove

func (*InterpretedFunctionValue) FunctionType

func (*InterpretedFunctionValue) Invoke added in v1.4.0

func (f *InterpretedFunctionValue) Invoke(invocation Invocation) Value

func (*InterpretedFunctionValue) IsFunctionValue added in v1.4.0

func (*InterpretedFunctionValue) IsFunctionValue()

func (*InterpretedFunctionValue) IsImportable

func (*InterpretedFunctionValue) IsResourceKinded

func (*InterpretedFunctionValue) IsValue added in v1.4.0

func (*InterpretedFunctionValue) IsValue()

func (*InterpretedFunctionValue) MeteredString

func (f *InterpretedFunctionValue) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (*InterpretedFunctionValue) NeedsStoreTo

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

func (*InterpretedFunctionValue) RecursiveString

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

func (*InterpretedFunctionValue) StaticType

func (*InterpretedFunctionValue) Storable

func (*InterpretedFunctionValue) String

func (f *InterpretedFunctionValue) String() string

func (*InterpretedFunctionValue) Transfer

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

func (*InterpretedFunctionValue) Walk

func (f *InterpretedFunctionValue) Walk(_ ValueWalkContext, _ func(Value))

type Interpreter

type Interpreter struct {
	Location    common.Location
	Program     *Program
	SharedState *SharedState
	Globals     GlobalVariables

	Transactions []*HostFunctionValue

	Tracer
	// 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) CallStack

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

func (*Interpreter) CallStackLocations added in v1.7.0

func (interpreter *Interpreter) CallStackLocations() []LocationRange

func (*Interpreter) ClearReferencedResourceKindedValues added in v1.4.0

func (interpreter *Interpreter) ClearReferencedResourceKindedValues(valueID atree.ValueID)

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) DefaultDestroyEvents added in v1.7.0

func (interpreter *Interpreter) DefaultDestroyEvents(resourceValue *CompositeValue) []*CompositeValue

func (*Interpreter) EmitEvent added in v1.5.0

func (interpreter *Interpreter) EmitEvent(
	context ValueExportContext,
	eventType *sema.CompositeType,
	eventFields []Value,
)

func (*Interpreter) EnforceNotResourceDestruction added in v1.4.0

func (interpreter *Interpreter) EnforceNotResourceDestruction(valueID atree.ValueID)

func (*Interpreter) EnsureLoaded

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

func (*Interpreter) FindVariable

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

func (*Interpreter) GetAccountHandlerFunc added in v1.6.2

func (interpreter *Interpreter) GetAccountHandlerFunc() AccountHandlerFunc

func (*Interpreter) GetCapabilityBorrowHandler added in v1.6.2

func (interpreter *Interpreter) GetCapabilityBorrowHandler() CapabilityBorrowHandlerFunc

func (*Interpreter) GetCapabilityCheckHandler added in v1.4.0

func (interpreter *Interpreter) GetCapabilityCheckHandler() CapabilityCheckHandlerFunc

func (*Interpreter) GetCapabilityControllerIterations added in v1.4.0

func (interpreter *Interpreter) GetCapabilityControllerIterations() map[AddressPath]int

func (*Interpreter) GetCompositeType

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

func (*Interpreter) GetCompositeValueFunctions

func (interpreter *Interpreter) GetCompositeValueFunctions(v *CompositeValue) *FunctionOrderedMap

func (*Interpreter) GetContractComposite

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

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

func (*Interpreter) GetContractValue added in v1.4.0

func (interpreter *Interpreter) GetContractValue(contractLocation common.AddressLocation) *CompositeValue

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) GetGlobal added in v1.5.0

func (interpreter *Interpreter) GetGlobal(name string) Value

func (*Interpreter) GetGlobalType added in v1.5.0

func (interpreter *Interpreter) GetGlobalType(name string) (*sema.Variable, bool)

func (*Interpreter) GetInjectedCompositeFieldsHandler added in v1.6.2

func (interpreter *Interpreter) GetInjectedCompositeFieldsHandler() InjectedCompositeFieldsHandlerFunc

func (*Interpreter) GetInterfaceType

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

func (*Interpreter) GetLocation added in v1.4.0

func (interpreter *Interpreter) GetLocation() common.Location

func (*Interpreter) GetMemberAccessContextForLocation added in v1.4.0

func (interpreter *Interpreter) GetMemberAccessContextForLocation(location common.Location) MemberAccessibleContext

func (*Interpreter) GetMethod added in v1.4.0

func (interpreter *Interpreter) GetMethod(value MemberAccessibleValue, name string) FunctionValue

func (*Interpreter) GetResourceDestructionContextForLocation added in v1.4.0

func (interpreter *Interpreter) GetResourceDestructionContextForLocation(location common.Location) ResourceDestructionContext

func (*Interpreter) GetValidateAccountCapabilitiesGetHandler added in v1.6.2

func (interpreter *Interpreter) GetValidateAccountCapabilitiesGetHandler() ValidateAccountCapabilitiesGetHandlerFunc

func (*Interpreter) GetValidateAccountCapabilitiesPublishHandler added in v1.6.2

func (interpreter *Interpreter) GetValidateAccountCapabilitiesPublishHandler() ValidateAccountCapabilitiesPublishHandlerFunc

func (*Interpreter) GetValueOfVariable added in v1.4.0

func (interpreter *Interpreter) GetValueOfVariable(name string) Value

func (*Interpreter) InStorageIteration added in v1.4.0

func (interpreter *Interpreter) InStorageIteration() bool

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) InvokeFunction

func (interpreter *Interpreter) InvokeFunction(
	_ FunctionValue,
	_ []Value,
) Value

func (*Interpreter) InvokeTransaction

func (interpreter *Interpreter) InvokeTransaction(arguments []Value, signers ...Value) (err error)

func (*Interpreter) IsTypeInfoRecovered added in v1.4.0

func (interpreter *Interpreter) IsTypeInfoRecovered(location common.Location) bool

func (*Interpreter) LocationRange added in v1.8.0

func (interpreter *Interpreter) LocationRange() LocationRange

func (*Interpreter) MaybeTrackReferencedResourceKindedValue added in v1.4.0

func (interpreter *Interpreter) MaybeTrackReferencedResourceKindedValue(referenceValue *EphemeralReferenceValue)

func (*Interpreter) MaybeUpdateStorageReferenceMemberReceiver added in v1.7.0

func (interpreter *Interpreter) MaybeUpdateStorageReferenceMemberReceiver(
	storageReference *StorageReferenceValue,
	referencedValue Value,
	member Value,
) Value

func (*Interpreter) MaybeValidateAtreeStorage added in v1.4.0

func (interpreter *Interpreter) MaybeValidateAtreeStorage()

func (*Interpreter) MaybeValidateAtreeValue added in v1.4.0

func (interpreter *Interpreter) MaybeValidateAtreeValue(v atree.Value)

func (*Interpreter) MeterComputation added in v1.5.0

func (interpreter *Interpreter) MeterComputation(usage common.ComputationUsage) error

MeterComputation delegates the computation usage to the interpreter's computation gauge, if any.

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) MutationDuringCapabilityControllerIteration added in v1.4.0

func (interpreter *Interpreter) MutationDuringCapabilityControllerIteration() bool

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) OnResourceOwnerChange added in v1.4.0

func (interpreter *Interpreter) OnResourceOwnerChange(resource *CompositeValue, oldOwner common.Address, newOwner common.Address)

func (*Interpreter) ReadStored

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

func (*Interpreter) RecordStorageMutation added in v1.4.0

func (interpreter *Interpreter) RecordStorageMutation()

func (*Interpreter) RecoverErrors

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

func (*Interpreter) ReferencedResourceKindedValues added in v1.4.0

func (interpreter *Interpreter) ReferencedResourceKindedValues(valueID atree.ValueID) map[*EphemeralReferenceValue]struct{}

func (*Interpreter) SemaAccessFromStaticAuthorization added in v1.8.4

func (interpreter *Interpreter) SemaAccessFromStaticAuthorization(auth Authorization) (sema.Access, error)

func (*Interpreter) SemaTypeFromStaticType added in v1.7.0

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

func (*Interpreter) SetAttachmentIteration added in v1.4.0

func (interpreter *Interpreter) SetAttachmentIteration(base *CompositeValue, state bool) (oldState bool)

func (*Interpreter) SetInStorageIteration added in v1.4.0

func (interpreter *Interpreter) SetInStorageIteration(inStorageIteration bool)

func (*Interpreter) SetMutationDuringCapabilityControllerIteration added in v1.4.0

func (interpreter *Interpreter) SetMutationDuringCapabilityControllerIteration()

func (*Interpreter) Storage

func (interpreter *Interpreter) Storage() Storage

func (*Interpreter) StorageMutatedDuringIteration added in v1.4.0

func (interpreter *Interpreter) StorageMutatedDuringIteration() bool

func (*Interpreter) ValidateAtreeValue

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

func (*Interpreter) ValidateContainerMutation added in v1.7.0

func (interpreter *Interpreter) ValidateContainerMutation(valueID atree.ValueID)

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, isStatement bool) 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) VisitStringTemplateExpression added in v1.3.0

func (interpreter *Interpreter) VisitStringTemplateExpression(expression *ast.StringTemplateExpression) 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) WithContainerMutationPrevention added in v1.7.0

func (interpreter *Interpreter) WithContainerMutationPrevention(valueID atree.ValueID, f func())

func (*Interpreter) WithResourceDestruction added in v1.4.0

func (interpreter *Interpreter) WithResourceDestruction(valueID atree.ValueID, f func())

func (*Interpreter) WriteStored

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

type InterpreterImport

type InterpreterImport struct {
	Interpreter *Interpreter
}

type InterpreterTypeArgumentsIterator added in v1.8.0

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

func NewInterpreterTypeArgumentsIterator added in v1.8.0

func NewInterpreterTypeArgumentsIterator(
	memoryGauge common.MemoryGauge,
	typeArguments *sema.TypeParameterTypeOrderedMap,
) *InterpreterTypeArgumentsIterator

func (*InterpreterTypeArgumentsIterator) NextSema added in v1.8.0

func (*InterpreterTypeArgumentsIterator) NextStatic added in v1.8.0

type IntersectionStaticType

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

func NewIntersectionStaticType

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

func (*IntersectionStaticType) Encode

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()

func (*InvalidAttachmentOperationTargetError) SetLocationRange added in v1.5.0

func (e *InvalidAttachmentOperationTargetError) SetLocationRange(locationRange LocationRange)

type InvalidCapabilityIDError

type InvalidCapabilityIDError struct {
	LocationRange
}

func (*InvalidCapabilityIDError) Error

func (e *InvalidCapabilityIDError) Error() string

func (*InvalidCapabilityIDError) IsInternalError

func (*InvalidCapabilityIDError) IsInternalError()

func (*InvalidCapabilityIDError) SetLocationRange added in v1.8.0

func (e *InvalidCapabilityIDError) SetLocationRange(locationRange LocationRange)

type InvalidCapabilityIssueTypeError

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

InvalidCapabilityIssueTypeError

func (*InvalidCapabilityIssueTypeError) Error

func (*InvalidCapabilityIssueTypeError) IsUserError

func (*InvalidCapabilityIssueTypeError) IsUserError()

func (*InvalidCapabilityIssueTypeError) SetLocationRange added in v1.5.0

func (e *InvalidCapabilityIssueTypeError) SetLocationRange(locationRange LocationRange)

type InvalidHexByteError

type InvalidHexByteError struct {
	LocationRange
	Byte byte
}

InvalidHexByteError

func (*InvalidHexByteError) Error

func (e *InvalidHexByteError) Error() string

func (*InvalidHexByteError) IsUserError

func (*InvalidHexByteError) IsUserError()

func (*InvalidHexByteError) SetLocationRange added in v1.5.0

func (e *InvalidHexByteError) SetLocationRange(locationRange LocationRange)

type InvalidHexLengthError

type InvalidHexLengthError struct {
	LocationRange
}

InvalidHexLengthError

func (*InvalidHexLengthError) Error

func (*InvalidHexLengthError) Error() string

func (*InvalidHexLengthError) IsUserError

func (*InvalidHexLengthError) IsUserError()

func (*InvalidHexLengthError) SetLocationRange added in v1.5.0

func (e *InvalidHexLengthError) SetLocationRange(locationRange LocationRange)

type InvalidMemberReferenceError

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

InvalidMemberReferenceError

func (*InvalidMemberReferenceError) Error

func (*InvalidMemberReferenceError) IsUserError

func (*InvalidMemberReferenceError) IsUserError()

func (*InvalidMemberReferenceError) SetLocationRange added in v1.5.0

func (e *InvalidMemberReferenceError) SetLocationRange(locationRange LocationRange)

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()

func (*InvalidOperandsError) SetLocationRange added in v1.5.0

func (e *InvalidOperandsError) SetLocationRange(locationRange LocationRange)

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

func (*InvalidPathDomainError) SetLocationRange added in v1.5.0

func (e *InvalidPathDomainError) SetLocationRange(locationRange LocationRange)

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) SetLocationRange added in v1.5.0

func (e *InvalidPublicKeyError) SetLocationRange(locationRange LocationRange)

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()

func (*InvalidSliceIndexError) SetLocationRange added in v1.5.0

func (e *InvalidSliceIndexError) SetLocationRange(locationRange LocationRange)

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()

func (*InvalidatedResourceError) SetLocationRange added in v1.5.0

func (e *InvalidatedResourceError) SetLocationRange(locationRange LocationRange)

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()

func (*InvalidatedResourceReferenceError) SetLocationRange added in v1.5.0

func (e *InvalidatedResourceReferenceError) SetLocationRange(locationRange LocationRange)

type Invocation

type Invocation struct {
	LocationRange     LocationRange
	Self              *Value
	Base              *EphemeralReferenceValue
	TypeArguments     *sema.TypeParameterTypeOrderedMap
	InvocationContext InvocationContext
	Arguments         []Value
	ArgumentTypes     []sema.Type
}

Invocation

func NewInvocation

func NewInvocation(
	invocationContext InvocationContext,
	self *Value,
	base *EphemeralReferenceValue,
	arguments []Value,
	argumentTypes []sema.Type,
	typeArguments *sema.TypeParameterTypeOrderedMap,
	locationRange LocationRange,
) Invocation

type InvocationContext added in v1.4.0

InvocationContext is a composite of all contexts, since function invocations can perform various operations, and hence need to provide all possible contexts to it.

type IterableValue

type IterableValue interface {
	Value
	ForEach(
		context IterableValueForeachContext,
		elementType sema.Type,
		function func(value Value) (resume bool),
		transferElements bool,
	)
	Iterator(context ValueStaticTypeContext) ValueIterator
}

IterableValue is a value which can be iterated over, e.g. with a for-loop

type IterableValueForeachContext added in v1.4.0

type IterableValueForeachContext interface {
	ValueTransferContext
}

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 LocationRangeProvider added in v1.8.0

type LocationRangeProvider interface {
	LocationRange() LocationRange
}

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()

func (*MemberAccessTypeError) SetLocationRange added in v1.5.0

func (e *MemberAccessTypeError) SetLocationRange(locationRange LocationRange)

type MemberAccessibleContext added in v1.4.0

type MemberAccessibleContext interface {
	FunctionCreationContext
	ArrayCreationContext
	ResourceDestructionHandler
	AccountHandlerContext
	CapabilityControllerIterationContext
	AccountContractBorrowContext
	AttachmentContext

	GetInjectedCompositeFieldsHandler() InjectedCompositeFieldsHandlerFunc
	GetMemberAccessContextForLocation(location common.Location) MemberAccessibleContext

	GetMethod(value MemberAccessibleValue, name string) FunctionValue
	MaybeUpdateStorageReferenceMemberReceiver(
		storageReference *StorageReferenceValue,
		referencedValue Value,
		member Value,
	) Value
}

type MemberAccessibleValue

type MemberAccessibleValue interface {
	Value
	GetMember(context MemberAccessibleContext, name string) Value
	RemoveMember(context ValueTransferContext, name string) Value
	// SetMember returns whether a value previously existed with this name.
	SetMember(context ValueTransferContext, name string, value Value) bool
	// GetMethod returns member functions of this value.
	// IMPORTANT: This method is for internal use only. Always use `GetMember` to retrieve a member of any kind.
	GetMethod(context MemberAccessibleContext, name string) FunctionValue
}

type NativeFunction added in v1.8.0

type NativeFunction func(
	context NativeFunctionContext,
	typeArguments TypeArgumentsIterator,
	receiver Value,
	args []Value,
) Value

func NativeAccountStorageBorrowFunction added in v1.8.0

func NativeAccountStorageBorrowFunction(
	addressPointer *AddressValue,
) NativeFunction

func NativeAccountStorageCheckFunction added in v1.8.0

func NativeAccountStorageCheckFunction(
	addressPointer *AddressValue,
) NativeFunction

func NativeAccountStorageIterateFunction added in v1.8.0

func NativeAccountStorageIterateFunction(
	addressPointer *AddressValue,
	domain common.PathDomain,
	pathType sema.Type,
) NativeFunction

func NativeAccountStorageReadFunction added in v1.8.0

func NativeAccountStorageReadFunction(
	addressPointer *AddressValue,
	clear bool,
) NativeFunction

func NativeAccountStorageSaveFunction added in v1.8.0

func NativeAccountStorageSaveFunction(
	addressPointer *AddressValue,
) NativeFunction

func NativeAccountStorageTypeFunction added in v1.8.0

func NativeAccountStorageTypeFunction(
	addressPointer *AddressValue,
) NativeFunction

func NativeCapabilityBorrowFunction added in v1.8.0

func NativeCapabilityBorrowFunction(
	addressValuePointer *AddressValue,
	capabilityIDPointer *UInt64Value,
	capabilityBorrowTypePointer *sema.ReferenceType,
) NativeFunction

func NativeCapabilityCheckFunction added in v1.8.0

func NativeCapabilityCheckFunction(
	addressValuePointer *AddressValue,
	capabilityIDPointer *UInt64Value,
	capabilityBorrowTypePointer *sema.ReferenceType,
) NativeFunction

func NativeConverterFunction added in v1.8.0

func NativeConverterFunction(convert func(memoryGauge common.MemoryGauge, value Value) Value) NativeFunction

func NativeFromBigEndianBytesFunction added in v1.8.0

func NativeFromBigEndianBytesFunction(byteLength uint, converter func(memoryGauge common.MemoryGauge, bytes []byte) Value) NativeFunction

func NativeFromStringFunction added in v1.8.0

func NativeFromStringFunction(parser StringValueParser) NativeFunction

func NewNativeDeletionCheckedAccountCapabilityControllerFunction added in v1.8.0

func NewNativeDeletionCheckedAccountCapabilityControllerFunction(
	f NativeFunction,
) NativeFunction

func NewNativeDeletionCheckedStorageCapabilityControllerFunction added in v1.8.0

func NewNativeDeletionCheckedStorageCapabilityControllerFunction(
	f NativeFunction,
) NativeFunction

func NewNativeDeployedContractPublicTypesFunctionValue added in v1.8.0

func NewNativeDeployedContractPublicTypesFunctionValue(
	addressPointer *common.Address,
	name *StringValue,
) NativeFunction

type NativeFunctionContext added in v1.8.0

minimal interfaces needed by all native functions

type NegativeShiftError added in v1.3.1

type NegativeShiftError struct {
	LocationRange
}

func (*NegativeShiftError) Error added in v1.3.1

func (e *NegativeShiftError) Error() string

func (*NegativeShiftError) IsUserError added in v1.3.1

func (*NegativeShiftError) IsUserError()

func (*NegativeShiftError) SetLocationRange added in v1.5.0

func (e *NegativeShiftError) SetLocationRange(locationRange LocationRange)

type NestedReferenceError

type NestedReferenceError struct {
	Value ReferenceValue
	LocationRange
}

NestedReferenceError

func (*NestedReferenceError) Error

func (e *NestedReferenceError) Error() string

func (*NestedReferenceError) IsUserError

func (*NestedReferenceError) IsUserError()

func (*NestedReferenceError) SetLocationRange added in v1.5.0

func (e *NestedReferenceError) SetLocationRange(locationRange LocationRange)

type NilValue

type NilValue struct{}

func (NilValue) Accept

func (v NilValue) Accept(context ValueVisitContext, visitor Visitor)

func (NilValue) ByteSize

func (v NilValue) ByteSize() uint32

func (NilValue) ChildStorables

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

func (NilValue) Clone

func (v NilValue) Clone(_ ValueCloneContext) Value

func (NilValue) ConformsToStaticType

func (NilValue) DeepRemove

func (NilValue) DeepRemove(_ ValueRemoveContext, _ bool)

func (NilValue) Destroy

func (v NilValue) Destroy(_ ResourceDestructionContext)

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(_ ValueComparisonContext, other Value) bool

func (NilValue) GetMember

func (v NilValue) GetMember(context MemberAccessibleContext, name string) Value

func (NilValue) GetMethod added in v1.4.0

func (NilValue) InnerValueType added in v1.5.0

func (v NilValue) InnerValueType(_ ValueStaticTypeContext) sema.Type

func (NilValue) IsDestroyed

func (NilValue) IsDestroyed() bool

func (NilValue) IsImportable

func (NilValue) IsImportable(_ ValueImportableContext) bool

func (NilValue) IsResourceKinded

func (NilValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (NilValue) IsStorable

func (NilValue) IsStorable() bool

func (NilValue) IsValue added in v1.4.0

func (NilValue) IsValue()

func (NilValue) MeteredString

func (v NilValue) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) 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(_ ValueTransferContext, _ string) Value

func (NilValue) SetMember

func (NilValue) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (NilValue) StaticType

func (NilValue) StaticType(context ValueStaticTypeContext) StaticType

func (NilValue) Storable

func (v NilValue) Storable(_ atree.SlabStorage, _ atree.Address, _ uint32) (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(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (NilValue) Walk

func (NilValue) Walk(_ ValueWalkContext, _ func(Value))

type NoOpStringContext added in v1.4.0

type NoOpStringContext struct {
	NoOpTracer
}

NoOpStringContext is the ValueStringContext implementation used in Value.RecursiveString method. Since Value.RecursiveString is a non-mutating operation, it should only need the no-op memory metering and a WithMutationPrevention implementation. All other methods should not be reachable, hence is safe to panic in them.

TODO: Ideally, Value.RecursiveString shouldn't need the full ValueTransferContext. But that would require refactoring the iterator methods for arrays and dictionaries.

func (NoOpStringContext) ClearReferencedResourceKindedValues added in v1.4.0

func (NoOpStringContext) ClearReferencedResourceKindedValues(_ atree.ValueID)

func (NoOpStringContext) EnforceNotResourceDestruction added in v1.4.0

func (NoOpStringContext) EnforceNotResourceDestruction(_ atree.ValueID)

func (NoOpStringContext) GetCompositeType added in v1.4.0

func (NoOpStringContext) GetCompositeType(_ common.Location, _ string, _ TypeID) (*sema.CompositeType, error)

func (NoOpStringContext) GetEntitlementMapType added in v1.4.0

func (NoOpStringContext) GetEntitlementMapType(_ TypeID) (*sema.EntitlementMapType, error)

func (NoOpStringContext) GetEntitlementType added in v1.4.0

func (NoOpStringContext) GetEntitlementType(_ TypeID) (*sema.EntitlementType, error)

func (NoOpStringContext) GetInterfaceType added in v1.4.0

func (NoOpStringContext) GetInterfaceType(_ common.Location, _ string, _ TypeID) (*sema.InterfaceType, error)

func (NoOpStringContext) InStorageIteration added in v1.4.0

func (NoOpStringContext) InStorageIteration() bool

func (NoOpStringContext) IsTypeInfoRecovered added in v1.4.0

func (NoOpStringContext) IsTypeInfoRecovered(_ common.Location) bool

func (NoOpStringContext) MaybeTrackReferencedResourceKindedValue added in v1.4.0

func (NoOpStringContext) MaybeTrackReferencedResourceKindedValue(_ *EphemeralReferenceValue)

func (NoOpStringContext) MaybeValidateAtreeStorage added in v1.4.0

func (NoOpStringContext) MaybeValidateAtreeStorage()

func (NoOpStringContext) MaybeValidateAtreeValue added in v1.4.0

func (NoOpStringContext) MaybeValidateAtreeValue(_ atree.Value)

func (NoOpStringContext) MeterComputation added in v1.5.0

func (NoOpStringContext) MeterComputation(_ common.ComputationUsage) error

func (NoOpStringContext) MeterMemory added in v1.4.0

func (NoOpStringContext) MeterMemory(_ common.MemoryUsage) error

func (NoOpStringContext) OnResourceOwnerChange added in v1.4.0

func (NoOpStringContext) OnResourceOwnerChange(_ *CompositeValue, _ common.Address, _ common.Address)

func (NoOpStringContext) ReadStored added in v1.4.0

func (NoOpStringContext) RecordStorageMutation added in v1.4.0

func (NoOpStringContext) RecordStorageMutation()

func (NoOpStringContext) ReferencedResourceKindedValues added in v1.4.0

func (NoOpStringContext) ReferencedResourceKindedValues(_ atree.ValueID) map[*EphemeralReferenceValue]struct{}

func (NoOpStringContext) SemaAccessFromStaticAuthorization added in v1.8.4

func (NoOpStringContext) SemaAccessFromStaticAuthorization(Authorization) (sema.Access, error)

func (NoOpStringContext) SemaTypeFromStaticType added in v1.7.0

func (NoOpStringContext) SemaTypeFromStaticType(_ StaticType) sema.Type

func (NoOpStringContext) SetInStorageIteration added in v1.4.0

func (NoOpStringContext) SetInStorageIteration(_ bool)

func (NoOpStringContext) Storage added in v1.4.0

func (NoOpStringContext) Storage() Storage

func (NoOpStringContext) StorageMutatedDuringIteration added in v1.4.0

func (NoOpStringContext) StorageMutatedDuringIteration() bool

func (NoOpStringContext) ValidateContainerMutation added in v1.7.0

func (NoOpStringContext) ValidateContainerMutation(_ atree.ValueID)

func (NoOpStringContext) WithContainerMutationPrevention added in v1.7.0

func (NoOpStringContext) WithContainerMutationPrevention(_ atree.ValueID, f func())

func (NoOpStringContext) WriteStored added in v1.4.0

func (NoOpStringContext) WriteStored(_ common.Address, _ common.StorageDomain, _ StorageMapKey, _ Value) (existed bool)

type NoOpTracer added in v1.7.0

type NoOpTracer struct{}

func (NoOpTracer) ReportArrayValueConformsToStaticTypeTrace added in v1.7.0

func (NoOpTracer) ReportArrayValueConformsToStaticTypeTrace(_ string, _ string, _ time.Duration)

func (NoOpTracer) ReportArrayValueConstructTrace added in v1.7.0

func (NoOpTracer) ReportArrayValueConstructTrace(_ string, _ string, _ time.Duration)

func (NoOpTracer) ReportArrayValueDeepRemoveTrace added in v1.7.0

func (NoOpTracer) ReportArrayValueDeepRemoveTrace(_ string, _ string, _ time.Duration)

func (NoOpTracer) ReportArrayValueDestroyTrace added in v1.7.0

func (NoOpTracer) ReportArrayValueDestroyTrace(_ string, _ string, _ time.Duration)

func (NoOpTracer) ReportArrayValueTransferTrace added in v1.7.0

func (NoOpTracer) ReportArrayValueTransferTrace(_ string, _ string, _ time.Duration)

func (NoOpTracer) ReportAtreeNewArrayFromBatchDataTrace added in v1.8.0

func (NoOpTracer) ReportAtreeNewArrayFromBatchDataTrace(_ string, _ string, _ time.Duration)

func (NoOpTracer) ReportAtreeNewMapFromBatchDataTrace added in v1.8.0

func (NoOpTracer) ReportAtreeNewMapFromBatchDataTrace(_ string, _ string, _ uint64, _ time.Duration)

func (NoOpTracer) ReportAtreeNewMapTrace added in v1.8.0

func (NoOpTracer) ReportAtreeNewMapTrace(_ string, _ string, _ uint64, _ time.Duration)

func (NoOpTracer) ReportCompositeValueConformsToStaticTypeTrace added in v1.7.0

func (NoOpTracer) ReportCompositeValueConformsToStaticTypeTrace(_ string, _ string, _ string, _ time.Duration)

func (NoOpTracer) ReportCompositeValueConstructTrace added in v1.7.0

func (NoOpTracer) ReportCompositeValueConstructTrace(_ string, _ string, _ string, _ time.Duration)

func (NoOpTracer) ReportCompositeValueDeepRemoveTrace added in v1.7.0

func (NoOpTracer) ReportCompositeValueDeepRemoveTrace(_ string, _ string, _ string, _ time.Duration)

func (NoOpTracer) ReportCompositeValueDestroyTrace added in v1.7.0

func (NoOpTracer) ReportCompositeValueDestroyTrace(_ string, _ string, _ string, _ time.Duration)

func (NoOpTracer) ReportCompositeValueGetMemberTrace added in v1.7.0

func (NoOpTracer) ReportCompositeValueGetMemberTrace(_ string, _ string, _ string, _ string, _ time.Duration)

func (NoOpTracer) ReportCompositeValueRemoveMemberTrace added in v1.7.0

func (NoOpTracer) ReportCompositeValueRemoveMemberTrace(_ string, _ string, _ string, _ string, _ time.Duration)

func (NoOpTracer) ReportCompositeValueSetMemberTrace added in v1.7.0

func (NoOpTracer) ReportCompositeValueSetMemberTrace(_ string, _ string, _ string, _ string, _ time.Duration)

func (NoOpTracer) ReportCompositeValueTransferTrace added in v1.7.0

func (NoOpTracer) ReportCompositeValueTransferTrace(_ string, _ string, _ string, _ time.Duration)

func (NoOpTracer) ReportDictionaryValueConformsToStaticTypeTrace added in v1.7.0

func (NoOpTracer) ReportDictionaryValueConformsToStaticTypeTrace(_ string, _ string, _ time.Duration)

func (NoOpTracer) ReportDictionaryValueConstructTrace added in v1.7.0

func (NoOpTracer) ReportDictionaryValueConstructTrace(_ string, _ string, _ time.Duration)

func (NoOpTracer) ReportDictionaryValueDeepRemoveTrace added in v1.7.0

func (NoOpTracer) ReportDictionaryValueDeepRemoveTrace(_ string, _ string, _ time.Duration)

func (NoOpTracer) ReportDictionaryValueDestroyTrace added in v1.7.0

func (NoOpTracer) ReportDictionaryValueDestroyTrace(_ string, _ string, _ time.Duration)

func (NoOpTracer) ReportDictionaryValueGetMemberTrace added in v1.7.0

func (NoOpTracer) ReportDictionaryValueGetMemberTrace(_ string, _ string, _ string, _ time.Duration)

func (NoOpTracer) ReportDictionaryValueTransferTrace added in v1.7.0

func (NoOpTracer) ReportDictionaryValueTransferTrace(_ string, _ string, _ time.Duration)

func (NoOpTracer) ReportDomainStorageMapDeepRemoveTrace added in v1.7.0

func (NoOpTracer) ReportDomainStorageMapDeepRemoveTrace(_ string, _ string, _ time.Duration)

func (NoOpTracer) ReportEmitEventTrace added in v1.8.0

func (NoOpTracer) ReportEmitEventTrace(_ string, _ time.Duration)

func (NoOpTracer) ReportImportTrace added in v1.7.0

func (NoOpTracer) ReportImportTrace(_ string, _ time.Duration)

func (NoOpTracer) ReportInvokeTrace added in v1.8.0

func (NoOpTracer) ReportInvokeTrace(_ string, _ string, _ time.Duration)

type NonOptionalReferenceToNilError added in v1.3.4

type NonOptionalReferenceToNilError struct {
	ReferenceType sema.Type
	LocationRange
}

NonOptionalReferenceToNilError

func (*NonOptionalReferenceToNilError) Error added in v1.3.4

func (*NonOptionalReferenceToNilError) IsUserError added in v1.3.4

func (*NonOptionalReferenceToNilError) IsUserError()

func (*NonOptionalReferenceToNilError) SetLocationRange added in v1.5.0

func (e *NonOptionalReferenceToNilError) SetLocationRange(locationRange 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
	LocationRange
}

NonStorableStaticTypeError

func (*NonStorableStaticTypeError) Error

func (*NonStorableStaticTypeError) IsUserError

func (*NonStorableStaticTypeError) IsUserError()

func (*NonStorableStaticTypeError) SetLocationRange added in v1.8.0

func (e *NonStorableStaticTypeError) SetLocationRange(locationRange LocationRange)

type NonStorableValueError

type NonStorableValueError struct {
	Value Value
	LocationRange
}

NonStorableValueError

func (*NonStorableValueError) Error

func (e *NonStorableValueError) Error() string

func (*NonStorableValueError) IsUserError

func (*NonStorableValueError) IsUserError()

func (*NonStorableValueError) SetLocationRange added in v1.8.0

func (e *NonStorableValueError) SetLocationRange(locationRange LocationRange)

type NonTransferableValueError

type NonTransferableValueError struct {
	LocationRange
	Value Value
}

NonTransferableValueError

func (*NonTransferableValueError) Error

func (e *NonTransferableValueError) Error() string

func (*NonTransferableValueError) IsUserError

func (*NonTransferableValueError) IsUserError()

func (*NonTransferableValueError) SetLocationRange added in v1.8.0

func (e *NonTransferableValueError) SetLocationRange(locationRange LocationRange)

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

NumberValue

type NumberValueArithmeticContext added in v1.4.0

type NumberValueArithmeticContext interface {
	ValueStaticTypeContext
}

type OnEventEmittedFunc

type OnEventEmittedFunc func(
	context ValueExportContext,
	eventType *sema.CompositeType,
	eventFields []Value,
) 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 OnRecordTraceFunc

type OnRecordTraceFunc func(
	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.

func CombineOnStatementFuncs added in v1.8.0

func CombineOnStatementFuncs(funcs ...OnStatementFunc) OnStatementFunc

type OptionalStaticType

type OptionalStaticType struct {
	Type StaticType
}

func NewOptionalStaticType

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

func (*OptionalStaticType) Encode

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

	InnerValueType(context ValueStaticTypeContext) sema.Type
	// 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()

func (*OverflowError) SetLocationRange added in v1.5.0

func (e *OverflowError) SetLocationRange(locationRange LocationRange)

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()

func (*OverwriteError) SetLocationRange added in v1.5.0

func (e *OverwriteError) SetLocationRange(locationRange LocationRange)

type OwnedValue

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

OwnedValue is a value which has an owner

type ParameterizedStaticType added in v1.8.4

type ParameterizedStaticType interface {
	StaticType
	BaseType() StaticType
	TypeArguments() []StaticType
}

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(context ValueCloneContext) Value

func (*PathCapabilityValue) ConformsToStaticType

func (*PathCapabilityValue) DeepRemove

func (v *PathCapabilityValue) DeepRemove(context ValueRemoveContext, _ 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(context ValueComparisonContext, other Value) bool

func (*PathCapabilityValue) GetMember

func (v *PathCapabilityValue) GetMember(context MemberAccessibleContext, name string) Value

func (*PathCapabilityValue) GetMethod added in v1.4.0

func (*PathCapabilityValue) IsImportable

func (v *PathCapabilityValue) IsImportable(_ ValueImportableContext) bool

func (*PathCapabilityValue) IsResourceKinded

func (*PathCapabilityValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (*PathCapabilityValue) IsStorable

func (*PathCapabilityValue) IsStorable() bool

func (*PathCapabilityValue) IsValue added in v1.4.0

func (*PathCapabilityValue) IsValue()

func (*PathCapabilityValue) MeteredString

func (v *PathCapabilityValue) MeteredString(
	context ValueStringContext,
	seenReferences SeenReferences,
) 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) SetMember

func (*PathCapabilityValue) StaticType

func (v *PathCapabilityValue) StaticType(context ValueStaticTypeContext) StaticType

func (*PathCapabilityValue) Storable

func (v *PathCapabilityValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint32,
) (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(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*PathCapabilityValue) Walk

func (v *PathCapabilityValue) Walk(_ ValueWalkContext, walkChild func(Value))

type PathLinkValue deprecated

type PathLinkValue struct {
	Type       StaticType
	TargetPath PathValue
}

Deprecated: PathLinkValue

func (PathLinkValue) Accept

func (v PathLinkValue) Accept(_ ValueVisitContext, _ Visitor)

func (PathLinkValue) ByteSize

func (v PathLinkValue) ByteSize() uint32

func (PathLinkValue) ChildStorables

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

func (PathLinkValue) Clone

func (v PathLinkValue) Clone(context ValueCloneContext) Value

func (PathLinkValue) ConformsToStaticType

func (PathLinkValue) DeepRemove

func (PathLinkValue) DeepRemove(_ ValueRemoveContext, _ 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(context ValueComparisonContext, other Value) bool

func (PathLinkValue) IsImportable

func (PathLinkValue) IsImportable(_ ValueImportableContext) bool

func (PathLinkValue) IsResourceKinded

func (PathLinkValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (PathLinkValue) IsStorable

func (PathLinkValue) IsStorable() bool

func (PathLinkValue) IsValue added in v1.4.0

func (PathLinkValue) IsValue()

func (PathLinkValue) MeteredString

func (v PathLinkValue) MeteredString(
	_ ValueStringContext,
	_ SeenReferences,
) 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(context ValueStaticTypeContext) StaticType

func (PathLinkValue) Storable

func (v PathLinkValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint32) (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(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (PathLinkValue) Walk

func (v PathLinkValue) Walk(_ ValueWalkContext, _ func(Value))

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(context ValueVisitContext, visitor Visitor)

func (PathValue) ByteSize

func (v PathValue) ByteSize() uint32

func (PathValue) ChildStorables

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

func (PathValue) Clone

func (v PathValue) Clone(_ ValueCloneContext) Value

func (PathValue) ConformsToStaticType

func (PathValue) DeepRemove

func (PathValue) DeepRemove(_ ValueRemoveContext, _ 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(context ValueComparisonContext, other Value) bool

func (PathValue) GetMember

func (v PathValue) GetMember(context MemberAccessibleContext, name string) Value

func (PathValue) GetMethod added in v1.4.0

func (v PathValue) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (PathValue) HashInput

func (v PathValue) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (PathValue) IsResourceKinded

func (PathValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (PathValue) IsStorable

func (PathValue) IsStorable() bool

func (PathValue) IsValue added in v1.4.0

func (PathValue) IsValue()

func (PathValue) MeteredString

func (v PathValue) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) 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(_ ValueTransferContext, _ string) Value

func (PathValue) SetMember

func (PathValue) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (PathValue) StaticType

func (v PathValue) StaticType(context ValueStaticTypeContext) StaticType

func (PathValue) Storable

func (v PathValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint32,
) (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(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (PathValue) Walk

func (PathValue) Walk(_ ValueWalkContext, _ func(Value))

type PlaceholderValue added in v1.7.0

type PlaceholderValue struct{}

PlaceholderValue

func (PlaceholderValue) Accept added in v1.7.0

func (PlaceholderValue) Clone added in v1.7.0

func (PlaceholderValue) ConformsToStaticType added in v1.7.0

func (PlaceholderValue) DeepRemove added in v1.7.0

func (PlaceholderValue) DeepRemove(_ ValueRemoveContext, _ bool)

func (PlaceholderValue) IsImportable added in v1.7.0

func (PlaceholderValue) IsResourceKinded added in v1.7.0

func (PlaceholderValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (PlaceholderValue) IsValue added in v1.7.0

func (PlaceholderValue) IsValue()

func (PlaceholderValue) MeteredString added in v1.7.0

func (PlaceholderValue) NeedsStoreTo added in v1.7.0

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

func (PlaceholderValue) RecursiveString added in v1.7.0

func (PlaceholderValue) RecursiveString(_ SeenReferences) string

func (PlaceholderValue) StaticType added in v1.7.0

func (PlaceholderValue) Storable added in v1.7.0

func (PlaceholderValue) String added in v1.7.0

func (v PlaceholderValue) String() string

func (PlaceholderValue) Transfer added in v1.7.0

func (v PlaceholderValue) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (PlaceholderValue) Walk added in v1.7.0

func (PlaceholderValue) Walk(_ ValueWalkContext, _ func(Value))

type PositionedError

type PositionedError struct {
	Err error
	ast.Range
}

PositionedError wraps an un-positioned 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
	PrimitiveStaticTypeStorable

	// 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
	PrimitiveStaticTypeFix128

	PrimitiveStaticTypeUFix64
	PrimitiveStaticTypeUFix128

	PrimitiveStaticTypePath
	// Deprecated: PrimitiveStaticTypeCapability only exists for encoding/decoding purposes.
	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

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 PublicKeyCreationContext added in v1.4.0

type PublicKeyCreationContext interface {
	MemberAccessibleContext
}

type PublicKeyValidationContext added in v1.4.0

type PublicKeyValidationContext interface {
	PublicKeyCreationContext
}

type PublicKeyValidationHandlerFunc

type PublicKeyValidationHandlerFunc func(
	context PublicKeyValidationContext,
	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(context ValueVisitContext, visitor Visitor)

func (*PublishedValue) ByteSize

func (v *PublishedValue) ByteSize() uint32

func (*PublishedValue) ChildStorables

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

func (*PublishedValue) Clone

func (v *PublishedValue) Clone(context ValueCloneContext) Value

func (*PublishedValue) ConformsToStaticType

func (*PublishedValue) DeepRemove

func (*PublishedValue) DeepRemove(_ ValueRemoveContext, _ 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(context ValueComparisonContext, other Value) bool

func (*PublishedValue) IsImportable

func (*PublishedValue) IsImportable(_ ValueImportableContext) bool

func (*PublishedValue) IsResourceKinded

func (*PublishedValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (*PublishedValue) IsStorable

func (*PublishedValue) IsStorable() bool

func (*PublishedValue) IsValue added in v1.4.0

func (*PublishedValue) IsValue()

func (*PublishedValue) MeteredString

func (v *PublishedValue) MeteredString(
	context ValueStringContext,
	seenReferences SeenReferences,
) 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(context ValueStaticTypeContext) StaticType

func (*PublishedValue) Storable

func (v *PublishedValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint32) (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(
	context ValueTransferContext,
	address atree.Address,
	remove bool,
	storable atree.Storable,
	preventTransfer map[atree.ValueID]struct{},
	hasNoParentContainer bool,
) Value

func (*PublishedValue) Walk

func (v *PublishedValue) Walk(_ ValueWalkContext, walkChild func(Value))

type RecursiveTransferError

type RecursiveTransferError struct {
	LocationRange
}

RecursiveTransferError

func (*RecursiveTransferError) Error

func (*RecursiveTransferError) Error() string

func (*RecursiveTransferError) IsUserError

func (*RecursiveTransferError) IsUserError()

func (*RecursiveTransferError) SetLocationRange added in v1.5.0

func (e *RecursiveTransferError) SetLocationRange(locationRange LocationRange)

type RedeclarationError

type RedeclarationError struct {
	Name string
}

func (RedeclarationError) Error

func (e RedeclarationError) Error() string

func (RedeclarationError) IsUserError

func (RedeclarationError) IsUserError()

type ReferenceCreationContext added in v1.4.0

type ReferenceCreationContext interface {
	common.MemoryGauge
	ReferenceTracker
	ValueStaticTypeContext
}

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

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(ValueStaticTypeContext) bool
}

ReferenceTrackedResourceKindedValue is a resource-kinded value that must be tracked when a reference of it is taken.

type ReferenceTracker added in v1.4.0

type ReferenceTracker interface {
	ClearReferencedResourceKindedValues(valueID atree.ValueID)
	ReferencedResourceKindedValues(valueID atree.ValueID) map[*EphemeralReferenceValue]struct{}
	MaybeTrackReferencedResourceKindedValue(ref *EphemeralReferenceValue)
}

type ReferenceValue

type ReferenceValue interface {
	Value
	AuthorizedValue

	ReferencedValue(context ValueStaticTypeContext, errorOnFailedDereference bool) *Value
	BorrowType() sema.Type
	// contains filtered or unexported methods
}

func ReceiverReference added in v1.5.0

func ReceiverReference(context ReferenceCreationContext, receiver Value) (ReferenceValue, bool)

type ReferenceValueIterator added in v1.5.0

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

func (*ReferenceValueIterator) HasNext added in v1.5.0

func (i *ReferenceValueIterator) HasNext(context ValueIteratorContext) bool

func (*ReferenceValueIterator) Next added in v1.5.0

func (*ReferenceValueIterator) ValueID added in v1.7.0

func (i *ReferenceValueIterator) ValueID() (atree.ValueID, bool)

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()

func (*ReferencedValueChangedError) SetLocationRange added in v1.5.0

func (e *ReferencedValueChangedError) SetLocationRange(locationRange LocationRange)

type ResourceConstructionError

type ResourceConstructionError struct {
	CompositeType *sema.CompositeType
	LocationRange
}

ResourceConstructionError

func (*ResourceConstructionError) Error

func (e *ResourceConstructionError) Error() string

func (*ResourceConstructionError) IsInternalError

func (*ResourceConstructionError) IsInternalError()

func (*ResourceConstructionError) SetLocationRange added in v1.5.0

func (e *ResourceConstructionError) SetLocationRange(locationRange LocationRange)

type ResourceDestructionContext added in v1.4.0

type ResourceDestructionContext interface {
	ValueWalkContext
	ResourceDestructionHandler
	CompositeFunctionContext
	EventContext
	InvocationContext
	LocationRangeProvider

	GetResourceDestructionContextForLocation(location common.Location) ResourceDestructionContext
	DefaultDestroyEvents(resourceValue *CompositeValue) []*CompositeValue
}

type ResourceDestructionHandler added in v1.4.0

type ResourceDestructionHandler interface {
	WithResourceDestruction(valueID atree.ValueID, f func())
}

type ResourceKindedValue

type ResourceKindedValue interface {
	Value
	Destroy(context ResourceDestructionContext)
	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()

func (*ResourceLossError) SetLocationRange added in v1.5.0

func (e *ResourceLossError) SetLocationRange(locationRange LocationRange)

type ResourceReferenceDereferenceError

type ResourceReferenceDereferenceError struct {
	LocationRange
}

ResourceReferenceDereferenceError

func (*ResourceReferenceDereferenceError) Error

func (*ResourceReferenceDereferenceError) IsInternalError

func (*ResourceReferenceDereferenceError) IsInternalError()

func (*ResourceReferenceDereferenceError) SetLocationRange added in v1.5.0

func (e *ResourceReferenceDereferenceError) SetLocationRange(locationRange LocationRange)

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(context ValueStaticTypeContext) Value

func (*SelfVariable) InitializeWithGetter

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

func (*SelfVariable) InitializeWithValue

func (v *SelfVariable) InitializeWithValue(Value)

func (*SelfVariable) Kind added in v1.7.0

func (*SelfVariable) Kind() VariableKind

func (*SelfVariable) SetValue

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, context MemberAccessibleContext) Value
	FunctionMemberGetter func(name string, context MemberAccessibleContext) FunctionValue

	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(
	gauge common.MemoryGauge,
	keyIndex IntValue,
	publicKey *CompositeValue,
	hashAlgo Value,
	weight UFix64Value,
	isRevoked BoolValue,
) *SimpleCompositeValue

NewAccountKeyValue constructs an AccountKey value.

func NewBlockValue

func NewBlockValue(
	context ContainerMutationContext,
	height UInt64Value,
	view UInt64Value,
	id *ArrayValue,
	timestamp UFix64Value,
) *SimpleCompositeValue

func NewDeployedContractValue

func NewDeployedContractValue(
	context FunctionCreationContext,
	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, context MemberAccessibleContext) Value,
	functionMemberGetter func(name string, context MemberAccessibleContext) FunctionValue,
	fieldFormatters map[string]func(common.MemoryGauge, Value, SeenReferences) string,
	stringer func(ValueStringContext, SeenReferences) string,
) *SimpleCompositeValue

func (*SimpleCompositeValue) Accept

func (v *SimpleCompositeValue) Accept(context ValueVisitContext, visitor Visitor)

func (*SimpleCompositeValue) Clone

func (v *SimpleCompositeValue) Clone(context ValueCloneContext) Value

func (*SimpleCompositeValue) ConformsToStaticType

func (v *SimpleCompositeValue) ConformsToStaticType(
	context ValueStaticTypeConformanceContext,
	results TypeConformanceResults,
) bool

func (*SimpleCompositeValue) DeepRemove

func (v *SimpleCompositeValue) DeepRemove(_ ValueRemoveContext, _ 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(context MemberAccessibleContext, name string) Value

func (*SimpleCompositeValue) GetMethod added in v1.4.0

func (*SimpleCompositeValue) IsImportable

func (v *SimpleCompositeValue) IsImportable(context ValueImportableContext) bool

func (*SimpleCompositeValue) IsResourceKinded

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

func (*SimpleCompositeValue) IsValue added in v1.4.0

func (*SimpleCompositeValue) IsValue()

func (*SimpleCompositeValue) MeteredString

func (v *SimpleCompositeValue) MeteredString(
	context ValueStringContext,
	seenReferences SeenReferences,
) string

func (*SimpleCompositeValue) NeedsStoreTo

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

func (*SimpleCompositeValue) PrivateField added in v1.4.0

func (v *SimpleCompositeValue) PrivateField(key string) Value

func (*SimpleCompositeValue) RecursiveString

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

func (*SimpleCompositeValue) RemoveMember

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

func (*SimpleCompositeValue) SetMember

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

func (*SimpleCompositeValue) StaticType

func (*SimpleCompositeValue) Storable

func (*SimpleCompositeValue) String

func (v *SimpleCompositeValue) String() string

func (*SimpleCompositeValue) Transfer

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

func (*SimpleCompositeValue) Walk

func (v *SimpleCompositeValue) Walk(_ ValueWalkContext, walkChild func(Value))

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

func (*SimpleCompositeValue) WithPrivateField added in v1.4.0

func (v *SimpleCompositeValue) WithPrivateField(key string, value Value) *SimpleCompositeValue

type SimpleVariable

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

func (*SimpleVariable) GetValue

func (*SimpleVariable) InitializeWithGetter

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

func (*SimpleVariable) InitializeWithValue

func (v *SimpleVariable) InitializeWithValue(value Value)

func (*SimpleVariable) Kind added in v1.7.0

func (v *SimpleVariable) Kind() VariableKind

func (*SimpleVariable) SetValue

func (v *SimpleVariable) SetValue(context ValueStaticTypeContext, 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)

func (SomeStorable) UnwrapAtreeStorable added in v1.3.1

func (s SomeStorable) UnwrapAtreeStorable() atree.Storable

func (SomeStorable) WrapAtreeStorable added in v1.3.1

func (s SomeStorable) WrapAtreeStorable(storable atree.Storable) atree.Storable

WrapAtreeStorable() wraps storable as innermost wrapped value and returns new wrapped storable.

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(context ValueVisitContext, visitor Visitor)

func (*SomeValue) Clone

func (v *SomeValue) Clone(context ValueCloneContext) Value

func (*SomeValue) ConformsToStaticType

func (v *SomeValue) ConformsToStaticType(
	context ValueStaticTypeConformanceContext,
	results TypeConformanceResults,
) bool

func (*SomeValue) DeepRemove

func (v *SomeValue) DeepRemove(context ValueRemoveContext, hasNoParentContainer bool)

func (*SomeValue) Destroy

func (v *SomeValue) Destroy(context ResourceDestructionContext)

func (*SomeValue) Equal

func (v *SomeValue) Equal(context ValueComparisonContext, other Value) bool

func (*SomeValue) GetMember

func (v *SomeValue) GetMember(context MemberAccessibleContext, name string) Value

func (*SomeValue) GetMethod added in v1.4.0

func (v *SomeValue) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (*SomeValue) InnerValue

func (v *SomeValue) InnerValue() Value

func (*SomeValue) InnerValueType added in v1.5.0

func (v *SomeValue) InnerValueType(context ValueStaticTypeContext) sema.Type

func (*SomeValue) IsDestroyed

func (v *SomeValue) IsDestroyed() bool

func (*SomeValue) IsImportable

func (v *SomeValue) IsImportable(context ValueImportableContext) bool

func (*SomeValue) IsResourceKinded

func (v *SomeValue) IsResourceKinded(context ValueStaticTypeContext) bool

func (*SomeValue) IsValue added in v1.4.0

func (*SomeValue) IsValue()

func (*SomeValue) MeteredString

func (v *SomeValue) MeteredString(
	context ValueStringContext,
	seenReferences SeenReferences,
) 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(_ ValueTransferContext, _ string) Value

func (*SomeValue) SetMember

func (v *SomeValue) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (*SomeValue) StaticType

func (v *SomeValue) StaticType(context ValueStaticTypeContext) StaticType

func (*SomeValue) Storable

func (v *SomeValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint32,
) (atree.Storable, error)

func (*SomeValue) String

func (v *SomeValue) String() string

func (*SomeValue) Transfer

func (v *SomeValue) Transfer(
	context ValueTransferContext,
	address atree.Address,
	remove bool,
	storable atree.Storable,
	preventTransfer map[atree.ValueID]struct{},
	hasNoParentContainer bool,
) Value

func (*SomeValue) UnwrapAtreeValue added in v1.3.1

func (v *SomeValue) UnwrapAtreeValue() (atree.Value, uint32)

UnwrapAtreeValue returns non-SomeValue and wrapper size.

func (*SomeValue) Walk

func (v *SomeValue) Walk(_ ValueWalkContext, walkChild func(Value))

type StackTraceError

type StackTraceError struct {
	LocationRange
}

func (StackTraceError) Error

func (StackTraceError) Error() string

func (StackTraceError) ImportLocation

func (e StackTraceError) ImportLocation() common.Location

func (StackTraceError) Prefix

func (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

func StaticTypeFromBytes added in v1.5.0

func StaticTypeFromBytes(bytes []byte) (StaticType, error)

type StaticTypeAndReferenceContext added in v1.4.0

type StaticTypeAndReferenceContext interface {
	common.MemoryGauge
	ValueStaticTypeContext
	ReferenceTracker
}

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
	GetDomainStorageMap(
		storageMutationTracker StorageMutationTracker,
		address common.Address,
		domain common.StorageDomain,
		createIfNotExists bool,
	) *DomainStorageMap
	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(common.MemoryGauge) *IDCapabilityValue
	GetTag        func(storageReader StorageReader) *StringValue
	SetTag        func(storageWriter StorageWriter, tag *StringValue)
	Delete        func(context CapabilityControllerContext)
	SetTarget     func(context CapabilityControllerContext, 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(context ValueVisitContext, visitor Visitor)

func (*StorageCapabilityControllerValue) ByteSize

func (*StorageCapabilityControllerValue) CapabilityControllerBorrowType

func (v *StorageCapabilityControllerValue) CapabilityControllerBorrowType() *ReferenceStaticType

func (*StorageCapabilityControllerValue) CheckDeleted added in v1.7.0

func (v *StorageCapabilityControllerValue) CheckDeleted()

CheckDeleted checks if the controller is deleted, and panics if it is.

func (*StorageCapabilityControllerValue) ChildStorables

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

func (*StorageCapabilityControllerValue) Clone

func (*StorageCapabilityControllerValue) ConformsToStaticType

func (*StorageCapabilityControllerValue) ControllerCapabilityID

func (v *StorageCapabilityControllerValue) ControllerCapabilityID() UInt64Value

func (*StorageCapabilityControllerValue) DeepRemove

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 (*StorageCapabilityControllerValue) GetMember

func (v *StorageCapabilityControllerValue) GetMember(context MemberAccessibleContext, name string) (result Value)

func (*StorageCapabilityControllerValue) GetMethod added in v1.4.0

func (*StorageCapabilityControllerValue) IsImportable

func (*StorageCapabilityControllerValue) IsResourceKinded

func (*StorageCapabilityControllerValue) IsStorable

func (*StorageCapabilityControllerValue) IsStorable() bool

func (*StorageCapabilityControllerValue) IsValue added in v1.4.0

func (*StorageCapabilityControllerValue) MeteredString

func (v *StorageCapabilityControllerValue) MeteredString(
	context ValueStringContext,
	seenReferences SeenReferences,
) string

func (*StorageCapabilityControllerValue) NeedsStoreTo

func (*StorageCapabilityControllerValue) RecursiveString

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

func (*StorageCapabilityControllerValue) ReferenceValue

func (*StorageCapabilityControllerValue) RemoveMember

func (*StorageCapabilityControllerValue) SetMember

func (v *StorageCapabilityControllerValue) SetMember(
	context ValueTransferContext,
	identifier string,
	value Value,
) bool

func (*StorageCapabilityControllerValue) StaticType

func (*StorageCapabilityControllerValue) Storable

func (v *StorageCapabilityControllerValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint32,
) (
	atree.Storable,
	error,
)

func (*StorageCapabilityControllerValue) StoredValue

func (*StorageCapabilityControllerValue) String

func (*StorageCapabilityControllerValue) Transfer

func (v *StorageCapabilityControllerValue) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*StorageCapabilityControllerValue) Walk

func (v *StorageCapabilityControllerValue) Walk(_ ValueWalkContext, walkChild func(Value))

type StorageCapabilityCreationContext added in v1.4.0

type StorageCapabilityCreationContext interface {
	FunctionCreationContext
	CapabilityControllerContext
}

type StorageContext added in v1.4.0

type StorageContext interface {
	ValueStaticTypeContext
	common.MemoryGauge
	StorageMutationTracker
	StorageIterationTracker
	StorageReader
	StorageWriter

	Storage() Storage
	MaybeValidateAtreeValue(v atree.Value)
	MaybeValidateAtreeStorage()
}

type StorageDomainKey added in v1.3.0

type StorageDomainKey struct {
	Domain  common.StorageDomain
	Address common.Address
}

func NewStorageDomainKey added in v1.3.0

func NewStorageDomainKey(
	memoryGauge common.MemoryGauge,
	address common.Address,
	domain common.StorageDomain,
) StorageDomainKey

func (StorageDomainKey) Compare added in v1.3.0

func (k StorageDomainKey) Compare(o StorageDomainKey) int

type StorageIterationTracker added in v1.4.0

type StorageIterationTracker interface {
	InStorageIteration() bool
	SetInStorageIteration(bool)
}

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 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()

func (*StorageMutatedDuringIterationError) SetLocationRange added in v1.5.0

func (e *StorageMutatedDuringIterationError) SetLocationRange(locationRange LocationRange)

type StorageMutationTracker added in v1.4.0

type StorageMutationTracker interface {
	RecordStorageMutation()
	StorageMutatedDuringIteration() bool
}

type StorageReader added in v1.4.0

type StorageReader interface {
	ReadStored(
		storageAddress common.Address,
		domain common.StorageDomain,
		identifier StorageMapKey,
	) Value
}

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 StorageReference added in v1.7.0

func StorageReference(
	context ValueStaticTypeContext,
	storageReference *StorageReferenceValue,
	referencedValue Value,
) *StorageReferenceValue

func (*StorageReferenceValue) Accept

func (v *StorageReferenceValue) Accept(context ValueVisitContext, visitor Visitor)

func (*StorageReferenceValue) BorrowType

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

func (*StorageReferenceValue) Clone

func (*StorageReferenceValue) ConformsToStaticType

func (v *StorageReferenceValue) ConformsToStaticType(
	context ValueStaticTypeConformanceContext,
	results TypeConformanceResults,
) bool

func (*StorageReferenceValue) DeepRemove

func (*StorageReferenceValue) DeepRemove(_ ValueRemoveContext, _ bool)

func (*StorageReferenceValue) Equal

func (*StorageReferenceValue) ForEach

func (v *StorageReferenceValue) ForEach(
	context IterableValueForeachContext,
	elementType sema.Type,
	function func(value Value) (resume bool),
	_ bool,
)

func (*StorageReferenceValue) GetAuthorization

func (v *StorageReferenceValue) GetAuthorization() Authorization

func (*StorageReferenceValue) GetKey

func (v *StorageReferenceValue) GetKey(context ContainerReadContext, key Value) Value

func (*StorageReferenceValue) GetMember

func (v *StorageReferenceValue) GetMember(context MemberAccessibleContext, name string) Value

func (*StorageReferenceValue) GetMethod added in v1.4.0

func (*StorageReferenceValue) GetTypeKey

func (v *StorageReferenceValue) GetTypeKey(
	context MemberAccessibleContext,
	key sema.Type,
) Value

func (*StorageReferenceValue) InsertKey

func (v *StorageReferenceValue) InsertKey(context ContainerMutationContext, key Value, value Value)

func (*StorageReferenceValue) IsImportable

func (*StorageReferenceValue) IsResourceKinded

func (*StorageReferenceValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (*StorageReferenceValue) IsStorable

func (*StorageReferenceValue) IsStorable() bool

func (*StorageReferenceValue) IsValue added in v1.4.0

func (*StorageReferenceValue) IsValue()

func (*StorageReferenceValue) Iterator

func (*StorageReferenceValue) MeteredString

func (v *StorageReferenceValue) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) 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(context ValueStaticTypeContext, errorOnFailedDereference bool) *Value

func (*StorageReferenceValue) RemoveKey

func (v *StorageReferenceValue) RemoveKey(context ContainerMutationContext, key Value) Value

func (*StorageReferenceValue) RemoveMember

func (v *StorageReferenceValue) RemoveMember(context ValueTransferContext, name string) Value

func (*StorageReferenceValue) RemoveTypeKey

func (v *StorageReferenceValue) RemoveTypeKey(context ValueTransferContext, key sema.Type) Value

func (*StorageReferenceValue) SetKey

func (v *StorageReferenceValue) SetKey(context ContainerMutationContext, key Value, value Value)

func (*StorageReferenceValue) SetMember

func (v *StorageReferenceValue) SetMember(context ValueTransferContext, name string, value Value) bool

func (*StorageReferenceValue) SetTypeKey

func (v *StorageReferenceValue) SetTypeKey(
	context ValueTransferContext,
	key sema.Type,
	value Value,
)

func (*StorageReferenceValue) StaticType

func (*StorageReferenceValue) Storable

func (*StorageReferenceValue) String

func (*StorageReferenceValue) String() string

func (*StorageReferenceValue) Transfer

func (v *StorageReferenceValue) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (*StorageReferenceValue) Walk

func (*StorageReferenceValue) Walk(_ ValueWalkContext, _ func(Value))

type StorageWriter added in v1.4.0

type StorageWriter interface {
	WriteStored(
		storageAddress common.Address,
		domain common.StorageDomain,
		key StorageMapKey,
		value Value,
	) (existed bool)
}

type StoredValueCheckContext added in v1.4.0

type StoredValueCheckContext interface {
	TypeConverter
	CheckCapabilityControllerContext
	GetCapabilityCheckHandler() CapabilityCheckHandlerFunc
}

type StoredValueTypeMismatchError added in v1.7.2

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

StoredValueTypeMismatchError

func (*StoredValueTypeMismatchError) Error added in v1.7.2

func (*StoredValueTypeMismatchError) IsUserError added in v1.7.2

func (*StoredValueTypeMismatchError) IsUserError()

func (*StoredValueTypeMismatchError) SetLocationRange added in v1.7.2

func (e *StoredValueTypeMismatchError) SetLocationRange(locationRange 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 uint32,
) (
	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()

func (*StringIndexOutOfBoundsError) SetLocationRange added in v1.5.0

func (e *StringIndexOutOfBoundsError) SetLocationRange(locationRange LocationRange)

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()

func (*StringSliceIndicesError) SetLocationRange added in v1.5.0

func (e *StringSliceIndicesError) SetLocationRange(locationRange LocationRange)

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 CharacterValueToString added in v1.5.0

func CharacterValueToString(
	memoryGauge common.MemoryGauge,
	v CharacterValue,
) *StringValue

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 NumberValueToString added in v1.5.0

func NumberValueToString(
	memoryGauge common.MemoryGauge,
	v NumberValue,
) *StringValue

func (*StringValue) Accept

func (v *StringValue) Accept(context ValueVisitContext, visitor Visitor)

func (*StringValue) ByteSize

func (v *StringValue) ByteSize() uint32

func (*StringValue) ChildStorables

func (*StringValue) ChildStorables() []atree.Storable

func (*StringValue) Clone

func (v *StringValue) Clone(_ ValueCloneContext) Value

func (*StringValue) Concat

func (v *StringValue) Concat(context StringValueFunctionContext, other *StringValue) Value

func (*StringValue) ConformsToStaticType

func (*StringValue) Contains

func (v *StringValue) Contains(context StringValueFunctionContext, other *StringValue) BoolValue

func (*StringValue) Count

func (v *StringValue) Count(context StringValueFunctionContext, other *StringValue) IntValue

func (*StringValue) DecodeHex

func (v *StringValue) DecodeHex(context ArrayCreationContext) *ArrayValue

DecodeHex hex-decodes this string and returns an array of UInt8 values

func (*StringValue) DeepRemove

func (*StringValue) DeepRemove(_ ValueRemoveContext, _ 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(context ValueComparisonContext, other Value) bool

func (*StringValue) Explode

func (v *StringValue) Explode(context ArrayCreationContext) *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(
	context IterableValueForeachContext,
	_ sema.Type,
	function func(value Value) (resume bool),
	transferElements bool,
)

func (*StringValue) GetKey

func (v *StringValue) GetKey(context ContainerReadContext, key Value) Value

func (*StringValue) GetMember

func (v *StringValue) GetMember(context MemberAccessibleContext, name string) Value

func (*StringValue) GetMethod added in v1.4.0

func (v *StringValue) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (*StringValue) Greater

func (v *StringValue) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (*StringValue) GreaterEqual

func (v *StringValue) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (*StringValue) HashInput

func (v *StringValue) HashInput(_ common.Gauge, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeString (1 byte) - string value (n bytes)

func (*StringValue) IndexOf

func (v *StringValue) IndexOf(context StringValueFunctionContext, other *StringValue) IntValue

func (*StringValue) InsertKey

func (*StringValue) InsertKey(_ ContainerMutationContext, _ Value, _ Value)

func (*StringValue) IsGraphemeBoundaryEnd

func (v *StringValue) IsGraphemeBoundaryEnd(gauge common.Gauge, end int) bool

func (*StringValue) IsGraphemeBoundaryStart

func (v *StringValue) IsGraphemeBoundaryStart(gauge common.Gauge, startOffset int) bool

func (*StringValue) IsImportable

func (*StringValue) IsImportable(_ ValueImportableContext) bool

func (*StringValue) IsResourceKinded

func (*StringValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (*StringValue) IsValue added in v1.4.0

func (*StringValue) IsValue()

func (*StringValue) Iterator

func (v *StringValue) Iterator(context ValueStaticTypeContext) ValueIterator

func (*StringValue) Length

func (v *StringValue) Length(gauge common.Gauge) int

Length returns the number of characters (grapheme clusters)

func (*StringValue) Less

func (*StringValue) LessEqual

func (v *StringValue) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (*StringValue) MeteredString

func (v *StringValue) MeteredString(context ValueStringContext, _ SeenReferences) string

func (*StringValue) NeedsStoreTo

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

func (*StringValue) RecursiveString

func (v *StringValue) RecursiveString(_ SeenReferences) string

func (*StringValue) RemoveKey

func (*StringValue) RemoveMember

func (*StringValue) RemoveMember(_ ValueTransferContext, _ string) Value

func (*StringValue) ReplaceAll

func (v *StringValue) ReplaceAll(
	context StringValueFunctionContext,
	original *StringValue,
	replacement *StringValue,
) *StringValue

func (*StringValue) SetKey

func (*StringValue) SetMember

func (*StringValue) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (*StringValue) Slice

func (v *StringValue) Slice(gauge common.Gauge, from IntValue, to IntValue) Value

func (*StringValue) Split

func (v *StringValue) Split(context ArrayCreationContext, separator *StringValue) *ArrayValue

func (*StringValue) StaticType

func (*StringValue) StaticType(context ValueStaticTypeContext) StaticType

func (*StringValue) Storable

func (v *StringValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint32) (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(context StringValueFunctionContext) *StringValue

func (*StringValue) Transfer

func (v *StringValue) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct {
	},
	_ bool,
) Value

func (*StringValue) Walk

func (*StringValue) Walk(_ ValueWalkContext, _ func(Value))

type StringValueFunctionContext added in v1.4.0

type StringValueFunctionContext interface {
	common.Gauge
}

type StringValueIterator

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

func NewStringValueIterator added in v1.7.2

func NewStringValueIterator(gauge common.MemoryGauge, v *StringValue) *StringValueIterator

func (*StringValueIterator) HasNext added in v1.4.0

func (i *StringValueIterator) HasNext(context ValueIteratorContext) bool

func (*StringValueIterator) Next

func (*StringValueIterator) ValueID added in v1.7.0

func (*StringValueIterator) ValueID() (atree.ValueID, bool)

type StringValueParser added in v1.6.0

type StringValueParser func(common.Gauge, string) OptionalValue

StringValueParser is a function that attempts to create a Cadence value from a string, e.g. parsing a number from a string

type Tracer added in v1.4.0

type Tracer interface {
	ReportInvokeTrace(functionType string, functionName string, duration time.Duration)
	ReportImportTrace(location string, duration time.Duration)
	ReportEmitEventTrace(eventType string, duration time.Duration)

	ReportArrayValueConstructTrace(valueID string, typeID string, duration time.Duration)
	ReportArrayValueTransferTrace(valueID string, typeID string, duration time.Duration)
	ReportArrayValueDeepRemoveTrace(valueID string, typeID string, duration time.Duration)
	ReportArrayValueDestroyTrace(valueID string, typeID string, duration time.Duration)
	ReportArrayValueConformsToStaticTypeTrace(valueID string, typeID string, duration time.Duration)

	ReportDictionaryValueConstructTrace(valueID string, typeID string, duration time.Duration)
	ReportDictionaryValueTransferTrace(valueID string, typeID string, duration time.Duration)
	ReportDictionaryValueDeepRemoveTrace(valueID string, typeID string, duration time.Duration)
	ReportDictionaryValueDestroyTrace(valueID string, typeID string, duration time.Duration)
	ReportDictionaryValueConformsToStaticTypeTrace(valueID string, typeID string, duration time.Duration)

	ReportCompositeValueConstructTrace(valueID string, typeID string, kind string, duration time.Duration)
	ReportCompositeValueTransferTrace(valueID string, typeID string, kind string, duration time.Duration)
	ReportCompositeValueDeepRemoveTrace(valueID string, typeID string, kind string, duration time.Duration)
	ReportCompositeValueDestroyTrace(valueID string, typeID string, kind string, duration time.Duration)
	ReportCompositeValueConformsToStaticTypeTrace(valueID string, typeID string, kind string, duration time.Duration)
	ReportCompositeValueGetMemberTrace(valueID string, typeID string, kind string, name string, duration time.Duration)
	ReportCompositeValueSetMemberTrace(valueID string, typeID string, kind string, name string, duration time.Duration)
	ReportCompositeValueRemoveMemberTrace(valueID string, typeID string, kind string, name string, duration time.Duration)

	ReportAtreeNewArrayFromBatchDataTrace(valueID string, typeID string, duration time.Duration)

	ReportAtreeNewMapTrace(valueID string, typeID string, seed uint64, duration time.Duration)
	ReportAtreeNewMapFromBatchDataTrace(valueID string, typeID string, seed uint64, duration time.Duration)
}

type TransactionNotDeclaredError

type TransactionNotDeclaredError struct {
	Index int
}

func (TransactionNotDeclaredError) Error

func (TransactionNotDeclaredError) IsUserError

func (TransactionNotDeclaredError) IsUserError()

type TypeArgumentsIterator added in v1.8.0

type TypeArgumentsIterator interface {
	NextStatic() StaticType
	NextSema() sema.Type
}
var TheEmptyTypeArgumentsIterator TypeArgumentsIterator = EmptyTypeArgumentsIterator{}

func NewTypeArgumentsIterator added in v1.8.0

func NewTypeArgumentsIterator(
	context InvocationContext,
	arguments *sema.TypeParameterTypeOrderedMap,
) TypeArgumentsIterator

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 TypeConverter added in v1.4.0

type TypeConverter interface {
	common.MemoryGauge
	StaticTypeConversionHandler
	SemaTypeFromStaticType(staticType StaticType) sema.Type
	SemaAccessFromStaticAuthorization(auth Authorization) (sema.Access, error)
}

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(context MemberAccessibleContext, ty sema.Type) Value
	SetTypeKey(context ValueTransferContext, ty sema.Type, value Value)
	RemoveTypeKey(context ValueTransferContext, 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()

func (*TypeMismatchError) SetLocationRange added in v1.5.0

func (e *TypeMismatchError) SetLocationRange(locationRange LocationRange)

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 ConstructConstantSizedArrayTypeValue added in v1.5.0

func ConstructConstantSizedArrayTypeValue(
	context InvocationContext,
	typeValue TypeValue,
	sizeValue IntValue,
) TypeValue

func ConstructVariableSizedArrayTypeValue added in v1.5.0

func ConstructVariableSizedArrayTypeValue(context InvocationContext, typeValue TypeValue) TypeValue

func NewTypeValue

func NewTypeValue(
	memoryGauge common.MemoryGauge,
	staticType StaticType,
) TypeValue

func NewUnmeteredTypeValue

func NewUnmeteredTypeValue(t StaticType) TypeValue

func (TypeValue) Accept

func (v TypeValue) Accept(context ValueVisitContext, visitor Visitor)

func (TypeValue) ByteSize

func (v TypeValue) ByteSize() uint32

func (TypeValue) ChildStorables

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

func (TypeValue) Clone

func (v TypeValue) Clone(_ ValueCloneContext) Value

func (TypeValue) ConformsToStaticType

func (TypeValue) DeepRemove

func (TypeValue) DeepRemove(_ ValueRemoveContext, _ 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(_ ValueComparisonContext, other Value) bool

func (TypeValue) GetMember

func (v TypeValue) GetMember(context MemberAccessibleContext, name string) Value

func (TypeValue) GetMethod added in v1.4.0

func (v TypeValue) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (TypeValue) HashInput

func (v TypeValue) HashInput(_ common.Gauge, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeType (1 byte) - type id (n bytes)

func (TypeValue) IsImportable

func (TypeValue) IsImportable(_ ValueImportableContext) bool

func (TypeValue) IsResourceKinded

func (TypeValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (TypeValue) IsValue added in v1.4.0

func (TypeValue) IsValue()

func (TypeValue) MeteredString

func (v TypeValue) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) 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(_ ValueTransferContext, _ string) Value

func (TypeValue) SetMember

func (TypeValue) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (TypeValue) StaticType

func (TypeValue) StaticType(context ValueStaticTypeContext) StaticType

func (TypeValue) Storable

func (v TypeValue) Storable(
	storage atree.SlabStorage,
	address atree.Address,
	maxInlineSize uint32,
) (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(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (TypeValue) Walk

func (TypeValue) Walk(_ ValueWalkContext, _ func(Value))

type TypedBigEndianBytesConverter added in v1.6.0

type TypedBigEndianBytesConverter struct {
	ReceiverType sema.Type
	ByteLength   uint
	Converter    BigEndianBytesConverter
}

type TypedStringValueParser added in v1.6.0

type TypedStringValueParser struct {
	ReceiverType sema.Type
	Parser       StringValueParser
}

type UFix128Value added in v1.7.0

type UFix128Value fix.UFix128

UFix128Value

func ConvertUFix128 added in v1.7.0

func ConvertUFix128(memoryGauge common.MemoryGauge, value Value) UFix128Value

func NewUFix128Value added in v1.7.0

func NewUFix128Value(gauge common.MemoryGauge, valueGetter func() fix.UFix128) UFix128Value

func NewUFix128ValueFromBigInt added in v1.7.0

func NewUFix128ValueFromBigInt(gauge common.MemoryGauge, v *big.Int) UFix128Value

func NewUFix128ValueFromBigIntWithRangeCheck added in v1.7.0

func NewUFix128ValueFromBigIntWithRangeCheck(gauge common.MemoryGauge, v *big.Int) UFix128Value

func NewUnmeteredUFix128Value added in v1.7.0

func NewUnmeteredUFix128Value(ufix128 fix.UFix128) UFix128Value

func NewUnmeteredUFix128ValueWithInteger added in v1.7.0

func NewUnmeteredUFix128ValueWithInteger(integer uint64) UFix128Value

NewUnmeteredUFix128ValueWithInteger construct a UFix128Value from an uint64. Note that this function uses the default scaling of 24.

func NewUnmeteredUFix128ValueWithIntegerAndScale added in v1.7.0

func NewUnmeteredUFix128ValueWithIntegerAndScale(integer uint64, scale int64) UFix128Value

func (UFix128Value) Accept added in v1.7.0

func (v UFix128Value) Accept(context ValueVisitContext, visitor Visitor)

func (UFix128Value) ByteSize added in v1.7.0

func (v UFix128Value) ByteSize() uint32

func (UFix128Value) ChildStorables added in v1.7.0

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

func (UFix128Value) Clone added in v1.7.0

func (UFix128Value) ConformsToStaticType added in v1.7.0

func (UFix128Value) DeepRemove added in v1.7.0

func (UFix128Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (UFix128Value) Div added in v1.7.0

func (UFix128Value) Encode added in v1.7.0

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

Encode encodes UFix128Value as

cbor.Tag{
		Number:  CBORTagUFix128Value,
		Content: []any {
		    int64(hi),
		    int64(lo),
		}
}

func (UFix128Value) Equal added in v1.7.0

func (v UFix128Value) Equal(_ ValueComparisonContext, other Value) bool

func (UFix128Value) GetMember added in v1.7.0

func (v UFix128Value) GetMember(context MemberAccessibleContext, name string) Value

func (UFix128Value) GetMethod added in v1.7.0

func (v UFix128Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (UFix128Value) Greater added in v1.7.0

func (UFix128Value) GreaterEqual added in v1.7.0

func (v UFix128Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UFix128Value) HashInput added in v1.7.0

func (v UFix128Value) HashInput(_ common.Gauge, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeUFix128 (1 byte) - high 64 bits encoded in big-endian (8 bytes) - low 64 bits encoded in big-endian (8 bytes)

func (UFix128Value) IntegerPart added in v1.7.0

func (v UFix128Value) IntegerPart() NumberValue

func (UFix128Value) IsImportable added in v1.7.0

func (UFix128Value) IsImportable(_ ValueImportableContext) bool

func (UFix128Value) IsResourceKinded added in v1.7.0

func (UFix128Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (UFix128Value) IsStorable added in v1.7.0

func (UFix128Value) IsStorable() bool

func (UFix128Value) IsValue added in v1.7.0

func (UFix128Value) IsValue()

func (UFix128Value) Less added in v1.7.0

func (UFix128Value) LessEqual added in v1.7.0

func (v UFix128Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UFix128Value) MeteredString added in v1.7.0

func (v UFix128Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (UFix128Value) Minus added in v1.7.0

func (UFix128Value) Mod added in v1.7.0

func (UFix128Value) Mul added in v1.7.0

func (UFix128Value) NeedsStoreTo added in v1.7.0

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

func (UFix128Value) Negate added in v1.7.0

func (UFix128Value) Plus added in v1.7.0

func (UFix128Value) RecursiveString added in v1.7.0

func (v UFix128Value) RecursiveString(_ SeenReferences) string

func (UFix128Value) RemoveMember added in v1.7.0

func (UFix128Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (UFix128Value) SaturatingDiv added in v1.7.0

func (v UFix128Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UFix128Value) SaturatingMinus added in v1.7.0

func (v UFix128Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UFix128Value) SaturatingMul added in v1.7.0

func (v UFix128Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UFix128Value) SaturatingPlus added in v1.7.0

func (v UFix128Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UFix128Value) Scale added in v1.7.0

func (UFix128Value) Scale() int

func (UFix128Value) SetMember added in v1.7.0

func (UFix128Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (UFix128Value) StaticType added in v1.7.0

func (UFix128Value) StaticType(context ValueStaticTypeContext) StaticType

func (UFix128Value) Storable added in v1.7.0

func (UFix128Value) StoredValue added in v1.7.0

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

func (UFix128Value) String added in v1.7.0

func (v UFix128Value) String() string

func (UFix128Value) ToBigEndianBytes added in v1.7.0

func (v UFix128Value) ToBigEndianBytes() []byte

func (UFix128Value) ToBigInt added in v1.7.0

func (v UFix128Value) ToBigInt() *big.Int

func (UFix128Value) ToInt added in v1.7.0

func (v UFix128Value) ToInt() int

func (UFix128Value) Transfer added in v1.7.0

func (v UFix128Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UFix128Value) Walk added in v1.7.0

func (UFix128Value) Walk(_ ValueWalkContext, _ func(Value))

type UFix64Value

type UFix64Value struct {
	values.UFix64Value
}

func ConvertUFix64

func ConvertUFix64(memoryGauge common.MemoryGauge, value Value) UFix64Value

func NewUFix64Value

func NewUFix64Value(gauge common.MemoryGauge, constructor func() uint64) UFix64Value

func NewUFix64ValueWithInteger

func NewUFix64ValueWithInteger(gauge common.MemoryGauge, constructor func() uint64) UFix64Value

func NewUnmeteredUFix64Value

func NewUnmeteredUFix64Value(integer uint64) UFix64Value

func NewUnmeteredUFix64ValueWithInteger

func NewUnmeteredUFix64ValueWithInteger(integer uint64) UFix64Value

func (UFix64Value) Accept

func (v UFix64Value) Accept(context ValueVisitContext, visitor Visitor)

func (UFix64Value) Clone

func (v UFix64Value) Clone(_ ValueCloneContext) Value

func (UFix64Value) ConformsToStaticType

func (UFix64Value) DeepRemove

func (UFix64Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (UFix64Value) Div

func (UFix64Value) Equal

func (v UFix64Value) Equal(context ValueComparisonContext, other Value) bool

func (UFix64Value) GetMember

func (v UFix64Value) GetMember(context MemberAccessibleContext, name string) Value

func (UFix64Value) GetMethod added in v1.4.0

func (v UFix64Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (UFix64Value) Greater

func (v UFix64Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (UFix64Value) GreaterEqual

func (v UFix64Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UFix64Value) HashInput

func (v UFix64Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (UFix64Value) IsResourceKinded

func (UFix64Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (UFix64Value) IsValue added in v1.4.0

func (UFix64Value) IsValue()

func (UFix64Value) Less

func (UFix64Value) LessEqual

func (v UFix64Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UFix64Value) MeteredString

func (v UFix64Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (UFix64Value) Minus

func (UFix64Value) Mod

func (UFix64Value) Mul

func (UFix64Value) NeedsStoreTo

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

func (UFix64Value) Negate

func (UFix64Value) Plus

func (UFix64Value) RecursiveString

func (v UFix64Value) RecursiveString(_ SeenReferences) string

func (UFix64Value) RemoveMember

func (UFix64Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (UFix64Value) SaturatingDiv

func (UFix64Value) SaturatingMinus

func (v UFix64Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UFix64Value) SaturatingMul

func (v UFix64Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UFix64Value) SaturatingPlus

func (v UFix64Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UFix64Value) SetMember

func (UFix64Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (UFix64Value) StaticType

func (UFix64Value) StaticType(context ValueStaticTypeContext) StaticType

func (UFix64Value) ToInt

func (v UFix64Value) ToInt() int

func (UFix64Value) Transfer

func (v UFix64Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UFix64Value) Walk

func (UFix64Value) Walk(_ ValueWalkContext, _ func(Value))

type UInt128Value

type UInt128Value struct {
	BigInt *big.Int
}

func NewUInt128ValueFromBigInt

func NewUInt128ValueFromBigInt(memoryGauge common.MemoryGauge, bigIntConstructor func() *big.Int) UInt128Value

func NewUInt128ValueFromUint64

func NewUInt128ValueFromUint64(memoryGauge common.MemoryGauge, 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(context ValueVisitContext, visitor Visitor)

func (UInt128Value) BitwiseAnd

func (v UInt128Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt128Value) BitwiseLeftShift

func (v UInt128Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt128Value) BitwiseOr

func (v UInt128Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt128Value) BitwiseRightShift

func (v UInt128Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt128Value) BitwiseXor

func (v UInt128Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) 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 (UInt128Value) ConformsToStaticType

func (UInt128Value) DeepRemove

func (UInt128Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (UInt128Value) Div

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(_ ValueComparisonContext, other Value) bool

func (UInt128Value) GetMember

func (v UInt128Value) GetMember(context MemberAccessibleContext, name string) Value

func (UInt128Value) GetMethod added in v1.4.0

func (v UInt128Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (UInt128Value) Greater

func (UInt128Value) GreaterEqual

func (v UInt128Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt128Value) HashInput

func (v UInt128Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (UInt128Value) IsResourceKinded

func (UInt128Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (UInt128Value) IsStorable

func (UInt128Value) IsStorable() bool

func (UInt128Value) IsValue added in v1.4.0

func (UInt128Value) IsValue()

func (UInt128Value) Less

func (UInt128Value) LessEqual

func (v UInt128Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt128Value) MeteredString

func (v UInt128Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (UInt128Value) Minus

func (UInt128Value) Mod

func (UInt128Value) Mul

func (UInt128Value) NeedsStoreTo

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

func (UInt128Value) Negate

func (UInt128Value) Plus

func (UInt128Value) RecursiveString

func (v UInt128Value) RecursiveString(_ SeenReferences) string

func (UInt128Value) RemoveMember

func (UInt128Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (UInt128Value) SaturatingDiv

func (v UInt128Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt128Value) SaturatingMinus

func (v UInt128Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt128Value) SaturatingMul

func (v UInt128Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt128Value) SaturatingPlus

func (v UInt128Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt128Value) SetMember

func (UInt128Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (UInt128Value) StaticType

func (UInt128Value) StaticType(context ValueStaticTypeContext) 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() int

func (UInt128Value) Transfer

func (v UInt128Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt128Value) Walk

func (UInt128Value) Walk(_ ValueWalkContext, _ func(Value))

type UInt16Value

type UInt16Value uint16

func ConvertUInt16

func ConvertUInt16(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (UInt16Value) BitwiseAnd

func (v UInt16Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt16Value) BitwiseLeftShift

func (v UInt16Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt16Value) BitwiseOr

func (v UInt16Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt16Value) BitwiseRightShift

func (v UInt16Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt16Value) BitwiseXor

func (v UInt16Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt16Value) ByteSize

func (v UInt16Value) ByteSize() uint32

func (UInt16Value) ChildStorables

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

func (UInt16Value) Clone

func (v UInt16Value) Clone(_ ValueCloneContext) Value

func (UInt16Value) ConformsToStaticType

func (UInt16Value) DeepRemove

func (UInt16Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (UInt16Value) Div

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(_ ValueComparisonContext, other Value) bool

func (UInt16Value) GetMember

func (v UInt16Value) GetMember(context MemberAccessibleContext, name string) Value

func (UInt16Value) GetMethod added in v1.4.0

func (v UInt16Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (UInt16Value) Greater

func (v UInt16Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt16Value) GreaterEqual

func (v UInt16Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt16Value) HashInput

func (v UInt16Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (UInt16Value) IsResourceKinded

func (UInt16Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (UInt16Value) IsStorable

func (UInt16Value) IsStorable() bool

func (UInt16Value) IsValue added in v1.4.0

func (UInt16Value) IsValue()

func (UInt16Value) Less

func (UInt16Value) LessEqual

func (v UInt16Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt16Value) MeteredString

func (v UInt16Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (UInt16Value) Minus

func (UInt16Value) Mod

func (UInt16Value) Mul

func (UInt16Value) NeedsStoreTo

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

func (UInt16Value) Negate

func (UInt16Value) Plus

func (UInt16Value) RecursiveString

func (v UInt16Value) RecursiveString(_ SeenReferences) string

func (UInt16Value) RemoveMember

func (UInt16Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (UInt16Value) SaturatingDiv

func (v UInt16Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt16Value) SaturatingMinus

func (v UInt16Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt16Value) SaturatingMul

func (v UInt16Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt16Value) SaturatingPlus

func (v UInt16Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt16Value) SetMember

func (UInt16Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (UInt16Value) StaticType

func (UInt16Value) StaticType(context ValueStaticTypeContext) 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() int

func (UInt16Value) Transfer

func (v UInt16Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt16Value) Walk

func (UInt16Value) Walk(_ ValueWalkContext, _ func(Value))

type UInt256Value

type UInt256Value struct {
	BigInt *big.Int
}

func ConvertUInt256

func ConvertUInt256(memoryGauge common.MemoryGauge, value Value) UInt256Value

func NewUInt256ValueFromBigInt

func NewUInt256ValueFromBigInt(memoryGauge common.MemoryGauge, bigIntConstructor func() *big.Int) UInt256Value

func NewUInt256ValueFromUint64

func NewUInt256ValueFromUint64(memoryGauge common.MemoryGauge, 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(context ValueVisitContext, visitor Visitor)

func (UInt256Value) BitwiseAnd

func (v UInt256Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt256Value) BitwiseLeftShift

func (v UInt256Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt256Value) BitwiseOr

func (v UInt256Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt256Value) BitwiseRightShift

func (v UInt256Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt256Value) BitwiseXor

func (v UInt256Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) 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 (UInt256Value) ConformsToStaticType

func (UInt256Value) DeepRemove

func (UInt256Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (UInt256Value) Div

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(_ ValueComparisonContext, other Value) bool

func (UInt256Value) GetMember

func (v UInt256Value) GetMember(context MemberAccessibleContext, name string) Value

func (UInt256Value) GetMethod added in v1.4.0

func (v UInt256Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (UInt256Value) Greater

func (UInt256Value) GreaterEqual

func (v UInt256Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt256Value) HashInput

func (v UInt256Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (UInt256Value) IsResourceKinded

func (UInt256Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (UInt256Value) IsStorable

func (UInt256Value) IsStorable() bool

func (UInt256Value) IsValue added in v1.4.0

func (UInt256Value) IsValue()

func (UInt256Value) Less

func (UInt256Value) LessEqual

func (v UInt256Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt256Value) MeteredString

func (v UInt256Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (UInt256Value) Minus

func (UInt256Value) Mod

func (UInt256Value) Mul

func (UInt256Value) NeedsStoreTo

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

func (UInt256Value) Negate

func (UInt256Value) Plus

func (UInt256Value) RecursiveString

func (v UInt256Value) RecursiveString(_ SeenReferences) string

func (UInt256Value) RemoveMember

func (UInt256Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (UInt256Value) SaturatingDiv

func (v UInt256Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt256Value) SaturatingMinus

func (v UInt256Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt256Value) SaturatingMul

func (v UInt256Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt256Value) SaturatingPlus

func (v UInt256Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt256Value) SetMember

func (UInt256Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (UInt256Value) StaticType

func (UInt256Value) StaticType(context ValueStaticTypeContext) 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() int

func (UInt256Value) Transfer

func (v UInt256Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt256Value) Walk

func (UInt256Value) Walk(_ ValueWalkContext, _ func(Value))

type UInt32Value

type UInt32Value uint32

func ConvertUInt32

func ConvertUInt32(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (UInt32Value) BitwiseAnd

func (v UInt32Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt32Value) BitwiseLeftShift

func (v UInt32Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt32Value) BitwiseOr

func (v UInt32Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt32Value) BitwiseRightShift

func (v UInt32Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt32Value) BitwiseXor

func (v UInt32Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt32Value) ByteSize

func (v UInt32Value) ByteSize() uint32

func (UInt32Value) ChildStorables

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

func (UInt32Value) Clone

func (v UInt32Value) Clone(_ ValueCloneContext) Value

func (UInt32Value) ConformsToStaticType

func (UInt32Value) DeepRemove

func (UInt32Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (UInt32Value) Div

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(_ ValueComparisonContext, other Value) bool

func (UInt32Value) GetMember

func (v UInt32Value) GetMember(context MemberAccessibleContext, name string) Value

func (UInt32Value) GetMethod added in v1.4.0

func (v UInt32Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (UInt32Value) Greater

func (v UInt32Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt32Value) GreaterEqual

func (v UInt32Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt32Value) HashInput

func (v UInt32Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (UInt32Value) IsResourceKinded

func (UInt32Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (UInt32Value) IsStorable

func (UInt32Value) IsStorable() bool

func (UInt32Value) IsValue added in v1.4.0

func (UInt32Value) IsValue()

func (UInt32Value) Less

func (UInt32Value) LessEqual

func (v UInt32Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt32Value) MeteredString

func (v UInt32Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (UInt32Value) Minus

func (UInt32Value) Mod

func (UInt32Value) Mul

func (UInt32Value) NeedsStoreTo

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

func (UInt32Value) Negate

func (UInt32Value) Plus

func (UInt32Value) RecursiveString

func (v UInt32Value) RecursiveString(_ SeenReferences) string

func (UInt32Value) RemoveMember

func (UInt32Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (UInt32Value) SaturatingDiv

func (v UInt32Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt32Value) SaturatingMinus

func (v UInt32Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt32Value) SaturatingMul

func (v UInt32Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt32Value) SaturatingPlus

func (v UInt32Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt32Value) SetMember

func (UInt32Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (UInt32Value) StaticType

func (UInt32Value) StaticType(context ValueStaticTypeContext) 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() int

func (UInt32Value) Transfer

func (v UInt32Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt32Value) Walk

func (UInt32Value) Walk(_ ValueWalkContext, _ func(Value))

type UInt64Value

type UInt64Value uint64
const InvalidCapabilityID UInt64Value = 0

func ConvertUInt64

func ConvertUInt64(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (UInt64Value) BitwiseAnd

func (v UInt64Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt64Value) BitwiseLeftShift

func (v UInt64Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt64Value) BitwiseOr

func (v UInt64Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt64Value) BitwiseRightShift

func (v UInt64Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt64Value) BitwiseXor

func (v UInt64Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) 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(_ ValueCloneContext) Value

func (UInt64Value) ConformsToStaticType

func (UInt64Value) DeepRemove

func (UInt64Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (UInt64Value) Div

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(_ ValueComparisonContext, other Value) bool

func (UInt64Value) GetMember

func (v UInt64Value) GetMember(context MemberAccessibleContext, name string) Value

func (UInt64Value) GetMethod added in v1.4.0

func (v UInt64Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (UInt64Value) Greater

func (v UInt64Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt64Value) GreaterEqual

func (v UInt64Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt64Value) HashInput

func (v UInt64Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (UInt64Value) IsResourceKinded

func (UInt64Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (UInt64Value) IsStorable

func (UInt64Value) IsStorable() bool

func (UInt64Value) IsValue added in v1.4.0

func (UInt64Value) IsValue()

func (UInt64Value) Less

func (UInt64Value) LessEqual

func (v UInt64Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt64Value) MeteredString

func (v UInt64Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (UInt64Value) Minus

func (UInt64Value) Mod

func (UInt64Value) Mul

func (UInt64Value) NeedsStoreTo

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

func (UInt64Value) Negate

func (UInt64Value) Plus

func (UInt64Value) RecursiveString

func (v UInt64Value) RecursiveString(_ SeenReferences) string

func (UInt64Value) RemoveMember

func (UInt64Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (UInt64Value) SaturatingDiv

func (v UInt64Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt64Value) SaturatingMinus

func (v UInt64Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt64Value) SaturatingMul

func (v UInt64Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt64Value) SaturatingPlus

func (v UInt64Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt64Value) SetMember

func (UInt64Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (UInt64Value) StaticType

func (UInt64Value) StaticType(context ValueStaticTypeContext) 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() int

func (UInt64Value) Transfer

func (v UInt64Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt64Value) Walk

func (UInt64Value) Walk(_ ValueWalkContext, _ func(Value))

type UInt8Value

type UInt8Value uint8

func ConvertUInt8

func ConvertUInt8(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (UInt8Value) BitwiseAnd

func (v UInt8Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt8Value) BitwiseLeftShift

func (v UInt8Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt8Value) BitwiseOr

func (v UInt8Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt8Value) BitwiseRightShift

func (v UInt8Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt8Value) BitwiseXor

func (v UInt8Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UInt8Value) ByteSize

func (v UInt8Value) ByteSize() uint32

func (UInt8Value) ChildStorables

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

func (UInt8Value) Clone

func (v UInt8Value) Clone(_ ValueCloneContext) Value

func (UInt8Value) ConformsToStaticType

func (UInt8Value) DeepRemove

func (UInt8Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (UInt8Value) Div

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(_ ValueComparisonContext, other Value) bool

func (UInt8Value) GetMember

func (v UInt8Value) GetMember(context MemberAccessibleContext, name string) Value

func (UInt8Value) GetMethod added in v1.4.0

func (v UInt8Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (UInt8Value) Greater

func (v UInt8Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt8Value) GreaterEqual

func (v UInt8Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt8Value) HashInput

func (v UInt8Value) HashInput(_ common.Gauge, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeUInt8 (1 byte) - uint8 value (1 byte)

func (UInt8Value) IsImportable

func (UInt8Value) IsImportable(_ ValueImportableContext) bool

func (UInt8Value) IsResourceKinded

func (UInt8Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (UInt8Value) IsValue added in v1.4.0

func (UInt8Value) IsValue()

func (UInt8Value) Less

func (UInt8Value) LessEqual

func (v UInt8Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UInt8Value) MeteredString

func (v UInt8Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (UInt8Value) Minus

func (UInt8Value) Mod

func (UInt8Value) Mul

func (UInt8Value) NeedsStoreTo

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

func (UInt8Value) Negate

func (UInt8Value) Plus

func (UInt8Value) RecursiveString

func (v UInt8Value) RecursiveString(_ SeenReferences) string

func (UInt8Value) RemoveMember

func (UInt8Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (UInt8Value) SaturatingDiv

func (v UInt8Value) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt8Value) SaturatingMinus

func (v UInt8Value) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt8Value) SaturatingMul

func (v UInt8Value) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt8Value) SaturatingPlus

func (v UInt8Value) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UInt8Value) SetMember

func (UInt8Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (UInt8Value) StaticType

func (UInt8Value) StaticType(context ValueStaticTypeContext) 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() int

func (UInt8Value) Transfer

func (v UInt8Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UInt8Value) Walk

func (UInt8Value) Walk(_ ValueWalkContext, _ func(Value))

type UIntValue

type UIntValue struct {
	BigInt *big.Int
}

func ConvertUInt

func ConvertUInt(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (UIntValue) BitwiseAnd

func (v UIntValue) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UIntValue) BitwiseLeftShift

func (v UIntValue) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UIntValue) BitwiseOr

func (v UIntValue) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UIntValue) BitwiseRightShift

func (v UIntValue) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (UIntValue) BitwiseXor

func (v UIntValue) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) 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(_ ValueCloneContext) Value

func (UIntValue) ConformsToStaticType

func (UIntValue) DeepRemove

func (UIntValue) DeepRemove(_ ValueRemoveContext, _ bool)

func (UIntValue) Div

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(context ValueComparisonContext, other Value) bool

func (UIntValue) GetMember

func (v UIntValue) GetMember(context MemberAccessibleContext, name string) Value

func (UIntValue) GetMethod added in v1.4.0

func (v UIntValue) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (UIntValue) Greater

func (v UIntValue) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (UIntValue) GreaterEqual

func (v UIntValue) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UIntValue) HashInput

func (v UIntValue) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (UIntValue) IsResourceKinded

func (UIntValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (UIntValue) IsValue added in v1.4.0

func (UIntValue) IsValue()

func (UIntValue) Less

func (UIntValue) LessEqual

func (v UIntValue) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (UIntValue) MeteredString

func (v UIntValue) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (UIntValue) Minus

func (UIntValue) Mod

func (UIntValue) Mul

func (UIntValue) NeedsStoreTo

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

func (UIntValue) Negate

func (UIntValue) Plus

func (UIntValue) RecursiveString

func (v UIntValue) RecursiveString(_ SeenReferences) string

func (UIntValue) RemoveMember

func (UIntValue) RemoveMember(_ ValueTransferContext, _ string) Value

func (UIntValue) SaturatingDiv

func (v UIntValue) SaturatingDiv(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UIntValue) SaturatingMinus

func (v UIntValue) SaturatingMinus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UIntValue) SaturatingMul

func (v UIntValue) SaturatingMul(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UIntValue) SaturatingPlus

func (v UIntValue) SaturatingPlus(context NumberValueArithmeticContext, other NumberValue) NumberValue

func (UIntValue) SetMember

func (UIntValue) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (UIntValue) StaticType

func (UIntValue) StaticType(context ValueStaticTypeContext) StaticType

func (UIntValue) Storable

func (v UIntValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint32) (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() int

func (UIntValue) Transfer

func (v UIntValue) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (UIntValue) Walk

func (UIntValue) Walk(_ ValueWalkContext, _ func(Value))

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()

func (*UUIDUnavailableError) SetLocationRange added in v1.5.0

func (e *UUIDUnavailableError) SetLocationRange(locationRange LocationRange)

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,
	_ uint32,
) (
	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 (t 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()

func (*UnderflowError) SetLocationRange added in v1.5.0

func (e *UnderflowError) SetLocationRange(locationRange LocationRange)

type UnexpectedMappedEntitlementError

type UnexpectedMappedEntitlementError struct {
	Type sema.Type
	LocationRange
}

UnexpectedMappedEntitlementError

func (*UnexpectedMappedEntitlementError) Error

func (*UnexpectedMappedEntitlementError) IsInternalError

func (*UnexpectedMappedEntitlementError) IsInternalError()

func (*UnexpectedMappedEntitlementError) SetLocationRange added in v1.5.0

func (e *UnexpectedMappedEntitlementError) SetLocationRange(locationRange LocationRange)

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()

func (*UseBeforeInitializationError) SetLocationRange added in v1.5.0

func (e *UseBeforeInitializationError) SetLocationRange(locationRange LocationRange)

type ValidateAccountCapabilitiesGetHandlerFunc

type ValidateAccountCapabilitiesGetHandlerFunc func(
	context AccountCapabilityGetValidationContext,
	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(
	context AccountCapabilityPublishValidationContext,
	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
	IsValue()
	Accept(context ValueVisitContext, visitor Visitor)
	Walk(walkContext ValueWalkContext, walkChild func(Value))
	StaticType(context ValueStaticTypeContext) 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(context ValueStaticTypeConformanceContext, results TypeConformanceResults) bool
	RecursiveString(seenReferences SeenReferences) string
	MeteredString(context ValueStringContext, seenReferences SeenReferences) string
	IsResourceKinded(context ValueStaticTypeContext) bool
	NeedsStoreTo(address atree.Address) bool
	Transfer(
		transferContext ValueTransferContext,
		address atree.Address,
		remove bool,
		storable atree.Storable,
		preventTransfer map[atree.ValueID]struct{},
		hasNoParentContainer bool,
	) Value
	DeepRemove(
		removeContext ValueRemoveContext,
		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(cloneContext ValueCloneContext) Value
	IsImportable(context ValueImportableContext) bool
}

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 AccountStorageBorrow added in v1.4.0

func AccountStorageBorrow(
	invocationContext InvocationContext,
	arguments []Value,
	typeParameter sema.Type,
	address common.Address,
) Value

func AccountStorageCheck added in v1.4.0

func AccountStorageCheck(
	invocationContext InvocationContext,
	address common.Address,
	arguments []Value,
	typeParameter sema.Type,
) Value

func AccountStorageIterate added in v1.4.0

func AccountStorageIterate(
	invocationContext InvocationContext,
	arguments []Value,
	address common.Address,
	domain common.PathDomain,
	pathType sema.Type,
) Value

func AccountStorageRead added in v1.4.0

func AccountStorageRead(
	invocationContext InvocationContext,
	arguments []Value,
	typeParameter sema.Type,
	address common.Address,
	clear bool,
) Value

func AccountStorageSave added in v1.4.0

func AccountStorageSave(
	context InvocationContext,
	arguments []Value,
	addressValue AddressValue,
) Value

func AccountStorageType added in v1.4.0

func AccountStorageType(
	interpreter InvocationContext,
	arguments []Value,
	address common.Address,
) Value

func AddressValueFromString added in v1.6.2

func AddressValueFromString(gauge common.MemoryGauge, string *StringValue) Value

func AddressValueToStringFunction added in v1.5.0

func AddressValueToStringFunction(
	invocationContext InvocationContext,
	v AddressValue,
) Value

func BoxOptional added in v1.4.0

func BoxOptional(gauge common.MemoryGauge, value Value, targetType sema.Type) Value

BoxOptional boxes a value in optionals, if necessary

func BuildStringTemplate added in v1.7.0

func BuildStringTemplate(
	context ValueStringContext,
	values []string,
	exprs []Value,
) Value

func CapabilityBorrow added in v1.4.0

func CapabilityBorrow(
	invocationContext InvocationContext,
	typeArgument sema.Type,
	addressValue AddressValue,
	capabilityID UInt64Value,
	capabilityBorrowType *sema.ReferenceType,
) Value

func CapabilityCheck added in v1.7.0

func CapabilityCheck(
	invocationContext InvocationContext,
	typeArgument sema.Type,
	addressValue AddressValue,
	capabilityID UInt64Value,
	capabilityBorrowType *sema.ReferenceType,
) Value

func ConstructCapabilityTypeValue added in v1.5.0

func ConstructCapabilityTypeValue(
	context InvocationContext,
	typeValue TypeValue,
) Value

func ConstructCompositeTypeValue added in v1.5.0

func ConstructCompositeTypeValue(
	context InvocationContext,
	typeIDValue *StringValue,
) Value

func ConstructDictionaryTypeValue added in v1.5.0

func ConstructDictionaryTypeValue(
	context InvocationContext,
	keyTypeValue TypeValue,
	valueTypeValue TypeValue,
) Value

func ConstructFunctionTypeValue added in v1.5.0

func ConstructFunctionTypeValue(
	invocationContext InvocationContext,
	parameterTypeValues *ArrayValue,
	returnTypeValue TypeValue,
) Value

func ConstructInclusiveRangeTypeValue added in v1.5.0

func ConstructInclusiveRangeTypeValue(
	context InvocationContext,
	typeValue TypeValue,
) Value

func ConstructIntersectionTypeValue added in v1.5.0

func ConstructIntersectionTypeValue(
	context InvocationContext,
	intersectionIDs *ArrayValue,
) Value

func ConstructOptionalTypeValue added in v1.5.0

func ConstructOptionalTypeValue(context InvocationContext, typeValue TypeValue) Value

func ConstructReferenceTypeValue added in v1.5.0

func ConstructReferenceTypeValue(
	invocationContext InvocationContext,
	entitlementValues *ArrayValue,
	typeValue TypeValue,
) Value

func ConvertAndBox added in v1.4.0

func ConvertAndBox(
	context ValueCreationContext,
	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 ConvertAndBoxWithValidation added in v1.8.0

func ConvertAndBoxWithValidation(
	context ValueConversionContext,
	transferredValue Value,
	valueType sema.Type,
	targetType sema.Type,
) Value

func ConvertStoredValue

func ConvertStoredValue(gauge common.MemoryGauge, value atree.Value) (Value, error)

func ConvertUInt128

func ConvertUInt128(memoryGauge common.MemoryGauge, value Value) Value

func ConvertWord128

func ConvertWord128(memoryGauge common.MemoryGauge, value Value) Value

func ConvertWord256

func ConvertWord256(memoryGauge common.MemoryGauge, value Value) Value

func CreateReferenceValue added in v1.5.0

func CreateReferenceValue(
	context ReferenceCreationContext,
	borrowType sema.Type,
	value Value,
	isImplicit bool,
) Value

func DereferenceValue

func DereferenceValue(
	context ValueTransferContext,
	value Value,
) Value

func GetReceiver added in v1.5.0

func GetReceiver(
	receiverReference ReferenceValue,
	receiverIsReference bool,
	context ValueStaticTypeContext,
) *Value

func InvokeExternally added in v1.4.0

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

func InvokeFunction added in v1.4.0

func InvokeFunction(errorHandler ErrorHandler, function FunctionValue, invocation Invocation) (value Value, err error)

InvokeFunction invokes a function value with the given invocation

func InvokeFunctionValue added in v1.4.0

func InvokeFunctionValue(
	context InvocationContext,
	function FunctionValue,
	arguments []Value,
	argumentTypes []sema.Type,
	parameterTypes []sema.Type,
	returnType sema.Type,
) (
	value Value,
	err error,
)

func IsInstance added in v1.5.0

func IsInstance(invocationContext InvocationContext, self Value, typeValue TypeValue) Value

func MetaTypeIsSubType added in v1.5.0

func MetaTypeIsSubType(
	invocationContext InvocationContext,
	typeValue TypeValue,
	otherTypeValue TypeValue,
) 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(context MemberAccessibleContext) UInt64Value,
	storageCapacityGet func(context MemberAccessibleContext) 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 NewFix128ValueFromBigEndianBytes added in v1.7.0

func NewFix128ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewFix64ValueFromBigEndianBytes added in v1.5.0

func NewFix64ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewInt128ValueFromBigEndianBytes added in v1.5.0

func NewInt128ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewInt16ValueFromBigEndianBytes added in v1.5.0

func NewInt16ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewInt256ValueFromBigEndianBytes added in v1.5.0

func NewInt256ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewInt32ValueFromBigEndianBytes added in v1.5.0

func NewInt32ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewInt64ValueFromBigEndianBytes added in v1.5.0

func NewInt64ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewInt8ValueFromBigEndianBytes added in v1.5.0

func NewInt8ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewIntValueFromBigEndianBytes added in v1.5.0

func NewIntValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewUFix128ValueFromBigEndianBytes added in v1.7.0

func NewUFix128ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewUFix64ValueFromBigEndianBytes added in v1.5.0

func NewUFix64ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewUInt128ValueFromBigEndianBytes added in v1.5.0

func NewUInt128ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewUInt16ValueFromBigEndianBytes added in v1.5.0

func NewUInt16ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewUInt256ValueFromBigEndianBytes added in v1.5.0

func NewUInt256ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewUInt32ValueFromBigEndianBytes added in v1.5.0

func NewUInt32ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewUInt64ValueFromBigEndianBytes added in v1.5.0

func NewUInt64ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewUInt8ValueFromBigEndianBytes added in v1.5.0

func NewUInt8ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewUIntValueFromBigEndianBytes added in v1.5.0

func NewUIntValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewWord128ValueFromBigEndianBytes added in v1.5.0

func NewWord128ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewWord16ValueFromBigEndianBytes added in v1.5.0

func NewWord16ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewWord256ValueFromBigEndianBytes added in v1.5.0

func NewWord256ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewWord32ValueFromBigEndianBytes added in v1.5.0

func NewWord32ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewWord64ValueFromBigEndianBytes added in v1.5.0

func NewWord64ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func NewWord8ValueFromBigEndianBytes added in v1.5.0

func NewWord8ValueFromBigEndianBytes(gauge common.MemoryGauge, b []byte) Value

func OptionalValueMapFunction added in v1.5.0

func OptionalValueMapFunction(
	invocationContext InvocationContext,
	optionalValue OptionalValue,
	transformFunctionType *sema.FunctionType,
	transformFunction FunctionValue,
	innerValueType sema.Type,
) Value

func PathValueToStringFunction added in v1.5.0

func PathValueToStringFunction(
	memoryGauge common.MemoryGauge,
	v PathValue,
) Value

func PrepareExternalInvocationArguments added in v1.5.0

func PrepareExternalInvocationArguments(context InvocationContext, functionType *sema.FunctionType, arguments []Value) ([]Value, error)

func StoredValue

func StoredValue(gauge common.MemoryGauge, storable atree.Storable, storage atree.SlabStorage) Value

func StringConcat added in v1.4.0

func StringConcat(
	context StringValueFunctionContext,
	this *StringValue,
	other Value,
) Value

func StringFunctionEncodeHex added in v1.5.0

func StringFunctionEncodeHex(
	invocationContext InvocationContext,
	argument *ArrayValue,
) Value

func StringFunctionFromCharacters added in v1.5.0

func StringFunctionFromCharacters(
	invocationContext InvocationContext,
	argument *ArrayValue,
) Value

func StringFunctionFromUtf8 added in v1.5.0

func StringFunctionFromUtf8(
	invocationContext InvocationContext,
	argument *ArrayValue,
) Value

func StringFunctionJoin added in v1.5.0

func StringFunctionJoin(
	context InvocationContext,
	stringArray *ArrayValue,
	separator *StringValue,
) Value

func TransferAndConvert added in v1.5.0

func TransferAndConvert(
	context ValueConversionContext,
	value Value,
	valueType, targetType sema.Type,
) Value

func TransferIfNotResourceAndConvert added in v1.8.0

func TransferIfNotResourceAndConvert(
	context ValueConversionContext,
	value Value,
	valueType, targetType sema.Type,
) Value

func Unbox added in v1.4.0

func Unbox(value Value) Value

func ValueGetType added in v1.5.0

func ValueGetType(context InvocationContext, self Value) Value

type ValueCapabilityControllerReferenceValueContext added in v1.4.0

type ValueCapabilityControllerReferenceValueContext interface {
	FunctionCreationContext
	ValueStaticTypeContext
	AccountHandlerContext
	AccountCreationContext
}

type ValueCloneContext added in v1.4.0

type ValueCloneContext interface {
	StorageContext
	ReferenceTracker
}

type ValueComparisonContext added in v1.4.0

type ValueComparisonContext interface {
	common.Gauge
	ValueStaticTypeContext
}

type ValueConversionContext added in v1.4.0

type ValueConversionContext interface {
	ValueTransferContext
}

type ValueConverterDeclaration

type ValueConverterDeclaration struct {
	Min     Value
	Max     Value
	Convert func(common.MemoryGauge, Value) Value

	Name string
	// contains filtered or unexported fields
}

type ValueCreationContext added in v1.4.0

type ValueCreationContext interface {
	ArrayCreationContext
	DictionaryCreationContext
}

type ValueDeclaration

type ValueDeclaration interface {
	ValueDeclarationName() string
	ValueDeclarationValue() Value
}

type ValueExportContext added in v1.4.0

type ValueExportContext interface {
	ContainerMutationContext // needed for container iteration
	CompositeValueExportContext
}

type ValueImportableContext added in v1.4.0

type ValueImportableContext interface {
	ContainerMutationContext
}

type ValueIndexableValue

type ValueIndexableValue interface {
	Value
	GetKey(context ContainerReadContext, key Value) Value
	SetKey(context ContainerMutationContext, key Value, value Value)
	RemoveKey(context ContainerMutationContext, key Value) Value
	InsertKey(context ContainerMutationContext, key Value, value Value)
}

type ValueIterator

type ValueIterator interface {
	HasNext(context ValueIteratorContext) bool
	Next(context ValueIteratorContext) Value
	ValueID() (atree.ValueID, bool)
}

ValueIterator is an iterator which returns values. When Next returns nil, it signals the end of the iterator.

func NewArrayIterator added in v1.7.2

func NewArrayIterator(gauge common.MemoryGauge, v *ArrayValue) ValueIterator

type ValueIteratorContext added in v1.4.0

type ValueIteratorContext interface {
	common.Gauge
	NumberValueArithmeticContext
}

type ValueRemoveContext added in v1.4.0

type ValueRemoveContext = ValueTransferContext

type ValueStaticTypeConformanceContext added in v1.4.0

type ValueStaticTypeConformanceContext interface {
	ValueStaticTypeContext
	ContainerMutationContext
}

type ValueStaticTypeContext added in v1.4.0

type ValueStaticTypeContext interface {
	common.Gauge
	StorageReader
	TypeConverter
	IsTypeInfoRecovered(location common.Location) bool
}

type ValueStringContext added in v1.4.0

type ValueStringContext interface {
	ValueTransferContext
}

type ValueTransferContext added in v1.4.0

type ValueTransferContext interface {
	StorageContext
	ReferenceTracker
	common.ComputationGauge
	Tracer

	OnResourceOwnerChange(
		resource *CompositeValue,
		oldOwner common.Address,
		newOwner common.Address,
	)

	WithContainerMutationPrevention(valueID atree.ValueID, f func())
	ValidateContainerMutation(valueID atree.ValueID)

	EnforceNotResourceDestruction(valueID atree.ValueID)
}

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()

func (*ValueTransferTypeError) SetLocationRange added in v1.5.0

func (e *ValueTransferTypeError) SetLocationRange(locationRange LocationRange)

type ValueVisitContext added in v1.4.0

type ValueVisitContext interface {
	ValueWalkContext
}

type ValueWalkContext added in v1.4.0

type ValueWalkContext interface {
	ContainerMutationContext
}

type ValueWalker

type ValueWalker interface {
	WalkValue(context ValueWalkContext, value Value) ValueWalker
}

type Variable

type Variable interface {
	GetValue(ValueStaticTypeContext) Value
	SetValue(context ValueStaticTypeContext, value Value)
	InitializeWithValue(value Value)
	InitializeWithGetter(getter func() Value)
	Kind() VariableKind
}

func NewContractVariableWithGetter added in v1.7.0

func NewContractVariableWithGetter(gauge common.MemoryGauge, getter func() Value) Variable

func NewSelfVariableWithValue

func NewSelfVariableWithValue(interpreter *Interpreter, value Value) 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 VariableKind added in v1.7.0

type VariableKind uint8
const (
	VariableKindSimple VariableKind = iota
	VariableKindSelf
	VariableKindContract
)

type VariableResolver added in v1.4.0

type VariableResolver interface {
	GetValueOfVariable(name string) Value
}

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

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) 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(context ValueVisitContext, value *SimpleCompositeValue)
	VisitTypeValue(context ValueVisitContext, value TypeValue)
	VisitVoidValue(context ValueVisitContext, value VoidValue)
	VisitBoolValue(context ValueVisitContext, value BoolValue)
	VisitStringValue(context ValueVisitContext, value *StringValue)
	VisitCharacterValue(context ValueVisitContext, value CharacterValue)
	VisitArrayValue(context ValueVisitContext, value *ArrayValue) bool
	VisitIntValue(context ValueVisitContext, value IntValue)
	VisitInt8Value(context ValueVisitContext, value Int8Value)
	VisitInt16Value(context ValueVisitContext, value Int16Value)
	VisitInt32Value(context ValueVisitContext, value Int32Value)
	VisitInt64Value(context ValueVisitContext, value Int64Value)
	VisitInt128Value(context ValueVisitContext, value Int128Value)
	VisitInt256Value(context ValueVisitContext, value Int256Value)
	VisitUIntValue(context ValueVisitContext, value UIntValue)
	VisitUInt8Value(context ValueVisitContext, value UInt8Value)
	VisitUInt16Value(context ValueVisitContext, value UInt16Value)
	VisitUInt32Value(context ValueVisitContext, value UInt32Value)
	VisitUInt64Value(context ValueVisitContext, value UInt64Value)
	VisitUInt128Value(context ValueVisitContext, value UInt128Value)
	VisitUInt256Value(context ValueVisitContext, value UInt256Value)
	VisitWord8Value(context ValueVisitContext, value Word8Value)
	VisitWord16Value(context ValueVisitContext, value Word16Value)
	VisitWord32Value(context ValueVisitContext, value Word32Value)
	VisitWord64Value(context ValueVisitContext, value Word64Value)
	VisitWord128Value(context ValueVisitContext, value Word128Value)
	VisitWord256Value(context ValueVisitContext, value Word256Value)
	VisitFix64Value(context ValueVisitContext, value Fix64Value)
	VisitFix128Value(context ValueVisitContext, v Fix128Value)
	VisitUFix64Value(context ValueVisitContext, value UFix64Value)
	VisitUFix128Value(context ValueVisitContext, v UFix128Value)
	VisitCompositeValue(context ValueVisitContext, value *CompositeValue) bool
	VisitDictionaryValue(context ValueVisitContext, value *DictionaryValue) bool
	VisitNilValue(context ValueVisitContext, value NilValue)
	VisitSomeValue(context ValueVisitContext, value *SomeValue) bool
	VisitStorageReferenceValue(context ValueVisitContext, value *StorageReferenceValue)
	VisitEphemeralReferenceValue(context ValueVisitContext, value *EphemeralReferenceValue)
	VisitAddressValue(context ValueVisitContext, value AddressValue)
	VisitPathValue(context ValueVisitContext, value PathValue)
	VisitCapabilityValue(context ValueVisitContext, value *IDCapabilityValue)
	VisitPublishedValue(context ValueVisitContext, value *PublishedValue)
	VisitInterpretedFunctionValue(context ValueVisitContext, value *InterpretedFunctionValue)
	VisitHostFunctionValue(context ValueVisitContext, value *HostFunctionValue)
	VisitBoundFunctionValue(context ValueVisitContext, value BoundFunctionValue)
	VisitStorageCapabilityControllerValue(context ValueVisitContext, v *StorageCapabilityControllerValue)
	VisitAccountCapabilityControllerValue(context ValueVisitContext, v *AccountCapabilityControllerValue)
}

type VoidValue

type VoidValue struct{}

func (VoidValue) Accept

func (v VoidValue) Accept(context ValueVisitContext, visitor Visitor)

func (VoidValue) ByteSize

func (VoidValue) ByteSize() uint32

func (VoidValue) ChildStorables

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

func (VoidValue) Clone

func (v VoidValue) Clone(_ ValueCloneContext) Value

func (VoidValue) ConformsToStaticType

func (VoidValue) DeepRemove

func (VoidValue) DeepRemove(_ ValueRemoveContext, _ 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(_ ValueComparisonContext, other Value) bool

func (VoidValue) IsImportable

func (VoidValue) IsImportable(_ ValueImportableContext) bool

func (VoidValue) IsResourceKinded

func (VoidValue) IsResourceKinded(_ ValueStaticTypeContext) bool

func (VoidValue) IsValue added in v1.4.0

func (VoidValue) IsValue()

func (VoidValue) MeteredString

func (v VoidValue) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) 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(context ValueStaticTypeContext) 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(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (VoidValue) Walk

func (VoidValue) Walk(_ ValueWalkContext, _ func(Value))

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 uint64) Word128Value

func (Word128Value) Accept

func (v Word128Value) Accept(context ValueVisitContext, visitor Visitor)

func (Word128Value) BitwiseAnd

func (v Word128Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word128Value) BitwiseLeftShift

func (v Word128Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word128Value) BitwiseOr

func (v Word128Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word128Value) BitwiseRightShift

func (v Word128Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word128Value) BitwiseXor

func (v Word128Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) 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 (Word128Value) ConformsToStaticType

func (Word128Value) DeepRemove

func (Word128Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Word128Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Word128Value) GetMember

func (v Word128Value) GetMember(context MemberAccessibleContext, name string) Value

func (Word128Value) GetMethod added in v1.4.0

func (v Word128Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Word128Value) Greater

func (Word128Value) GreaterEqual

func (v Word128Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word128Value) HashInput

func (v Word128Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (Word128Value) IsResourceKinded

func (Word128Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Word128Value) IsStorable

func (Word128Value) IsStorable() bool

func (Word128Value) IsValue added in v1.4.0

func (Word128Value) IsValue()

func (Word128Value) Less

func (Word128Value) LessEqual

func (v Word128Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word128Value) MeteredString

func (v Word128Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Word128Value) Minus

func (Word128Value) Mod

func (Word128Value) Mul

func (Word128Value) NeedsStoreTo

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

func (Word128Value) Negate

func (Word128Value) Plus

func (Word128Value) RecursiveString

func (v Word128Value) RecursiveString(_ SeenReferences) string

func (Word128Value) RemoveMember

func (Word128Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Word128Value) SaturatingDiv

func (Word128Value) SaturatingMinus

func (Word128Value) SaturatingMul

func (Word128Value) SaturatingPlus

func (Word128Value) SetMember

func (Word128Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Word128Value) StaticType

func (Word128Value) StaticType(context ValueStaticTypeContext) 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() int

func (Word128Value) Transfer

func (v Word128Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word128Value) Walk

func (Word128Value) Walk(_ ValueWalkContext, _ func(Value))

type Word16Value

type Word16Value uint16

func ConvertWord16

func ConvertWord16(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (Word16Value) BitwiseAnd

func (v Word16Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word16Value) BitwiseLeftShift

func (v Word16Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word16Value) BitwiseOr

func (v Word16Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word16Value) BitwiseRightShift

func (v Word16Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word16Value) BitwiseXor

func (v Word16Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word16Value) ByteSize

func (v Word16Value) ByteSize() uint32

func (Word16Value) ChildStorables

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

func (Word16Value) Clone

func (v Word16Value) Clone(_ ValueCloneContext) Value

func (Word16Value) ConformsToStaticType

func (Word16Value) DeepRemove

func (Word16Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Word16Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Word16Value) GetMember

func (v Word16Value) GetMember(context MemberAccessibleContext, name string) Value

func (Word16Value) GetMethod added in v1.4.0

func (v Word16Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Word16Value) Greater

func (v Word16Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word16Value) GreaterEqual

func (v Word16Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word16Value) HashInput

func (v Word16Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (Word16Value) IsResourceKinded

func (Word16Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Word16Value) IsStorable

func (Word16Value) IsStorable() bool

func (Word16Value) IsValue added in v1.4.0

func (Word16Value) IsValue()

func (Word16Value) Less

func (Word16Value) LessEqual

func (v Word16Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word16Value) MeteredString

func (v Word16Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Word16Value) Minus

func (Word16Value) Mod

func (Word16Value) Mul

func (Word16Value) NeedsStoreTo

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

func (Word16Value) Negate

func (Word16Value) Plus

func (Word16Value) RecursiveString

func (v Word16Value) RecursiveString(_ SeenReferences) string

func (Word16Value) RemoveMember

func (Word16Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Word16Value) SaturatingDiv

func (Word16Value) SaturatingMinus

func (Word16Value) SaturatingMul

func (Word16Value) SaturatingPlus

func (Word16Value) SetMember

func (Word16Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Word16Value) StaticType

func (Word16Value) StaticType(context ValueStaticTypeContext) 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() int

func (Word16Value) Transfer

func (v Word16Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word16Value) Walk

func (Word16Value) Walk(_ ValueWalkContext, _ func(Value))

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 uint64) Word256Value

func (Word256Value) Accept

func (v Word256Value) Accept(context ValueVisitContext, visitor Visitor)

func (Word256Value) BitwiseAnd

func (v Word256Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word256Value) BitwiseLeftShift

func (v Word256Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word256Value) BitwiseOr

func (v Word256Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word256Value) BitwiseRightShift

func (v Word256Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word256Value) BitwiseXor

func (v Word256Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) 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 (Word256Value) ConformsToStaticType

func (Word256Value) DeepRemove

func (Word256Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Word256Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Word256Value) GetMember

func (v Word256Value) GetMember(context MemberAccessibleContext, name string) Value

func (Word256Value) GetMethod added in v1.4.0

func (v Word256Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Word256Value) Greater

func (Word256Value) GreaterEqual

func (v Word256Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word256Value) HashInput

func (v Word256Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (Word256Value) IsResourceKinded

func (Word256Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Word256Value) IsStorable

func (Word256Value) IsStorable() bool

func (Word256Value) IsValue added in v1.4.0

func (Word256Value) IsValue()

func (Word256Value) Less

func (Word256Value) LessEqual

func (v Word256Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word256Value) MeteredString

func (v Word256Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Word256Value) Minus

func (Word256Value) Mod

func (Word256Value) Mul

func (Word256Value) NeedsStoreTo

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

func (Word256Value) Negate

func (Word256Value) Plus

func (Word256Value) RecursiveString

func (v Word256Value) RecursiveString(_ SeenReferences) string

func (Word256Value) RemoveMember

func (Word256Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Word256Value) SaturatingDiv

func (Word256Value) SaturatingMinus

func (Word256Value) SaturatingMul

func (Word256Value) SaturatingPlus

func (Word256Value) SetMember

func (Word256Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Word256Value) StaticType

func (Word256Value) StaticType(context ValueStaticTypeContext) 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() int

func (Word256Value) Transfer

func (v Word256Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word256Value) Walk

func (Word256Value) Walk(_ ValueWalkContext, _ func(Value))

type Word32Value

type Word32Value uint32

func ConvertWord32

func ConvertWord32(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (Word32Value) BitwiseAnd

func (v Word32Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word32Value) BitwiseLeftShift

func (v Word32Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word32Value) BitwiseOr

func (v Word32Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word32Value) BitwiseRightShift

func (v Word32Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word32Value) BitwiseXor

func (v Word32Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word32Value) ByteSize

func (v Word32Value) ByteSize() uint32

func (Word32Value) ChildStorables

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

func (Word32Value) Clone

func (v Word32Value) Clone(_ ValueCloneContext) Value

func (Word32Value) ConformsToStaticType

func (Word32Value) DeepRemove

func (Word32Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Word32Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Word32Value) GetMember

func (v Word32Value) GetMember(context MemberAccessibleContext, name string) Value

func (Word32Value) GetMethod added in v1.4.0

func (v Word32Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Word32Value) Greater

func (v Word32Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word32Value) GreaterEqual

func (v Word32Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word32Value) HashInput

func (v Word32Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (Word32Value) IsResourceKinded

func (Word32Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Word32Value) IsStorable

func (Word32Value) IsStorable() bool

func (Word32Value) IsValue added in v1.4.0

func (Word32Value) IsValue()

func (Word32Value) Less

func (Word32Value) LessEqual

func (v Word32Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word32Value) MeteredString

func (v Word32Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Word32Value) Minus

func (Word32Value) Mod

func (Word32Value) Mul

func (Word32Value) NeedsStoreTo

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

func (Word32Value) Negate

func (Word32Value) Plus

func (Word32Value) RecursiveString

func (v Word32Value) RecursiveString(_ SeenReferences) string

func (Word32Value) RemoveMember

func (Word32Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Word32Value) SaturatingDiv

func (Word32Value) SaturatingMinus

func (Word32Value) SaturatingMul

func (Word32Value) SaturatingPlus

func (Word32Value) SetMember

func (Word32Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Word32Value) StaticType

func (Word32Value) StaticType(context ValueStaticTypeContext) 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() int

func (Word32Value) Transfer

func (v Word32Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word32Value) Walk

func (Word32Value) Walk(_ ValueWalkContext, _ func(Value))

type Word64Value

type Word64Value uint64

func ConvertWord64

func ConvertWord64(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (Word64Value) BitwiseAnd

func (v Word64Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word64Value) BitwiseLeftShift

func (v Word64Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word64Value) BitwiseOr

func (v Word64Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word64Value) BitwiseRightShift

func (v Word64Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word64Value) BitwiseXor

func (v Word64Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) 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(_ ValueCloneContext) Value

func (Word64Value) ConformsToStaticType

func (Word64Value) DeepRemove

func (Word64Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Word64Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Word64Value) GetMember

func (v Word64Value) GetMember(context MemberAccessibleContext, name string) Value

func (Word64Value) GetMethod added in v1.4.0

func (v Word64Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Word64Value) Greater

func (v Word64Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word64Value) GreaterEqual

func (v Word64Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word64Value) HashInput

func (v Word64Value) HashInput(_ common.Gauge, 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(_ ValueImportableContext) bool

func (Word64Value) IsResourceKinded

func (Word64Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Word64Value) IsStorable

func (Word64Value) IsStorable() bool

func (Word64Value) IsValue added in v1.4.0

func (Word64Value) IsValue()

func (Word64Value) Less

func (Word64Value) LessEqual

func (v Word64Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word64Value) MeteredString

func (v Word64Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Word64Value) Minus

func (Word64Value) Mod

func (Word64Value) Mul

func (Word64Value) NeedsStoreTo

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

func (Word64Value) Negate

func (Word64Value) Plus

func (Word64Value) RecursiveString

func (v Word64Value) RecursiveString(_ SeenReferences) string

func (Word64Value) RemoveMember

func (Word64Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Word64Value) SaturatingDiv

func (Word64Value) SaturatingMinus

func (Word64Value) SaturatingMul

func (Word64Value) SaturatingPlus

func (Word64Value) SetMember

func (Word64Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Word64Value) StaticType

func (Word64Value) StaticType(context ValueStaticTypeContext) 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() int

func (Word64Value) Transfer

func (v Word64Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word64Value) Walk

func (Word64Value) Walk(_ ValueWalkContext, _ func(Value))

type Word8Value

type Word8Value uint8

func ConvertWord8

func ConvertWord8(memoryGauge common.MemoryGauge, value Value) 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(context ValueVisitContext, visitor Visitor)

func (Word8Value) BitwiseAnd

func (v Word8Value) BitwiseAnd(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word8Value) BitwiseLeftShift

func (v Word8Value) BitwiseLeftShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word8Value) BitwiseOr

func (v Word8Value) BitwiseOr(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word8Value) BitwiseRightShift

func (v Word8Value) BitwiseRightShift(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word8Value) BitwiseXor

func (v Word8Value) BitwiseXor(context ValueStaticTypeContext, other IntegerValue) IntegerValue

func (Word8Value) ByteSize

func (v Word8Value) ByteSize() uint32

func (Word8Value) ChildStorables

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

func (Word8Value) Clone

func (v Word8Value) Clone(_ ValueCloneContext) Value

func (Word8Value) ConformsToStaticType

func (Word8Value) DeepRemove

func (Word8Value) DeepRemove(_ ValueRemoveContext, _ bool)

func (Word8Value) Div

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(_ ValueComparisonContext, other Value) bool

func (Word8Value) GetMember

func (v Word8Value) GetMember(context MemberAccessibleContext, name string) Value

func (Word8Value) GetMethod added in v1.4.0

func (v Word8Value) GetMethod(context MemberAccessibleContext, name string) FunctionValue

func (Word8Value) Greater

func (v Word8Value) Greater(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word8Value) GreaterEqual

func (v Word8Value) GreaterEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word8Value) HashInput

func (v Word8Value) HashInput(_ common.Gauge, scratch []byte) []byte

HashInput returns a byte slice containing: - HashInputTypeWord8 (1 byte) - uint8 value (1 byte)

func (Word8Value) IsImportable

func (Word8Value) IsImportable(_ ValueImportableContext) bool

func (Word8Value) IsResourceKinded

func (Word8Value) IsResourceKinded(_ ValueStaticTypeContext) bool

func (Word8Value) IsStorable

func (Word8Value) IsStorable() bool

func (Word8Value) IsValue added in v1.4.0

func (Word8Value) IsValue()

func (Word8Value) Less

func (Word8Value) LessEqual

func (v Word8Value) LessEqual(context ValueComparisonContext, other ComparableValue) BoolValue

func (Word8Value) MeteredString

func (v Word8Value) MeteredString(
	context ValueStringContext,
	_ SeenReferences,
) string

func (Word8Value) Minus

func (Word8Value) Mod

func (Word8Value) Mul

func (Word8Value) NeedsStoreTo

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

func (Word8Value) Negate

func (Word8Value) Plus

func (Word8Value) RecursiveString

func (v Word8Value) RecursiveString(_ SeenReferences) string

func (Word8Value) RemoveMember

func (Word8Value) RemoveMember(_ ValueTransferContext, _ string) Value

func (Word8Value) SaturatingDiv

func (Word8Value) SaturatingMinus

func (Word8Value) SaturatingMul

func (Word8Value) SaturatingPlus

func (Word8Value) SetMember

func (Word8Value) SetMember(_ ValueTransferContext, _ string, _ Value) bool

func (Word8Value) StaticType

func (Word8Value) StaticType(context ValueStaticTypeContext) 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() int

func (Word8Value) Transfer

func (v Word8Value) Transfer(
	context ValueTransferContext,
	_ atree.Address,
	remove bool,
	storable atree.Storable,
	_ map[atree.ValueID]struct{},
	_ bool,
) Value

func (Word8Value) Walk

func (Word8Value) Walk(_ ValueWalkContext, _ func(Value))

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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