algopy_testing.primitives.array
Module Contents
Section titled “Module Contents”Classes
Section titled “Classes”ImmutableFixedArray | An immutable fixed length Array of the specified type and length. |
|---|---|
FixedArray | A fixed length Array of the specified type and length. |
ImmutableArray | For algopy testing only, allows serializing to/from bytes for types that aren’t |
ReferenceArray | |
Array | A dynamically sized Array of the specified type. |
Struct | Base class for Struct types. |
Functions
Section titled “Functions”zero_bytes(→ _T) |
|---|
class ImmutableFixedArray
Section titled “class ImmutableFixedArray”Bases: algopy_testing.protocols.Serializable, Generic[_TArrayItem, _TArrayLength]
An immutable fixed length Array of the specified type and length.
classmethod full(item: _TArrayItem) → Self
Section titled “classmethod full(item: _TArrayItem) → Self”property length : UInt64
Section titled “property length : UInt64”replace(index: UInt64 | int, value: _TArrayItem) → ImmutableFixedArray[_TArrayItem, _TArrayLength]
Section titled “replace(index: UInt64 | int, value: _TArrayItem) → ImmutableFixedArray[_TArrayItem, _TArrayLength]”copy() → Self
Section titled “copy() → Self”serialize() → bytes
Section titled “serialize() → bytes”classmethod from_bytes(value: bytes) → Self
Section titled “classmethod from_bytes(value: bytes) → Self”validate() → None
Section titled “validate() → None”class FixedArray
Section titled “class FixedArray”Bases: algopy_testing.protocols.Serializable, algopy_testing.mutable.MutableBytes, Generic[_TArrayItem, _TArrayLength]
A fixed length Array of the specified type and length.
classmethod full(item: _TArrayItem) → Self
Section titled “classmethod full(item: _TArrayItem) → Self”property length : UInt64
Section titled “property length : UInt64”replace(index: UInt64 | int, value: _TArrayItem) → FixedArray[_TArrayItem, _TArrayLength]
Section titled “replace(index: UInt64 | int, value: _TArrayItem) → FixedArray[_TArrayItem, _TArrayLength]”copy() → Self
Section titled “copy() → Self”freeze() → ImmutableFixedArray[_TArrayItem, _TArrayLength]
Section titled “freeze() → ImmutableFixedArray[_TArrayItem, _TArrayLength]”serialize() → bytes
Section titled “serialize() → bytes”classmethod from_bytes(value: bytes) → Self
Section titled “classmethod from_bytes(value: bytes) → Self”validate() → None
Section titled “validate() → None”class ImmutableArray
Section titled “class ImmutableArray”Bases: algopy_testing.protocols.Serializable, Generic[_TArrayItem]
For algopy testing only, allows serializing to/from bytes for types that aren’t BytesBacked.
property length : UInt64
Section titled “property length : UInt64”replace(index: UInt64 | int, value: _TArrayItem) → ImmutableArray[_TArrayItem]
Section titled “replace(index: UInt64 | int, value: _TArrayItem) → ImmutableArray[_TArrayItem]”append(item: _TArrayItem) → ImmutableArray[_TArrayItem]
Section titled “append(item: _TArrayItem) → ImmutableArray[_TArrayItem]”pop() → ImmutableArray[_TArrayItem]
Section titled “pop() → ImmutableArray[_TArrayItem]”serialize() → bytes
Section titled “serialize() → bytes”classmethod from_bytes(value: bytes) → Self
Section titled “classmethod from_bytes(value: bytes) → Self”validate() → None
Section titled “validate() → None”class ReferenceArray
Section titled “class ReferenceArray”Bases: collections.abc.Reversible[_TArrayItem]
property length : UInt64
Section titled “property length : UInt64”append(item: _TArrayItem) → None
Section titled “append(item: _TArrayItem) → None”extend(other: Iterable[_TArrayItem]) → None
Section titled “extend(other: Iterable[_TArrayItem]) → None”pop() → _TArrayItem
Section titled “pop() → _TArrayItem”copy() → ReferenceArray[_TArrayItem]
Section titled “copy() → ReferenceArray[_TArrayItem]”freeze() → ImmutableArray[_TArrayItem]
Section titled “freeze() → ImmutableArray[_TArrayItem]”class Array
Section titled “class Array”Bases: algopy_testing.protocols.Serializable, algopy_testing.mutable.MutableBytes, Generic[_TArrayItem]
A dynamically sized Array of the specified type.
property length : UInt64
Section titled “property length : UInt64”append(item: _TArrayItem) → None
Section titled “append(item: _TArrayItem) → None”extend(other: Iterable[_TArrayItem]) → None
Section titled “extend(other: Iterable[_TArrayItem]) → None”pop() → _TArrayItem
Section titled “pop() → _TArrayItem”copy() → Self
Section titled “copy() → Self”freeze() → ImmutableArray[_TArrayItem]
Section titled “freeze() → ImmutableArray[_TArrayItem]”serialize() → bytes
Section titled “serialize() → bytes”classmethod from_bytes(value: bytes) → Self
Section titled “classmethod from_bytes(value: bytes) → Self”validate() → None
Section titled “validate() → None”class Struct
Section titled “class Struct”Bases: algopy_testing.protocols.Serializable, algopy_testing.mutable.MutableBytes
Base class for Struct types.