Skip to content

Commit 02f4625

Browse files
authored
Merge pull request #186 from xeroc/release/20230126
Release/20230126
2 parents 77a915d + cb608fc commit 02f4625

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2056
-1778
lines changed

.github/workflows/tox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
max-parallel: 4
1010
matrix:
11-
python-version: [3.6, 3.7, 3.8]
11+
python-version: [3.7, 3.8, 3.9]
1212

1313
steps:
1414
- name: Install secp256k1

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.PHONY: clean-pyc clean-build docs
2-
31
.PHONY: clean
42
clean: clean-build clean-pyc
53

@@ -54,3 +52,10 @@ check:
5452
docs:
5553
sphinx-apidoc -d 6 -e -f -o docs . *.py tests
5654
make -C docs clean html
55+
56+
.PHONY: release
57+
release:
58+
git diff-index --quiet HEAD || { echo "untracked files! Aborting"; exit 1; }
59+
git checkout develop
60+
git checkout -b release/$(shell date +'%Y%m%d')
61+
git push origin release/$(shell date +'%Y%m%d')

docs/graphenebase.ripemd160.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
graphenebase.ripemd160 module
2+
=============================
3+
4+
.. automodule:: graphenebase.ripemd160
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/graphenebase.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Submodules
2020
graphenebase.operationids
2121
graphenebase.operations
2222
graphenebase.prefix
23+
graphenebase.ripemd160
2324
graphenebase.signedtransactions
2425
graphenebase.transactions
2526
graphenebase.types

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
graphenelib==1.2.0
2+
sphinx

grapheneapi/aio/api.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ def get_network(self):
3232
return self._chain_props
3333

3434
async def cache_chain_properties(self):
35-
""" Cache chain properties to prevent turning lots of methods into async
36-
"""
35+
"""Cache chain properties to prevent turning lots of methods into async"""
3736
self._chain_props = await self.get_chain_properties()
3837

3938
def get_cached_chain_properties(self):
@@ -58,8 +57,7 @@ async def next(self):
5857
await self.connect()
5958

6059
async def find_next(self):
61-
""" Find the next url in the list
62-
"""
60+
"""Find the next url in the list"""
6361
if int(self.num_retries) < 0: # pragma: no cover
6462
self._cnt_retries += 1
6563
sleeptime = (self._cnt_retries - 1) * 2 if self._cnt_retries < 10 else 10
@@ -103,8 +101,7 @@ async def func(*args, **kwargs):
103101
except KeyboardInterrupt: # pragma: no cover
104102
raise
105103
except RPCError as e: # pragma: no cover
106-
""" When the backend actual returns an error
107-
"""
104+
"""When the backend actual returns an error"""
108105
self.post_process_exception(e)
109106
# the above line should raise. Let's be sure to at least
110107
# break
@@ -118,8 +115,7 @@ async def func(*args, **kwargs):
118115
self.error_url()
119116
self.next()
120117
except Exception as e: # pragma: no cover
121-
""" When something fails talking to the backend
122-
"""
118+
"""When something fails talking to the backend"""
123119
import traceback
124120

125121
log.debug(traceback.format_exc())

grapheneapi/aio/http.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010

1111
class Http(Rpc):
12-
""" RPC Calls
13-
"""
12+
"""RPC Calls"""
1413

1514
def __init__(self, *args, **kwargs):
1615
super().__init__(*args, **kwargs)
@@ -24,10 +23,10 @@ async def disconnect(self):
2423
await self.session.close()
2524

2625
async def rpcexec(self, payload):
27-
""" Execute a RPC call
26+
"""Execute a RPC call
2827
29-
:param dict payload: json-rpc request in format:
30-
{"jsonrpc": "2.0", "method": "call", "params": "[x, y, z]", "id": 1}
28+
:param dict payload: json-rpc request in format:
29+
{"jsonrpc": "2.0", "method": "call", "params": "[x, y, z]", "id": 1}
3130
"""
3231
async with self.session.post(self.url, json=payload) as response:
3332
response_text = await response.text()

grapheneapi/aio/rpc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ def __init__(self, url, *args, loop=None, **kwargs):
1616
self.loop = kwargs.get(loop, asyncio.get_event_loop())
1717

1818
def __getattr__(self, name):
19-
""" Map all methods to RPC calls and pass through the arguments
19+
"""Map all methods to RPC calls and pass through the arguments
2020
21-
This method is actually defined in RPC class, but we need to
22-
overwrite this here so that we can use async/await.
21+
This method is actually defined in RPC class, but we need to
22+
overwrite this here so that we can use async/await.
2323
"""
2424

2525
async def method(*args, **kwargs):

grapheneapi/aio/websocket.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async def disconnect(self):
3030
await self.ws.close()
3131

3232
async def _parsing_wrapper(self):
33-
""" Wraps parse_messages() coroutine to retrieve and handle exceptions
33+
"""Wraps parse_messages() coroutine to retrieve and handle exceptions
3434
3535
When parse_messages() stopped for any reason, websocket transport should be
3636
stopped, and get_response_by_id() should be notified about broken parser
@@ -52,12 +52,12 @@ async def _parsing_wrapper(self):
5252
self._event.set()
5353

