From 7d3900100434c05df8621dd9427f1499e295c89f Mon Sep 17 00:00:00 2001 From: Unique Divine <51418232+Unique-Divine@users.noreply.github.com> Date: Wed, 24 Aug 2022 17:25:43 -0500 Subject: [PATCH] chore(release): Update nibiru-proto dependency for v0.14.0 binary (#109) * test: all green w/ new binary * increment pyproject version for release * update changelog --- CHANGELOG.md | 15 +++++++++++++++ nibiru/query_clients/vpool.py | 3 ++- poetry.lock | 36 +++++++++++++++++------------------ pyproject.toml | 4 ++-- tests/pricefeed_test.py | 4 ++-- tests/vpool_test.py | 4 ++-- 6 files changed, 41 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea907946..1d27244f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,21 @@ All notable changes to this project will be documented in this file. +## v0.2.0 2022-08-24 + +### Breaking Changes + +- Improve query error handling [#108](https://github.com/NibiruChain/py-sdk/pull/108) +- feat: Split the design of txs between message and execution. [#96](https://github.com/NibiruChain/py-sdk/pull/96) +- hotfix/test(query_clients): Test vpool.query.all_pools fn. Account for deserialize edge case #102. [#103](https://github.com/NibiruChain/py-sdk/pull/103) + +### Improvements + +- refactor(ci-cd): Update linter workflow. Cache poetry installation. [#96](https://github.com/NibiruChain/py-sdk/pull/96) +- Remove legacy run-examples.sh [#97](https://github.com/NibiruChain/py-sdk/pull/97) +- test: Add back utils_test file [#96](https://github.com/NibiruChain/py-sdk/pull/96) +- docs: Update README.md [#104](https://github.com/NibiruChain/py-sdk/pull/104) + ## v0.1.0 2022-08-22 - feat(proto): use external proto pkg `nibiru_proto` for versioned types [#81](https://github.com/NibiruChain/py-sdk/pull/81) diff --git a/nibiru/query_clients/vpool.py b/nibiru/query_clients/vpool.py index f4689f30..22c3b0fd 100644 --- a/nibiru/query_clients/vpool.py +++ b/nibiru/query_clients/vpool.py @@ -21,7 +21,8 @@ def reserve_assets(self, pair: str): def all_pools(self): req = vpool_type.QueryAllPoolsRequest() - return self.query(self.api.AllPools, req) + resp = self.query(self.api.AllPools, req) + return resp def base_asset_price(self, pair: str, direction: Direction, base_asset_amount: str): dir_pb = pbDirection.DIRECTION_UNSPECIFIED diff --git a/poetry.lock b/poetry.lock index b342e85c..7f4df499 100644 --- a/poetry.lock +++ b/poetry.lock @@ -99,7 +99,7 @@ optional = false python-versions = ">=3.5" [package.extras] -tests = ["mypy", "PyHamcrest (>=2.0.2)", "pytest (>=4.6)", "pytest-benchmark", "pytest-cov", "pytest-flake8"] +tests = ["pytest-flake8", "pytest-cov", "pytest-benchmark", "pytest (>=4.6)", "PyHamcrest (>=2.0.2)", "mypy"] [[package]] name = "bech32" @@ -172,7 +172,7 @@ python-versions = ">=3.6.1" [[package]] name = "charset-normalizer" -version = "2.1.0" +version = "2.1.1" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." category = "main" optional = false @@ -453,19 +453,19 @@ python-versions = "*" [[package]] name = "mypy-protobuf" -version = "3.2.0" +version = "3.3.0" description = "Generate mypy stub files from protobuf specs" category = "main" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" [package.dependencies] -protobuf = ">=3.19.3" -types-protobuf = ">=3.19.5" +protobuf = ">=3.19.4" +types-protobuf = ">=3.19.12" [[package]] name = "nibiru-proto" -version = "0.13.2" +version = "0.14.1" description = "" category = "main" optional = false @@ -767,7 +767,7 @@ test = ["pytest-mock (>=3.3)", "pytest (>=4.3)"] [[package]] name = "urllib3" -version = "1.26.11" +version = "1.26.12" description = "HTTP library with thread-safe connection pooling, file post, and more." category = "main" optional = false @@ -775,7 +775,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, [package.extras] brotli = ["brotlicffi (>=0.8.0)", "brotli (>=1.0.9)", "brotlipy (>=0.6.0)"] -secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] +secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "urllib3-secure-extra", "ipaddress"] socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] @@ -810,7 +810,7 @@ multidict = ">=4.0" [metadata] lock-version = "1.1" python-versions = "^3.9" -content-hash = "731be98b7513b49da1706f79962afac1c3ca472038e50b298ab160fe59ba4594" +content-hash = "6d121bafb0202b6c13cb0ee71ba7b36761fcc5c2e8e30530e1eb8bc7569c328a" [metadata.files] aiocron = [ @@ -1028,8 +1028,8 @@ cfgv = [ {file = "cfgv-3.3.1.tar.gz", hash = "sha256:f5a830efb9ce7a445376bb66ec94c638a9787422f96264c98edc6bdeed8ab736"}, ] charset-normalizer = [ - {file = "charset-normalizer-2.1.0.tar.gz", hash = "sha256:575e708016ff3a5e3681541cb9d79312c416835686d054a23accb873b254f413"}, - {file = "charset_normalizer-2.1.0-py3-none-any.whl", hash = "sha256:5189b6f22b01957427f35b6a08d9a0bc45b46d3788ef5a92e978433c7a35f8a5"}, + {file = "charset-normalizer-2.1.1.tar.gz", hash = "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"}, + {file = "charset_normalizer-2.1.1-py3-none-any.whl", hash = "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"}, ] click = [ {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, @@ -1443,12 +1443,12 @@ mypy-extensions = [ {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, ] mypy-protobuf = [ - {file = "mypy-protobuf-3.2.0.tar.gz", hash = "sha256:730aa15337c38f0446fbe08f6c6c2370ee01d395125369d4b70e08b1e2ee30ee"}, - {file = "mypy_protobuf-3.2.0-py3-none-any.whl", hash = "sha256:65fc0492165f4a3c0aff69b03e34096fc1453e4dac8f14b4e9c2306cdde06010"}, + {file = "mypy-protobuf-3.3.0.tar.gz", hash = "sha256:24f3b0aecb06656e983f58e07c732a90577b9d7af3e1066fc2b663bbf0370248"}, + {file = "mypy_protobuf-3.3.0-py3-none-any.whl", hash = "sha256:15604f6943b16c05db646903261e3b3e775cf7f7990b7c37b03d043a907b650d"}, ] nibiru-proto = [ - {file = "nibiru-proto-0.13.2.tar.gz", hash = "sha256:c62740920a9c61629d7364025289a7d6061412ac76527f07611f2b0dc19a2aa7"}, - {file = "nibiru_proto-0.13.2-py3-none-any.whl", hash = "sha256:773e627eabaddec1bf89f3121dacca5d19b94d70c6830a6a1ea74e5e5e3462b0"}, + {file = "nibiru-proto-0.14.1.tar.gz", hash = "sha256:41ab06ec7031dea1ca188acfc89150b99d3c349ab79ee155e92fc6cc195bc742"}, + {file = "nibiru_proto-0.14.1-py3-none-any.whl", hash = "sha256:2e68ce448ab18e5dd8352fa9c73c365ed4c991c0d0463c659201ce2794264b4d"}, ] nodeenv = [ {file = "nodeenv-1.7.0-py2.py3-none-any.whl", hash = "sha256:27083a7b96a25f2f5e1d8cb4b6317ee8aeda3bdd121394e5ac54e498028a042e"}, @@ -1635,8 +1635,8 @@ tzlocal = [ {file = "tzlocal-4.2.tar.gz", hash = "sha256:ee5842fa3a795f023514ac2d801c4a81d1743bbe642e3940143326b3a00addd7"}, ] urllib3 = [ - {file = "urllib3-1.26.11-py2.py3-none-any.whl", hash = "sha256:c33ccba33c819596124764c23a97d25f32b28433ba0dedeb77d873a38722c9bc"}, - {file = "urllib3-1.26.11.tar.gz", hash = "sha256:ea6e8fb210b19d950fab93b60c9009226c63a28808bc8386e05301e25883ac0a"}, + {file = "urllib3-1.26.12-py2.py3-none-any.whl", hash = "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997"}, + {file = "urllib3-1.26.12.tar.gz", hash = "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"}, ] virtualenv = [ {file = "virtualenv-20.16.3-py2.py3-none-any.whl", hash = "sha256:4193b7bc8a6cd23e4eb251ac64f29b4398ab2c233531e66e40b19a6b7b0d30c1"}, diff --git a/pyproject.toml b/pyproject.toml index bb213b36..11617a2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nibiru" -version = "0.0.17" +version = "0.2.0" description = "Python SDK for interacting with Nibiru." authors = ["Nibiru Chain "] license = "MIT" @@ -39,7 +39,7 @@ coincurve = "^17.0.0" aiocron = "^1.8" pytest = "^7.1.2" pre-commit = "^2.20.0" -nibiru-proto = "^0.13.2" +nibiru-proto = "^0.14.1" shutup = "^0.2.0" [tool.poetry.dev-dependencies] diff --git a/tests/pricefeed_test.py b/tests/pricefeed_test.py index 25c73374..71d07c1e 100644 --- a/tests/pricefeed_test.py +++ b/tests/pricefeed_test.py @@ -124,7 +124,7 @@ def test_post_prices(oracle_agent: nibiru.Sdk): # Unibi price object must be a dict with specific keys unibi_price = oracle_agent.query.pricefeed.price("unibi:unusd")["price"] - dict_keys_must_match(unibi_price, ["pair_id", "price"]) + dict_keys_must_match(unibi_price, ["pair_id", "price", "twap"]) # At least one pair in prices must be unibi:unusd prices = oracle_agent.query.pricefeed.prices()["prices"] @@ -132,4 +132,4 @@ def test_post_prices(oracle_agent: nibiru.Sdk): # Unibi price object must be a dict with specific keys unibi_price = next(price for price in prices if price["pair_id"] == "unibi:unusd") - dict_keys_must_match(unibi_price, ["pair_id", "price"]) + dict_keys_must_match(unibi_price, ["pair_id", "price", "twap"]) diff --git a/tests/vpool_test.py b/tests/vpool_test.py index 859b0a26..8b43c59e 100644 --- a/tests/vpool_test.py +++ b/tests/vpool_test.py @@ -49,10 +49,10 @@ def test_query_vpool_all_pools(agent: nibiru.Sdk): vpool_prices = all_vpool_prices[0] assert isinstance(vpool_prices["block_number"], int), "block_number" - assert isinstance(vpool_prices["index_price"], float), "index_price" + assert isinstance(vpool_prices["index_price"], str), "index_price" assert isinstance(vpool_prices["mark_price"], float), "mark_price" assert isinstance(vpool_prices["swap_invariant"], int), "swap_invariant" - assert isinstance(vpool_prices["twap_mark"], float), "twap_mark" + assert isinstance(vpool_prices["twap_mark"], str), "twap_mark" assert isinstance(vpool_prices["pair"], str), "pair" tests.LOGGER.info(f"vpool_prices: {pprint.pformat(vpool_prices, indent=3)}")