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

Add missing trx_num to streamed block operation

* set_next_node_on_empty_reply added to some appbase rpc calls
parent c1dff293
No related branches found
No related tags found
No related merge requests found
...@@ -156,6 +156,13 @@ before transmitting the packed file. Please check the hash-sum after downloading ...@@ -156,6 +156,13 @@ before transmitting the packed file. Please check the hash-sum after downloading
Changelog Changelog
========= =========
0.19.51
-------
* Add missing trx_num to streamed block operation
* Add d.tube format to resolve_authorperm
* disable_chain_detection added to graphenerpc (for testing hivemind e.g.)
* set_next_node_on_empty_reply added to some appbase rpc calls
0.19.50 0.19.50
------- -------
* Class to access Steemit Conveyor instances added by crokkon * Class to access Steemit Conveyor instances added by crokkon
......
...@@ -94,7 +94,7 @@ class Account(BlockchainObject): ...@@ -94,7 +94,7 @@ class Account(BlockchainObject):
""" """
if not self.steem.is_connected(): if not self.steem.is_connected():
return return
self.steem.rpc.set_next_node_on_empty_reply(False) self.steem.rpc.set_next_node_on_empty_reply(self.steem.rpc.get_use_appbase())
if self.steem.rpc.get_use_appbase(): if self.steem.rpc.get_use_appbase():
account = self.steem.rpc.find_accounts({'accounts': [self.identifier]}, api="database") account = self.steem.rpc.find_accounts({'accounts': [self.identifier]}, api="database")
else: else:
......
...@@ -675,7 +675,7 @@ class Blockchain(object): ...@@ -675,7 +675,7 @@ class Blockchain(object):
'memo': 'https://steemit.com/lofi/@johngreenfield/lofi-joji-yeah-right', 'memo': 'https://steemit.com/lofi/@johngreenfield/lofi-joji-yeah-right',
'_id': '6d4c5f2d4d8ef1918acaee4a8dce34f9da384786', '_id': '6d4c5f2d4d8ef1918acaee4a8dce34f9da384786',
'timestamp': datetime.datetime(2018, 5, 9, 11, 23, 6, tzinfo=<UTC>), 'timestamp': datetime.datetime(2018, 5, 9, 11, 23, 6, tzinfo=<UTC>),
'block_num': 22277588, 'trx_id': 'cf11b2ac8493c71063ec121b2e8517ab1e0e6bea' 'block_num': 22277588, 'trx_num': 35, 'trx_id': 'cf11b2ac8493c71063ec121b2e8517ab1e0e6bea'
} }
output when `raw_ops=True` is set: output when `raw_ops=True` is set:
...@@ -733,6 +733,7 @@ class Blockchain(object): ...@@ -733,6 +733,7 @@ class Blockchain(object):
if not bool(opNames) or op_type in opNames and block_num > 0: if not bool(opNames) or op_type in opNames and block_num > 0:
if raw_ops: if raw_ops:
yield {"block_num": block_num, yield {"block_num": block_num,
"trx_num": trx_nr,
"op": [op_type, op], "op": [op_type, op],
"timestamp": timestamp} "timestamp": timestamp}
else: else:
...@@ -741,6 +742,7 @@ class Blockchain(object): ...@@ -741,6 +742,7 @@ class Blockchain(object):
updated_op.update({"_id": _id, updated_op.update({"_id": _id,
"timestamp": timestamp, "timestamp": timestamp,
"block_num": block_num, "block_num": block_num,
"trx_num": trx_nr,
"trx_id": trx_id}) "trx_id": trx_id})
yield updated_op yield updated_op
...@@ -800,7 +802,7 @@ class Blockchain(object): ...@@ -800,7 +802,7 @@ class Blockchain(object):
lastname = None lastname = None
else: else:
lastname = start lastname = start
self.steem.rpc.set_next_node_on_empty_reply(False) self.steem.rpc.set_next_node_on_empty_reply(self.steem.rpc.get_use_appbase())
while True: while True:
if self.steem.rpc.get_use_appbase(): if self.steem.rpc.get_use_appbase():
ret = self.steem.rpc.list_accounts({'start': lastname, 'limit': steps, 'order': 'by_name'}, api="database")["accounts"] ret = self.steem.rpc.list_accounts({'start': lastname, 'limit': steps, 'order': 'by_name'}, api="database")["accounts"]
......
...@@ -268,6 +268,8 @@ def remove_from_dict(obj, keys=list(), keep_keys=True): ...@@ -268,6 +268,8 @@ def remove_from_dict(obj, keys=list(), keep_keys=True):
""" """
if type(obj) == dict: if type(obj) == dict:
items = list(obj.items()) items = list(obj.items())
elif isinstance(obj, dict):
items = list(obj.items())
else: else:
items = list(obj.__dict__.items()) items = list(obj.__dict__.items())
if keep_keys: if keep_keys:
......
...@@ -12,7 +12,7 @@ from beem.discussions import ( ...@@ -12,7 +12,7 @@ from beem.discussions import (
Post_discussions_by_payout, Discussions_by_created, Discussions_by_active, Post_discussions_by_payout, Discussions_by_created, Discussions_by_active,
Discussions_by_cashout, Discussions_by_votes, Discussions_by_cashout, Discussions_by_votes,
Discussions_by_children, Discussions_by_hot, Discussions_by_feed, Discussions_by_blog, Discussions_by_children, Discussions_by_hot, Discussions_by_feed, Discussions_by_blog,
Discussions_by_comments, Discussions_by_promoted Discussions_by_comments, Discussions_by_promoted, Discussions
) )
from datetime import datetime from datetime import datetime
from beem.instance import set_shared_steem_instance from beem.instance import set_shared_steem_instance
...@@ -214,4 +214,9 @@ class Testcases(unittest.TestCase): ...@@ -214,4 +214,9 @@ class Testcases(unittest.TestCase):
query["limit"] = 10 query["limit"] = 10
query["tag"] = "steemit" query["tag"] = "steemit"
d = Discussions_by_promoted(query, steem_instance=bts) d = Discussions_by_promoted(query, steem_instance=bts)
discussions = Discussions(steem_instance=bts)
d2 = []
for dd in discussions.get_discussions("promoted", query, limit=10):
d2.append(dd)
self.assertEqual(len(d), 10) self.assertEqual(len(d), 10)
self.assertEqual(len(d2), 10)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment