Skip to content

Commit

Permalink
Merge branch 'release/1.4.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroc committed Oct 22, 2020
2 parents 6df42ff + b0680a4 commit 6df90db
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .changes/1.4.3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"description": "Improve caching significantly",
"type": "patch"
}
]
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
798 Fabian Schuh <[email protected]>
806 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.3

- patch: Improve caching significantly

## 1.4.2

- patch: Do not break backwards compatibility on ObjectCache
Expand Down
6 changes: 5 additions & 1 deletion grapheneapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,19 @@ def __init__(self, urls, user=None, password=None, connect=True, **kwargs):
# Let's also be able to deal with infinite connection
self.urls = cycle(urls)
self._cnt_retries = 0
self._network = None

# Connect!
if connect:
self.connect()
self._network = self.get_network()

# Get chain parameters
@property
def chain_params(self):
return self.get_network()
if self._network is None:
self._network = self.get_network()
return self._network

def get_network(self):
return self.get_chain_properties()
Expand Down
1 change: 1 addition & 0 deletions graphenecommon/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def refresh(self):
if not account:
raise AccountDoesNotExistsException(self.identifier)
self.store(account, "name")
self.store(account, "id")

if self.full: # pragma: no cover
accounts = self.blockchain.rpc.get_full_accounts([account["id"]], False)
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(key)
self._store_item(data[key])

@classmethod
def cache_object(cls, data, key=None):
Expand Down
2 changes: 1 addition & 1 deletion graphenecommon/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def finalizeOp(self, ops, account, permission, **kwargs):
elif self.bundle:
# In case we want to add more ops to the tx (bundle)
self.txbuffer.appendSigner(account, permission)
return self.txbuffer.json()
return self.txbuffer
else:
# default behavior: sign + broadcast
self.txbuffer.appendSigner(account, permission)
Expand Down
2 changes: 1 addition & 1 deletion graphenecommon/transactionbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(
proposal_review=None,
parent=None,
*args,
**kwargs
**kwargs,
):
self.define_classes()
assert self.operation_class
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.2"
__version__ = "1.4.3"
URL = "https://github.com/xeroc/python-graphenelib"

setup(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import unittest
from .fixtures import Api, Websocket, Http, exceptions

urls = ["wss://node.bitshares.eu", "https://eu.nodes.bitshares.ws"]
urls = ["wss://eu.nodes.bitshares.ws", "https://eu.nodes.bitshares.ws"]


class Testcases(unittest.TestCase):
Expand Down Expand Up @@ -49,7 +49,7 @@ def test_raise_rpc_error_wss(self):
api.connection.disconnect()
api.connection.disconnect()

#def test_raise_rpc_error_https(self):
# def test_raise_rpc_error_https(self):
# api = Api(urls[1], num_retries=1)
# with self.assertRaises(exceptions.RPCError):
# api.get_SOMETHING(["2.8.0"])
Expand All @@ -59,5 +59,5 @@ def test_login(self):
Api(urls[0], None, None, num_retries=1)

def test_rollover(self):
api = Api(["http://error.example.com", "wss://node.bitshares.eu"])
api = Api(["http://error.example.com", urls[0]])
api.get_objects(["2.8.0"])

0 comments on commit 6df90db

Please sign in to comment.