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

chore(release): Update nibiru-proto dependency for v0.14.0 binary #109

Merged
merged 3 commits into from
Aug 24, 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
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion nibiru/query_clients/vpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 18 additions & 18 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions tests/pricefeed_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ 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"]
assert any([price["pair_id"] == "unibi:unusd" for price in prices])

# 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"])
4 changes: 2 additions & 2 deletions tests/vpool_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want str? Is it the function breaking and a way to quickly fix this?

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)}")

Expand Down