diff --git a/hive/db/sql_scripts/bridge_get_ranked_post_for_communities.sql b/hive/db/sql_scripts/bridge_get_ranked_post_for_communities.sql index 879b3510b9e086762a0c90bf13838321236e6908..e068d7a9667fd36b724fbd647f5937029bbe7ff5 100644 --- a/hive/db/sql_scripts/bridge_get_ranked_post_for_communities.sql +++ b/hive/db/sql_scripts/bridge_get_ranked_post_for_communities.sql @@ -8,9 +8,7 @@ DECLARE __post_id INT; BEGIN __observer_id = find_account_id( _observer, True ); - IF _author != '' AND _permlink != '' THEN - __post_id = find_comment_id( _author, _permlink, True ); - END IF; + __post_id = find_comment_id( _author, _permlink, True ); RETURN QUERY WITH pinned AS @@ -22,7 +20,7 @@ BEGIN JOIN hive_communities hc ON hc.id = hp.community_id LEFT OUTER JOIN blacklisted_by_observer_view blacklist ON (blacklist.observer_id = __observer_id AND blacklist.blacklisted_id = hp.author_id) WHERE hc.name = _community AND hp.is_pinned - AND ((_author = '' AND _permlink = '') OR hp.id < __post_id) + AND (__post_id = 0 OR hp.id < __post_id) AND (NOT EXISTS (SELECT 1 FROM muted_accounts_by_id_view WHERE observer_id = __observer_id AND muted_id = hp.author_id)) ORDER BY hp.id DESC LIMIT _limit diff --git a/hive/db/sql_scripts/bridge_list_communities.sql b/hive/db/sql_scripts/bridge_list_communities.sql index 77d9fae58a7b61c189efa2e4b7325171217b78cd..ee91899a7692f07ac2a7c8493e9cc489d9f1fc9e 100644 --- a/hive/db/sql_scripts/bridge_list_communities.sql +++ b/hive/db/sql_scripts/bridge_list_communities.sql @@ -30,9 +30,12 @@ LANGUAGE plpgsql AS $function$ DECLARE - __context JSON; + __last_id INT := find_community_id( _last, True ); + __rank hive_communities.rank%TYPE = 0; BEGIN - + IF ( _last <> '' ) THEN + SELECT hc.rank INTO __rank FROM hive_communities hc WHERE hc.id = __last_id; + END IF; RETURN QUERY SELECT hc.id, hc.name, @@ -52,8 +55,7 @@ BEGIN FROM hive_communities as hc LEFT JOIN hive_roles hr ON hr.community_id = hc.id AND hr.role_id = 6 LEFT JOIN hive_accounts ha ON hr.account_id = ha.id - WHERE (_last = '' OR hc.rank > (SELECT rank FROM hive_communities WHERE name = _last)) - AND hc.rank > 0 + WHERE hc.rank > __rank AND (_search IS NULL OR to_tsvector('english', hc.title || ' ' || hc.about) @@ plainto_tsquery(_search)) GROUP BY hc.id ORDER BY hc.rank ASC @@ -76,7 +78,7 @@ LANGUAGE plpgsql AS $function$ DECLARE - __context JSON; + __last_id INT := find_community_id( _last, True ); BEGIN RETURN QUERY SELECT hc.id, @@ -97,10 +99,10 @@ BEGIN FROM hive_communities as hc LEFT JOIN hive_roles hr ON hr.community_id = hc.id AND hr.role_id = 6 LEFT JOIN hive_accounts ha ON hr.account_id = ha.id - WHERE (_last = '' OR hc.created_at < (SELECT created_at FROM hive_communities WHERE name = _last)) + WHERE (__last_id = 0 OR hc.id < __last_id) AND (_search IS NULL OR to_tsvector('english', hc.title || ' ' || hc.about) @@ plainto_tsquery(_search)) GROUP BY hc.id - ORDER BY hc.created_at DESC + ORDER BY hc.id DESC LIMIT _limit ; END @@ -120,8 +122,12 @@ LANGUAGE plpgsql AS $function$ DECLARE - __context JSON; + __last_id INT := find_community_id( _last, True ); + __subscribers hive_communities.subscribers%TYPE; BEGIN + IF ( _last <> '' ) THEN + SELECT hc.subscribers INTO __subscribers FROM hive_communities hc WHERE hc.id = __last_id; + END IF; RETURN QUERY SELECT hc.id, hc.name, @@ -141,10 +147,10 @@ BEGIN FROM hive_communities as hc LEFT JOIN hive_roles hr ON hr.community_id = hc.id AND hr.role_id = 6 LEFT JOIN hive_accounts ha ON hr.account_id = ha.id - WHERE (_last = '' OR hc.subscribers < (SELECT subscribers FROM hive_communities WHERE name = _last)) + WHERE (__last_id = 0 OR hc.subscribers < __subscribers OR (hc.subscribers = __subscribers AND hc.id < __last_id)) AND (_search IS NULL OR to_tsvector('english', hc.title || ' ' || hc.about) @@ plainto_tsquery(_search)) GROUP BY hc.id - ORDER BY hc.subscribers DESC + ORDER BY hc.subscribers DESC, hc.id DESC LIMIT _limit ; END diff --git a/hive/db/sql_scripts/bridge_list_community_roles.sql b/hive/db/sql_scripts/bridge_list_community_roles.sql index 7be45d6edd59d6c611728db66b345685ec9ecad0..47ecac6317ac2161a30fae320287d633b073b283 100644 --- a/hive/db/sql_scripts/bridge_list_community_roles.sql +++ b/hive/db/sql_scripts/bridge_list_community_roles.sql @@ -40,7 +40,7 @@ BEGIN ),0); IF __last_role = 0 THEN - RAISE EXCEPTION 'invalid last'; + RAISE EXCEPTION 'invalid last' USING ERRCODE = 'CEHM1'; END IF; RETURN QUERY diff --git a/hive/db/sql_scripts/db_upgrade.sh b/hive/db/sql_scripts/db_upgrade.sh index cfc434687519fce8da445843f0e266172e6cbd31..ad99bf8db071fddf07c72cbd4ff9b0aef5130886 100755 --- a/hive/db/sql_scripts/db_upgrade.sh +++ b/hive/db/sql_scripts/db_upgrade.sh @@ -17,7 +17,7 @@ for sql in postgres_handle_view_changes.sql \ hive_muted_accounts_view.sql \ hive_muted_accounts_by_id_view.sql \ hive_blacklisted_accounts_by_observer_view.sql \ - get_post_view_by_id.sql \ + get_post_view_by_id.sql \ hive_post_operations.sql \ head_block_time.sql \ update_feed_cache.sql \ diff --git a/hive/db/sql_scripts/utility_functions.sql b/hive/db/sql_scripts/utility_functions.sql index 93cd47caaa065e2d1196c2d005e2ec22462d763d..b116a0d1202c445492fb8302e9a2c2ca8e612fd1 100644 --- a/hive/db/sql_scripts/utility_functions.sql +++ b/hive/db/sql_scripts/utility_functions.sql @@ -43,9 +43,9 @@ BEGIN WHERE ha.name = _author AND hpd.permlink = _permlink ); IF __post_id = 0 THEN - RAISE EXCEPTION 'Post %/% does not exist', _author, _permlink; + RAISE EXCEPTION 'Post %/% does not exist', _author, _permlink USING ERRCODE = 'CEHM2'; ELSE - RAISE EXCEPTION 'Post %/% was deleted % time(s)', _author, _permlink, __post_id; + RAISE EXCEPTION 'Post %/% was deleted % time(s)', _author, _permlink, __post_id USING ERRCODE = 'CEHM3'; END IF; END IF; END IF; @@ -69,7 +69,7 @@ BEGIN IF (_account <> '') THEN SELECT INTO __account_id COALESCE( ( SELECT id FROM hive_accounts WHERE name=_account ), 0 ); IF _check AND __account_id = 0 THEN - RAISE EXCEPTION 'Account % does not exist', _account; + RAISE EXCEPTION 'Account % does not exist', _account USING ERRCODE = 'CEHM4'; END IF; END IF; RETURN __account_id; @@ -93,7 +93,7 @@ BEGIN IF (_tag_name <> '') THEN SELECT INTO __tag_id COALESCE( ( SELECT id FROM hive_tag_data WHERE tag=_tag_name ), 0 ); IF _check AND __tag_id = 0 THEN - RAISE EXCEPTION 'Tag % does not exist', _tag_name; + RAISE EXCEPTION 'Tag % does not exist', _tag_name USING ERRCODE = 'CEHM5'; END IF; END IF; RETURN __tag_id; @@ -117,7 +117,7 @@ BEGIN IF (_category_name <> '') THEN SELECT INTO __category_id COALESCE( ( SELECT id FROM hive_category_data WHERE category=_category_name ), 0 ); IF _check AND __category_id = 0 THEN - RAISE EXCEPTION 'Category % does not exist', _category_name; + RAISE EXCEPTION 'Category % does not exist', _category_name USING ERRCODE = 'CEHM6'; END IF; END IF; RETURN __category_id; @@ -141,7 +141,7 @@ BEGIN IF (_community_name <> '') THEN SELECT INTO __community_id COALESCE( ( SELECT id FROM hive_communities WHERE name=_community_name ), 0 ); IF _check AND __community_id = 0 THEN - RAISE EXCEPTION 'Community % does not exist', _community_name; + RAISE EXCEPTION 'Community % does not exist', _community_name USING ERRCODE = 'CEHM7'; END IF; END IF; RETURN __community_id; @@ -166,7 +166,7 @@ BEGIN WHEN 6 THEN 'admin' WHEN 8 THEN 'owner' END; - RAISE EXCEPTION 'role id not found'; + RAISE EXCEPTION 'role id not found' USING ERRCODE = 'CEHM8'; END $function$ ; \ No newline at end of file diff --git a/hive/indexer/accounts.py b/hive/indexer/accounts.py index 934d31395f30a42fe9a622ce5c0a9c7a607100c7..1cae785b52116ed86ccf141ef76f4bdf36a71fa4 100644 --- a/hive/indexer/accounts.py +++ b/hive/indexer/accounts.py @@ -114,11 +114,11 @@ class Accounts(DbAdapterHolder): """ if name is None: - return + return False # filter out names which already registered if cls.exists(name): - return + return True ( _posting_json_metadata, _json_metadata ) = get_profile_str( op_details ) @@ -128,13 +128,18 @@ class Accounts(DbAdapterHolder): RETURNING id """.format( name, block_date, cls.get_json_data( _posting_json_metadata ), cls.get_json_data( _json_metadata ) ) - cls._ids[name] = DB.query_one( sql ) + new_id = DB.query_one( sql ) + if new_id is None: + return False + cls._ids[name] = new_id # post-insert: pass to communities to check for new registrations from hive.indexer.community import Community if block_num > Community.start_block: Community.register(name, block_date, block_num) + return True + @classmethod def flush(cls): """ Flush json_metadatafrom cache to database """ diff --git a/hive/indexer/blocks.py b/hive/indexer/blocks.py index 35271904159d71314177ae71309876ef261def94..937d963489537fa7c50fea5dd9b389c77f852d81 100644 --- a/hive/indexer/blocks.py +++ b/hive/indexer/blocks.py @@ -249,22 +249,29 @@ class Blocks: account_name = None op_details = None + potentially_new_account = False # account ops if op_type == 'pow_operation': account_name = op['worker_account'] + potentially_new_account = True elif op_type == 'pow2_operation': account_name = op['work']['value']['input']['worker_account'] + potentially_new_account = True elif op_type == 'account_create_operation': account_name = op['new_account_name'] op_details = op + potentially_new_account = True elif op_type == 'account_create_with_delegation_operation': account_name = op['new_account_name'] op_details = op + potentially_new_account = True elif op_type == 'create_claimed_account_operation': account_name = op['new_account_name'] op_details = op + potentially_new_account = True - Accounts.register(account_name, op_details, cls._head_block_date, num) + if potentially_new_account and not Accounts.register(account_name, op_details, cls._head_block_date, num): + log.error("Failed to register account {} from operation: {}".format(account_name, op)) # account metadata updates if op_type == 'account_update_operation': diff --git a/hive/indexer/community.py b/hive/indexer/community.py index acc66bc5baef9466648ed9221d6ebea6174c47f5..5a7ebfe182cc4d6ba721a7cb1170990d992a4a09 100644 --- a/hive/indexer/community.py +++ b/hive/indexer/community.py @@ -10,6 +10,7 @@ import ujson as json from hive.db.adapter import Db from hive.indexer.accounts import Accounts from hive.indexer.notify import Notify +from hive.server.common.helpers import check_community log = logging.getLogger(__name__) @@ -139,10 +140,7 @@ class Community: @classmethod def validated_name(cls, name): - """Perform basic validation on community name, then search for id.""" - if (name[:5] == 'hive-' - and len(name) > 5 and name[5] in ['1', '2', '3'] - and re.match(r'^hive-[123]\d{4,6}$', name)): + if (check_community(name)): return name return None @@ -441,7 +439,7 @@ JOIN hive_permlink_data hpd ON hp.permlink_id=hpd.id WHERE author_id=:_author AND hpd.permlink=:_permlink """ result = DB.query_row(sql, _author=self.account_id, _permlink=_permlink) - assert result, f"post does not exists, query:\t{sql}" + assert result, f'post does not exists {self.account}/{_permlink}' result = dict(result) _pid = result.get('id', None) diff --git a/hive/indexer/follow.py b/hive/indexer/follow.py index 82dff52afd04e35ebfc0268fb988be8c23c6dcbf..cd42b15cb58c052a7c81b9e8acf2c5837dc148fa 100644 --- a/hive/indexer/follow.py +++ b/hive/indexer/follow.py @@ -153,8 +153,8 @@ class Follow(DbAdapterHolder): add_null_muted = True else: assert False, 'Unhandled follow state' - # apply action to existing cached data as well as to database (ABW: with expected frequency of list resetting - # there is no point in grouping such operations from group of blocks - we can just execute them one by one + # apply action to existing cached data as well as to database (ABW: with expected frequency of list resetting + # there is no point in grouping such operations from group of blocks - we can just execute them one by one # in order of appearance) for k, data in cls.follow_items_to_flush.items(): if data['follower'] == follower: diff --git a/hive/indexer/mock_block_provider.py b/hive/indexer/mock_block_provider.py index 429d7a29653e8df979fab611c7c81f6b05cea686..4417aa4dd55cec060e4d1b9f5e01b26a804bb877 100644 --- a/hive/indexer/mock_block_provider.py +++ b/hive/indexer/mock_block_provider.py @@ -14,12 +14,19 @@ class MockBlockProvider(MockDataProvider): max_block = 0 last_real_block_num = 1 + last_real_block_id = "" last_real_block_time = dateutil.parser.isoparse("2016-03-24T16:05:00") @classmethod - def set_last_real_block_num_date(cls, block_num, block_date): + def set_last_real_block_num_date(cls, block_num, block_date, block_id): + if cls.last_real_block_num > block_num: + log.error( "Incoming block has lower number than previous one: old {}, new {}".format(cls.last_real_block_num, block_num) ) cls.last_real_block_num = int(block_num) - cls.last_real_block_time = dateutil.parser.isoparse(block_date) + cls.last_real_block_id = block_id + new_date = dateutil.parser.isoparse(block_date) + if cls.last_real_block_time > new_date: + log.error( "Incoming block has older timestamp than previous one: old {}, new {}".format(cls.last_real_block_time, new_date) ) + cls.last_real_block_time = new_date @classmethod def add_block_data_from_file(cls, file_name): @@ -39,9 +46,10 @@ class MockBlockProvider(MockDataProvider): if block_num < cls.min_block: cls.min_block = block_num - #log.info("Loading mock data for block {} with timestamp: {}".format(block_num, block_content['timestamp'])) - if block_num in cls.block_data: + # mocks contain only transactions - rest is taken either from original block + # or from default empty mock; see also get_block_data below; note that we can't + # supplement data with defaults here because they depend on last_real_block_... assert 'transactions' in cls.block_data[block_num] assert 'transactions' in block_content cls.block_data[block_num]['transactions'] = cls.block_data[block_num]['transactions'] + block_content['transactions'] @@ -55,10 +63,12 @@ class MockBlockProvider(MockDataProvider): data = cls.block_data.get(block_num, None) - #if data is not None: - #log.info("Block {} has timestamp: {}".format(block_num, data['timestamp'])) - - if make_on_empty and data is None: + if data is not None: + # supplement mock data with necessary (default) elements + base = cls.make_empty_block(block_num) + base['transactions'] = data['transactions'] + data = base + elif make_on_empty: data = cls.make_empty_block(block_num) return data @@ -69,7 +79,10 @@ class MockBlockProvider(MockDataProvider): @classmethod def make_block_id(cls, block_num): - return "{:08x}00000000000000000000000000000000".format(block_num) + if block_num == cls.last_real_block_num: + return cls.last_real_block_id + else: + return "{:08x}00000000000000000000000000000000".format(block_num) @classmethod def make_block_timestamp(cls, block_num): diff --git a/hive/indexer/posts.py b/hive/indexer/posts.py index 266e264bed0c5b1e6bafba5f861ae52179e4f7bf..42f4c8c43f55ea18da311bc334c7057e91251963 100644 --- a/hive/indexer/posts.py +++ b/hive/indexer/posts.py @@ -76,6 +76,9 @@ class Posts(DbAdapterHolder): row = DB.query_row(sql, author=op['author'], permlink=op['permlink'], parent_author=op['parent_author'], parent_permlink=op['parent_permlink'], date=block_date, community_support_start_block=Community.start_block, block_num=op['block_num'], tags=tags) + if not row: + log.error("Failed to process comment_op: {}".format(op)) + return result = dict(row) # TODO we need to enhance checking related community post validation and honor is_muted. diff --git a/hive/indexer/sync.py b/hive/indexer/sync.py index 3cabf6a41a9366cfa66afcc3912f48196c034893..0880966e3ad4d75f4c4a95d24a4af4610d023d7d 100644 --- a/hive/indexer/sync.py +++ b/hive/indexer/sync.py @@ -230,7 +230,7 @@ class Sync: def load_mock_data(self,mock_block_data_path): if mock_block_data_path: MockBlockProvider.load_block_data(mock_block_data_path) - MockBlockProvider.print_data() + # MockBlockProvider.print_data() def refresh_sparse_stats(self): # normally it should be refreshed in various time windows @@ -280,7 +280,7 @@ class Sync: mock_vops_data_path = self._conf.get("mock_vops_data_path") if mock_vops_data_path: MockVopsProvider.load_block_data(mock_vops_data_path) - MockVopsProvider.print_data() + # MockVopsProvider.print_data() # prefetch id->name and id->rank memory maps Accounts.load_ids() diff --git a/hive/server/common/helpers.py b/hive/server/common/helpers.py index 67a576676c39b6fe2aab325e1cdbaa4d630bc85b..d157692ebab6ae577b945f56101f5dfe00812bfd 100644 --- a/hive/server/common/helpers.py +++ b/hive/server/common/helpers.py @@ -6,9 +6,9 @@ import traceback import logging import datetime from dateutil.relativedelta import relativedelta -from psycopg2.errors import RaiseException +from psycopg2.errors import DatabaseError +from sqlalchemy.exc import DatabaseError as AlchemyDatabaseError from jsonrpcserver.exceptions import ApiError as RPCApiError -from hive.indexer.community import Community log = logging.getLogger(__name__) @@ -18,7 +18,16 @@ class ApiError(Exception): pass # values -32768..-32000 are reserved -ACCESS_TO_DELETED_POST_ERROR_CODE = -31999 +ACCESS_TO_DELETED_POST_ERROR_CODE = -31999 # SQLSTATE = 'CEHM3' + +def valid_custom_sql_error(exc): + """Tests given DatabaseError, rethrows if it is not custom Hivemind error""" + e = exc + if isinstance(exc, AlchemyDatabaseError): + e = exc.orig + if not isinstance(e, DatabaseError) or not e.pgcode or len(e.pgcode) != 5 or e.pgcode[:2] != 'CE': + raise exc + return e def return_error_info(function): """Async API method decorator which catches and formats exceptions.""" @@ -27,9 +36,10 @@ def return_error_info(function): """Catch ApiError and AssertionError (always due to user error).""" try: return await function(*args, **kwargs) - except (RaiseException) as e: + except DatabaseError as e: + e = valid_custom_sql_error(e) msg = e.diag.message_primary - if 'was deleted' in msg: + if e.pgcode == 'CEHM3': raise RPCApiError('Invalid parameters', ACCESS_TO_DELETED_POST_ERROR_CODE, msg) else: raise AssertionError(msg) @@ -83,10 +93,17 @@ def get_hive_accounts_info_view_query_string(names, lite = False): return sql def check_community(name) -> bool: - return Community.validated_name(name) is not None + """Perform basic validation on community name""" + if (name and isinstance(name, str) and len(name) > 5 and name[:5] == 'hive-' + and name[5] in ['1', '2', '3'] and re.match(r'^hive-[123]\d{4,6}$', name)): + return True + return False -def valid_community(name): +def valid_community(name, allow_empty=False): """Checks is given name of community matches community regex, if not asserts""" + if not name: + assert allow_empty, 'community name cannot be blank' + return "" assert check_community(name), "given community name is not valid" return name diff --git a/hive/server/hive_api/community.py b/hive/server/hive_api/community.py index d1285009e9c398cf5f656bcb3b21bf4f6ca010e3..733c49eb55244dbe09324e0a307087503c7f109d 100644 --- a/hive/server/hive_api/community.py +++ b/hive/server/hive_api/community.py @@ -2,7 +2,7 @@ import logging from hive.server.hive_api.common import (get_community_id) -from hive.server.common.helpers import (return_error_info, valid_account, valid_limit) +from hive.server.common.helpers import (return_error_info, valid_community, valid_account, valid_limit) # pylint: disable=too-many-lines @@ -15,6 +15,7 @@ async def get_community(context, name, observer=None): If `observer` is provided, get subcription status, user title, user role. """ db = context['db'] + name = valid_community(name) observer = valid_account(observer, allow_empty=True) sql = "SELECT * FROM bridge_get_community( (:name)::VARCHAR, (:observer)::VARCHAR )" @@ -27,6 +28,7 @@ async def get_community(context, name, observer=None): async def get_community_context(context, name, account): """For a community/account: returns role, title, subscribed state""" db = context['db'] + name = valid_community(name) account = valid_account(account) sql = "SELECT * FROM bridge_get_community_context( (:account)::VARCHAR, (:name)::VARCHAR )" @@ -74,8 +76,9 @@ async def list_all_subscriptions(context, account): @return_error_info async def list_subscribers(context, community, last='', limit=100): """Lists subscribers of `community`.""" - limit = valid_limit(limit, 100, 100) + community = valid_community(community) last = valid_account(last, True) + limit = valid_limit(limit, 100, 100) db = context['db'] sql = "SELECT * FROM bridge_list_subscribers( (:community)::VARCHAR, (:last)::VARCHAR, (:limit)::INT )" rows = await db.query_all(sql, community=community, last=last, limit=limit) @@ -85,9 +88,11 @@ async def list_subscribers(context, community, last='', limit=100): async def list_communities(context, last='', limit=100, query=None, sort='rank', observer=None): """List all communities, paginated. Returns lite community list.""" # pylint: disable=too-many-arguments, too-many-locals + last = valid_community(last, True) limit = valid_limit(limit, 100, 100) + supported_sort_list = ['rank', 'new', 'subs'] + assert sort in supported_sort_list, "Unsupported sort, valid sorts: {}".format(", ".join(supported_sort_list)) observer = valid_account(observer, True) - assert sort in ('rank', 'new', 'subs'), 'invalid sort' search = query db = context['db'] @@ -103,6 +108,8 @@ async def list_communities(context, last='', limit=100, query=None, sort='rank', async def list_community_roles(context, community, last='', limit=50): """List community account-roles (anyone with non-guest status).""" db = context['db'] + community = valid_community(community) + last = valid_account(last, True) limit = valid_limit(limit, 1000, 50) sql = "SELECT * FROM bridge_list_community_roles( (:community)::VARCHAR, (:last)::VARCHAR, (:limit)::INT )" @@ -128,6 +135,7 @@ async def top_community_voters(context, community): """Get a list of top 5 (pending) community voters.""" # TODO: which are voting on muted posts? db = context['db'] + # TODO: missing validation of community parameter top = await _top_community_posts(db, community) total = {} for _, votes, _ in top: @@ -140,6 +148,7 @@ async def top_community_voters(context, community): async def top_community_authors(context, community): """Get a list of top 5 (pending) community authors.""" db = context['db'] + # TODO: missing validation of community parameter top = await _top_community_posts(db, community) total = {} for author, _, payout in top: diff --git a/hive/steem/block/schedule.py b/hive/steem/block/schedule.py index b7226d2743c28c9aa60b2a4fc21437d529b1f243..6bed513eae9c27923af0989618733cff2c4e2636 100644 --- a/hive/steem/block/schedule.py +++ b/hive/steem/block/schedule.py @@ -88,7 +88,7 @@ class BlockSchedule: missed = (gap_secs / self.BLOCK_INTERVAL) - 1 if missed: self._add_missed(missed) - log.warning("%d missed @ block %d", missed, num) + log.warning("%d missed @ block %d (prev: %s, next: %s)", missed, num, prev_date, next_date) def _drift_backward(self, delta=0.1): """Delay the schedule by 0.1s when a block fetch failed.""" diff --git a/hive/steem/blocks_provider.py b/hive/steem/blocks_provider.py index 36d9349c3ea5d1ff10e2d8fa7a74d475b6e474fe..217a1d050a30296d93d0255af457c9a06d18f63f 100644 --- a/hive/steem/blocks_provider.py +++ b/hive/steem/blocks_provider.py @@ -71,7 +71,7 @@ class BlocksProvider: return; while cls._breaker(): try: - blocks = cls._responses_queues[ blocks_queue ].get( True, 1) + blocks = cls._responses_queues[ blocks_queue ].get( True, 1 ) cls._responses_queues[ blocks_queue ].task_done() #split blocks range for block in blocks: @@ -79,10 +79,11 @@ class BlocksProvider: if block_mock is not None: if 'block' in block: block["block"]["transactions"].extend( block_mock["transactions"] ) - block["block"]["transaction_ids"].extend( block_mock["transaction_ids"] ) else: + log.warning("Pure mock block: id {}, previous {}".format(block_mock["block_id"], block_mock["previous"])) block["block"] = block_mock - if not 'block' in 'block': # if block not exists in the node nor moc + if not 'block' in block: # if block not exists in the node nor mock + log.warning("Block data is missing for block: {}".format(block)) continue; while cls._breaker(): diff --git a/hive/steem/client.py b/hive/steem/client.py index 6138dceeeeef86c0009cb9e02c9413fd2eddbf6c..2c91f43dadb44d4688cec308958539fb1db4c369 100644 --- a/hive/steem/client.py +++ b/hive/steem/client.py @@ -68,17 +68,17 @@ class SteemClient: #logger.info("Found real block %d with timestamp: %s", num, ret['timestamp']) - MockBlockProvider.set_last_real_block_num_date(num, ret['timestamp']) + MockBlockProvider.set_last_real_block_num_date(num, ret['timestamp'], ret['block_id']) data = MockBlockProvider.get_block_data(num) if data is not None: ret["transactions"].extend(data["transactions"]) - ret["transaction_ids"].extend(data["transaction_ids"]) return ret else: # if block does not exist in hived but exist in Mock Provider # return block from block provider mocked_block = MockBlockProvider.get_block_data(num, True) #logger.info("Found real block %d with timestamp: %s", num, mocked_block['timestamp']) + logger.warning("Pure mock block: id {}, previous {}".format(mocked_block["block_id"], mocked_block["previous"])) return mocked_block def get_blocks_provider( cls, lbound, ubound, breaker ): @@ -201,13 +201,14 @@ class SteemClient: num = int(block['block_id'][:8], base=16) assert block_num == num, "Reference block number and block number from result does not match" blocks[num] = block - MockBlockProvider.set_last_real_block_num_date(num, block['timestamp']) + MockBlockProvider.set_last_real_block_num_date(num, block['timestamp'], block['block_id']) data = MockBlockProvider.get_block_data(num) if data is not None: blocks[num]["transactions"].extend(data["transactions"]) - blocks[num]["transaction_ids"].extend(data["transaction_ids"]) else: - blocks[block_num] = MockBlockProvider.get_block_data(block_num, True) + block_mock = MockBlockProvider.get_block_data(block_num, True) + log.warning("Pure mock block: id {}, previous {}".format(block_mock["block_id"], block_mock["previous"])) + blocks[block_num] = block_mock idx += 1 return [blocks[x] for x in block_nums] diff --git a/hive/steem/vops_provider.py b/hive/steem/vops_provider.py index 4c841a1655eb8d9ba5fa5751b7fb3430586345ed..a7e068c00246a8fb86a8b7af5394abc20a919a4a 100644 --- a/hive/steem/vops_provider.py +++ b/hive/steem/vops_provider.py @@ -79,7 +79,7 @@ class VopsProvider: return; while cls._breaker(): try: - vops = cls._responses_queues[ vops_queue ].get( True, 1) + vops = cls._responses_queues[ vops_queue ].get( True, 1 ) cls._responses_queues[ vops_queue ].task_done() #split blocks range if not vops: diff --git a/mock_data/block_data/community_op/flow.txt b/mock_data/block_data/community_op/flow.txt index dfe5cf9839e0379c3e376e6f69b5be3d6a8f2cee..5f61b93a837e9e0932d4bf8e9ca992197f3f6549 100644 --- a/mock_data/block_data/community_op/flow.txt +++ b/mock_data/block_data/community_op/flow.txt @@ -1,4 +1,4 @@ -***block 4999999*** +***block 4998001*** account_create_operation( `hive-171487` ) account_create_operation( `hive-171488` ) account_create_operation( `hive-135485` ) @@ -20,7 +20,7 @@ comment_operation( `hive-117600`, `test-safari`, `secrets4`) comment_operation( `hive-117600`, `test-safari`, `secrets5`) comment_operation( `hive-117600`, `test-safari`, `secrets6`) custom_json_operation("[\"setRole\",{\"community\":\"hive-135485\",\"account\":\"test-safari\",\"role\":\"admin\"}]") -***block 5000000*** +***block 4998002*** custom_json_operation("[\"updateProps\",{\"community\":\"hive-135485\",\"props\":{\"title\":\"World News\",\"about\":\"A place for major news from around the world.\",\"is_nsfw\":true,\"description\":\"\",\"flag_text\":\"\"}}]") custom_json_operation("[\"setRole\",{\"community\":\"hive-135485\",\"account\":\"blocktrades\",\"role\":\"mod\"}]") custom_json_operation("[\"setUserTitle\",{\"community\":\"hive-135485\",\"account\":\"test-safari\",\"title\":\"Bill Gates\"}]") @@ -41,7 +41,7 @@ custom_json_operation("[\"setRole\",{\"community\":\"hive-198723\",\"account\":\ custom_json_operation("[\"subscribe\",{\"community\":\"hive-171487\"}]") custom_json_operation("[\"subscribe\",{\"community\":\"hive-157439\"}]") custom_json_operation("[\"subscribe\",{\"community\":\"hive-198723\"}]") -***block 5000001*** +***block 4998003*** custom_json_operation("[\"setRole\",{\"community\":\"hive-171488\",\"account\":\"test-safari\",\"role\":\"admin\"}]") custom_json_operation("[\"setRole\",{\"community\":\"hive-171487\",\"account\":\"test-safari\",\"role\":\"admin\"}]") custom_json_operation("[\"updateProps\",{\"community\":\"hive-171488\",\"props\":{\"title\":\"Hello\",\"about\":\"Nothing.\",\"is_nsfw\":true,\"description\":\"Nothing\",\"flag_text\":\"Lol\"}}]") @@ -63,7 +63,7 @@ comment_operation( `hive-198723`, `test-safari`, `please-comment-hive3-03`) comment_operation( `hive-171487`, `alice`, `My-first-post-hive-1`) comment_operation( `hive-157439`, `alice`, `My-first-post-hive-2`) comment_operation( `hive-198723`, `alice`, `My-first-post-hive-3`) -***block 5000002*** +***block 4998004*** comment_operation(`steemit`, `comment-to-please-comment-hive1`) comment_operation(`alice`, `comment-to-please-comment-hive1`) comment_operation(`alice`, `comment-to-please-comment-hive1-02`) @@ -84,7 +84,7 @@ custom_json_operation("[\"mutePost\",{\"community\":\"hive-135485\",\"account\": custom_json_operation("[\"mutePost\",{\"community\":\"hive-135485\",\"account\":\"test-safari\",\"permlink\":\"secrets2\",\"notes\":\"secrets2 are a spam\"}]") custom_json_operation("[\"mutePost\",{\"community\":\"hive-117600\",\"account\":\"test-safari\",\"permlink\":\"secrets5\",\"notes\":\"secret5 are a spam\"}]") custom_json_operation("[\"unmutePost\",{\"community\":\"hive-135485\",\"account\":\"test-safari\",\"permlink\":\"secrets2\",\"notes\":\"secrets1 are a spam, but I love them\"}]") -***block 5000003*** +***block 4998005*** custom_json_operation("[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"comment-to-please-comment-hive1\",\"notes\":\"first muted comment\"}]") custom_json_operation("[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"comment-to-please-comment-hive2\",\"notes\":\"first muted comment\"}]") custom_json_operation("[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"comment-to-please-comment-hive3\",\"notes\":\"first muted comment\"}]") @@ -101,7 +101,7 @@ custom_json_operation("[\"pinPost\",{\"community\":\"hive-117600\",\"account\":\ custom_json_operation("[\"unpinPost\",{\"community\":\"hive-117600\",\"account\":\"test-safari\",\"permlink\":\"secrets3\"}]") custom_json_operation("[\"pinPost\",{\"community\":\"hive-117600\",\"account\":\"test-safari\",\"permlink\":\"secrets4\"}]") custom_json_operation("[\"pinPost\",{\"community\":\"hive-117600\",\"account\":\"test-safari\",\"permlink\":\"secrets5\"}]") -***block 5000004*** +***block 4998006*** custom_json_operation("[\"unmutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"comment-to-please-comment-hive1\",\"notes\":\"Unmuted her first comment\"}]") custom_json_operation("[\"unmutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"comment-to-please-comment-hive2\",\"notes\":\"Unmuted her first comment\"}]") custom_json_operation("[\"unmutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"comment-to-please-comment-hive3\",\"notes\":\"Unmuted her first comment\"}]") @@ -110,7 +110,7 @@ custom_json_operation("[\"unmutePost\",{\"community\":\"hive-157439\",\"account\ custom_json_operation("[\"unmutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"My-first-post-hive-1\",\"notes\":\"Unmuted her first post\"}]") custom_json_operation("[\"flagPost\",{\"community\":\"hive-117600\",\"account\":\"test-safari\",\"permlink\":\"secrets5\",\"notes\":\"secrets5 are boring\"}]") custom_json_operation("[\"flagPost\",{\"community\":\"hive-117600\",\"account\":\"test-safari\",\"permlink\":\"secrets6\",\"notes\":\"secrets5 are stupid\"}]") -***block 5000005*** +***block 4998007*** custom_json_operation("[\"setRole\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"role\":\"muted\"}]") custom_json_operation("[\"setRole\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"role\":\"muted\"}]") custom_json_operation("[\"setRole\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"role\":\"muted\"}]") @@ -129,7 +129,7 @@ custom_json_operation("roadscape" -> "[\"subscribe\",{\"community\":\"hive-17148 custom_json_operation("roadscape" -> "[\"subscribe\",{\"community\":\"hive-135485\"}]") custom_json_operation("roadscape" -> "[\"subscribe\",{\"community\":\"hive-186669\"}]") custom_json_operation("roadscape" -> "[\"subscribe\",{\"community\":\"hive-104647\"}]") -***block 5000006*** +***block 4998008*** comment_operation( `hive-171487`, `alice`, `First-after-muted-post-hive1`) comment_operation( `hive-157439`, `alice`, `First-after-muted-post-hive2`) comment_operation( `hive-198723`, `alice`, `First-after-muted-post-hive3`) @@ -158,7 +158,7 @@ custom_json_operation("good-karma" -> "[\"subscribe\",{\"community\":\"hive-1034 custom_json_operation("good-karma" -> "[\"subscribe\",{\"community\":\"hive-188204\"}]") custom_json_operation("good-karma" -> "[\"subscribe\",{\"community\":\"hive-149232\"}]") custom_json_operation("good-karma" -> "[\"subscribe\",{\"community\":\"hive-104647\"}]") -***block 5000007*** +***block 4998009*** custom_json_operation("[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"after-muted-comment-to-please-comment-hive1\",\"notes\":\"I hate first comments!\"}]") custom_json_operation("[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"after-muted-comment-to-please-comment-hive2\",\"notes\":\"I hate first comments!\"}]") custom_json_operation("[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"after-muted-comment-to-please-comment-hive3\",\"notes\":\"I hate first comments!\"}]") @@ -177,7 +177,7 @@ comment_operation( `hive-117600`, `abit`, `anaconda01`) custom_json_operation("[\"pinPost\",{\"community\":\"hive-117600\",\"account\":\"abit\",\"permlink\":\"anaconda01\"}]") comment_operation( `hive-117600`, `abit`, `anaconda02`) custom_json_operation("[\"pinPost\",{\"community\":\"hive-117600\",\"account\":\"abit\",\"permlink\":\"anaconda02\"}]") -***block 5000008*** +***block 4998010*** custom_json_operation("[\"unmutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"First-after-muted-post-hive1\",\"notes\":\"Unmute first post\"}]") custom_json_operation("[\"unmutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"First-after-muted-post-hive2\",\"notes\":\"Unmute first post\"}]") custom_json_operation("[\"unmutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"First-after-muted-post-hive3\",\"notes\":\"Unmute first post\"}]") @@ -191,7 +191,7 @@ custom_json_operation("[\"pinPost\",{\"community\":\"hive-117600\",\"account\":\ custom_json_operation("[\"mutePost\",{\"community\":\"hive-117600\",\"account\":\"good-karma\",\"permlink\":\"spider02\",\"notes\":\"I hate spiders 02\"}]") custom_json_operation("[\"mutePost\",{\"community\":\"hive-117600\",\"account\":\"good-karma\",\"permlink\":\"spider01\",\"notes\":\"I hate spiders 01\"}]") custom_json_operation("[\"unmutePost\",{\"community\":\"hive-117600\",\"account\":\"good-karma\",\"permlink\":\"spider01\",\"notes\":\"I hate spiders 02, but they are funny\"}]") -***block 5000009*** +***block 4998011*** custom_json_operation("[\"setRole\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"role\":\"member\"}]") custom_json_operation("[\"setRole\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"role\":\"member\"}]") custom_json_operation("[\"setRole\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"role\":\"member\"}]") @@ -206,7 +206,7 @@ custom_json_operation("[\"unmutePost\",{\"community\":\"hive-135485\",\"account\ custom_json_operation("[\"pinPost\",{\"community\":\"hive-135485\",\"account\":\"blocktrades\",\"permlink\":\"crocodile02\"}]") custom_json_operation("[\"pinPost\",{\"community\":\"hive-135485\",\"account\":\"blocktrades\",\"permlink\":\"crocodile03\"}]") comment_operation( `hive-135485`, `blocktrades`, `elephant01`) -***block 5000010*** +***block 4998012*** comment_operation( `hive-171487`, `alice`, `First-after-member-post-hive1`) comment_operation( `hive-157439`, `alice`, `First-after-member-post-hive2`) comment_operation( `hive-198723`, `alice`, `First-after-member-post-hive3`) @@ -231,7 +231,7 @@ custom_json_operation("[\"mutePost\",{\"community\":\"hive-117600\",\"account\": delete_comment_operation(`test-safari`, `secrets6`) custom_json_operation("[\"mutePost\",{\"community\":\"hive-135485\",\"account\":\"blocktrades\",\"permlink\":\"elephant01\",\"notes\":\"I don't like elephants\"}]") custom_json_operation("[\"pinPost\",{\"community\":\"hive-135485\",\"account\":\"blocktrades\",\"permlink\":\"elephant01\"}]") -***block 5000011*** +***block 4998013*** custom_json_operation("[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive1\",\"notes\":\"I hate first comments!\"}]") custom_json_operation("[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive2\",\"notes\":\"I hate first comments!\"}]") custom_json_operation("[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive3\",\"notes\":\"I hate first comments!\"}]") @@ -247,7 +247,7 @@ custom_json_operation("[\"mutePost\",{\"community\":\"hive-198723\",\"account\": custom_json_operation("gtg" -> "[\"unsubscribe\",{\"community\":\"hive-103459\"}]") custom_json_operation("good-karma" -> "[\"unsubscribe\",{\"community\":\"hive-103459\"}]") delete_comment_operation(`blocktrades`, `elephant01`) -***block 5000012*** +***block 4998014*** custom_json_operation("[\"unmutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive1\",\"notes\":\"Unmute first comment\"}]") custom_json_operation("[\"unmutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive2\",\"notes\":\"Unmute first comment\"}]") custom_json_operation("[\"unmutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive3\",\"notes\":\"Unmute first comment\"}]") diff --git a/mock_data/block_data/community_op/mock_block_data_community.json b/mock_data/block_data/community_op/mock_block_data_community.json index 9365d3dfb0cc10cbf49130f6412dd7b9e1f57063..8c9ea5329d4839afd7ebd308f1bbd5be50540c58 100644 --- a/mock_data/block_data/community_op/mock_block_data_community.json +++ b/mock_data/block_data/community_op/mock_block_data_community.json @@ -1,11 +1,5 @@ { - "4999999": { - "previous": "004c4b3e03ea2eac2494790786bfb9e41a8669d9", - "timestamp": "2016-09-15T19:47:18", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", + "4998001": { "transactions": [ { "ref_block_num": 100000, @@ -670,18 +664,9 @@ "" ] } - ], - "block_id": "004c4b3fc6a8735b4ab5433d59f4526e4a042644", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000000": { - "previous": "004c4b3fc6a8735b4ab5433d59f4526e4a042644", - "timestamp": "2016-09-15T19:47:21", - "witness": "initminer", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", + "4998002": { "transactions": [ { "ref_block_num": 100001, @@ -963,18 +948,9 @@ } ] } - ], - "block_id": "004c4b40245ffb07380a393fb2b3d841b76cdaec", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000001": { - "previous": "004c4b40245ffb07380a393fb2b3d841b76cdaec", - "timestamp": "2016-09-15T19:47:24", - "witness": "initminer", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", + "4998003": { "transactions": [ { "ref_block_num": 100001, @@ -1228,18 +1204,9 @@ } ] } - ], - "block_id": "004c4b4100000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000002": { - "previous": "004c4b4100000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:27", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998004": { "transactions": [ { "ref_block_num": 100001, @@ -1259,7 +1226,7 @@ } }, { - "type": "comment_operation", + "type": "comment_operation", "value": { "parent_author": "test-safari", "parent_permlink": "parent-post-for-muted-steemit", @@ -1520,18 +1487,9 @@ } ] } - ], - "block_id": "004c4b4200000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000003": { - "previous": "004c4b4200000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:30", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998005": { "transactions": [ { "ref_block_num": 100001, @@ -1645,7 +1603,7 @@ "test-safari" ], "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"My-second-post-hive-3\",\"notes\":\"second muted post-03\"}]" + "json": "[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"My-second-post-hive3\",\"notes\":\"second muted post-03\"}]" } }, { @@ -1656,7 +1614,7 @@ "test-safari" ], "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"My-second-post-hive-2\",\"notes\":\"second muted post-02\"}]" + "json": "[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"My-second-post-hive2\",\"notes\":\"second muted post-02\"}]" } }, { @@ -1667,7 +1625,7 @@ "test-safari" ], "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"My-second-post-hive-1\",\"notes\":\"second muted post-01\"}]" + "json": "[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"My-second-post-hive1\",\"notes\":\"second muted post-01\"}]" } }, { @@ -1716,18 +1674,9 @@ } ] } - ], - "block_id": "004c4b4300000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000004": { - "previous": "004c4b4300000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:33", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998006": { "transactions": [ { "ref_block_num": 100001, @@ -1824,18 +1773,9 @@ } ] } - ], - "block_id": "004c4b4400000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000005": { - "previous": "004c4b4400000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:36", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998007": { "transactions": [ { "ref_block_num": 100001, @@ -2114,18 +2054,9 @@ } ] } - ], - "block_id": "004c4b4500000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000006": { - "previous": "004c4b4500000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:39", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998008": { "transactions": [ { "ref_block_num": 100001, @@ -2854,18 +2785,9 @@ } ] } - ], - "block_id": "004c4b4600000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000007": { - "previous": "004c4b4600000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:42", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998009": { "transactions": [ { "ref_block_num": 100001, @@ -3074,18 +2996,9 @@ } ] } - ], - "block_id": "004c4b4700000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000008": { - "previous": "004c4b4700000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:45", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998010": { "transactions": [ { "ref_block_num": 100001, @@ -3239,18 +3152,9 @@ } ] } - ], - "block_id": "004c4b4800000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000009": { - "previous": "004c4b4800000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:48", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998011": { "transactions": [ { "ref_block_num": 100001, @@ -3417,27 +3321,9 @@ } ] } - ], - "block_id": "004c4b4900000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [ - { - "ref_block_num": 100001, - "ref_block_prefix": 1, - "expiration": "2020-03-23T12:17:00", - "operations": [ - ] - } - ] }, - "5000010": { - "previous": "004c4b4900000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:51", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998012": { "transactions": [ { "ref_block_num": 100001, @@ -3720,18 +3606,9 @@ } ] } - ], - "block_id": "004c4b4a00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000011": { - "previous": "004c4b4a00000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:54", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998013": { "transactions": [ { "ref_block_num": 100001, @@ -3739,182 +3616,173 @@ "expiration": "2020-03-23T12:17:00", "operations": [ { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "test-safari" - ], - "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive1\",\"notes\":\"I hate first comments hive1-!\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "test-safari" - ], - "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive2\",\"notes\":\"I hate first comments hive2-!\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "test-safari" - ], - "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive3\",\"notes\":\"I hate first comments hive3-!\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "test-safari" - ], - "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive1-02\",\"notes\":\"I hate second comments too hive1-!\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "test-safari" - ], - "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive2-02\",\"notes\":\"I hate second comments too hive2-!\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "test-safari" - ], - "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive3-02\",\"notes\":\"I hate second comments too hive3-!\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "test-safari" - ], - "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"First-after-member-post-hive1\",\"notes\":\"hive1 I hate first posts!\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "test-safari" - ], - "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"First-after-member-post-hive2\",\"notes\":\"hive2 I hate first posts!\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "test-safari" - ], - "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"First-after-member-post-hive3\",\"notes\":\"hive3 I hate first posts!\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "test-safari" - ], - "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"Second-after-member-post-hive1\",\"notes\":\"hive1 I hate second posts too!\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "test-safari" - ], - "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"Second-after-member-post-hive2\",\"notes\":\"hive2 I hate second posts too!\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "test-safari" - ], - "id": "community", - "json": "[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"Second-after-member-post-hive3\",\"notes\":\"hive3 I hate second posts too!\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "gtg" - ], - "id": "community", - "json": "[\"unsubscribe\",{\"community\":\"hive-103459\"}]" - } - }, - { - "type": "custom_json_operation", - "value": { - "required_auths": [], - "required_posting_auths": [ - "good-karma" - ], - "id": "community", - "json": "[\"unsubscribe\",{\"community\":\"hive-103459\"}]" - } - }, - { - "type": "delete_comment_operation", - "value": { - "author": "blocktrades", - "permlink": "elephant01" - } + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "test-safari" + ], + "id": "community", + "json": "[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive1\",\"notes\":\"I hate first comments hive1-!\"}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "test-safari" + ], + "id": "community", + "json": "[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive2\",\"notes\":\"I hate first comments hive2-!\"}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "test-safari" + ], + "id": "community", + "json": "[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive3\",\"notes\":\"I hate first comments hive3-!\"}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "test-safari" + ], + "id": "community", + "json": "[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive1-02\",\"notes\":\"I hate second comments too hive1-!\"}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "test-safari" + ], + "id": "community", + "json": "[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive2-02\",\"notes\":\"I hate second comments too hive2-!\"}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "test-safari" + ], + "id": "community", + "json": "[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"after-member-comment-to-please-comment-hive3-02\",\"notes\":\"I hate second comments too hive3-!\"}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "test-safari" + ], + "id": "community", + "json": "[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"First-after-member-post-hive1\",\"notes\":\"hive1 I hate first posts!\"}]" } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "test-safari" + ], + "id": "community", + "json": "[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"First-after-member-post-hive2\",\"notes\":\"hive2 I hate first posts!\"}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "test-safari" + ], + "id": "community", + "json": "[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"First-after-member-post-hive3\",\"notes\":\"hive3 I hate first posts!\"}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "test-safari" + ], + "id": "community", + "json": "[\"mutePost\",{\"community\":\"hive-171487\",\"account\":\"alice\",\"permlink\":\"Second-after-member-post-hive1\",\"notes\":\"hive1 I hate second posts too!\"}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "test-safari" + ], + "id": "community", + "json": "[\"mutePost\",{\"community\":\"hive-157439\",\"account\":\"alice\",\"permlink\":\"Second-after-member-post-hive2\",\"notes\":\"hive2 I hate second posts too!\"}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "test-safari" + ], + "id": "community", + "json": "[\"mutePost\",{\"community\":\"hive-198723\",\"account\":\"alice\",\"permlink\":\"Second-after-member-post-hive3\",\"notes\":\"hive3 I hate second posts too!\"}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "gtg" + ], + "id": "community", + "json": "[\"unsubscribe\",{\"community\":\"hive-103459\"}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "good-karma" + ], + "id": "community", + "json": "[\"unsubscribe\",{\"community\":\"hive-103459\"}]" + } + }, + { + "type": "delete_comment_operation", + "value": { + "author": "blocktrades", + "permlink": "elephant01" + } + } ] } - ], - "block_id": "004c4b4b00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000012": { - "previous": "004c4b4b00000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:57", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998014": { "transactions": [ - { + { "ref_block_num": 100001, "ref_block_prefix": 1, "expiration": "2020-03-23T12:17:00", @@ -4023,69 +3891,6 @@ } ] } - ], - "block_id": "004c4b4c00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] - }, - "5000013": { - "previous": "004c4b4c00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:00", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", - "transactions": [], - "block_id": "004c4b4d00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] - }, - "5000014": { - "previous": "004c4b4d00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:03", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", - "transactions": [], - "block_id": "004c4b4e00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] - }, - "5000015": { - "previous": "004c4b4e00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:06", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", - "transactions": [], - "block_id": "004c4b4f00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] - }, - "5000016": { - "previous": "004c4b4f00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:09", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", - "transactions": [], - "block_id": "004c4b5000000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] - }, - "5000017": { - "previous": "004c4b5000000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:12", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", - "transactions": [], - "block_id": "004c4b5100000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] } } diff --git a/mock_data/block_data/follow_op/mock_block_data_follow.json b/mock_data/block_data/follow_op/mock_block_data_follow.json index 0fc88dc221c3f5d227a37048b61b2febd0b37d4c..fa37de4bb4fe60680aa89a1669c4bba1faaca70a 100644 --- a/mock_data/block_data/follow_op/mock_block_data_follow.json +++ b/mock_data/block_data/follow_op/mock_block_data_follow.json @@ -1,11 +1,5 @@ { - "4999999": { - "previous": "004c4b3e03ea2eac2494790786bfb9e41a8669d9", - "timestamp": "2016-09-15T19:47:18", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", + "4998001": { "transactions": [ { "ref_block_num": 100000, @@ -412,7 +406,7 @@ "extensions": [] } }, - { + { "type": "create_claimed_account_operation", "value": { "creator": "esteemapp", @@ -578,18 +572,9 @@ "" ] } - ], - "block_id": "004c4b3fc6a8735b4ab5433d59f4526e4a042644", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000000": { - "previous": "004c4b3fc6a8735b4ab5433d59f4526e4a042644", - "timestamp": "2016-09-15T19:47:21", - "witness": "initminer", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", + "4998002": { "transactions": [ { "ref_block_num": 100001, @@ -818,18 +803,9 @@ } ] } - ], - "block_id": "004c4b40245ffb07380a393fb2b3d841b76cdaec", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000001": { - "previous": "004c4b40245ffb07380a393fb2b3d841b76cdaec", - "timestamp": "2016-09-15T19:47:24", - "witness": "initminer", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", + "4998003": { "transactions": [ { "ref_block_num": 100001, @@ -981,18 +957,9 @@ } ] } - ], - "block_id": "004c4b4100000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000002": { - "previous": "004c4b4100000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:27", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998004": { "transactions": [ { "ref_block_num": 100001, @@ -1089,18 +1056,9 @@ } ] } - ], - "block_id": "004c4b4200000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000003": { - "previous": "004c4b4200000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:30", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998005": { "transactions": [ { "ref_block_num": 100001, @@ -1120,18 +1078,9 @@ } ] } - ], - "block_id": "004c4b4300000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000004": { - "previous": "004c4b4300000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:33", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998006": { "transactions": [ { "ref_block_num": 100001, @@ -1173,18 +1122,9 @@ } ] } - ], - "block_id": "004c4b4400000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000005": { - "previous": "004c4b4400000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:36", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998007": { "transactions": [ { "ref_block_num": 100001, @@ -1204,18 +1144,9 @@ } ] } - ], - "block_id": "004c4b4500000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000006": { - "previous": "004c4b4500000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:39", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998008": { "transactions": [ { "ref_block_num": 100001, @@ -1235,18 +1166,9 @@ } ] } - ], - "block_id": "004c4b4600000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000007": { - "previous": "004c4b4600000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:42", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998009": { "transactions": [ { "ref_block_num": 100001, @@ -1266,18 +1188,9 @@ } ] } - ], - "block_id": "004c4b4700000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000008": { - "previous": "004c4b4700000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:45", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998010": { "transactions": [ { "ref_block_num": 100001, @@ -1297,18 +1210,9 @@ } ] } - ], - "block_id": "004c4b4800000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000009": { - "previous": "004c4b4800000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:48", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998011": { "transactions": [ { "ref_block_num": 100001, @@ -1328,18 +1232,9 @@ } ] } - ], - "block_id": "004c4b4900000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000010": { - "previous": "004c4b4900000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:51", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998012": { "transactions": [ { "ref_block_num": 100001, @@ -1359,18 +1254,9 @@ } ] } - ], - "block_id": "004c4b4a00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000011": { - "previous": "004c4b4a00000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:54", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998013": { "transactions": [ { "ref_block_num": 100001, @@ -1390,18 +1276,9 @@ } ] } - ], - "block_id": "004c4b4b00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000012": { - "previous": "004c4b4b00000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:57", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998014": { "transactions": [ { "ref_block_num": 100001, @@ -1421,18 +1298,9 @@ } ] } - ], - "block_id": "004c4b4c00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000013": { - "previous": "004c4b4c00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:00", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998015": { "transactions": [ { "ref_block_num": 100001, @@ -1452,18 +1320,9 @@ } ] } - ], - "block_id": "004c4b4d00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000014": { - "previous": "004c4b4d00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:03", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998016": { "transactions": [ { "ref_block_num": 100001, @@ -1571,18 +1430,9 @@ } ] } - ], - "block_id": "004c4b4e00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000015": { - "previous": "004c4b4e00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:06", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998017": { "transactions": [ { "ref_block_num": 100001, @@ -1613,9 +1463,6 @@ } ] } - ], - "block_id": "004c4b4f00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] } } \ No newline at end of file diff --git a/mock_data/block_data/follow_op/mock_block_data_follow_tests.json b/mock_data/block_data/follow_op/mock_block_data_follow_tests.json index 38f8c1eab82ce72b2a8c5650153ed4d92219de7e..599e955148cbefcce1b0a506db9d918ff6e5dda3 100644 --- a/mock_data/block_data/follow_op/mock_block_data_follow_tests.json +++ b/mock_data/block_data/follow_op/mock_block_data_follow_tests.json @@ -1,11 +1,5 @@ { "2000000": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -818,18 +812,9 @@ "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "2010000": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -1040,18 +1025,9 @@ "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "2020000": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -1226,21 +1202,12 @@ ], "extensions": [], "signatures": [ - "" + "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "2030000": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -1348,18 +1315,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "2040000": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -1735,18 +1693,9 @@ "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "2050000": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -1847,18 +1796,9 @@ "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "2050001": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -2256,18 +2196,9 @@ "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "2060000": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -2390,18 +2321,9 @@ "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "2070000": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -2810,18 +2732,9 @@ "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "2080000": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -3934,18 +3847,9 @@ "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "2090000": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -4013,18 +3917,9 @@ "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "2090001": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -4103,18 +3998,9 @@ "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "2090002": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -4182,18 +4068,9 @@ "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "5000010": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -4305,9 +4182,6 @@ "" ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] } } \ No newline at end of file diff --git a/mock_data/block_data/payments_op/mock_block_data_payments.json b/mock_data/block_data/payments_op/mock_block_data_payments.json index 5550c910486c6c6300b2e68dde1cd53961af881b..57bb3a3abe0bfcb66d4c4c4f6bc732079c9acced 100644 --- a/mock_data/block_data/payments_op/mock_block_data_payments.json +++ b/mock_data/block_data/payments_op/mock_block_data_payments.json @@ -1,11 +1,5 @@ { "4000001": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100000, @@ -23,18 +17,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4010001": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -71,18 +56,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4020001": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100003, @@ -121,9 +97,6 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] } } \ No newline at end of file diff --git a/mock_data/block_data/reblog_op/flow.txt b/mock_data/block_data/reblog_op/flow.txt index 9e6c0d69cc811521665e99546882c280c3f0f26f..9e4b348ad492f13efba257695eb5a3c112a7456b 100644 --- a/mock_data/block_data/reblog_op/flow.txt +++ b/mock_data/block_data/reblog_op/flow.txt @@ -1,4 +1,5 @@ -***block 4999999*** +***block 4998001*** +custom_json_operation("[\"reblog\",{\"account\":\"funny\",\"author\":\"steemit\",\"permlink\":\"fi\nrst'%@post\"}]") - bad permlink custom_json_operation("[\"reblog\",{\"account\":\"funny\",\"author\":\"steemit\",\"permlink\":\"firstpost\"}]") - very old post custom_json_operation("[\"reblog\",{\"account\":\"funny\",\"author\":\"steak\",\"permlink\":\"streak-test\"}]") - deleted post (should not be reblogged) custom_json_operation("[\"reblog\",{\"account\":\"funny\",\"author\":\"dollarvigilante\",\"permlink\":\"another-billionaire-warns-of-catastrophic-depths-not-seen-in-5-000-years-and-emphasizes-gold\"}]") - fresh post @@ -14,7 +15,7 @@ comment_operation( `test-reblog-03`, `parrot-03`) comment_operation( `test-reblog-04`, `parrot-04`) comment_operation( `test-reblog-05`, `parrot-05`) comment_operation( `test-reblog-06`, `parrot-06`) -***block 5000000*** +***block 4998002*** custom_json_operation("{\"account\":\"test-reblog-01\",\"author\":\"test-reblog-02\",\"permlink\":\"parrot-02\"}") custom_json_operation("{\"account\":\"test-reblog-01\",\"author\":\"test-reblog-03\",\"permlink\":\"parrot-03\"}") custom_json_operation("{\"account\":\"test-reblog-01\",\"author\":\"test-reblog-04\",\"permlink\":\"parrot-04\"}") @@ -22,31 +23,31 @@ custom_json_operation("{\"delete\":\"delete\",\"account\":\"test-reblog-01\",\"a custom_json_operation("{\"delete\":\"delete\",\"account\":\"test-reblog-01\",\"author\":\"test-reblog-03\",\"permlink\":\"parrot-03\"}") custom_json_operation("{\"delete\":\"delete\",\"account\":\"test-reblog-01\",\"author\":\"test-reblog-02\",\"permlink\":\"parrot-02\"}") -***block 5000001*** +***block 4998003*** custom_json_operation("{\"account\":\"test-reblog-02\",\"author\":\"test-reblog-01\",\"permlink\":\"parrot-01\"}") custom_json_operation("{\"account\":\"test-reblog-02\",\"author\":\"test-reblog-02\",\"permlink\":\"parrot-02\"}") custom_json_operation("{\"account\":\"test-reblog-02\",\"author\":\"test-reblog-03\",\"permlink\":\"parrot-03\"}") custom_json_operation("{\"account\":\"test-reblog-03\",\"author\":\"test-reblog-02\",\"permlink\":\"parrot-02\"}") custom_json_operation("{\"account\":\"test-reblog-03\",\"author\":\"test-reblog-03\",\"permlink\":\"parrot-03\"}") custom_json_operation("{\"account\":\"test-reblog-03\",\"author\":\"test-reblog-04\",\"permlink\":\"parrot-04\"}") -***block 5000002*** +***block 4998004*** custom_json_operation("{\"account\":\"test-reblog-04\",\"author\":\"test-reblog-04\",\"permlink\":\"parrot-04\"}") custom_json_operation("{\"account\":\"test-reblog-05\",\"author\":\"test-reblog-05\",\"permlink\":\"parrot-05\"}") custom_json_operation("{\"account\":\"test-reblog-06\",\"author\":\"test-reblog-06\",\"permlink\":\"parrot-06\"}") custom_json_operation("{\"account\":\"test-reblog-06\",\"author\":\"test-reblog-05\",\"permlink\":\"parrot-05\"}") custom_json_operation("{\"delete\":\"delete\",\"account\":\"test-reblog-04\",\"author\":\"test-reblog-04\",\"permlink\":\"parrot-04\"}") custom_json_operation("{\"delete\":\"delete\",\"account\":\"test-reblog-06\",\"author\":\"test-reblog-06\",\"permlink\":\"parrot-06\"}") -***block 5000003*** +***block 4998005*** custom_json_operation("{\"delete\":\"delete\",\"account\":\"test-reblog-05\",\"author\":\"test-reblog-05\",\"permlink\":\"parrot-05\"}") custom_json_operation("{\"delete\":\"delete\",\"account\":\"test-reblog-06\",\"author\":\"test-reblog-05\",\"permlink\":\"parrot-05\"}") -***block 5000004*** +***block 4998006*** custom_json_operation("{\"account\":\"test-reblog-04\",\"author\":\"test-reblog-04\",\"permlink\":\"parrot-04\"}") custom_json_operation("{\"account\":\"test-reblog-05\",\"author\":\"test-reblog-05\",\"permlink\":\"parrot-05\"}") custom_json_operation("{\"account\":\"test-reblog-06\",\"author\":\"test-reblog-06\",\"permlink\":\"parrot-06\"}") custom_json_operation("{\"account\":\"test-reblog-06\",\"author\":\"test-reblog-05\",\"permlink\":\"parrot-05\"}") delete_comment_operation(`test-reblog-04`, `parrot-04`) delete_comment_operation(`test-reblog-05`, `parrot-05`) -***block 5000005*** +***block 4998007*** delete_comment_operation(`test-reblog-06`, `parrot-06`) comment_operation( `test-reblog-01`, `monkey-01`) comment_operation( `test-reblog-01`, `monkey-02`) @@ -55,11 +56,11 @@ comment_operation( `test-reblog-01`, `monkey-04`) comment_operation( `test-reblog-01`, `monkey-05`) custom_json_operation("{\"account\":\"test-reblog-01\",\"author\":\"test-reblog-01\",\"permlink\":\"monkey-01\"}") delete_comment_operation(`test-reblog-01`, `monkey-01`) -***block 5000006*** +***block 4998008*** custom_json_operation("{\"account\":\"test-reblog-01\",\"author\":\"test-reblog-01\",\"permlink\":\"monkey-02\"}") custom_json_operation("{\"account\":\"test-reblog-03\",\"author\":\"test-reblog-01\",\"permlink\":\"monkey-02\"}") custom_json_operation("{\"account\":\"test-reblog-04\",\"author\":\"test-reblog-01\",\"permlink\":\"monkey-02\"}") -***block 5000007*** +***block 4998009*** delete_comment_operation(`test-reblog-01`, `monkey-02`) custom_json_operation("{\"delete\":\"delete\",\"account\":\"test-reblog-03\",\"author\":\"test-reblog-04\",\"permlink\":\"parrot-04\"}") custom_json_operation("{\"account\":\"test-reblog-01\",\"author\":\"test-reblog-01\",\"permlink\":\"monkey-03\"}") @@ -69,12 +70,11 @@ custom_json_operation("{\"account\":\"test-reblog-04\",\"author\":\"test-reblog- custom_json_operation("{\"account\":\"test-reblog-05\",\"author\":\"test-reblog-01\",\"permlink\":\"monkey-03\"}") custom_json_operation("{\"account\":\"test-reblog-05\",\"author\":\"test-reblog-01\",\"permlink\":\"monkey-04\"}") custom_json_operation("{\"account\":\"test-reblog-05\",\"author\":\"test-reblog-01\",\"permlink\":\"monkey-05\"}") -***block 5000008*** +***block 4998010*** custom_json_operation("{\"delete\":\"delete\",\"account\":\"test-reblog-05\",\"author\":\"test-reblog-01\",\"permlink\":\"monkey-04\"}") custom_json_operation("{\"account\":\"test-reblog-05\",\"author\":\"test-reblog-01\",\"permlink\":\"monkey-04\"}") custom_json_operation("{\"delete\":\"delete\",\"account\":\"test-reblog-05\",\"author\":\"test-reblog-01\",\"permlink\":\"monkey-04\"}") custom_json_operation("{\"delete\":\"delete\",\"account\":\"test-reblog-05\",\"author\":\"test-reblog-01\",\"permlink\":\"monkey-04\"}") -***block 5000009*** +***block 4998011*** delete_comment_operation(`test-reblog-01`, `monkey-04`) -***block 5000010*** -***block 5000011*** +***block 4998012*** diff --git a/mock_data/block_data/reblog_op/mock_block_data_reblog.json b/mock_data/block_data/reblog_op/mock_block_data_reblog.json index 8cd641c02df4a9dd793677575d313a5847b6a129..e23114e724ac265fe4e81d6c00734463896884b1 100644 --- a/mock_data/block_data/reblog_op/mock_block_data_reblog.json +++ b/mock_data/block_data/reblog_op/mock_block_data_reblog.json @@ -1,11 +1,5 @@ { - "4999999": { - "previous": "004c4b3e03ea2eac2494790786bfb9e41a8669d9", - "timestamp": "2016-09-15T19:47:18", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", + "4998001": { "transactions": [ { "ref_block_num": 100000, @@ -494,18 +488,9 @@ "" ] } - ], - "block_id": "004c4b3fc6a8735b4ab5433d59f4526e4a042644", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000000": { - "previous": "004c4b3fc6a8735b4ab5433d59f4526e4a042644", - "timestamp": "2016-09-15T19:47:21", - "witness": "initminer", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", + "4998002": { "transactions": [ { "ref_block_num": 100001, @@ -580,18 +565,9 @@ } ] } - ], - "block_id": "004c4b40245ffb07380a393fb2b3d841b76cdaec", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000001": { - "previous": "004c4b40245ffb07380a393fb2b3d841b76cdaec", - "timestamp": "2016-09-15T19:47:24", - "witness": "initminer", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", + "4998003": { "transactions": [ { "ref_block_num": 100001, @@ -701,18 +677,9 @@ } ] } - ], - "block_id": "004c4b4100000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000002": { - "previous": "004c4b4100000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:27", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998004": { "transactions": [ { "ref_block_num": 100001, @@ -787,18 +754,9 @@ } ] } - ], - "block_id": "004c4b4200000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000003": { - "previous": "004c4b4200000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:30", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998005": { "transactions": [ { "ref_block_num": 100001, @@ -829,18 +787,9 @@ } ] } - ], - "block_id": "004c4b4300000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000004": { - "previous": "004c4b4300000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:33", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998006": { "transactions": [ { "ref_block_num": 100001, @@ -907,18 +856,9 @@ } ] } - ], - "block_id": "004c4b4400000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000005": { - "previous": "004c4b4400000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:36", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998007": { "transactions": [ { "ref_block_num": 100001, @@ -1036,18 +976,9 @@ } ] } - ], - "block_id": "004c4b4500000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000006": { - "previous": "004c4b4500000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:39", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998008": { "transactions": [ { "ref_block_num": 100001, @@ -1089,18 +1020,9 @@ } ] } - ], - "block_id": "004c4b4600000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000007": { - "previous": "004c4b4600000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:42", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998009": { "transactions": [ { "ref_block_num": 100001, @@ -1204,18 +1126,9 @@ } ] } - ], - "block_id": "004c4b4700000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000008": { - "previous": "004c4b4700000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:45", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998010": { "transactions": [ { "ref_block_num": 100001, @@ -1279,18 +1192,9 @@ } ] } - ], - "block_id": "004c4b4800000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, - "5000009": { - "previous": "004c4b4800000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:48", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998011": { "transactions": [ { "ref_block_num": 100001, @@ -1306,27 +1210,9 @@ } ] } - ], - "block_id": "004c4b4900000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [ - { - "ref_block_num": 100001, - "ref_block_prefix": 1, - "expiration": "2020-03-23T12:17:00", - "operations": [ - ] - } - ] }, - "5000010": { - "previous": "004c4b4900000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:51", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", + "4998012": { "transactions": [ { "ref_block_num": 100001, @@ -1335,101 +1221,6 @@ "operations": [ ] } - ], - "block_id": "004c4b4a00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] - }, - "5000011": { - "previous": "004c4b4a00000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:54", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", - "transactions": [ - { - "ref_block_num": 100001, - "ref_block_prefix": 1, - "expiration": "2020-03-23T12:17:00", - "operations": [ - ] - } - ], - "block_id": "004c4b4b00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] - }, - "5000012": { - "previous": "004c4b4b00000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:57", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", - "transactions": [], - "block_id": "004c4b4c00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] - }, - "5000013": { - "previous": "004c4b4c00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:00", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", - "transactions": [], - "block_id": "004c4b4d00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] - }, - "5000014": { - "previous": "004c4b4d00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:03", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", - "transactions": [], - "block_id": "004c4b4e00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] - }, - "5000015": { - "previous": "004c4b4e00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:06", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", - "transactions": [], - "block_id": "004c4b4f00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] - }, - "5000016": { - "previous": "004c4b4f00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:09", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", - "transactions": [], - "block_id": "004c4b5000000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] - }, - "5000017": { - "previous": "004c4b5000000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:12", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", - "transactions": [], - "block_id": "004c4b5100000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] } } diff --git a/mock_data/block_data/reblog_op/mock_block_data_reblog_delete.json b/mock_data/block_data/reblog_op/mock_block_data_reblog_delete.json index 8ebb35928ad114fbdcc30f6c7c28728fb3194e13..5651c9a253c3c7a12ee9dad8de3a1a57154f5fe3 100644 --- a/mock_data/block_data/reblog_op/mock_block_data_reblog_delete.json +++ b/mock_data/block_data/reblog_op/mock_block_data_reblog_delete.json @@ -1,11 +1,5 @@ { "4990000": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -502,18 +496,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4990100": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -561,18 +546,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4990200": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -592,18 +568,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4991000": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -634,18 +601,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4992100": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -665,18 +623,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4992200": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -696,18 +645,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4992300": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -727,18 +667,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4993100": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -758,18 +689,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4994200": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "2078ea5ce6181f4c6ff1fba879e17261b39ded2a4c628eeba6797c1a6c5e3d78114b8f427a44f9d28da31eb48a6f8f7a8eb8a228bb48e542de0c0e3f40eba0dea3", "transactions": [ { "ref_block_num": 100001, @@ -789,18 +711,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4995100": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -820,18 +733,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4996100": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -884,18 +788,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4997100": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "205e8584f2bc1ab070c6c29834bb365c228fd4d86e5bb232c08d555491a247c491270c52043e4e4270ec968b6731fb7a9b910699fccca323f7901235e2838b1180", "transactions": [ { "ref_block_num": 100001, @@ -929,18 +824,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "4997200": { - "previous": "", - "timestamp": "", - "witness": "", - "transaction_merkle_root": "", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -993,18 +879,9 @@ } ] } - ], - "block_id": "", - "signing_key": "", - "transaction_ids": [] + ] }, "5000011": { - "previous": "004c4b4a00000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:54", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1035,18 +912,9 @@ } ] } - ], - "block_id": "004c4b4b00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000012": { - "previous": "004c4b4b00000000000000000000000000000000", - "timestamp": "2016-09-15T19:47:57", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1088,18 +956,9 @@ } ] } - ], - "block_id": "004c4b4c00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000013": { - "previous": "004c4b4c00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:00", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1119,18 +978,9 @@ } ] } - ], - "block_id": "004c4b4d00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000014": { - "previous": "004c4b4d00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:03", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1150,18 +1000,9 @@ } ] } - ], - "block_id": "004c4b4e00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000015": { - "previous": "004c4b4e00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:06", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1181,18 +1022,9 @@ } ] } - ], - "block_id": "004c4b4f00000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000016": { - "previous": "004c4b4f00000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:09", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1223,18 +1055,9 @@ } ] } - ], - "block_id": "004c4b5000000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000017": { - "previous": "004c4b5000000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:12", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1265,18 +1088,9 @@ } ] } - ], - "block_id": "004c4b5100000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000018": { - "previous": "004c4b5100000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:15", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1307,18 +1121,9 @@ } ] } - ], - "block_id": "004c4b5200000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000019": { - "previous": "004c4b5200000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:18", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1338,18 +1143,9 @@ } ] } - ], - "block_id": "004c4b5300000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000020": { - "previous": "004c4b5300000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:21", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1380,18 +1176,9 @@ } ] } - ], - "block_id": "004c4b5400000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000021": { - "previous": "004c4b5400000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:24", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1447,18 +1234,9 @@ } ] } - ], - "block_id": "004c4b5500000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000022": { - "previous": "004c4b5500000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:27", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1481,18 +1259,9 @@ } ] } - ], - "block_id": "004c4b5600000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000023": { - "previous": "004c4b5600000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:30", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1534,18 +1303,9 @@ } ] } - ], - "block_id": "004c4b5700000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] }, "5000024": { - "previous": "004c4b5700000000000000000000000000000000", - "timestamp": "2016-09-15T19:48:33", - "witness": "initminer", - "transaction_merkle_root": "0000000000000000000000000000000000000000", - "extensions": [], - "witness_signature": "", "transactions": [ { "ref_block_num": 100001, @@ -1587,9 +1347,6 @@ } ] } - ], - "block_id": "004c4b5800000000000000000000000000000000", - "signing_key": "", - "transaction_ids": [] + ] } } \ No newline at end of file diff --git a/scripts/ci/hive-sync.sh b/scripts/ci/hive-sync.sh index 8ea3c5045f9243771f18b69512c68c9524d52584..d657a18e47ed5160dc63d08a7a547290f9d7f151 100755 --- a/scripts/ci/hive-sync.sh +++ b/scripts/ci/hive-sync.sh @@ -33,7 +33,7 @@ EOF mock_data/block_data/reblog_op/mock_block_data_reblog.json \ mock_data/block_data/reblog_op/mock_block_data_reblog_delete.json \ mock_data/block_data/payments_op/mock_block_data_payments.json \ - --community-start-block 4999998 \ + --community-start-block 4998000 \ 2>&1 | tee -i hivemind-sync.log } diff --git a/scripts/ci_sync.sh b/scripts/ci_sync.sh index 0950cdd666794d4eef103d03b833c0c5c319d77d..d7353bb46f2871548bd6c6480f57ebe07e2971f0 100755 --- a/scripts/ci_sync.sh +++ b/scripts/ci_sync.sh @@ -60,5 +60,5 @@ echo Attempting to starting hive sync using hived node: $HIVEMIND_SOURCE_HIVED_U echo Attempting to access database $DB_URL ./$HIVE_NAME sync --pid-file hive_sync.pid --test-max-block=$HIVEMIND_MAX_BLOCK --test-profile=False --steemd-url "$HIVEMIND_SOURCE_HIVED_URL" --prometheus-port 11011 \ --database-url $DB_URL --mock-block-data-path mock_data/block_data/follow_op/mock_block_data_follow.json mock_data/block_data/community_op/mock_block_data_community.json mock_data/block_data/reblog_op/mock_block_data_reblog.json \ - --community-start-block 4999998 2>&1 | tee -i hivemind-sync.log + --community-start-block 4998000 2>&1 | tee -i hivemind-sync.log rm hive_sync.pid diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 6ee61ca0cf0317223f44828c9840ddc764a828b0..5d8e99160507e86708dfd9ff5adfcc8cb5e1f916 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -65,7 +65,7 @@ export HIVEMIND_ADDRESS=$1 export HIVEMIND_PORT=$2 if [ -z "$TAVERN_DIR" ] then - export TAVERN_DIR="tests/tests_api/hivemind/tavern" + export TAVERN_DIR="$(realpath ./tests/tests_api/hivemind/tavern)" fi echo "Attempting to start tests on hivemind instance listening on: $HIVEMIND_ADDRESS port: $HIVEMIND_PORT" diff --git a/tests/tests_api b/tests/tests_api index 19cdd81696c9a48229208d40afa357f2e46d84ff..e9ad23a0ab238bca9f8ec75bbc24d597a6b58011 160000 --- a/tests/tests_api +++ b/tests/tests_api @@ -1 +1 @@ -Subproject commit 19cdd81696c9a48229208d40afa357f2e46d84ff +Subproject commit e9ad23a0ab238bca9f8ec75bbc24d597a6b58011