Skip to content

Commit

Permalink
fixed logic eval error parsing & added pythonpublish action
Browse files Browse the repository at this point in the history
  • Loading branch information
sn0wyQ committed Feb 13, 2024
1 parent 85b1456 commit 9a6f076
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build and publish
run: |
python setup.py sdist bdist_wheel
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
long_description = f.read()

setuptools.setup(
name="tinyman-py-sdk",
description="Tinyman Python SDK",
name="sn0wyq-tinyman-py-sdk",
description="Tinyman Python SDK (forked)",
author="Tinyman",
author_email="[email protected]",
version="2.1.1",
version="2.2.0",
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
Expand Down
6 changes: 3 additions & 3 deletions tinyman/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ def parse_error(exception):
return AlgodError(error_message)

if "logic eval error" in error_message:
pattern = r"error: (.+?). Details: pc=(\d+)"
error, pc = re.findall(pattern, error_message)[0]
return LogicError(error, txn_id=txn_id, pc=pc)
pattern = r"error: (.+?). Details: app=(\d+), pc=(\d+)"
error, app_id, pc = re.findall(pattern, error_message)[0]
return LogicError(error, txn_id=txn_id, pc=pc, app_id=app_id)

if "overspend" in error_message:
pattern = r"overspend \(account (.+?),.+tried to spend {(\d+)}\)"
Expand Down

0 comments on commit 9a6f076

Please sign in to comment.