--- orphan: true --- # {py:mod}`_algopy_testing.context_helpers.ledger_context` ```{py:module} _algopy_testing.context_helpers.ledger_context ``` ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context :allowtitles: ``` ## Module Contents ### Classes ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`LedgerContext <_algopy_testing.context_helpers.ledger_context.LedgerContext>` - ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext :summary: ``` ```` ### API `````{py:class} LedgerContext() :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext ``` ```{rubric} Initialization ``` ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.__init__ ``` ````{py:method} get_account(address: str) -> algopy.Account :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.get_account ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.get_account ``` ```` ````{py:method} account_exists(address: str) -> bool :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.account_exists ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.account_exists ``` ```` ````{py:method} update_account(address: str, opted_asset_balances: dict[int, algopy.UInt64] | None = None, **account_fields: typing.Unpack[_algopy_testing.models.account.AccountFields]) -> None :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.update_account ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.update_account ``` ```` ````{py:method} get_asset(asset_id: algopy.UInt64 | int) -> algopy.Asset :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.get_asset ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.get_asset ``` ```` ````{py:method} asset_exists(asset_id: algopy.UInt64 | int) -> bool :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.asset_exists ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.asset_exists ``` ```` ````{py:method} update_asset(asset_id: int, **asset_fields: typing.Unpack[_algopy_testing.models.asset.AssetFields]) -> None :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.update_asset ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.update_asset ``` ```` ````{py:method} get_app(app_id: algopy.Contract | algopy.Application | algopy.UInt64 | int) -> algopy.Application :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.get_app ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.get_app ``` ```` ````{py:method} app_exists(app_id: algopy.UInt64 | int) -> bool :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.app_exists ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.app_exists ``` ```` ````{py:method} update_app(app_id: int, **application_fields: typing.Unpack[_algopy_testing.models.application.ApplicationFields]) -> None :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.update_app ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.update_app ``` ```` ````{py:method} get_global_state(app: algopy.Contract | algopy.Application | algopy.UInt64 | int, key: bytes | algopy.Bytes) -> int | bytes :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.get_global_state ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.get_global_state ``` ```` ````{py:method} set_global_state(app: algopy.Contract | algopy.Application | algopy.UInt64 | int, key: bytes | algopy.Bytes, value: int | bytes | None) -> None :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.set_global_state ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.set_global_state ``` ```` ````{py:method} get_local_state(app: algopy.Contract | algopy.Application | algopy.UInt64 | int, account: algopy.Account | str, key: algopy.Bytes | bytes) -> int | bytes :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.get_local_state ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.get_local_state ``` ```` ````{py:method} set_local_state(app: algopy.Contract | algopy.Application | algopy.UInt64 | int, account: algopy.Account | str, key: algopy.Bytes | bytes, value: int | bytes | None) -> None :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.set_local_state ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.set_local_state ``` ```` ````{py:method} get_box(app: algopy.Contract | algopy.Application | algopy.UInt64 | int, key: algopy.Bytes | bytes) -> bytes :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.get_box ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.get_box ``` ```` ````{py:method} set_box(app: algopy.Contract | algopy.Application | algopy.UInt64 | int, key: algopy.Bytes | bytes, value: algopy.Bytes | bytes) -> None :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.set_box ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.set_box ``` ```` ````{py:method} delete_box(app: algopy.Contract | algopy.Application | algopy.UInt64 | int, key: algopy.Bytes | bytes) -> bool :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.delete_box ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.delete_box ``` ```` ````{py:method} box_exists(app: algopy.Contract | algopy.Application | algopy.UInt64 | int, key: algopy.Bytes | bytes) -> bool :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.box_exists ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.box_exists ``` ```` ````{py:method} set_block(index: int, seed: algopy.UInt64 | int, timestamp: algopy.UInt64 | int) -> None :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.set_block ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.set_block ``` ```` ````{py:method} get_block_content(index: int, key: str) -> int :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.get_block_content ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.get_block_content ``` ```` ````{py:method} patch_global_fields(**global_fields: typing.Unpack[_algopy_testing.op.global_values.GlobalFields]) -> None :canonical: _algopy_testing.context_helpers.ledger_context.LedgerContext.patch_global_fields ```{autodoc2-docstring} _algopy_testing.context_helpers.ledger_context.LedgerContext.patch_global_fields ``` ```` `````