Skip to content

Commit

Permalink
chore: test tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcampbell committed May 13, 2024
1 parent 97955ae commit 1504b00
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions tests/test_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
transfer,
transfer_asset,
)
from algokit_utils.application_client import ApplicationClient
from algokit_utils.application_specification import ApplicationSpecification
from algokit_utils.dispenser_api import DispenserApiConfig
from algokit_utils.network_clients import get_algod_client, get_algonode_config
from algosdk.atomic_transaction_composer import AccountTransactionSigner
Expand All @@ -32,29 +30,18 @@
if TYPE_CHECKING:
from algosdk.kmd import KMDClient
from algosdk.v2client.algod import AlgodClient
from algosdk.v2client.indexer import IndexerClient


MINIMUM_BALANCE = 100_000 # see https://developer.algorand.org/docs/get-details/accounts/#minimum-balance


@pytest.fixture(scope="module")
def client_fixture(
algod_client: "AlgodClient",
indexer_client: "IndexerClient",
app_spec: ApplicationSpecification,
funded_account: Account,
) -> ApplicationClient:
return ApplicationClient(algod_client, app_spec, creator=funded_account, indexer_client=indexer_client)


@pytest.fixture()
def to_account(kmd_client: "KMDClient") -> Account:
return create_kmd_wallet_account(kmd_client, get_unique_name())


@pytest.fixture()
def rekeyed_account(algod_client: "AlgodClient", kmd_client: "KMDClient") -> Account:
def rekeyed_from_account(algod_client: "AlgodClient", kmd_client: "KMDClient") -> Account:
account = create_kmd_wallet_account(kmd_client, get_unique_name())
rekey_account = create_kmd_wallet_account(kmd_client, get_unique_name())

Expand Down Expand Up @@ -82,11 +69,12 @@ def rekeyed_account(algod_client: "AlgodClient", kmd_client: "KMDClient") -> Acc


@pytest.fixture()
def account_transaction_signer(
def transaction_signer_from_account(
kmd_client: "KMDClient",
algod_client: "AlgodClient",
) -> AccountTransactionSigner:
account = create_kmd_wallet_account(kmd_client, get_unique_name())

ensure_funded(
algod_client,
EnsureBalanceParameters(
Expand Down Expand Up @@ -122,13 +110,13 @@ def test_transfer_algo(algod_client: "AlgodClient", to_account: Account, funded_


def test_transfer_algo_rekey_account(
algod_client: "AlgodClient", to_account: Account, rekeyed_account: Account
algod_client: "AlgodClient", to_account: Account, rekeyed_from_account: Account
) -> None:
requested_amount = 100_000
transfer(
algod_client,
TransferParameters(
from_account=rekeyed_account,
from_account=rekeyed_from_account,
to_address=to_account.address,
micro_algos=requested_amount,
),
Expand All @@ -141,13 +129,13 @@ def test_transfer_algo_rekey_account(


def test_transfer_algo_transaction_signer_account(
algod_client: "AlgodClient", to_account: Account, account_transaction_signer: AccountTransactionSigner
algod_client: "AlgodClient", to_account: Account, transaction_signer_from_account: AccountTransactionSigner
) -> None:
requested_amount = 100_000
transfer(
algod_client,
TransferParameters(
from_account=account_transaction_signer,
from_account=transaction_signer_from_account,
to_address=to_account.address,
micro_algos=requested_amount,
),
Expand Down

0 comments on commit 1504b00

Please sign in to comment.