Skip to content

Commit

Permalink
Remove _call and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bo-one committed Oct 4, 2017
1 parent c84181b commit 1c7690f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 27 deletions.
4 changes: 3 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ Changes
**NEW**:

* Add more docstrings to the code;

* Add tests for all rpc methods;

* Add admin and debug;


**FIX**:

* Errors in eth module call;
* Unixsocket invalid loop for Python 3.4;

* Unixsocket invalid loop for Python 3.4;


0.1.1 (2017-10-01)
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
|pypi| |travis-ci| |codecov|
|pypi| |travis-ci| |codecov| |docs|

aioethereum
===========
Expand Down Expand Up @@ -94,16 +94,16 @@ The aioethereum is offered under MIT license.
.. _travis: https://travis-ci.org/DeV1doR/aioethereum


.. |pypi| image:: https://img.shields.io/pypi/v/aioethereum.svg?style=flat&label=latest%20version
:target: https://pypi.python.org/pypi/aioethereum
.. |pypi| image:: https://badge.fury.io/py/aioethereum.svg
:target: https://badge.fury.io/py/aioethereum
:alt: Latest version released on PyPi

.. |travis-ci| image:: https://travis-ci.org/DeV1doR/aioethereum.svg?branch=master
:target: https://travis-ci.org/DeV1doR/aioethereum
:alt: Travis CI status

.. |docs| image:: https://readthedocs.org/projects/aioethereum/badge/?version=latest
:target: http://aioethereum.readthedocs.io/en/latest/?badge=latest
:target: https://aioethereum.readthedocs.io/
:alt: Documentation status

.. |codecov| image:: https://codecov.io/gh/DeV1doR/aioethereum/branch/master/graph/badge.svg
Expand Down
8 changes: 1 addition & 7 deletions aioethereum/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ def rpc_call(self, method, params=None, id_=None):
:return: `Response from RPC`
"""

@asyncio.coroutine
def _call(self, method, params=None, id_=None):
warnings.warn('This method is deprecated and will be removed '
'in v0.2.0', DeprecationWarning, stacklevel=2)
return (yield from self.rpc_call(method, params, id_))


class AsyncIOHTTPClient(BaseAsyncIOClient, RpcMixin):
"""Creates AsyncIOHTTPClient client to communicate via HTTP(s).
Expand Down Expand Up @@ -191,7 +185,7 @@ def rpc_call(self, method, params=None, id_=None):
self._reader = new_client._reader
self._writer = new_client._writer
self._lock = new_client._lock
return self._call(method, params, id_)
return (yield from self.rpc_call(method, params, id_))

try:
response = json.loads(b.decode('utf-8'))
Expand Down
23 changes: 9 additions & 14 deletions aioethereum/management/personal.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def personal_newAccount(self, passphrase=None):
:return: address
:rtype: str
"""
result = yield from self._call('personal_newAccount', [passphrase])
return result
return (yield from self.rpc_call('personal_newAccount', [passphrase]))

@asyncio.coroutine
def personal_unlockAccount(self, address, passphrase=None, duration=None):
Expand All @@ -69,9 +68,8 @@ def personal_unlockAccount(self, address, passphrase=None, duration=None):
:rtype: bool
"""
result = yield from self._call('personal_unlockAccount',
[address, passphrase, duration])
return result
return (yield from self.rpc_call('personal_unlockAccount',
[address, passphrase, duration]))

@asyncio.coroutine
def personal_sendTransaction(self, from_, to=None, gas=None,
Expand Down Expand Up @@ -121,9 +119,8 @@ def personal_sendTransaction(self, from_, to=None, gas=None,
if nonce is not None:
obj['nonce'] = hex(nonce)

result = yield from self._call('personal_sendTransaction',
[obj, passphrase])
return result
return (yield from self.rpc_call('personal_sendTransaction',
[obj, passphrase]))

@asyncio.coroutine
def personal_sign(self, message, account, password=None):
Expand All @@ -141,9 +138,8 @@ def personal_sign(self, message, account, password=None):
:return: signature
:rtype: str
"""
result = yield from self._call('personal_sign',
[message, account, password])
return result
return (yield from self.rpc_call('personal_sign',
[message, account, password]))

@asyncio.coroutine
def personal_ecRecover(self, message, signature):
Expand All @@ -158,6 +154,5 @@ def personal_ecRecover(self, message, signature):
:return: address
:rtype: str
"""
result = yield from self._call('personal_ecRecover',
[message, signature])
return result
return (yield from self.rpc_call('personal_ecRecover',
[message, signature]))
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source = aioethereum,tests
show_missing = true

[tool:pytest]
addopts = --cov --no-cov-on-fail --cov-fail-under=1 --cov-report=term --verbose --cache-clear
addopts = --cov --no-cov-on-fail --cov-fail-under=75 --cov-report=term --verbose --cache-clear
testpaths = tests

[metadata]
Expand Down

0 comments on commit 1c7690f

Please sign in to comment.