Documentation
¶
Index ¶
- Constants
- func BigEndianBytesToSignedBigInt(b []byte) *big.Int
- func BigEndianBytesToUnsignedBigInt(b []byte) *big.Int
- func GetBigIntCBORSize(v *big.Int) uint32
- func GetBytesCBORSize(b []byte) uint32
- func GetIntCBORSize(v int64) uint32
- func GetUintCBORSize(v uint64) uint32
- func MaybeLargeImmutableStorable(storable atree.Storable, storage atree.SlabStorage, address atree.Address, ...) (atree.Storable, error)
- func SafeAddUint64(a, b uint64) (uint64, error)
- func SignedBigIntToBigEndianBytes(bigInt *big.Int) []byte
- func SignedBigIntToSizedBigEndianBytes(bigInt *big.Int, sizeInBytes uint) []byte
- func UnsignedBigIntToBigEndianBytes(bigInt *big.Int) []byte
- func UnsignedBigIntToSizedBigEndianBytes(bigInt *big.Int, sizeInBytes uint) []byte
- type BoolValue
- func (v BoolValue) ByteSize() uint32
- func (BoolValue) ChildStorables() []atree.Storable
- func (v BoolValue) Encode(e *atree.Encoder) error
- func (v BoolValue) Equal(_ common.Gauge, other Value) bool
- func (v BoolValue) Greater(_ common.Gauge, other BoolValue) bool
- func (v BoolValue) GreaterEqual(_ common.Gauge, other BoolValue) bool
- func (BoolValue) IsValue()
- func (v BoolValue) Less(_ common.Gauge, other BoolValue) bool
- func (v BoolValue) LessEqual(_ common.Gauge, other BoolValue) bool
- func (v BoolValue) Negate() BoolValue
- func (v BoolValue) Storable(_ atree.SlabStorage, _ atree.Address, _ uint32) (atree.Storable, error)
- func (v BoolValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)
- func (v BoolValue) String() string
- type ComparableValue
- type DivisionByZeroError
- type EquatableValue
- type FixedPointValue
- type IntValue
- func NewIntValueFromBigInt(memoryGauge common.MemoryGauge, memoryUsage common.MemoryUsage, ...) IntValue
- func NewIntValueFromInt64(memoryGauge common.MemoryGauge, value int64) IntValue
- func NewUnmeteredIntValueFromBigInt(value *big.Int) IntValue
- func NewUnmeteredIntValueFromInt64(value int64) IntValue
- func (v IntValue) BitwiseAnd(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) BitwiseLeftShift(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) BitwiseOr(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) BitwiseRightShift(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) BitwiseXor(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) ByteSize() uint32
- func (IntValue) ChildStorables() []atree.Storable
- func (v IntValue) Div(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) Encode(e *atree.Encoder) error
- func (v IntValue) Equal(gauge common.Gauge, other Value) bool
- func (v IntValue) Greater(gauge common.Gauge, other IntValue) bool
- func (v IntValue) GreaterEqual(gauge common.Gauge, other IntValue) bool
- func (IntValue) IsValue()
- func (v IntValue) Less(gauge common.Gauge, other IntValue) bool
- func (v IntValue) LessEqual(gauge common.Gauge, other IntValue) bool
- func (v IntValue) Minus(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) Mod(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) Mul(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) Negate(gauge common.Gauge) IntValue
- func (v IntValue) Plus(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) SaturatingDiv(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) SaturatingMinus(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) SaturatingMul(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) SaturatingPlus(gauge common.Gauge, other IntValue) (IntValue, error)
- func (v IntValue) Storable(storage atree.SlabStorage, address atree.Address, maxInlineSize uint32) (atree.Storable, error)
- func (v IntValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)
- func (v IntValue) String() string
- func (v IntValue) ToBigEndianBytes() []byte
- func (v IntValue) ToInt() (int, error)
- type IntegerValue
- type InvalidOperandsError
- type NegativeShiftError
- type NumberValue
- type OverflowError
- type UFix64Value
- func NewUFix64Value(gauge common.MemoryGauge, constructor func() (uint64, error)) (UFix64Value, error)
- func NewUFix64ValueWithInteger(gauge common.MemoryGauge, constructor func() (uint64, error)) (UFix64Value, error)
- func NewUnmeteredUFix64Value(integer uint64) UFix64Value
- func NewUnmeteredUFix64ValueWithInteger(integer uint64) (UFix64Value, error)
- func (v UFix64Value) ByteSize() uint32
- func (UFix64Value) ChildStorables() []atree.Storable
- func (v UFix64Value) Div(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
- func (v UFix64Value) Encode(e *atree.Encoder) error
- func (v UFix64Value) Equal(_ common.Gauge, other Value) bool
- func (v UFix64Value) Greater(_ common.Gauge, other UFix64Value) bool
- func (v UFix64Value) GreaterEqual(_ common.Gauge, other UFix64Value) bool
- func (v UFix64Value) IntegerPart() uint64
- func (UFix64Value) IsValue()
- func (v UFix64Value) Less(_ common.Gauge, other UFix64Value) bool
- func (v UFix64Value) LessEqual(_ common.Gauge, other UFix64Value) bool
- func (v UFix64Value) Minus(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
- func (v UFix64Value) Mod(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
- func (v UFix64Value) Mul(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
- func (v UFix64Value) Negate(_ common.Gauge) UFix64Value
- func (v UFix64Value) Plus(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
- func (v UFix64Value) SaturatingDiv(_ common.Gauge, _ UFix64Value) (UFix64Value, error)
- func (v UFix64Value) SaturatingMinus(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
- func (v UFix64Value) SaturatingMul(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
- func (v UFix64Value) SaturatingPlus(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
- func (UFix64Value) Scale() int
- func (v UFix64Value) Storable(_ atree.SlabStorage, _ atree.Address, _ uint32) (atree.Storable, error)
- func (v UFix64Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)
- func (v UFix64Value) String() string
- func (v UFix64Value) ToBigEndianBytes() []byte
- func (v UFix64Value) ToInt() (int, error)
- type UnderflowError
- type Value
Constants ¶
View Source
const ( CBORTagVoidValue = CBORTagBase + iota CBORTagSomeValue CBORTagAddressValue CBORTagCompositeValue CBORTagTypeValue CBORTagStringValue CBORTagCharacterValue CBORTagSomeValueWithNestedLevels // Int* CBORTagIntValue CBORTagInt8Value CBORTagInt16Value CBORTagInt32Value CBORTagInt64Value CBORTagInt128Value CBORTagInt256Value // UInt* CBORTagUIntValue CBORTagUInt8Value CBORTagUInt16Value CBORTagUInt32Value CBORTagUInt64Value CBORTagUInt128Value CBORTagUInt256Value CBORTagWord8Value CBORTagWord16Value CBORTagWord32Value CBORTagWord64Value CBORTagWord128Value CBORTagWord256Value CBORTagFix64Value CBORTagFix128Value CBORTagUFix64Value CBORTagUFix128Value // Locations CBORTagAddressLocation CBORTagStringLocation CBORTagIdentifierLocation CBORTagTransactionLocation CBORTagScriptLocation CBORTagPathValue // Deprecated: CBORTagPathCapabilityValue CBORTagPathCapabilityValue // Deprecated: CBORTagPathLinkValue CBORTagPathLinkValue CBORTagPublishedValue // Deprecated: CBORTagAccountLinkValue CBORTagAccountLinkValue CBORTagStorageCapabilityControllerValue CBORTagAccountCapabilityControllerValue CBORTagCapabilityValue // Static Types CBORTagPrimitiveStaticType CBORTagCompositeStaticType CBORTagInterfaceStaticType CBORTagVariableSizedStaticType CBORTagConstantSizedStaticType CBORTagDictionaryStaticType CBORTagOptionalStaticType CBORTagReferenceStaticType CBORTagIntersectionStaticType CBORTagCapabilityStaticType CBORTagEntitlementMapStaticAuthorization CBORTagEntitlementSetStaticAuthorization CBORTagInaccessibleStaticAuthorization CBORTagInclusiveRangeStaticType // !!! *WARNING* !!! // ADD NEW TYPES *BEFORE* THIS WARNING. // DO *NOT* ADD NEW TYPES AFTER THIS LINE! CBORTag_Count )
View Source
const CBORTagBase = 128
View Source
const CBORTagSize = 2
View Source
const FalseValue = BoolValue(false)
View Source
const TrueValue = BoolValue(true)
Variables ¶
This section is empty.
Functions ¶
func GetBigIntCBORSize ¶
func GetBytesCBORSize ¶
func GetIntCBORSize ¶
func GetUintCBORSize ¶
func MaybeLargeImmutableStorable ¶
func MaybeLargeImmutableStorable( storable atree.Storable, storage atree.SlabStorage, address atree.Address, maxInlineSize uint32, ) ( atree.Storable, error, )
MaybeLargeImmutableStorable either returns the given immutable atree.Storable if it can be stored inline inside its parent container, or else stores it in a separate slab and returns an atree.SlabIDStorable.
func SafeAddUint64 ¶
Types ¶
type BoolValue ¶
type BoolValue bool
func (BoolValue) ChildStorables ¶
func (BoolValue) GreaterEqual ¶
func (BoolValue) StoredValue ¶
type ComparableValue ¶
type DivisionByZeroError ¶
type DivisionByZeroError struct{}
func (DivisionByZeroError) Error ¶
func (DivisionByZeroError) Error() string
func (DivisionByZeroError) IsUserError ¶
func (DivisionByZeroError) IsUserError()
type EquatableValue ¶
type FixedPointValue ¶
type FixedPointValue[T Value, U uint64 | int64] interface { NumberValue[T] IntegerPart() U Scale() int }
FixedPointValue is a fixed-point number value
type 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 (IntValue) BitwiseAnd ¶
func (IntValue) BitwiseLeftShift ¶
func (IntValue) BitwiseRightShift ¶
func (IntValue) BitwiseXor ¶
func (IntValue) ChildStorables ¶
func (IntValue) Encode ¶
Encode encodes the value as
cbor.Tag{
Number: CBORTagIntValue,
Content: *big.Int(v.BigInt),
}
func (IntValue) GreaterEqual ¶
func (IntValue) SaturatingDiv ¶
func (IntValue) SaturatingMinus ¶
func (IntValue) SaturatingMul ¶
func (IntValue) SaturatingPlus ¶
func (IntValue) StoredValue ¶
func (IntValue) ToBigEndianBytes ¶
type IntegerValue ¶
type IntegerValue[T Value] interface { NumberValue[T] BitwiseOr(gauge common.Gauge, other T) (T, error) BitwiseXor(gauge common.Gauge, other T) (T, error) BitwiseAnd(gauge common.Gauge, other T) (T, error) BitwiseLeftShift(gauge common.Gauge, other T) (T, error) BitwiseRightShift(gauge common.Gauge, other T) (T, error) }
type InvalidOperandsError ¶
type InvalidOperandsError struct{}
func (InvalidOperandsError) Error ¶
func (InvalidOperandsError) Error() string
func (InvalidOperandsError) IsUserError ¶
func (InvalidOperandsError) IsUserError()
type NegativeShiftError ¶
type NegativeShiftError struct{}
func (NegativeShiftError) Error ¶
func (NegativeShiftError) Error() string
func (NegativeShiftError) IsUserError ¶
func (NegativeShiftError) IsUserError()
type NumberValue ¶
type NumberValue[T Value] interface { ComparableValue[T] ToInt() (int, error) Negate(gauge common.Gauge) T Plus(gauge common.Gauge, other T) (T, error) SaturatingPlus(gauge common.Gauge, other T) (T, error) Minus(gauge common.Gauge, other T) (T, error) SaturatingMinus(gauge common.Gauge, other T) (T, error) Mod(gauge common.Gauge, other T) (T, error) Mul(gauge common.Gauge, other T) (T, error) SaturatingMul(gauge common.Gauge, other T) (T, error) Div(gauge common.Gauge, other T) (T, error) SaturatingDiv(gauge common.Gauge, other T) (T, error) ToBigEndianBytes() []byte }
type OverflowError ¶
type OverflowError struct{}
func (OverflowError) Error ¶
func (OverflowError) Error() string
func (OverflowError) IsUserError ¶
func (OverflowError) IsUserError()
type UFix64Value ¶
type UFix64Value uint64
func NewUFix64Value ¶
func NewUFix64Value(gauge common.MemoryGauge, constructor func() (uint64, error)) (UFix64Value, error)
func NewUFix64ValueWithInteger ¶
func NewUFix64ValueWithInteger(gauge common.MemoryGauge, constructor func() (uint64, error)) (UFix64Value, error)
func NewUnmeteredUFix64Value ¶
func NewUnmeteredUFix64Value(integer uint64) UFix64Value
func NewUnmeteredUFix64ValueWithInteger ¶
func NewUnmeteredUFix64ValueWithInteger(integer uint64) (UFix64Value, error)
func (UFix64Value) ByteSize ¶
func (v UFix64Value) ByteSize() uint32
func (UFix64Value) ChildStorables ¶
func (UFix64Value) ChildStorables() []atree.Storable
func (UFix64Value) Div ¶
func (v UFix64Value) Div(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
func (UFix64Value) Encode ¶
func (v UFix64Value) Encode(e *atree.Encoder) error
Encode encodes UFix64Value as
cbor.Tag{
Number: CBORTagUFix64Value,
Content: uint64(v),
}
func (UFix64Value) Greater ¶
func (v UFix64Value) Greater(_ common.Gauge, other UFix64Value) bool
func (UFix64Value) GreaterEqual ¶
func (v UFix64Value) GreaterEqual(_ common.Gauge, other UFix64Value) bool
func (UFix64Value) IntegerPart ¶
func (v UFix64Value) IntegerPart() uint64
func (UFix64Value) IsValue ¶
func (UFix64Value) IsValue()
func (UFix64Value) Less ¶
func (v UFix64Value) Less(_ common.Gauge, other UFix64Value) bool
func (UFix64Value) LessEqual ¶
func (v UFix64Value) LessEqual(_ common.Gauge, other UFix64Value) bool
func (UFix64Value) Minus ¶
func (v UFix64Value) Minus(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
func (UFix64Value) Mod ¶
func (v UFix64Value) Mod(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
func (UFix64Value) Mul ¶
func (v UFix64Value) Mul(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
func (UFix64Value) Negate ¶
func (v UFix64Value) Negate(_ common.Gauge) UFix64Value
func (UFix64Value) Plus ¶
func (v UFix64Value) Plus(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
func (UFix64Value) SaturatingDiv ¶
func (v UFix64Value) SaturatingDiv(_ common.Gauge, _ UFix64Value) (UFix64Value, error)
func (UFix64Value) SaturatingMinus ¶
func (v UFix64Value) SaturatingMinus(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
func (UFix64Value) SaturatingMul ¶
func (v UFix64Value) SaturatingMul(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
func (UFix64Value) SaturatingPlus ¶
func (v UFix64Value) SaturatingPlus(gauge common.Gauge, other UFix64Value) (UFix64Value, error)
func (UFix64Value) Scale ¶
func (UFix64Value) Scale() int
func (UFix64Value) Storable ¶
func (v UFix64Value) Storable(_ atree.SlabStorage, _ atree.Address, _ uint32) (atree.Storable, error)
func (UFix64Value) StoredValue ¶
func (v UFix64Value) StoredValue(_ atree.SlabStorage) (atree.Value, error)
func (UFix64Value) String ¶
func (v UFix64Value) String() string
func (UFix64Value) ToBigEndianBytes ¶
func (v UFix64Value) ToBigEndianBytes() []byte
func (UFix64Value) ToInt ¶
func (v UFix64Value) ToInt() (int, error)
type UnderflowError ¶
type UnderflowError struct{}
func (UnderflowError) Error ¶
func (UnderflowError) Error() string
func (UnderflowError) IsUserError ¶
func (UnderflowError) IsUserError()
Click to show internal directories.
Click to hide internal directories.