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 v2.6.0 #540

Closed
wants to merge 11 commits into from
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ workflows:
- unit-test:
matrix:
parameters:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
- integration-test:
matrix:
parameters:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
- docset

jobs:
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Changelog

# v2.6.0

<!-- Release notes generated using configuration in .github/release.yml at release/v2.6.0 -->

## What's Changed
### Bugfixes
* fix: no timeout for urlopen issue #526 by @grzracz in https://github.com/algorand/py-algorand-sdk/pull/527
* txns: Uses sp.min_fee if available by @jannotti in https://github.com/algorand/py-algorand-sdk/pull/530
* fix: Fix initialization for `WrongAmountType` error by @algolog in https://github.com/algorand/py-algorand-sdk/pull/532
* Fix: Fix indexer sync issue in cucumber tests by @jasonpaulos in https://github.com/algorand/py-algorand-sdk/pull/533
### Enhancements
* Docs: Add missing pages for source map and dryrun results by @jasonpaulos in https://github.com/algorand/py-algorand-sdk/pull/520
* DX: Keyreg bytes by @jannotti in https://github.com/algorand/py-algorand-sdk/pull/522
* Testing: Add Python 3.12 to test matrix by @jasonpaulos in https://github.com/algorand/py-algorand-sdk/pull/534
* Simulate: Support newer simulate options by @jasonpaulos in https://github.com/algorand/py-algorand-sdk/pull/537
* Tests: Enable min-balance Cucumber tests. by @gmalouf in https://github.com/algorand/py-algorand-sdk/pull/539
### Other
* Fix typographic error when printing offline participation transaction by @hsoerensen in https://github.com/algorand/py-algorand-sdk/pull/524

## New Contributors
* @hsoerensen made their first contribution in https://github.com/algorand/py-algorand-sdk/pull/524
* @grzracz made their first contribution in https://github.com/algorand/py-algorand-sdk/pull/527
* @algolog made their first contribution in https://github.com/algorand/py-algorand-sdk/pull/532
* @gmalouf made their first contribution in https://github.com/algorand/py-algorand-sdk/pull/539

**Full Changelog**: https://github.com/algorand/py-algorand-sdk/compare/v2.5.0...v2.6.0

# v2.5.0

<!-- Release notes generated using configuration in .github/release.yml at release/v2.5.0 -->
Expand Down
6 changes: 6 additions & 0 deletions algosdk/atomic_transaction_composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,13 @@ def __init__(
max_log_calls: Optional[int] = None,
max_log_size: Optional[int] = None,
allow_empty_signatures: Optional[bool] = None,
allow_unnamed_resources: Optional[bool] = None,
extra_opcode_budget: Optional[int] = None,
) -> None:
self.max_log_calls = max_log_calls
self.max_log_size = max_log_size
self.allow_empty_signatures = allow_empty_signatures
self.allow_unnamed_resources = allow_unnamed_resources
self.extra_opcode_budget = extra_opcode_budget

@staticmethod
Expand All @@ -297,6 +299,10 @@ def from_simulation_result(
eval_override.allow_empty_signatures = eval_override_dict[
"allow-empty-signatures"
]
if "allow-unnamed-resources" in eval_override_dict:
eval_override.allow_unnamed_resources = eval_override_dict[
"allow-unnamed-resources"
]
if "extra-opcode-budget" in eval_override_dict:
eval_override.extra_opcode_budget = eval_override_dict[
"extra-opcode-budget"
Expand Down
12 changes: 6 additions & 6 deletions algosdk/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self):


class WrongAmountType(Exception):
def __init(self):
def __init__(self):
Exception.__init__(self, "amount (amt) must be a non-negative integer")


Expand All @@ -70,7 +70,7 @@ def __init__(self):
class WrongHashLengthError(Exception):
"""General error that is normally changed to be more specific"""

def __init(self):
def __init__(self):
Exception.__init__(self, "length must be 32 bytes")


Expand All @@ -85,22 +85,22 @@ def __init__(self):


class WrongMetadataLengthError(Exception):
def __init(self):
def __init__(self):
Exception.__init__(self, "metadata length must be 32 bytes")


class WrongLeaseLengthError(Exception):
def __init(self):
def __init__(self):
Exception.__init__(self, "lease length must be 32 bytes")


class WrongNoteType(Exception):
def __init(self):
def __init__(self):
Exception.__init__(self, 'note must be of type "bytes"')


class WrongNoteLength(Exception):
def __init(self):
def __init__(self):
Exception.__init__(self, "note length must be at most 1024")


Expand Down
5 changes: 3 additions & 2 deletions algosdk/kmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, kmd_token, kmd_address):
self.kmd_token = kmd_token
self.kmd_address = kmd_address

def kmd_request(self, method, requrl, params=None, data=None):
def kmd_request(self, method, requrl, params=None, data=None, timeout=30):
"""
Execute a given request.

Expand All @@ -35,6 +35,7 @@ def kmd_request(self, method, requrl, params=None, data=None):
requrl (str): url for the request
params (dict, optional): parameters for the request
data (dict, optional): data in the body of the request
timeout (int, optional): request timeout in seconds

Returns:
dict: loaded from json response body
Expand All @@ -56,7 +57,7 @@ def kmd_request(self, method, requrl, params=None, data=None):
)
resp = None
try:
resp = urlopen(req)
resp = urlopen(req, timeout=timeout)
except urllib.error.HTTPError as e:
e = e.read().decode("utf-8")
try:
Expand Down
Loading