code stringlengths 0 94.8k | repo_name stringclasses 1
value | path stringlengths 14 57 | language stringclasses 1
value | license stringclasses 1
value | size int64 0 94.8k |
|---|---|---|---|---|---|
from algopy import (
ARC4Contract,
BigUInt,
Global,
UInt64,
arc4,
ensure_budget,
itxn,
op,
urange,
)
class InnerFeeContract(ARC4Contract):
@arc4.abimethod
def burn_ops(self, op_budget: UInt64) -> None:
# Uses approx 60 op budget per iteration
count = op_budg... | algorandfoundation/algokit-utils-py | tests/artifacts/inner-fee/contract.py | Python | MIT | 2,073 |
from typing import Literal
import beaker
import pyteal
from beaker.lib.storage import BoxMapping
class State:
greeting = beaker.GlobalStateValue(pyteal.TealType.bytes)
last = beaker.LocalStateValue(pyteal.TealType.bytes, default=pyteal.Bytes("unset"))
box = BoxMapping(pyteal.abi.StaticBytes[Literal[4]], ... | algorandfoundation/algokit-utils-py | tests/artifacts/legacy_app_client_test/app_client_test.py | Python | MIT | 5,773 |
from typing import Literal
import beaker
import pyteal as pt
from beaker.lib.storage import BoxMapping
from pyteal.ast import CallConfig, MethodConfig
UPDATABLE_TEMPLATE_NAME = "TMPL_UPDATABLE"
DELETABLE_TEMPLATE_NAME = "TMPL_DELETABLE"
class BareCallAppState:
value = beaker.GlobalStateValue(stack_type=pt.TealT... | algorandfoundation/algokit-utils-py | tests/artifacts/testing_app/contract.py | Python | MIT | 5,883 |
from typing import Literal
from algopy import ARC4Contract, BoxMap, Bytes, arc4, op
class DummyStruct(arc4.Struct):
name: arc4.String
id: arc4.UInt64
class TestPuyaBoxes(ARC4Contract):
def __init__(self) -> None:
self.box_bytes = BoxMap(arc4.String, Bytes)
self.box_bytes2 = BoxMap(Bytes... | algorandfoundation/algokit-utils-py | tests/artifacts/testing_app_puya/contract.py | Python | MIT | 1,502 |
algorandfoundation/algokit-utils-py | tests/assets/__init__.py | Python | MIT | 0 | |
import pytest
from algosdk.atomic_transaction_composer import AccountTransactionSigner
from algokit_utils import SigningAccount
from algokit_utils.algorand import AlgorandClient
from algokit_utils.assets.asset_manager import (
AccountAssetInformation,
AssetInformation,
BulkAssetOptInOutResult,
)
from algok... | algorandfoundation/algokit-utils-py | tests/assets/test_asset_manager.py | Python | MIT | 7,241 |
algorandfoundation/algokit-utils-py | tests/clients/__init__.py | Python | MIT | 0 | |
algorandfoundation/algokit-utils-py | tests/clients/algorand_client/__init__.py | Python | MIT | 0 | |
import httpx
import pytest
from pytest_httpx._httpx_mock import HTTPXMock
from algokit_utils.algorand import AlgorandClient
from algokit_utils.clients.dispenser_api_client import DispenserApiConfig, TestNetDispenserApiClient
from algokit_utils.models.account import SigningAccount
from algokit_utils.models.amount impor... | algorandfoundation/algokit-utils-py | tests/clients/algorand_client/test_transfer.py | Python | MIT | 14,942 |
import inspect
import math
import random
import subprocess
from pathlib import Path
from typing import TYPE_CHECKING
from uuid import uuid4
import pytest
from dotenv import load_dotenv
from algokit_utils import (
ApplicationClient,
ApplicationSpecification,
SigningAccount,
replace_template_variables,
... | algorandfoundation/algokit-utils-py | tests/conftest.py | Python | MIT | 4,824 |
from decimal import Decimal
import pytest
from algokit_utils.models.amount import ALGORAND_MIN_TX_FEE, AlgoAmount, algo, micro_algo, transaction_fees
def test_initialization() -> None:
# Test valid initialization formats
assert AlgoAmount(micro_algos=1_000_000).micro_algos == 1_000_000
assert AlgoAmount... | algorandfoundation/algokit-utils-py | tests/models/test_algo_amount.py | Python | MIT | 3,340 |
import json
import os
from collections.abc import Generator
from dataclasses import dataclass
from datetime import datetime, timezone
from pathlib import Path
from unittest.mock import Mock, patch
import pytest
from algosdk.abi.method import Method
from algosdk.atomic_transaction_composer import (
AccountTransacti... | algorandfoundation/algokit-utils-py | tests/test_debug_utils.py | Python | MIT | 12,977 |
algorandfoundation/algokit-utils-py | tests/transactions/__init__.py | Python | MIT | 0 | |
from algosdk.abi import ABIType, Method
from algosdk.abi.method import Returns
from algosdk.atomic_transaction_composer import ABIResult
from algokit_utils.applications.abi import ABIReturn, ABIValue
def get_abi_result(type_str: str, value: ABIValue) -> ABIReturn:
"""Helper function to simulate ABI method return... | algorandfoundation/algokit-utils-py | tests/transactions/test_abi_return.py | Python | MIT | 4,514 |
import dataclasses
import json
from collections.abc import Generator
from pathlib import Path
import algosdk
import pytest
from algosdk.atomic_transaction_composer import TransactionWithSigner
from algosdk.transaction import OnComplete, PaymentTxn
from algokit_utils import SigningAccount
from algokit_utils.algorand i... | algorandfoundation/algokit-utils-py | tests/transactions/test_resource_packing.py | Python | MIT | 43,071 |
import base64
from collections.abc import Generator
from pathlib import Path
from typing import TYPE_CHECKING, Any
from unittest.mock import Mock, patch
import algosdk
import pytest
from algosdk.transaction import (
ApplicationCallTxn,
AssetConfigTxn,
AssetCreateTxn,
PaymentTxn,
)
from algokit_utils._... | algorandfoundation/algokit-utils-py | tests/transactions/test_transaction_composer.py | Python | MIT | 16,697 |
from pathlib import Path
import algosdk
import pytest
from algosdk.transaction import (
ApplicationCallTxn,
AssetConfigTxn,
AssetCreateTxn,
AssetDestroyTxn,
AssetFreezeTxn,
AssetTransferTxn,
KeyregTxn,
PaymentTxn,
)
from algokit_utils.algorand import AlgorandClient
from algokit_utils.m... | algorandfoundation/algokit-utils-py | tests/transactions/test_transaction_creator.py | Python | MIT | 9,543 |
from pathlib import Path
from unittest.mock import MagicMock, patch
import algosdk
import pytest
from algosdk.transaction import OnComplete
from algokit_utils import SigningAccount
from algokit_utils._legacy_v2.application_specification import ApplicationSpecification
from algokit_utils.algorand import AlgorandClient... | algorandfoundation/algokit-utils-py | tests/transactions/test_transaction_sender.py | Python | MIT | 16,156 |
from pathlib import Path
from typing import Literal, overload
from algokit_utils.applications.app_manager import DELETABLE_TEMPLATE_NAME, UPDATABLE_TEMPLATE_NAME, AppManager
from algokit_utils.applications.app_spec import Arc32Contract, Arc56Contract
@overload
def load_app_spec(
path: Path,
arc: Literal[32],... | algorandfoundation/algokit-utils-py | tests/utils.py | Python | MIT | 1,575 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.