_algopy_testing.itxn_loader

Module Contents

Classes

ITxnLoader

A helper class for handling access to individual inner transactions in test context.

ITxnGroupLoader

A helper class for handling access to groups of inner transactions in test context.

API

class ITxnLoader(inner_txn: _algopy_testing.itxn_loader.InnerTransactionResultType)

A helper class for handling access to individual inner transactions in test context.

This class provides methods to access and retrieve specific types of inner transactions. It performs type checking and conversion for various transaction types.

Initialization

property payment: algopy.itxn.PaymentInnerTransaction

Retrieve the last PaymentInnerTransaction.

Raises:

ValueError – If the transaction is not found or not of the expected type.

property asset_config: algopy.itxn.AssetConfigInnerTransaction

Retrieve the last AssetConfigInnerTransaction.

Raises:

ValueError – If the transaction is not found or not of the expected type.

property asset_transfer: algopy.itxn.AssetTransferInnerTransaction

Retrieve the last AssetTransferInnerTransaction.

Raises:

ValueError – If the transaction is not found or not of the expected type.

property asset_freeze: algopy.itxn.AssetFreezeInnerTransaction

Retrieve the last AssetFreezeInnerTransaction.

Raises:

ValueError – If the transaction is not found or not of the expected type.

property application_call: algopy.itxn.ApplicationCallInnerTransaction

Retrieve the last ApplicationCallInnerTransaction.

Raises:

ValueError – If the transaction is not found or not of the expected type.

property key_registration: algopy.itxn.KeyRegistrationInnerTransaction

Retrieve the last KeyRegistrationInnerTransaction.

Raises:

ValueError – If the transaction is not found or not of the expected type.

property transaction: algopy.itxn.InnerTransactionResult

Retrieve the last InnerTransactionResult.

Raises:

ValueError – If the transaction is not found or not of the expected type.

class ITxnGroupLoader(
inner_txn_group: collections.abc.Sequence[_algopy_testing.itxn_loader.InnerTransactionResultType],
)

A helper class for handling access to groups of inner transactions in test context.

This class provides methods to access and retrieve inner transactions from a group, either individually or as slices. It supports type-specific retrieval of inner transactions and implements indexing operations.

Initialization

payment(index: int) algopy.itxn.PaymentInnerTransaction

Return a PaymentInnerTransaction from the group at the given index.

Parameters:

index – The index of the transaction in the group.

Returns:

The PaymentInnerTransaction at the given index.

Raises:

TypeError – If the transaction is not found or not of

asset_config(index: int) algopy.itxn.AssetConfigInnerTransaction

Return an AssetConfigInnerTransaction from the group at the given index.

Parameters:

index – The index of the transaction in the group.

Returns:

The AssetConfigInnerTransaction at the given index.

Raises:

TypeError – If the transaction is not found or not of the expected type.

asset_transfer(index: int) algopy.itxn.AssetTransferInnerTransaction

Return an AssetTransferInnerTransaction from the group at the given index.

Parameters:

index – The index of the transaction in the group.

Returns:

The AssetTransferInnerTransaction at the given index.

asset_freeze(index: int) algopy.itxn.AssetFreezeInnerTransaction

Return an AssetFreezeInnerTransaction from the group at the given index.

Parameters:

index – The index of the transaction in the group.

Returns:

The AssetFreezeInnerTransaction at the given index.

application_call(index: int) algopy.itxn.ApplicationCallInnerTransaction

Return an ApplicationCallInnerTransaction from the group at the given index.

Parameters:

index – The index of the transaction in the group.

Returns:

The ApplicationCallInnerTransaction at the given index.

key_registration(index: int) algopy.itxn.KeyRegistrationInnerTransaction

Return a KeyRegistrationInnerTransaction from the group at the given index.

Parameters:

index – The index of the transaction in the group.

Returns:

The KeyRegistrationInnerTransaction at the given index.

transaction(index: int) algopy.itxn.InnerTransactionResult

Return an InnerTransactionResult from the group at the given index.

Parameters:

index – The index of the transaction in the group.

Returns:

The InnerTransactionResult at the given index.