Skip to content

Commit dcc4676

Browse files
authored
Revert "feat: send payment transaction with algokit core"
Revert "feat: send payment transaction with algokit core"
2 parents 9980636 + 1ffeaf1 commit dcc4676

File tree

10 files changed

+17
-631
lines changed

10 files changed

+17
-631
lines changed

.github/workflows/build-python.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: ./.github/actions/setup-poetry
2323

2424
- name: Install dependencies
25-
run: poetry install --no-interaction --without=experimental
25+
run: poetry install --no-interaction
2626

2727
- name: pytest + coverage
2828
shell: bash

poetry.lock

Lines changed: 9 additions & 442 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,6 @@ py-algorand-sdk = "^2.4.0"
1212
httpx = ">=0.23.1,<=0.28.1"
1313
typing-extensions = ">=4.6.0"
1414

15-
[tool.poetry.group.experimental.dependencies]
16-
algokit-transact = [
17-
# macOS
18-
{url = "https://github.com/algorandfoundation/algokit-core/releases/download/python%2Falgokit_transact%401.0.0-alpha.10/algokit_transact-1.0.0a10-py3-none-macosx_10_12_x86_64.whl", markers = "sys_platform == 'darwin' and platform_machine == 'x86_64'"},
19-
{url = "https://github.com/algorandfoundation/algokit-core/releases/download/python%2Falgokit_transact%401.0.0-alpha.10/algokit_transact-1.0.0a10-py3-none-macosx_11_0_arm64.whl", markers = "sys_platform == 'darwin' and platform_machine == 'arm64'"},
20-
21-
# Windows
22-
{url = "https://github.com/algorandfoundation/algokit-core/releases/download/python%2Falgokit_transact%401.0.0-alpha.10/algokit_transact-1.0.0a10-py3-none-win_amd64.whl", markers = "sys_platform == 'win32' and platform_machine == 'AMD64'"},
23-
24-
# Linux - manylinux (for most common glibc-based distributions like Ubuntu, Debian, Fedora)
25-
{url = "https://github.com/algorandfoundation/algokit-core/releases/download/python%2Falgokit_transact%401.0.0-alpha.10/algokit_transact-1.0.0a10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", markers = "sys_platform == 'linux' and platform_machine == 'aarch64'"},
26-
{url = "https://github.com/algorandfoundation/algokit-core/releases/download/python%2Falgokit_transact%401.0.0-alpha.10/algokit_transact-1.0.0a10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", markers = "sys_platform == 'linux' and platform_machine == 'x86_64'"},
27-
]
28-
algokit-algod-api = {url = "https://github.com/algorandfoundation/algokit-core/releases/download/python%2Falgod_api%401.0.0-alpha.11/algokit_algod_api-1.0.0a11-py3-none-any.whl"}
29-
3015
[tool.poetry.group.dev.dependencies]
3116
pytest = "^8"
3217
ruff = ">=0.1.6,<=0.11.8"
@@ -145,9 +130,7 @@ suppress-none-returning = true
145130
"tests/clients/test_algorand_client.py" = ["ERA001"]
146131
"src/algokit_utils/_legacy_v2/**/*" = ["E501"]
147132
"tests/**/*" = ["PLR2004"]
148-
"src/algokit_utils/__init__.py" = ["I001", "RUF022", "E402"] # Ignore import sorting for __init__.py
149-
"src/algokit_utils/transactions/_algokit_core_bridge.py" = ["ANN001"]
150-
"src/algokit_utils/clients/_algokit_core_bridge.py" = ["ANN001", "ANN202","ANN204"]
133+
"src/algokit_utils/__init__.py" = ["I001", "RUF022"] # Ignore import sorting for __init__.py
151134

152135
[tool.poe.tasks]
153136
docs = ["docs-html-only", "docs-md-only"]
@@ -191,14 +174,6 @@ disallow_untyped_calls = false
191174
module = ["tests.transactions.test_transaction_composer"]
192175
disable_error_code = ["call-overload", "union-attr"]
193176

194-
[[tool.mypy.overrides]]
195-
module = ["algokit_utils.clients._algokit_core_bridge"]
196-
disable_error_code = ["attr-defined", "no-untyped-def", "no-untyped-call"]
197-
198-
[[tool.mypy.overrides]]
199-
module = ["algokit_utils.transactions._algokit_core_bridge"]
200-
disable_error_code = ["attr-defined", "no-untyped-def", "no-any-return"]
201-
202177
[tool.semantic_release]
203178
version_toml = "pyproject.toml:tool.poetry.version"
204179
remove_dist = false

