Skip to content

Commit

Permalink
Merge branch 'release/1.4.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroc committed Oct 22, 2020
2 parents 6df90db + 671ddd6 commit cc3dbce
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .changes/1.4.4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"description": "Make the caching key explicit",
"type": "patch"
}
]
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
806 Fabian Schuh <[email protected]>
811 Fabian Schuh <[email protected]>
167 Fabian Schuh <[email protected]>
104 Vladimir Kamarzin <[email protected]>
100 Fabian Schuh <[email protected]>
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
Note: version releases in the 0.x.y range may introduce breaking changes.

## 1.4.4

- patch: Make the caching key explicit

## 1.4.3

- patch: Improve caching significantly
Expand Down
4 changes: 2 additions & 2 deletions graphenecommon/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def refresh(self):
account = self.blockchain.rpc.lookup_account_names([self.identifier])[0]
if not account:
raise AccountDoesNotExistsException(self.identifier)
self.store(account, "name")
self.store(account, "id")
self.store(account, account["name"])
self.store(account, account["id"])

if self.full: # pragma: no cover
accounts = self.blockchain.rpc.get_full_accounts([account["id"]], False)
Expand Down
3 changes: 2 additions & 1 deletion graphenecommon/aio/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ async def refresh(self):
account = result[0]
if not account:
raise AccountDoesNotExistsException(self.identifier)
self.store(account, "name")
self.store(account, account["name"])
self.store(account, account["id"])

if self.full: # pragma: no cover
accounts = await self.blockchain.rpc.get_full_accounts(
Expand Down
2 changes: 2 additions & 0 deletions graphenecommon/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def refresh(self):
self["dynamic_asset_data"] = self.blockchain.rpc.get_object(
asset["dynamic_asset_data_id"]
)
self.store(asset, asset["symbol"])
self.store(asset, asset["id"])

@property
def is_fully_loaded(self):
Expand Down
2 changes: 1 addition & 1 deletion graphenecommon/blockchainobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def store(self, data, key="id"):
:param list data: List of objects to cache
"""
dict.__init__(self, data)
self._store_item(data[key])
self._store_item(key)

@classmethod
def cache_object(cls, data, key=None):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from setuptools import setup

__version__ = "1.4.3"
__version__ = "1.4.4"
URL = "https://github.com/xeroc/python-graphenelib"

setup(
Expand Down

0 comments on commit cc3dbce

Please sign in to comment.