diff --git a/hive/db/schema.py b/hive/db/schema.py index 5bdbb816f69a9f42173e144cf02f131e18bef4ba..a5a09dddeaeb56b3e1d0b191487af3d21317dae6 100644 --- a/hive/db/schema.py +++ b/hive/db/schema.py @@ -570,6 +570,7 @@ def setup(db): "payout_stats_view.sql", "update_hive_posts_mentions.sql", "find_tag_id.sql", + "mutes.sql", "bridge_get_ranked_post_type.sql", "bridge_get_ranked_post_for_communities.sql", "bridge_get_ranked_post_for_observer_communities.sql", diff --git a/hive/db/sql_scripts/bridge_get_by_feed_with_reblog.sql b/hive/db/sql_scripts/bridge_get_by_feed_with_reblog.sql index b2a35a7917879770fe94ea4901640c187928229d..1448a9350cc6e4fbe18c1d0d95cbb7fe493875ed 100644 --- a/hive/db/sql_scripts/bridge_get_by_feed_with_reblog.sql +++ b/hive/db/sql_scripts/bridge_get_by_feed_with_reblog.sql @@ -60,6 +60,7 @@ BEGIN hp.role_id, hp.is_pinned, hp.curator_payout_value, + hp.is_muted, T.reblogged_by FROM hive_posts_view hp JOIN diff --git a/hive/db/sql_scripts/bridge_get_discussion.sql b/hive/db/sql_scripts/bridge_get_discussion.sql index 1870082d7d45bee92711fca7e694fd7e91aebc77..b3f1304f3f12b91bd2df65d6070dcd737470688b 100644 --- a/hive/db/sql_scripts/bridge_get_discussion.sql +++ b/hive/db/sql_scripts/bridge_get_discussion.sql @@ -5,20 +5,7 @@ CREATE OR REPLACE FUNCTION get_discussion( in _permlink hive_permlink_data.permlink%TYPE, in _observer VARCHAR ) -RETURNS TABLE -( - id hive_posts.id%TYPE, parent_id hive_posts.parent_id%TYPE, author hive_accounts.name%TYPE, permlink hive_permlink_data.permlink%TYPE, - title hive_post_data.title%TYPE, body hive_post_data.body%TYPE, category hive_category_data.category%TYPE, depth hive_posts.depth%TYPE, - promoted hive_posts.promoted%TYPE, payout hive_posts.payout%TYPE, pending_payout hive_posts.pending_payout%TYPE, payout_at hive_posts.payout_at%TYPE, - is_paidout hive_posts.is_paidout%TYPE, children hive_posts.children%TYPE, created_at hive_posts.created_at%TYPE, updated_at hive_posts.updated_at%TYPE, - rshares hive_posts_view.rshares%TYPE, abs_rshares hive_posts_view.abs_rshares%TYPE, json hive_post_data.json%TYPE, author_rep hive_accounts.reputation%TYPE, - is_hidden hive_posts.is_hidden%TYPE, is_grayed BOOLEAN, total_votes BIGINT, sc_trend hive_posts.sc_trend%TYPE, - acct_author_id hive_posts.author_id%TYPE, root_author hive_accounts.name%TYPE, root_permlink hive_permlink_data.permlink%TYPE, - parent_author hive_accounts.name%TYPE, parent_permlink_or_category hive_permlink_data.permlink%TYPE, allow_replies BOOLEAN, - allow_votes hive_posts.allow_votes%TYPE, allow_curation_rewards hive_posts.allow_curation_rewards%TYPE, url TEXT, root_title hive_post_data.title%TYPE, - beneficiaries hive_posts.beneficiaries%TYPE, max_accepted_payout hive_posts.max_accepted_payout%TYPE, percent_hbd hive_posts.percent_hbd%TYPE, - curator_payout_value hive_posts.curator_payout_value%TYPE -) +RETURNS SETOF bridge_api_post_discussion LANGUAGE plpgsql AS $function$ @@ -29,9 +16,16 @@ BEGIN RETURN QUERY SELECT hpv.id, - hpv.parent_id, hpv.author, + hpv.parent_author, + hpv.author_rep, + hpv.root_title, + hpv.beneficiaries, + hpv.max_accepted_payout, + hpv.percent_hbd, + hpv.url, hpv.permlink, + hpv.parent_permlink_or_category, hpv.title, hpv.body, hpv.category, @@ -42,30 +36,23 @@ BEGIN hpv.payout_at, hpv.is_paidout, hpv.children, + hpv.votes, hpv.created_at, hpv.updated_at, hpv.rshares, hpv.abs_rshares, hpv.json, - hpv.author_rep, hpv.is_hidden, hpv.is_grayed, hpv.total_votes, hpv.sc_trend, - hpv.author_id AS acct_author_id, - hpv.root_author, - hpv.root_permlink, - hpv.parent_author, - hpv.parent_permlink_or_category, - hpv.allow_replies, - hpv.allow_votes, - hpv.allow_curation_rewards, - hpv.url, - hpv.root_title, - hpv.beneficiaries, - hpv.max_accepted_payout, - hpv.percent_hbd, - hpv.curator_payout_value + hpv.role_title, + hpv.community_title, + hpv.role_id, + hpv.is_pinned, + hpv.curator_payout_value, + hpv.is_muted, + hpv.parent_id FROM ( WITH RECURSIVE child_posts (id, parent_id) AS diff --git a/hive/db/sql_scripts/bridge_get_ranked_post_for_observer_communities.sql b/hive/db/sql_scripts/bridge_get_ranked_post_for_observer_communities.sql index 520921d2ca898d0bdaca2ced43d313c46222982a..1fc78b56bbc88db6c38aff2a2e04a3f2d76130ce 100644 --- a/hive/db/sql_scripts/bridge_get_ranked_post_for_observer_communities.sql +++ b/hive/db/sql_scripts/bridge_get_ranked_post_for_observer_communities.sql @@ -74,7 +74,7 @@ BEGIN SELECT hp.sc_hot INTO __hot_limit FROM hive_posts hp WHERE hp.id = __post_id; END IF; __account_id = find_account_id( _observer, True ); - RETURN QUERY SELECT + RETURN QUERY SELECT hp.id, hp.author, hp.parent_author, diff --git a/hive/db/sql_scripts/bridge_get_ranked_post_type.sql b/hive/db/sql_scripts/bridge_get_ranked_post_type.sql index af5aab7184af7bd940625ac389284f8b2ccf0c97..7436418b5a1b763990c7f1bb14ce184e5dcb63d2 100644 --- a/hive/db/sql_scripts/bridge_get_ranked_post_type.sql +++ b/hive/db/sql_scripts/bridge_get_ranked_post_type.sql @@ -40,6 +40,7 @@ CREATE TYPE bridge_api_post AS ( ); DROP TYPE IF EXISTS bridge_api_post_reblogs CASCADE; +-- extension of bridge_api_post (same fields/types/order plus extras at the end) CREATE TYPE bridge_api_post_reblogs AS ( id INTEGER, author VARCHAR, @@ -77,5 +78,49 @@ CREATE TYPE bridge_api_post_reblogs AS ( role_id SMALLINT, is_pinned BOOLEAN, curator_payout_value VARCHAR, + is_muted BOOLEAN, reblogged_by VARCHAR[] ); + +DROP TYPE IF EXISTS bridge_api_post_discussion CASCADE; +-- extension of bridge_api_post (same fields/types/order plus extras at the end) +CREATE TYPE bridge_api_post_discussion AS ( + id INTEGER, + author VARCHAR, + parent_author VARCHAR, + author_rep BIGINT, + root_title VARCHAR, + beneficiaries JSON, + max_accepted_payout VARCHAR, + percent_hbd INTEGER, + url TEXT, + permlink VARCHAR, + parent_permlink_or_category VARCHAR, + title VARCHAR, + body TEXT, + category VARCHAR, + depth SMALLINT, + promoted DECIMAL(10,3), + payout DECIMAL(10,3), + pending_payout DECIMAL(10,3), + payout_at TIMESTAMP, + is_paidout BOOLEAN, + children INTEGER, + votes INTEGER, + created_at TIMESTAMP, + updated_at TIMESTAMP, + rshares NUMERIC, + abs_rshares NUMERIC, + json TEXT, + is_hidden BOOLEAN, + is_grayed BOOLEAN, + total_votes BIGINT, + sc_trend FLOAT4, + role_title VARCHAR, + community_title VARCHAR, + role_id SMALLINT, + is_pinned BOOLEAN, + curator_payout_value VARCHAR, + is_muted BOOLEAN, + parent_id INTEGER +); \ No newline at end of file diff --git a/hive/db/sql_scripts/db_upgrade.sh b/hive/db/sql_scripts/db_upgrade.sh index 12abddccc436c6ffb9b3c2ff0070b082d9fedd13..67aadeb0e08d3a6bf3df81f4cdd00ba8809298e5 100755 --- a/hive/db/sql_scripts/db_upgrade.sh +++ b/hive/db/sql_scripts/db_upgrade.sh @@ -21,6 +21,7 @@ for sql in postgres_handle_view_changes.sql \ payout_stats_view.sql \ update_hive_posts_mentions.sql \ find_tag_id.sql \ + mutes.sql \ bridge_get_ranked_post_type.sql \ bridge_get_ranked_post_for_communities.sql \ bridge_get_ranked_post_for_observer_communities.sql \ diff --git a/hive/db/sql_scripts/mutes.sql b/hive/db/sql_scripts/mutes.sql new file mode 100644 index 0000000000000000000000000000000000000000..ae6a2149f89e7cb5b49a049e5d18d30ffa2b1df5 --- /dev/null +++ b/hive/db/sql_scripts/mutes.sql @@ -0,0 +1,51 @@ +DROP FUNCTION IF EXISTS mutes_get_blacklists_for_observer; +CREATE FUNCTION mutes_get_blacklists_for_observer( in _observer VARCHAR ) +RETURNS TABLE( + account hive_accounts.name%TYPE, + source VARCHAR +) +AS +$function$ +DECLARE + __observer_id INT; +BEGIN + __observer_id = find_account_id( _observer, True ); + RETURN QUERY SELECT -- mutes_get_blacklists_for_observer (local observer blacklist) + ha.name AS account, + _observer AS source + FROM + hive_follows hf + JOIN hive_accounts ha ON ha.id = hf.following + WHERE + hf.follower = __observer_id AND hf.blacklisted; + RETURN QUERY SELECT -- mutes_get_blacklists_for_observer (indirect observer blacklists) + ha_i.name AS account, + ha.name AS source + FROM + hive_follows hf + JOIN hive_follows hf_i ON hf_i.follower = hf.following + JOIN hive_accounts ha_i ON ha_i.id = hf_i.following + JOIN hive_accounts ha ON ha.id = hf.following + WHERE + hf.follower = __observer_id AND hf.follow_blacklists AND hf_i.blacklisted; + RETURN QUERY SELECT-- mutes_get_blacklists_for_observer (local observer mute list) + ha.name AS account, + CONCAT( _observer, ' (mute list)' )::VARCHAR AS source + FROM + hive_follows hf + JOIN hive_accounts ha ON ha.id = hf.following + WHERE + hf.follower = __observer_id AND hf.state = 2; + RETURN QUERY SELECT-- mutes_get_blacklists_for_observer (indirect observer mute list) + ha_i.name AS account, + CONCAT( ha.name, ' (mute list)' )::VARCHAR AS source + FROM + hive_follows hf + JOIN hive_follows hf_i ON hf_i.follower = hf.following + JOIN hive_accounts ha_i ON ha_i.id = hf_i.following + JOIN hive_accounts ha ON ha.id = hf.following + WHERE + hf.follower = __observer_id AND hf.follow_muted AND hf_i.state = 2; +END +$function$ +language plpgsql STABLE; diff --git a/hive/server/bridge_api/methods.py b/hive/server/bridge_api/methods.py index 39c2c0ec40c0cc8d448935cfa0cf3601da8e7b7b..613e863c8ba79e0e1fcea4c4931e4af03b2fcf3f 100644 --- a/hive/server/bridge_api/methods.py +++ b/hive/server/bridge_api/methods.py @@ -56,7 +56,7 @@ async def get_post(context, author, permlink, observer=None): valid_permlink(permlink) blacklists_for_user = None - if observer and context: + if observer: blacklists_for_user = await Mutes.get_blacklists_for_observer(observer, context) sql = "SELECT * FROM bridge_get_post( (:author)::VARCHAR, (:permlink)::VARCHAR )" @@ -103,7 +103,7 @@ async def _get_ranked_posts_for_observer_communities( db, sort:str, start_author assert False, "Unknown sort order" @return_error_info -async def _get_ranked_posts_for_communities( db, sort:str, community, start_author:str, start_permlink:str, limit, observer:str=None): +async def _get_ranked_posts_for_communities( db, sort:str, community, start_author:str, start_permlink:str, limit, observer:str ): async def execute_community_query(db, sql, limit): return await db.query_all(sql, community=community, author=start_author, permlink=start_permlink, limit=limit, observer=observer ) @@ -151,72 +151,72 @@ async def _get_ranked_posts_for_communities( db, sort:str, community, start_auth @return_error_info -async def _get_ranked_posts_for_tag( db, sort:str, tag, start_author:str, start_permlink:str, limit, observer:str=None): - async def execute_tags_query(db, sql, limit): +async def _get_ranked_posts_for_tag( db, sort:str, tag, start_author:str, start_permlink:str, limit, observer:str ): + async def execute_tags_query(db, sql): return await db.query_all(sql, tag=tag, author=start_author, permlink=start_permlink, limit=limit, observer=observer ) if sort == 'hot': sql = "SELECT * FROM bridge_get_ranked_post_by_hot_for_tag( (:tag)::VARCHAR, (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, (:observer)::VARCHAR )" - return await execute_tags_query(db, sql, limit) + return await execute_tags_query(db, sql) if sort == 'promoted': sql = "SELECT * FROM bridge_get_ranked_post_by_promoted_for_tag( (:tag)::VARCHAR, (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, (:observer)::VARCHAR )" - return await execute_tags_query(db, sql, limit) + return await execute_tags_query(db, sql) if sort == 'payout': sql = "SELECT * FROM bridge_get_ranked_post_by_payout_for_category( (:tag)::VARCHAR, (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, True, (:observer)::VARCHAR )" - return await execute_tags_query(db, sql, limit) + return await execute_tags_query(db, sql) if sort == 'payout_comments': sql = "SELECT * FROM bridge_get_ranked_post_by_payout_comments_for_category( (:tag)::VARCHAR, (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, (:observer)::VARCHAR )" - return await execute_tags_query(db, sql, limit) + return await execute_tags_query(db, sql) if sort == 'muted': sql = "SELECT * FROM bridge_get_ranked_post_by_muted_for_tag( (:tag)::VARCHAR, (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, (:observer)::VARCHAR )" - return await execute_tags_query(db, sql, limit) + return await execute_tags_query(db, sql) if sort == 'trending': sql = "SELECT * FROM bridge_get_ranked_post_by_trends_for_tag( (:tag)::VARCHAR, (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, (:observer)::VARCHAR )" - return await execute_tags_query(db, sql, limit) + return await execute_tags_query(db, sql) if sort == 'created': sql = "SELECT * FROM bridge_get_ranked_post_by_created_for_tag( (:tag)::VARCHAR, (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, (:observer)::VARCHAR )" - return await execute_tags_query(db, sql, limit) + return await execute_tags_query(db, sql) assert False, "Unknown sort order" @return_error_info -async def _get_ranked_posts_for_all( db, sort:str, start_author:str, start_permlink:str, limit, observer:str=None): - async def execute_query(db, sql, limit, observer=None): +async def _get_ranked_posts_for_all( db, sort:str, start_author:str, start_permlink:str, limit, observer:str ): + async def execute_query(db, sql): return await db.query_all(sql, author=start_author, permlink=start_permlink, limit=limit, observer=observer ) if sort == 'trending': sql = "SELECT * FROM bridge_get_ranked_post_by_trends( (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, (:observer)::VARCHAR )" - return await execute_query(db, sql, limit) + return await execute_query(db, sql) if sort == 'created': sql = "SELECT * FROM bridge_get_ranked_post_by_created( (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, (:observer)::VARCHAR )" - return await execute_query(db, sql, limit, observer) + return await execute_query(db, sql) if sort == 'hot': sql = "SELECT * FROM bridge_get_ranked_post_by_hot( (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, (:observer)::VARCHAR )" - return await execute_query(db, sql, limit) + return await execute_query(db, sql) if sort == 'promoted': sql = "SELECT * FROM bridge_get_ranked_post_by_promoted( (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, (:observer)::VARCHAR )" - return await execute_query(db, sql, limit) + return await execute_query(db, sql) if sort == 'payout': sql = "SELECT * FROM bridge_get_ranked_post_by_payout( (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, True, (:observer)::VARCHAR )" - return await execute_query(db, sql, limit) + return await execute_query(db, sql) if sort == 'payout_comments': sql = "SELECT * FROM bridge_get_ranked_post_by_payout_comments( (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, (:observer)::VARCHAR )" - return await execute_query(db, sql, limit) + return await execute_query(db, sql) if sort == 'muted': sql = "SELECT * FROM bridge_get_ranked_post_by_muted( (:author)::VARCHAR, (:permlink)::VARCHAR, (:limit)::SMALLINT, (:observer)::VARCHAR )" - return await execute_query(db, sql, limit) + return await execute_query(db, sql) assert False, "Unknown sort order" @@ -316,7 +316,7 @@ async def get_account_posts(context, sort:str, account:str, start_author:str='', reblogged_by_list.sort() post['reblogged_by'] = reblogged_by_list - post = append_statistics_to_post(post, row, False if account_posts else row['is_pinned'], blacklists_for_user, not account_posts) + post = append_statistics_to_post(post, row, False if account_posts else row['is_pinned'], blacklists_for_user) posts.append(post) return posts diff --git a/hive/server/bridge_api/objects.py b/hive/server/bridge_api/objects.py index c34135a68b0d365c76ffb212e3bd7d62cc86981d..360b1d7946f37c3dc82435753c799181797f655e 100644 --- a/hive/server/bridge_api/objects.py +++ b/hive/server/bridge_api/objects.py @@ -15,7 +15,7 @@ log = logging.getLogger(__name__) # pylint: disable=too-many-lines -def append_statistics_to_post(post, row, is_pinned, blacklists_for_user=[], override_gray=False): +def append_statistics_to_post(post, row, is_pinned, blacklists_for_user=[]): """ apply information such as blacklists and community names/roles to a given post """ post['blacklists'] = [] @@ -23,7 +23,7 @@ def append_statistics_to_post(post, row, is_pinned, blacklists_for_user=[], over blacklists = blacklists_for_user[row['author']] for blacklist in blacklists: post['blacklists'].append(blacklist) - reputation = row['author_rep'] + reputation = post['author_reputation'] if reputation < 1: post['blacklists'].append('reputation-0') elif reputation == 1: @@ -39,9 +39,7 @@ def append_statistics_to_post(post, row, is_pinned, blacklists_for_user=[], over post['author_role'] = 'guest' post['author_title'] = '' - post['stats']['gray'] = row['is_grayed'] - if 'is_muted' in row and row['is_muted']: - post['stats']['gray'] = True + post['stats']['gray'] = row['is_grayed'] or row['is_muted'] if is_pinned: post['stats']['is_pinned'] = True return post diff --git a/hive/server/common/mutes.py b/hive/server/common/mutes.py index 019d09a81a1ae1f6173c1a87bf2867874aa3e785..2396b9914c6d7e53d08bb27311de02a18b14b77f 100644 --- a/hive/server/common/mutes.py +++ b/hive/server/common/mutes.py @@ -7,29 +7,6 @@ from hive.db.adapter import Db log = logging.getLogger(__name__) -GET_BLACKLISTED_ACCOUNTS_SQL = """ -WITH blacklisted_users AS ( - SELECT following, 'my_blacklist' AS source FROM hive_follows WHERE follower = - (SELECT id FROM hive_accounts WHERE name = :observer ) - AND blacklisted - UNION ALL - SELECT following, 'my_followed_blacklists' AS source FROM hive_follows WHERE follower IN - (SELECT following FROM hive_follows WHERE follower = - (SELECT id FROM hive_accounts WHERE name = :observer ) - AND follow_blacklists) AND blacklisted - UNION ALL - SELECT following, 'my_muted' AS source FROM hive_follows WHERE follower = - (SELECT id FROM hive_accounts WHERE name = :observer ) - AND state = 2 - UNION ALL - SELECT following, 'my_followed_mutes' AS source FROM hive_follows WHERE follower IN - (SELECT following FROM hive_follows WHERE follower = - (SELECT id FROM hive_accounts WHERE name = :observer ) - AND follow_muted) AND state = 2 -) -SELECT following, source FROM blacklisted_users -""" - def _read_url(url): req = Request(url, headers={'User-Agent': 'Mozilla/5.0'}) return urlopen(req).read() @@ -90,10 +67,10 @@ class Mutes: blacklisted_users = {} db = context['db'] - sql = GET_BLACKLISTED_ACCOUNTS_SQL + sql = "SELECT * FROM mutes_get_blacklists_for_observer( (:observer)::VARCHAR )" sql_result = await db.query_all(sql, observer=observer) for row in sql_result: - account_name = cls.all_accounts[row['following']] + account_name = row['account'] if account_name not in blacklisted_users: blacklisted_users[account_name] = [] blacklisted_users[account_name].append(row['source']) diff --git a/hive/server/condenser_api/methods.py b/hive/server/condenser_api/methods.py index 4b4410b87ab53ebe31e8aad4022a3384ce443f62..7e5a6f719e48c561bce3334566e7a7a775515240 100644 --- a/hive/server/condenser_api/methods.py +++ b/hive/server/condenser_api/methods.py @@ -170,8 +170,6 @@ def nested_query_compat(function): return function(*args, **kwargs) return wrapper -@return_error_info -@nested_query_compat async def get_posts_by_given_sort(context, sort: str, start_author: str = '', start_permlink: str = '', limit: int = 20, tag: str = None, truncate_body: int = 0, filter_tags: list = None, observer:str=None): 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 63d158b848c802573ad6b9e3cb5479e5209e2b84..29ecd18309c89cfba092121b4164e6327382c672 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 @@ -211,6 +211,206 @@ "json_metadata": "", "extensions": [] } + }, + { + "type": "create_claimed_account_operation", + "value": { + "creator": "esteemapp", + "new_account_name": "spaminator", + "owner": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "active": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "posting": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "memo_key": "", + "json_metadata": "", + "extensions": [] + } + }, + { + "type": "create_claimed_account_operation", + "value": { + "creator": "esteemapp", + "new_account_name": "hivewatchers", + "owner": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "active": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "posting": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "memo_key": "", + "json_metadata": "", + "extensions": [] + } + }, + { + "type": "create_claimed_account_operation", + "value": { + "creator": "esteemapp", + "new_account_name": "buildawhale", + "owner": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "active": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "posting": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "memo_key": "", + "json_metadata": "", + "extensions": [] + } + }, + { + "type": "create_claimed_account_operation", + "value": { + "creator": "esteemapp", + "new_account_name": "redeemer", + "owner": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "active": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "posting": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "memo_key": "", + "json_metadata": "", + "extensions": [] + } + }, + { + "type": "create_claimed_account_operation", + "value": { + "creator": "esteemapp", + "new_account_name": "ignoreall", + "owner": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "active": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "posting": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "", + 1 + ] + ] + }, + "memo_key": "", + "json_metadata": "", + "extensions": [] + } } ], "extensions": [], @@ -484,6 +684,72 @@ "id": "follow", "json": "[\"follow\",{\"follower\":\"tester1\",\"following\":\"tester2\",\"what\":[\"ignore\"]}]" } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "spaminator" + ], + "id": "follow", + "json": "[\"follow\",{\"follower\":\"spaminator\",\"following\":[\"lyubovbar\",\"zaitsevalesyaa\",\"kingscrown\",\"trevonjb\",\"craig-grant\",\"ned\"],\"what\":[\"blacklist\"]}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "hivewatchers" + ], + "id": "follow", + "json": "[\"follow\",{\"follower\":\"hivewatchers\",\"following\":[\"lyubovbar\",\"rkpl\",\"blendplayz\",\"renzoarg\",\"kingscrown\",\"forevergala\",\"machinelearning\",\"ola1\",\"steembeast\",\"ekremi12\",\"steem4lyf\",\"caitlinm\",\"bruno1122\"],\"what\":[\"blacklist\"]}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "buildawhale" + ], + "id": "follow", + "json": "[\"follow\",{\"follower\":\"buildawhale\",\"following\":[\"zaitsevalesyaa\",\"trevonjb\",\"earnest\",\"wildchild\",\"craig-grant\"],\"what\":[\"blacklist\"]}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "redeemer" + ], + "id": "follow", + "json": "[\"follow\",{\"follower\":\"redeemer\",\"following\":[\"zaitsevalesyaa\",\"trevonjb\",\"craig-grant\"],\"what\":[\"blacklist\"]}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "ignoreall" + ], + "id": "follow", + "json": "[\"follow\",{\"follower\":\"ignoreall\",\"following\":[\"gtg\",\"alice\",\"davr86\"],\"what\":[\"blacklist\"]}]" + } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "ignoreall" + ], + "id": "follow", + "json": "[\"follow\",{\"follower\":\"ignoreall\",\"following\":[\"gtg\",\"alice\",\"davr86\"],\"what\":[\"ignore\"]}]" + } } ] } @@ -546,6 +812,17 @@ "id": "follow", "json": "[\"follow\",{\"follower\":\"tester1\",\"following\":\"tester2\",\"what\":[\"follow_blacklist\"]}]" } + }, + { + "type": "custom_json_operation", + "value": { + "required_auths": [], + "required_posting_auths": [ + "alice" + ], + "id": "follow", + "json": "[\"follow\",{\"follower\":\"alice\",\"following\":[\"spaminator\",\"hivewatchers\",\"buildawhale\",\"redeemer\"],\"what\":[\"follow_blacklist\"]}]" + } } ] } diff --git a/tests/tests_api b/tests/tests_api index e302be835b3de938fb5941a1ea1dd40c1a6ed632..b03bb410ede1106bb2a30c5d5e5da6b6d5eda491 160000 --- a/tests/tests_api +++ b/tests/tests_api @@ -1 +1 @@ -Subproject commit e302be835b3de938fb5941a1ea1dd40c1a6ed632 +Subproject commit b03bb410ede1106bb2a30c5d5e5da6b6d5eda491