src/algokit_utils/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
etc.
1010
"""
1111

12-
import importlib.util
13-
14-
_EXPERIMENTAL_DEPENDENCIES_INSTALLED: bool | None = importlib.util.find_spec("algokit_algod_api") is not None
15-
1612
# Core types and utilities that are commonly used
1713
from algokit_utils.applications import * # noqa: F403
1814
from algokit_utils.assets import * # noqa: F403

src/algokit_utils/clients/_algokit_core_bridge.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/algokit_utils/clients/client_manager.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from algosdk.v2client.algod import AlgodClient
1414
from algosdk.v2client.indexer import IndexerClient
1515

16-
from algokit_utils import _EXPERIMENTAL_DEPENDENCIES_INSTALLED
1716
from algokit_utils._legacy_v2.application_specification import ApplicationSpecification
1817
from algokit_utils.applications.app_deployer import ApplicationLookup
1918
from algokit_utils.applications.app_spec.arc56 import Arc56Contract
@@ -120,12 +119,7 @@ def __init__(self, clients_or_configs: AlgoClientConfigs | AlgoSdkClients, algor
120119
if clients_or_configs.kmd_config
121120
else None,
122121
)
123-
if not _EXPERIMENTAL_DEPENDENCIES_INSTALLED:
124-
self._algod = _clients.algod
125-
else:
126-
from algokit_utils.clients._algokit_core_bridge import AlgodClientWithCore
127-
128-
self._algod = AlgodClientWithCore(_clients.algod) # type: ignore[assignment]
122+
self._algod = _clients.algod
129123
self._indexer = _clients.indexer
130124
self._kmd = _clients.kmd
131125
self._algorand = algorand_client

src/algokit_utils/errors/logic_error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class LogicErrorData(TypedDict):
3333
def parse_logic_error(
3434
error_str: str,
3535
) -> LogicErrorData | None:
36-
match = re.search(LOGIC_ERROR, error_str, re.DOTALL)
36+
match = re.match(LOGIC_ERROR, error_str)
3737
if match is None:
3838
return None
3939

src/algokit_utils/transactions/_algokit_core_bridge.py

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/algokit_utils/transactions/transaction_composer.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from algosdk.v2client.models.simulate_request import SimulateRequest
2323
from typing_extensions import deprecated
2424

25-
from algokit_utils import _EXPERIMENTAL_DEPENDENCIES_INSTALLED
2625
from algokit_utils.applications.abi import ABIReturn, ABIValue
2726
from algokit_utils.applications.app_manager import AppManager
2827
from algokit_utils.applications.app_spec.arc56 import Method as Arc56Method
@@ -31,9 +30,6 @@
3130
from algokit_utils.models.transaction import SendParams, TransactionWrapper
3231
from algokit_utils.protocols.account import TransactionSignerAccountProtocol
3332

34-
if _EXPERIMENTAL_DEPENDENCIES_INSTALLED:
35-
from algokit_utils.transactions._algokit_core_bridge import build_payment_with_core
36-
3733
if TYPE_CHECKING:
3834
from collections.abc import Callable
3935

@@ -1865,17 +1861,6 @@ def send(
18651861
)
18661862
except algosdk.error.AlgodHTTPError as e:
18671863
raise Exception(f"Transaction failed: {e}") from e
1868-
# We need this code to handle separately an exception thrown by the experimental AlgoKit Algod Client.
1869-
# However, we can't just import the dependency (as it may not be there) and
1870-
# we still need to re-throw the exception in all other cases.
1871-
except Exception as e:
1872-
if _EXPERIMENTAL_DEPENDENCIES_INSTALLED:
1873-
from algokit_algod_api.exceptions import BadRequestException
1874-
1875-
if isinstance(e, BadRequestException):
1876-
raise Exception(f"Transaction failed: {e}") from e
1877-
raise e
1878-
raise e
18791864

18801865
def _handle_simulate_error(self, simulate_response: SimulateAtomicTransactionResponse) -> None:
18811866
# const failedGroup = simulateResponse?.txnGroups[0]
@@ -2265,10 +2250,7 @@ def _build_payment(
22652250
"close_remainder_to": params.close_remainder_to,
22662251
}
22672252

2268-
if _EXPERIMENTAL_DEPENDENCIES_INSTALLED:
2269-
return self._common_txn_build_step(lambda x: build_payment_with_core(**x), params, txn_params)
2270-
else:
2271-
return self._common_txn_build_step(lambda x: algosdk.transaction.PaymentTxn(**x), params, txn_params)
2253+
return self._common_txn_build_step(lambda x: algosdk.transaction.PaymentTxn(**x), params, txn_params)
22722254

22732255
def _build_asset_create(
22742256
self, params: AssetCreateParams, suggested_params: algosdk.transaction.SuggestedParams

tests/transactions/test_transaction_sender.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pytest
66
from algosdk.transaction import OnComplete
77

8-
from algokit_utils import _EXPERIMENTAL_DEPENDENCIES_INSTALLED, SigningAccount
8+
from algokit_utils import SigningAccount
99
from algokit_utils._legacy_v2.application_specification import ApplicationSpecification
1010
from algokit_utils.algorand import AlgorandClient
1111
from algokit_utils.applications.app_manager import AppManager
@@ -451,8 +451,8 @@ def test_payment_logging(
451451
)
452452
)
453453

454-
assert mock_debug.call_count == 1 if not _EXPERIMENTAL_DEPENDENCIES_INSTALLED else 2
455-
log_message = mock_debug.call_args_list[0][0][0]
454+
assert mock_debug.call_count == 1
455+
log_message = mock_debug.call_args[0][0]
456456
assert "Sending 1,000,000 µALGO" in log_message
457457
assert sender.address in log_message
458458
assert receiver.address in log_message

0 commit comments

Comments
 (0)