From 98969bb3c9326ca651139d13770045affb59b237 Mon Sep 17 00:00:00 2001 From: Dariusz Kedzierski <dkedzierski@syncad.com> Date: Thu, 25 Jun 2020 11:44:11 +0200 Subject: [PATCH] Fix for missing comment_reward_operation - removed "limit":1000 option in enum_virtual_ops call (limit was causing trimming ops) - fixed some syntax errors --- hive/indexer/blocks.py | 2 +- hive/indexer/sync.py | 3 ++- hive/steem/client.py | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hive/indexer/blocks.py b/hive/indexer/blocks.py index a1184f81d..339f40037 100644 --- a/hive/indexer/blocks.py +++ b/hive/indexer/blocks.py @@ -106,7 +106,7 @@ class Blocks: val = {'hbd_payout':op_value['hbd_payout'], 'hive_payout':op_value['hive_payout'], 'vesting_payout':op_value['vesting_payout']} elif op_type == 'comment_reward_operation': if('payout' not in op_value or op_value['payout'] is None): - logger.error("Broken op: `{}'".format(str(op))) + log.error("Broken op: `{}'".format(str(vop))) key = "{}/{}".format(op_value['author'], op_value['permlink']) val = {'payout':op_value['payout'], 'author_rewards':op_value['author_rewards']} elif op_type == 'effective_comment_vote_operation': diff --git a/hive/indexer/sync.py b/hive/indexer/sync.py index 8677fb67b..5a12fe7d2 100644 --- a/hive/indexer/sync.py +++ b/hive/indexer/sync.py @@ -40,10 +40,11 @@ def print_ops_stats(prefix, ops_stats): log.info("`{}': {}".format(k, v)) log.info("############################################################################") + def prepare_vops(vops_by_block): preparedVops = {} - for blockNum, blockDict in vops_by_block.items(): + for blockNum, blockDict in vops_by_block.items(): vopsList = blockDict['ops'] date = blockDict['timestamp'] preparedVops[blockNum] = Blocks.prepare_vops(vopsList, date) diff --git a/hive/steem/client.py b/hive/steem/client.py index 08a38d614..cf366dcea 100644 --- a/hive/steem/client.py +++ b/hive/steem/client.py @@ -174,9 +174,11 @@ class SteemClient: resume_on_operation = 0 while from_block < to_block: - result = self.__exec('enum_virtual_ops', {"block_range_begin":from_block, "block_range_end":to_block - , "operation_begin": resume_on_operation, "limit": 1000, "filter": tracked_ops_filter - }) + result = self.__exec('enum_virtual_ops', + {"block_range_begin":from_block, "block_range_end":to_block, + "operation_begin": resume_on_operation, + "filter": tracked_ops_filter + }) ops = result['ops'] if 'ops' in result else [] resume_on_operation = result['next_operation_begin'] if 'next_operation_begin' in result else 0 -- GitLab