5454
async def parse_messages(self):
55-
""" Listen websocket for incoming messages in infinity manner
55+
"""Listen websocket for incoming messages in infinity manner
5656
57-
Messages which are responses (has id) are stored in dict, while
58-
messages which are notifies are stored in asyncio queue and are
59-
supposed to be processed later by whom who sets the subscribtion
60-
callback
57+
Messages which are responses (has id) are stored in dict, while
58+
messages which are notifies are stored in asyncio queue and are
59+
supposed to be processed later by whom who sets the subscribtion
60+
callback
6161
"""
6262

6363
async for message in self.ws:
@@ -97,9 +97,9 @@ async def parse_messages(self):
9797
await self.notifications.put(m)
9898

9999
async def get_response_by_id(self, request_id):
100-
""" Pop response from dict containing all query results
100+
"""Pop response from dict containing all query results
101101
102-
:param int request_id: request id to get response to
102+
:param int request_id: request id to get response to
103103
"""
104104
response = None
105105
while not response:
@@ -114,10 +114,10 @@ async def get_response_by_id(self, request_id):
114114
return response
115115

116116
async def rpcexec(self, payload):
117-
""" Execute a RPC call
117+
"""Execute a RPC call
118118
119-
:param dict payload: json-rpc request in format:
120-
{"jsonrpc": "2.0", "method": "call", "params": "[x, y, z]", "id": 1}
119+
:param dict payload: json-rpc request in format:
120+
{"jsonrpc": "2.0", "method": "call", "params": "[x, y, z]", "id": 1}
121121
"""
122122
if not self.ws:
123123
await self.connect()

grapheneapi/api.py

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ def connect(self):
8484
self.register_apis()
8585

8686
def find_next(self):
87-
""" Find the next url in the list
88-
"""
87+
"""Find the next url in the list"""
8988
if int(self.num_retries) < 0: # pragma: no cover
9089
self._cnt_retries += 1
9190
sleeptime = (self._cnt_retries - 1) * 2 if self._cnt_retries < 10 else 10
@@ -119,8 +118,7 @@ def find_next(self):
119118
return url
120119

121120
def reset_counter(self):
122-
""" reset the failed connection counters
123-
"""
121+
"""reset the failed connection counters"""
124122
self._cnt_retries = 0
125123
for i in self._url_counter:
126124
self._url_counter[i] = 0
@@ -141,34 +139,34 @@ def post_process_exception(self, exception):
141139

142140
@property
143141
def api_id(self):
144-
""" This allows to list api_ids, if they have been registered through
145-
api_register() -- LEGACY
142+
"""This allows to list api_ids, if they have been registered through
143+
api_register() -- LEGACY
146144
147-
In previous API version, one would connect and register to APIs
148-
like this
145+
In previous API version, one would connect and register to APIs
146+
like this
149147
150-
.. code-block:: python
148+
.. code-block:: python
151149
152-
self.api_id["database"] = self.database(api_id=1)
153-
self.api_id["history"] = self.history(api_id=1)
154-
self.api_id["network_broadcast"] = self.network_broadcast(
155-
api_id=1)
150+
self.api_id["database"] = self.database(api_id=1)
151+
self.api_id["history"] = self.history(api_id=1)
152+
self.api_id["network_broadcast"] = self.network_broadcast(
153+
api_id=1)
156154
157155
"""
158156
return self.connection.api_id
159157

160158
def register_apis(self): # pragma: no cover
161-
""" This method is called right after connection and has previously
162-
been used to register to different APIs within the backend that are
163-
considered default. The requirement to register to APIs has been
164-
removed in some systems.
159+
"""This method is called right after connection and has previously
160+
been used to register to different APIs within the backend that are
161+
considered default. The requirement to register to APIs has been
162+
removed in some systems.
165163
"""
166164
pass
167165

168166
def __getattr__(self, name):
169-
""" Proxies RPC calls to actual Websocket or Http instance.
167+
"""Proxies RPC calls to actual Websocket or Http instance.
170168
171-
Connection-related errors catched here and handled.
169+
Connection-related errors catched here and handled.
172170
"""
173171

174172
def func(*args, **kwargs):
@@ -182,8 +180,7 @@ def func(*args, **kwargs):
182180
except KeyboardInterrupt: # pragma: no cover
183181
raise
184182
except RPCError as e: # pragma: no cover
185-
""" When the backend actual returns an error
186-
"""
183+
"""When the backend actual returns an error"""
187184
self.post_process_exception(e)
188185
# the above line should raise. Let's be sure to at least
189186
# break
@@ -197,8 +194,7 @@ def func(*args, **kwargs):
197194
self.error_url()
198195
self.next()
199196
except Exception as e: # pragma: no cover
200-
""" When something fails talking to the backend
201-
"""
197+
"""When something fails talking to the backend"""
202198
import traceback
203199

204200
log.debug(traceback.format_exc())

0 commit comments

Comments
 (0)