Skip to content
Snippets Groups Projects
Commit 344e461e authored by Holger's avatar Holger
Browse files

Readme changelog for next version

parent 9150e953
No related branches found
No related tags found
No related merge requests found
......@@ -156,6 +156,12 @@ before transmitting the packed file. Please check the hash-sum after downloading
Changelog
=========
0.19.39
-------
* get_feed_entries, get_blog_authors, get_savings_withdrawals, get_escrow, verify_account_authority, get_expiring_vesting_delegations added to Account
* get_account_reputations, get_account_count added to Blockchain
* ImageUploader class added
0.19.38
-------
* Bug fixes
......
......@@ -19,6 +19,7 @@ from datetime import datetime, timedelta
from .utils import formatTimeString, addTzInfo
from .block import Block
from .exceptions import BatchedCallsNotSupported, BlockDoesNotExistsException, BlockWaitTimeExceeded, OfflineHasNoRPCException
from beemapi.exceptions import NumRetriesReached
from beemgraphenebase.py23 import py23_bytes
from beem.instance import shared_steem_instance
from .amount import Amount
......@@ -67,6 +68,7 @@ class Worker(Thread):
try:
# the function may raise
result = func(*args, **kwargs)
# print(result)
if(result is not None):
self.results.put(result)
except Exception as e:
......@@ -364,6 +366,9 @@ class Blockchain(object):
if not start:
start = current_block_num
head_block_reached = False
if threading:
# pool = ThreadPoolExecutor(max_workers=thread_num + 1)
pool = Pool(thread_num, batch_mode=True)
# We are going to loop indefinitely
while True:
......@@ -374,8 +379,6 @@ class Blockchain(object):
current_block_num = self.get_current_block_num()
head_block = current_block_num
if threading and not head_block_reached:
# pool = ThreadPoolExecutor(max_workers=thread_num + 1)
pool = Pool(thread_num, batch_mode=True)
# disable autoclean
auto_clean = current_block.get_cache_auto_clean()
latest_block = start - 1
......@@ -392,7 +395,6 @@ class Blockchain(object):
i += 1
pool.run(True)
pool.join()
results = []
for result in pool.results():
results.append(result)
pool.abort()
......
......@@ -46,17 +46,19 @@ class Testcases(unittest.TestCase):
ops_stream = []
ops_stream_no_threading = []
opNames = ["transfer", "vote"]
block_num_list = []
for op in b.stream(opNames=opNames, start=self.start, stop=self.stop, threading=True, thread_num=2):
ops_stream.append(op)
if op["block_num"] not in block_num_list:
block_num_list.append(op["block_num"])
block_num_list2 = []
for op in b.stream(opNames=opNames, start=self.start, stop=self.stop, threading=False):
ops_stream_no_threading.append(op)
if op["block_num"] not in block_num_list2:
block_num_list2.append(op["block_num"])
block_num_list = []
for op in b.stream(opNames=opNames, start=self.start, stop=self.stop, threading=True, thread_num=8):
ops_stream.append(op)
if op["block_num"] not in block_num_list:
block_num_list.append(op["block_num"])
self.assertEqual(ops_stream[0]["block_num"], ops_stream_no_threading[0]["block_num"])
self.assertEqual(ops_stream[-1]["block_num"], ops_stream_no_threading[-1]["block_num"])
self.assertEqual(len(ops_stream_no_threading), len(ops_stream))
......@@ -69,7 +71,7 @@ class Testcases(unittest.TestCase):
blocks = []
last_id = self.start - 1
for block in b.blocks(start=self.start, stop=self.stop, threading=True, thread_num=2):
for block in b.blocks(start=self.start, stop=self.stop, threading=True, thread_num=8):
blocks.append(block)
self.assertEqual(block.identifier, last_id + 1)
last_id += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment