Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOR REVIEW ONLY: py-algorand-sdk v1.20.1 #399

Merged
merged 5 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Changelog
# v1.20.1

## What's Changed
### Bugfixes
* Bug-fix: Implement `TransactionRejectedError` by @jdtzmn in https://github.com/algorand/py-algorand-sdk/pull/396
* Decoding: Fix roundtrip encode/decode tests for transactions by @algochoi in https://github.com/algorand/py-algorand-sdk/pull/398

**Full Changelog**: https://github.com/algorand/py-algorand-sdk/compare/v1.20.0...v1.20.1

# v1.20.0

Expand Down
8 changes: 7 additions & 1 deletion algosdk/box_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ def __init__(self, app_index: int, name: bytes):

@staticmethod
def translate_box_reference(
ref: Tuple[int, Union[bytes, bytearray, str, int]],
ref: Union[
Tuple[int, Union[bytes, bytearray, str, int]], "BoxReference"
],
foreign_apps: List[int],
this_app_id: int,
) -> "BoxReference":
# Do not need to translate the references if they are already BoxReference type.
if isinstance(ref, BoxReference):
return ref

# Try checking reference id and name type.
ref_id, ref_name = ref[0], encoding.encode_as_bytes(ref[1])
if not isinstance(ref_id, int):
Expand Down
4 changes: 4 additions & 0 deletions algosdk/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ class ConfirmationTimeoutError(Exception):
pass


class TransactionRejectedError(Exception):
pass


class ABITypeError(Exception):
def __init__(self, msg):
super().__init__(msg)
Expand Down
8 changes: 4 additions & 4 deletions algosdk/future/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1519,8 +1519,8 @@ def dictify(self):
@staticmethod
def undictify(d):
return StateSchema(
num_uints=d["nui"] if "nui" in d else None,
num_byte_slices=d["nbs"] if "nbs" in d else None,
num_uints=d["nui"] if "nui" in d else 0,
num_byte_slices=d["nbs"] if "nbs" in d else 0,
)

def __eq__(self, other):
Expand Down Expand Up @@ -1628,13 +1628,13 @@ def __init__(
self, sender, sp, note, lease, constants.appcall_txn, rekey_to
)
self.index = self.creatable_index(index)
self.on_complete = on_complete
self.on_complete = on_complete if on_complete else 0
self.local_schema = self.state_schema(local_schema)
self.global_schema = self.state_schema(global_schema)
self.approval_program = self.teal_bytes(approval_program)
self.clear_program = self.teal_bytes(clear_program)
self.app_args = self.bytes_list(app_args)
self.accounts = accounts
self.accounts = accounts if accounts else None
self.foreign_apps = self.int_list(foreign_apps)
self.foreign_assets = self.int_list(foreign_assets)
self.extra_pages = extra_pages
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
description="Algorand SDK in Python",
author="Algorand",
author_email="[email protected]",
version="v1.20.0",
version="v1.20.1",
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
Expand Down