algopy_testing.context_helpers.txn_context
Module Contents
Section titled “Module Contents”Classes
Section titled “Classes”DeferredAppCall | |
|---|---|
TransactionContext | Context for managing transaction groups and active transactions. |
TransactionGroup |
TReturn | |
|---|---|
TParamSpec |
TReturn
Section titled “TReturn”TParamSpec
Section titled “TParamSpec”class DeferredAppCall
Section titled “class DeferredAppCall”Bases: Generic[TReturn]
submit() → TReturn
Section titled “submit() → TReturn”class TransactionContext
Section titled “class TransactionContext”Context for managing transaction groups and active transactions.
defer_app_call(method: Callable[TParamSpec, TReturn], *args: TParamSpec, **kwargs: TParamSpec) → DeferredAppCall[TReturn]
Section titled “defer_app_call(method: Callable[TParamSpec, TReturn], *args: TParamSpec, **kwargs: TParamSpec) → DeferredAppCall[TReturn]”Prepare an application call transaction group for a contract method without executing it.
create_group(gtxns: Sequence[algopy.gtxn.TransactionBase | DeferredAppCall[Any]] | None = None, active_txn_index: int | None = None, active_txn_overrides: ActiveTransactionFields | None = None) → Iterator[None]
Section titled “create_group(gtxns: Sequence[algopy.gtxn.TransactionBase | DeferredAppCall[Any]] | None = None, active_txn_index: int | None = None, active_txn_overrides: ActiveTransactionFields | None = None) → Iterator[None]”Adds a new transaction group using a list of transactions and an optional index to indicate the active transaction within the group.
- Parameters:
- gtxns – List of transactions
- active_txn_index – Index of the active transaction
- active_txn_overrides – Overrides for active txn
- Returns: None
property last_group : TransactionGroup
Section titled “property last_group : TransactionGroup”property last_active : algopy.gtxn.Transaction
Section titled “property last_active : algopy.gtxn.Transaction”class TransactionGroup
Section titled “class TransactionGroup”property active_app_id : int
Section titled “property active_app_id : int”property active_txn : algopy.gtxn.Transaction
Section titled “property active_txn : algopy.gtxn.Transaction”property itxn_groups : Sequence[collections.abc.Sequence[InnerTransactionResultType]]
Section titled “property itxn_groups : Sequence[collections.abc.Sequence[InnerTransactionResultType]]”property last_itxn : ITxnLoader
Section titled “property last_itxn : ITxnLoader”get_txn(index: int | algopy.UInt64) → algopy.gtxn.Transaction
Section titled “get_txn(index: int | algopy.UInt64) → algopy.gtxn.Transaction”get_itxn_group(index: int) → ITxnGroupLoader
Section titled “get_itxn_group(index: int) → ITxnGroupLoader”get_scratch_slot(index: algopy.UInt64 | int) → algopy.UInt64 | algopy.Bytes
Section titled “get_scratch_slot(index: algopy.UInt64 | int) → algopy.UInt64 | algopy.Bytes”Retrieves the scratch values for a specific slot in the active transaction.
- Parameters: index – Which scratch slot to query
- Returns: Scratch slot value for the active transaction
get_scratch_space() → Sequence[algopy.Bytes | algopy.UInt64]
Section titled “get_scratch_space() → Sequence[algopy.Bytes | algopy.UInt64]”Retrieves scratch space for the active transaction.
- Returns: List of scratch space values for the active transaction
- Return type: Sequence[algopy.Bytes | algopy.UInt64]