_algopy_testing.value_generators.txn

Module Contents

Classes

TxnValueGenerator

Factory for generating test data for transactions.

API

class TxnValueGenerator

Factory for generating test data for transactions.

application_call(
scratch_space: Sequence[algopy.Bytes | algopy.UInt64 | int | bytes] | None = None,
**fields: Unpack[_algopy_testing.models.txn_fields.ApplicationCallFields],
) algopy.gtxn.ApplicationCallTransaction

Generate a new application call transaction.

Parameters:
  • scratch_space – Scratch space data.

  • **fields – Fields to be set in the transaction.

Returns:

New application call transaction.

Raises:

TypeError – If app_id is not an instance of algopy.Application

asset_transfer(
**fields: Unpack[_algopy_testing.models.txn_fields.AssetTransferFields],
) algopy.gtxn.AssetTransferTransaction

Generate a new asset transfer transaction with specified fields.

Parameters:

**fields – Fields to be set in the transaction.

Returns:

The newly generated asset transfer transaction.

payment(
**fields: Unpack[_algopy_testing.models.txn_fields.PaymentFields],
) algopy.gtxn.PaymentTransaction

Generate a new payment transaction with specified fields.

Parameters:

**fields – Fields to be set in the transaction.

Returns:

The newly generated payment transaction.

asset_config(
**fields: Unpack[_algopy_testing.models.txn_fields.AssetConfigFields],
) algopy.gtxn.AssetConfigTransaction

Generate a new ACFG transaction with specified fields.

Parameters:

**fields – Fields to be set in the transaction.

Returns:

The newly generated asset config transaction.

key_registration(
**fields: Unpack[_algopy_testing.models.txn_fields.KeyRegistrationFields],
) algopy.gtxn.KeyRegistrationTransaction

Generate a new key registration transaction with specified fields.

Parameters:

**fields – Fields to be set in the transaction.

Returns:

The newly generated key registration transaction.

asset_freeze(
**fields: Unpack[_algopy_testing.models.txn_fields.AssetFreezeFields],
) algopy.gtxn.AssetFreezeTransaction

Generate a new asset freeze transaction with specified fields.

Parameters:

**fields – Fields to be set in the transaction.

Returns:

The newly generated asset freeze transaction.

transaction(
**fields: Unpack[_algopy_testing.models.txn_fields.TransactionFields],
) algopy.gtxn.Transaction

Generate a new transaction with specified fields.

Parameters:

**fields – Fields to be set in the transaction.

Returns:

The newly generated transaction.