Skip to content

algopy_testing.value_generators.arc4

ARC4ValueGeneratorFactory for generating ARC4-compliant test data.

Factory for generating ARC4-compliant test data.

Generate a random Algorand address.

  • Returns: A new, random Algorand address.

uint8(min_value: int = 0, max_value: int = MAX_UINT8) → algopy.arc4.UInt8

Section titled “uint8(min_value: int = 0, max_value: int = MAX_UINT8) → algopy.arc4.UInt8”

Generate a random UInt8 within the specified range.

  • Parameters:
    • min_value – Minimum value (inclusive). Defaults to 0.
    • max_value – Maximum value (inclusive). Defaults to MAX_UINT8.
  • Returns: A random UInt8 value.

uint16(min_value: int = 0, max_value: int = MAX_UINT16) → algopy.arc4.UInt16

Section titled “uint16(min_value: int = 0, max_value: int = MAX_UINT16) → algopy.arc4.UInt16”

Generate a random UInt16 within the specified range.

  • Parameters:
    • min_value – Minimum value (inclusive). Defaults to 0.
    • max_value – Maximum value (inclusive). Defaults to MAX_UINT16.
  • Returns: A random UInt16 value.

uint32(min_value: int = 0, max_value: int = MAX_UINT32) → algopy.arc4.UInt32

Section titled “uint32(min_value: int = 0, max_value: int = MAX_UINT32) → algopy.arc4.UInt32”

Generate a random UInt32 within the specified range.

  • Parameters:
    • min_value – Minimum value (inclusive). Defaults to 0.
    • max_value – Maximum value (inclusive). Defaults to MAX_UINT32.
  • Returns: A random UInt32 value.

uint64(min_value: int = 0, max_value: int = MAX_UINT64) → algopy.arc4.UInt64

Section titled “uint64(min_value: int = 0, max_value: int = MAX_UINT64) → algopy.arc4.UInt64”

Generate a random UInt64 within the specified range.

  • Parameters:
    • min_value – Minimum value (inclusive). Defaults to 0.
    • max_value – Maximum value (inclusive). Defaults to MAX_UINT64.
  • Returns: A random UInt64 value.

biguint128(min_value: int = 0, max_value: int = 1 << 128 - 1) → algopy.arc4.UInt128

Section titled “biguint128(min_value: int = 0, max_value: int = 1 << 128 - 1) → algopy.arc4.UInt128”

Generate a random UInt128 within the specified range.

  • Parameters:
    • min_value – Minimum value (inclusive). Defaults to 0.
    • max_value – Maximum value (inclusive). Defaults to (2^128 - 1).
  • Returns: A random UInt128 value.

biguint256(min_value: int = 0, max_value: int = 1 << 256 - 1) → algopy.arc4.UInt256

Section titled “biguint256(min_value: int = 0, max_value: int = 1 << 256 - 1) → algopy.arc4.UInt256”

Generate a random UInt256 within the specified range.

  • Parameters:
    • min_value – Minimum value (inclusive). Defaults to 0.
    • max_value – Maximum value (inclusive). Defaults to (2^256 - 1).
  • Returns: A random UInt256 value.

biguint512(min_value: int = 0, max_value: int = MAX_UINT512) → algopy.arc4.UInt512

Section titled “biguint512(min_value: int = 0, max_value: int = MAX_UINT512) → algopy.arc4.UInt512”

Generate a random UInt512 within the specified range.

  • Parameters:
    • min_value – Minimum value (inclusive). Defaults to 0.
    • max_value – Maximum value (inclusive). Defaults to MAX_UINT512.
  • Returns: A random UInt512 value.

dynamic_bytes(n: int) → algopy.arc4.DynamicBytes

Section titled “dynamic_bytes(n: int) → algopy.arc4.DynamicBytes”

Generate a random dynamic bytes of size n bits.

  • Parameters: n – The number of bits for the dynamic bytes. Must be a multiple of 8, otherwise the last byte will be truncated.
  • Returns: A new, random dynamic bytes of size n bits.

Generate a random string of size n bits.

  • Parameters: n – The number of bits for the string.
  • Returns: A new, random string of size n bits.