diff --git a/CHANGELOG.md b/CHANGELOG.md index da4df3c..4eeacae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ All notable changes to the Aptos Python SDK will be captured in this file. This ## 0.9.0 - Add Multikey support for Python, with an example - Deprecate and remove non-BCS transaction submission +- Set max Uleb128 to MAX_U32 +- Add Behave behavioral specifications for BCS and AccountAddress ## 0.8.6 - add client for graphql indexer service with light demo in coin transfer diff --git a/Makefile b/Makefile index 494851a..de57e49 100644 --- a/Makefile +++ b/Makefile @@ -3,19 +3,23 @@ test: poetry run python -m unittest discover -s aptos_sdk/ -p '*.py' -t .. + poetry run behave test-coverage: poetry run python -m coverage run -m unittest discover -s aptos_sdk/ -p '*.py' -t .. poetry run python -m coverage report +test-spec: + poetry run behave + fmt: - find ./examples ./aptos_sdk . -type f -name "*.py" | xargs poetry run autoflake -i -r --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports - poetry run isort aptos_sdk examples - poetry run black aptos_sdk examples + find ./examples ./aptos_sdk ./features . -type f -name "*.py" | xargs poetry run autoflake -i -r --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports + poetry run isort aptos_sdk examples features + poetry run black aptos_sdk examples features lint: - poetry run mypy aptos_sdk examples - poetry run flake8 aptos_sdk examples + poetry run mypy aptos_sdk examples features + poetry run flake8 aptos_sdk examples features examples: poetry run python -m examples.aptos_token diff --git a/aptos_sdk/bcs.py b/aptos_sdk/bcs.py index ba50e40..b626c61 100644 --- a/aptos_sdk/bcs.py +++ b/aptos_sdk/bcs.py @@ -129,7 +129,7 @@ def uleb128(self) -> int: break shift += 7 - if value > MAX_U128: + if value > MAX_U32: raise Exception("Unexpectedly large uleb128 value") return value diff --git a/features/account_address.feature b/features/account_address.feature new file mode 100644 index 0000000..fcd5bbd --- /dev/null +++ b/features/account_address.feature @@ -0,0 +1,68 @@ +Feature: Account Address +""" +AccountAddress is a 32-byte value that represents an address on chain. +""" + + Scenario Outline: Parse account address