diff --git a/DEV_config.json b/DEV_config.json index 7a2fac46289d15acb4b86752e99a0a58a3c4859e..4c6750c2e1365cd0b03cbd278c79f678dad6129f 100644 --- a/DEV_config.json +++ b/DEV_config.json @@ -6,91 +6,91 @@ }, "upstreams": [ { - "name": "steemd", + "name": "hived", "translate_to_appbase": true, "urls": [ [ - "steemd", - "https://api.steemit.com" + "hived", + "https://api.hive.blog" ] ], "ttls": [ [ - "steemd", + "hived", 3 ], [ - "steemd.login_api", + "hived.login_api", -1 ], [ - "steemd.network_broadcast_api", + "hived.network_broadcast_api", -1 ], [ - "steemd.follow_api", + "hived.follow_api", 10 ], [ - "steemd.market_history_api", + "hived.market_history_api", 1 ], [ - "steemd.database_api", + "hived.database_api", 3 ], [ - "steemd.database_api.get_block", + "hived.database_api.get_block", -2 ], [ - "steemd.database_api.get_block_header", + "hived.database_api.get_block_header", -2 ], [ - "steemd.database_api.get_content", + "hived.database_api.get_content", 1 ], [ - "steemd.database_api.get_state", + "hived.database_api.get_state", 1 ], [ - "steemd.database_api.get_state.params=['/trending']", + "hived.database_api.get_state.params=['/trending']", 30 ], [ - "steemd.database_api.get_state.params=['trending']", + "hived.database_api.get_state.params=['trending']", 30 ], [ - "steemd.database_api.get_state.params=['/hot']", + "hived.database_api.get_state.params=['/hot']", 30 ], [ - "steemd.database_api.get_state.params=['/welcome']", + "hived.database_api.get_state.params=['/welcome']", 30 ], [ - "steemd.database_api.get_state.params=['/promoted']", + "hived.database_api.get_state.params=['/promoted']", 30 ], [ - "steemd.database_api.get_state.params=['/created']", + "hived.database_api.get_state.params=['/created']", 10 ], [ - "steemd.database_api.get_dynamic_global_properties", + "hived.database_api.get_dynamic_global_properties", 1 ] ], "timeouts": [ [ - "steemd", + "hived", 5 ], [ - "steemd.network_broadcast_api", + "hived.network_broadcast_api", 0 ] ] @@ -100,7 +100,7 @@ "urls": [ [ "appbase", - "https://api.steemit.com" + "https://api.hive.blog" ] ], "ttls": [ diff --git a/EXAMPLE_hivemind_upstream_config.json b/EXAMPLE_hivemind_upstream_config.json index fa82760175bce127d27c6d2d14a4dfdcd639c4d3..368cacf0a8fc1633c27d78bde72277cf62a449af 100644 --- a/EXAMPLE_hivemind_upstream_config.json +++ b/EXAMPLE_hivemind_upstream_config.json @@ -6,23 +6,23 @@ }, "upstreams": [ { - "name": "steemd", + "name": "hived", "translate_to_appbase": true, "urls": [ [ - "steemd", - "https://your.steemd.url" + "hived", + "https://your.hived.url" ] ], "ttls": [ [ - "steemd", + "hived", 3 ] ], "timeouts": [ [ - "steemd", + "hived", 3 ] ] @@ -32,19 +32,19 @@ "urls": [ [ "appbase", - "https://your.steemd.url" + "https://your.hived.url" ], [ "appbase.account_history_api", - "https://your.account.history.steemd.url" + "https://your.account.history.hived.url" ], [ "appbase.condenser_api.get_account_history", - "https://your.account.history.steemd.url" + "https://your.account.history.hived.url" ], [ "appbase.condenser_api.get_ops_in_block", - "https://your.account.history.steemd.url" + "https://your.account.history.hived.url" ], [ "appbase.condenser_api.get_followers", @@ -124,19 +124,19 @@ ], [ "appbase.condenser_api.get_state.params=['witnesses']", - "https://your.account.history.steemd.url" + "https://your.account.history.hived.url" ], [ "appbase.condenser_api.get_state.params=['/witnesses']", - "https://your.account.history.steemd.url" + "https://your.account.history.hived.url" ], [ "appbase.condenser_api.get_state.params=['/~witnesses']", - "https://your.account.history.steemd.url" + "https://your.account.history.hived.url" ], [ "appbase.condenser_api.get_state.params=['~witnesses']", - "https://your.account.history.steemd.url" + "https://your.account.history.hived.url" ], [ "appbase.follow_api", diff --git a/Makefile b/Makefile index d3c2ea8244ffd1472621903c0073a0fed1c6c19a..a1ffc3cc702c824d69085f3273ddee5d577b1206 100644 --- a/Makefile +++ b/Makefile @@ -132,8 +132,8 @@ mypy: ## run mypy type checking on python files http --json :9000/ id:=1 jsonrpc=2.0 method=get_block params:='[1000]' -.PHONY: test-local-steemd-calls -test-local-steemd-calls: +.PHONY: test-local-hived-calls +test-local-hived-calls: pipenv run pytest -vv tests/test_responses.py::test_steemd_responses --jussiurl http://localhost:9000 .PHONY: test-local-appbase-calls @@ -154,7 +154,7 @@ test-live-staging-appbase-calls: .PHONY: test-live-prod-appbase-calls test-live-prod-appbase-calls: - pipenv run pytest --maxfail=1 tests/test_responses.py::test_appbase_responses --jussiurl https://api.steemit.com + pipenv run pytest --maxfail=1 tests/test_responses.py::test_appbase_responses --jussiurl https://api.hive.blog ./perf: diff --git a/README.md b/README.md index 8296f767f5abbfacaaedcc7acebc222dbf6cff3d..e024941d67392e7d182baca12d8fca8bcccf659e 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Content-Type: application/json ``` ### Default Namespace -Any json-rpc method with no period in the method name is presumed to be in the "steemd" namespace and will be forwarded to a steemd endpoint: +Any json-rpc method with no period in the method name is presumed to be in the "hived" namespace and will be forwarded to a hived endpoint: ``` POST / HTTP/1.1 diff --git a/contrib/async_http_client.py b/contrib/async_http_client.py index 372d2376b545181ba0002a3b05e9ebc09cdab4c9..9e97d5ce58ed1782e98a5fd4cfe80e1ba358d404 100644 --- a/contrib/async_http_client.py +++ b/contrib/async_http_client.py @@ -93,7 +93,7 @@ def chunkify(iterable, chunksize=3000): class AsyncClient(object): def __init__(self, *, url=None, **kwargs): self.url = url or os.environ.get( - 'STEEMD_HTTP_URL', 'https://steemd.steemitdev.com') + 'STEEMD_HTTP_URL', 'https://api.hive.blog') self.kwargs = kwargs self.session = kwargs.get('session', None) self.connector = get_in(kwargs, ['session', 'connector']) @@ -234,7 +234,7 @@ class AsyncClient(object): @property def concurrent_connections(self): - """number of tcp connections to steemd""" + """number of tcp connections to hived""" return self.connector.limit @property diff --git a/contrib/http_client.py b/contrib/http_client.py index 23f03aafd9a1c19ad65eb5bddf52439209bd63f7..178b0e1c75c026c14a167a5a330b6d97dfd7cf3d 100644 --- a/contrib/http_client.py +++ b/contrib/http_client.py @@ -80,7 +80,7 @@ class SimpleSteemAPIClient(object): tcp_keepalive=True, **kwargs): url = url or os.environ.get('STEEMD_HTTP_URL', - 'https://steemd.steemitdev.com') + 'https://api.hive.blog') self.url = url self.hostname = urlparse(url).hostname self.return_with_args = kwargs.get('return_with_args', False) diff --git a/jussi/cache/ttl.py b/jussi/cache/ttl.py index b78a1af34fbd5cfc5e0816a8883b191cc404a479..1ed38698461e271cce84dd1207cfeaec5d5679fe 100644 --- a/jussi/cache/ttl.py +++ b/jussi/cache/ttl.py @@ -3,7 +3,7 @@ Method Settings --------------- - Each tuple in the METHOD_SETTING's list of tuples is a setting -- Each setting is a two-tuple of `prefix` and `ttl`, eg, ('steemd.database_api.get_block',1) +- Each setting is a two-tuple of `prefix` and `ttl`, eg, ('hived.database_api.get_block',1) - Settings are stored in a trie structure, the longest matching prefix for a method is it's setting - TTL is an integer value in seconds. Integers <= 0 have special meaning - A TTL of `0` won't expire diff --git a/jussi/cache/utils.py b/jussi/cache/utils.py index 6a3bfe2aae356cccaed6947b6f501ed0aaf7c664..2725b8edd8cbe98feae656bf2d33efa3c79517db 100644 --- a/jussi/cache/utils.py +++ b/jussi/cache/utils.py @@ -54,12 +54,12 @@ def block_num_from_jsonrpc_response( if previous: return int(str(previous)[:8], base=16) + 1 - # for steemd get_block + # for hived get_block block_id = get_in(['result', 'block_id'], jsonrpc_response) if block_id: return int(str(block_id)[:8], base=16) - # for steemd get_block_header + # for hived get_block_header previous = get_in(['result', 'previous'], jsonrpc_response) if previous: diff --git a/jussi/upstream.py b/jussi/upstream.py index e25ff584e84ec03aee2a5a01dcad6806c4aa297d..4f3a3d2a23b3c40aa69eb770ab0f24e2f0beff67 100644 --- a/jussi/upstream.py +++ b/jussi/upstream.py @@ -88,7 +88,7 @@ class _Upstreams(object): @functools.lru_cache(8192) def url(self, request_urn) -> str: - # certain steemd.get_state paths must be routed differently + # certain hived.get_state paths must be routed differently if (request_urn.api in ['database_api', 'condenser_api'] and request_urn.method == 'get_state' and isinstance(request_urn.params, list) diff --git a/jussi/urn.py b/jussi/urn.py index 3a303416e6deb0fbaba6bedddf8e6d6a45d87711..241153078d90259f185129f237a8d2b29debff94 100644 --- a/jussi/urn.py +++ b/jussi/urn.py @@ -117,7 +117,7 @@ def _parse_jrpc(single_jsonrpc_request) -> dict: if method != 'call': return { - 'namespace': 'steemd', + 'namespace': 'hived', 'api': 'database_api', 'method': method, 'params': params @@ -132,12 +132,12 @@ def _parse_jrpc(single_jsonrpc_request) -> dict: if api == 'condenser_api' or isinstance(_params, dict) or api == 'jsonrpc': namespace = 'appbase' else: - namespace = 'steemd' + namespace = 'hived' if isinstance(api, int): try: api = STEEMD_NUMERIC_API_MAPPING[api] except IndexError: - raise InvalidNamespaceAPIError(namespace='steemd', + raise InvalidNamespaceAPIError(namespace='hived', api=api) return { diff --git a/jussi/validators.py b/jussi/validators.py index aae536e856ee7dd939c3b00349c0a2f19900d543..13421f8652d70f597afe14d810b96ffe6928a182 100644 --- a/jussi/validators.py +++ b/jussi/validators.py @@ -112,17 +112,17 @@ def is_valid_non_error_jussi_response( def is_get_block_request(request: JSONRPCRequest) -> bool: - return request.urn.namespace in ('steemd', 'appbase') and request.urn.method == 'get_block' + return request.urn.namespace in ('hived', 'appbase') and request.urn.method == 'get_block' def is_get_block_header_request(request: JSONRPCRequest) -> bool: return request.urn.namespace in ( - 'steemd', 'appbase') and request.urn.method == 'get_block_header' + 'hived', 'appbase') and request.urn.method == 'get_block_header' def is_get_dynamic_global_properties_request(request: JSONRPCRequest) -> bool: return request.urn.namespace in ( - 'steemd', 'appbase') and request.urn.method == 'get_dynamic_global_properties' + 'hived', 'appbase') and request.urn.method == 'get_dynamic_global_properties' def is_valid_get_block_response( diff --git a/tests/conftest.py b/tests/conftest.py index 0b8a66e7a9f3cb0a66e5be1b408cd932439f01be..689b87cfd0fd1354c7412c4d6baa90bb1fd190d0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -103,7 +103,7 @@ def jrpc_response_schema(): @pytest.fixture def steemd_response_schema(): - with open(os.path.join(SCHEMA_DIR, 'steemd-response-schema.json')) as f: + with open(os.path.join(SCHEMA_DIR, 'hived-response-schema.json')) as f: return ujson.load(f) @@ -116,7 +116,7 @@ with open(os.path.join(CONFIGS_DIR, 'TEST_UPSTREAM_CONFIG.json')) as f: # ------------------------ def steemd_requests_and_responses(): - with open(os.path.join(REQS_AND_RESPS_DIR, 'steemd.json')) as f: + with open(os.path.join(REQS_AND_RESPS_DIR, 'hived.json')) as f: return ujson.load(f) @@ -1126,24 +1126,24 @@ URN_TEST_REQUEST_DICTS = [ ), # -------- STEEMD BARE METHOD ---------------- - # steemd, bare method, no params + # hived, bare method, no params ({ 'id': 5020, 'jsonrpc': '2.0', 'method': 'get_dynamic_global_properties' }, { - 'namespace': 'steemd', + 'namespace': 'hived', 'api': 'database_api', 'method': 'get_dynamic_global_properties', 'params': _empty }, - 'steemd.database_api.get_dynamic_global_properties', - 'wss://steemd.steemitdev.com', + 'hived.database_api.get_dynamic_global_properties', + 'https://api.hive.blog', 1, 3 ), - # steemd, bare method, empty params list + # hived, bare method, empty params list ({ 'id': 5021, 'jsonrpc': '2.0', @@ -1151,17 +1151,17 @@ URN_TEST_REQUEST_DICTS = [ 'params': [] }, { - 'namespace': 'steemd', + 'namespace': 'hived', 'api': 'database_api', 'method': 'get_dynamic_global_properties', 'params': [] }, - 'steemd.database_api.get_dynamic_global_properties.params=[]', - 'wss://steemd.steemitdev.com', + 'hived.database_api.get_dynamic_global_properties.params=[]', + 'https://api.hive.blog', 1, 3 ), - # steemd, bare method, params list + # hived, bare method, params list ({ 'id': 5022, 'jsonrpc': '2.0', @@ -1169,18 +1169,18 @@ URN_TEST_REQUEST_DICTS = [ 'params': [1] }, { - 'namespace': 'steemd', + 'namespace': 'hived', 'api': 'database_api', 'method': 'get_block', 'params': [1] }, - 'steemd.database_api.get_block.params=[1]', - 'wss://steemd.steemitdev.com', + 'hived.database_api.get_block.params=[1]', + 'https://api.hive.blog', -2, 3 ), - # steemd, bare_method, account transfer url + # hived, bare_method, account transfer url ({ "id": 5023, "jsonrpc": "2.0", @@ -1188,12 +1188,12 @@ URN_TEST_REQUEST_DICTS = [ "params": ["/@justinw/transfers"] }, { - 'namespace': 'steemd', + 'namespace': 'hived', 'api': 'database_api', 'method': 'get_state', 'params': ["/@justinw/transfers"] }, - 'steemd.database_api.get_state.params=["\/@justinw\/transfers"]', + 'hived.database_api.get_state.params=["\/@justinw\/transfers"]', 'account_transfer_url', 1, 3 @@ -1203,7 +1203,7 @@ URN_TEST_REQUEST_DICTS = [ # -------- STEEMD METHOD=CALL ---------------- - # steemd, method=call, empty params list + # hived, method=call, empty params list ({ 'id': 5024, 'jsonrpc': '2.0', @@ -1211,17 +1211,17 @@ URN_TEST_REQUEST_DICTS = [ 'params': ['database_api', 'get_account_count', []] }, { - 'namespace': 'steemd', + 'namespace': 'hived', 'api': 'database_api', 'method': 'get_account_count', 'params': [] }, - 'steemd.database_api.get_account_count.params=[]', - 'wss://steemd.steemitdev.com', + 'hived.database_api.get_account_count.params=[]', + 'https://api.hive.blog', 3, 3 ), - # steemd numeric apis + # hived numeric apis ({ 'id': 5025, 'jsonrpc': '2.0', @@ -1229,13 +1229,13 @@ URN_TEST_REQUEST_DICTS = [ 'params': [1, "login", ["", ""]] }, { - 'namespace': 'steemd', + 'namespace': 'hived', 'api': 'login_api', 'method': 'login', 'params': ["", ""] }, - 'steemd.login_api.login.params=["",""]', - 'wss://steemd.steemitdev.com', + 'hived.login_api.login.params=["",""]', + 'https://api.hive.blog', -1, 3 ), @@ -1246,17 +1246,17 @@ URN_TEST_REQUEST_DICTS = [ 'params': [0, "find_accounts", []] }, { - 'namespace': 'steemd', + 'namespace': 'hived', 'api': 'database_api', 'method': 'find_accounts', 'params': [] }, - 'steemd.database_api.find_accounts.params=[]', - 'wss://steemd.steemitdev.com', + 'hived.database_api.find_accounts.params=[]', + 'https://api.hive.blog', 3, 3 ), - # steemd, method=call, account transfer url + # hived, method=call, account transfer url ({ "id": 5027, "jsonrpc": "2.0", @@ -1264,12 +1264,12 @@ URN_TEST_REQUEST_DICTS = [ "params": ["database_api", "get_state", [r"/@justinw/transfers"]] }, { - 'namespace': 'steemd', + 'namespace': 'hived', 'api': 'database_api', 'method': 'get_state', 'params': ["/@justinw/transfers"] }, - 'steemd.database_api.get_state.params=["\/@justinw\/transfers"]', + 'hived.database_api.get_state.params=["\/@justinw\/transfers"]', 'account_transfer_url', 1, 3 diff --git a/tests/data/configs/TEST_UPSTREAM_CONFIG.json b/tests/data/configs/TEST_UPSTREAM_CONFIG.json index 556fb07925aea537ec3bac5c1068b63906c0d54a..1ed9529bc0486a369d0d3e5d58037d4fba428644 100644 --- a/tests/data/configs/TEST_UPSTREAM_CONFIG.json +++ b/tests/data/configs/TEST_UPSTREAM_CONFIG.json @@ -4,90 +4,90 @@ }, "upstreams": [ { - "name": "steemd", + "name": "hived", "urls": [ [ - "steemd", - "wss://steemd.steemitdev.com" + "hived", + "https://api.hive.blog" ] ], "ttls": [ [ - "steemd", + "hived", 3 ], [ - "steemd.login_api", + "hived.login_api", -1 ], [ - "steemd.network_broadcast_api", + "hived.network_broadcast_api", -1 ], [ - "steemd.follow_api", + "hived.follow_api", 10 ], [ - "steemd.market_history_api", + "hived.market_history_api", 1 ], [ - "steemd.database_api", + "hived.database_api", 3 ], [ - "steemd.database_api.get_block", + "hived.database_api.get_block", -2 ], [ - "steemd.database_api.get_block_header", + "hived.database_api.get_block_header", -2 ], [ - "steemd.database_api.get_content", + "hived.database_api.get_content", 1 ], [ - "steemd.database_api.get_state", + "hived.database_api.get_state", 1 ], [ - "steemd.database_api.get_state.params=['/trending']", + "hived.database_api.get_state.params=['/trending']", 30 ], [ - "steemd.database_api.get_state.params=['trending']", + "hived.database_api.get_state.params=['trending']", 30 ], [ - "steemd.database_api.get_state.params=['/hot']", + "hived.database_api.get_state.params=['/hot']", 30 ], [ - "steemd.database_api.get_state.params=['/welcome']", + "hived.database_api.get_state.params=['/welcome']", 30 ], [ - "steemd.database_api.get_state.params=['/promoted']", + "hived.database_api.get_state.params=['/promoted']", 30 ], [ - "steemd.database_api.get_state.params=['/created']", + "hived.database_api.get_state.params=['/created']", 10 ], [ - "steemd.database_api.get_dynamic_global_properties", + "hived.database_api.get_dynamic_global_properties", 1 ] ], "timeouts": [ [ - "steemd", + "hived", 3 ], [ - "steemd.network_broadcast_api", + "hived.network_broadcast_api", 0 ] ] diff --git a/tests/test_cache_middleware.py b/tests/test_cache_middleware.py index a8158f90f59884c6d18e3b069ad25de1ed0727ee..a57a56491ba0c49af1f391206ee9a5fa236d3b4c 100644 --- a/tests/test_cache_middleware.py +++ b/tests/test_cache_middleware.py @@ -85,7 +85,7 @@ async def test_cache_response_middleware(test_cli): response = await test_cli.post('/', json=req) assert await response.json() == expected_steemd_response response = await test_cli.post('/', json=req) - assert response.headers['x-jussi-cache-hit'] == 'steemd.database_api.get_dynamic_global_properties' + assert response.headers['x-jussi-cache-hit'] == 'hived.database_api.get_dynamic_global_properties' async def test_mocked_cache_response_middleware(mocked_app_test_cli): @@ -96,5 +96,5 @@ async def test_mocked_cache_response_middleware(mocked_app_test_cli): assert await response.json() == expected_response response = await test_cli.post('/', json=req, headers={'x-jussi-request-id': '1'}) - assert response.headers['x-jussi-cache-hit'] == 'steemd.database_api.get_dynamic_global_properties' + assert response.headers['x-jussi-cache-hit'] == 'hived.database_api.get_dynamic_global_properties' assert await response.json() == expected_response diff --git a/tests/test_jsonrpc_request_and_responses.py b/tests/test_jsonrpc_request_and_responses.py index 52e655ab95df1534a22655015206780fe5f743bb..58f78f6108a47950e63f14b17630aab041204e1a 100644 --- a/tests/test_jsonrpc_request_and_responses.py +++ b/tests/test_jsonrpc_request_and_responses.py @@ -22,11 +22,11 @@ correct_get_block_1000_response = { 'jsonrpc_request, expected', [ ( - # single jsonrpc steemd request + # single jsonrpc hived request dict(id=1, jsonrpc='2.0', method='get_block', params=[1000]), correct_get_block_1000_response ), - # batch jsronrpc steemd request + # batch jsronrpc hived request ( [ dict(id=1, jsonrpc='2.0', method='get_block', params=[1000]), @@ -35,7 +35,7 @@ correct_get_block_1000_response = { [correct_get_block_1000_response, correct_get_block_1000_response] ), ( - # single jsonrpc old-style steemd requests + # single jsonrpc old-style hived requests dict( id=1, jsonrpc='2.0', @@ -44,7 +44,7 @@ correct_get_block_1000_response = { correct_get_block_1000_response ), ( - # batch jsonrpc old-style steemd request + # batch jsonrpc old-style hived request [ dict( id=1, @@ -60,7 +60,7 @@ correct_get_block_1000_response = { [correct_get_block_1000_response, correct_get_block_1000_response] ), ( - # batch jsonrpc mixed-style steemd request + # batch jsonrpc mixed-style hived request [ dict(id=1, jsonrpc='2.0', method='get_block', params=[1000]), dict(id=1, jsonrpc='2.0', method='call', params=[ diff --git a/tests/test_jussi_handlers.py b/tests/test_jussi_handlers.py index 9171eef2bf9b29fb036e5a3c5344c836fcaece15..2fffb9d5f516af1cdcfa5474caee9b365b74054c 100644 --- a/tests/test_jussi_handlers.py +++ b/tests/test_jussi_handlers.py @@ -21,7 +21,7 @@ correct_get_block_1000_response = { test_request = { 'id': 1, 'jsonrpc': '2.0', - 'method': 'steemd.fake_method' + 'method': 'hived.fake_method' } error_response1 = {'id': 1, 'jsonrpc': '2.0', 'error': { diff --git a/tests/test_jussi_request_response_middleware.py b/tests/test_jussi_request_response_middleware.py index 2221f23077da290ed77dba1116af2922b80045ce..55bce2ae9a3e28a5d9195cdbfe234db1b4a5eb59 100644 --- a/tests/test_jussi_request_response_middleware.py +++ b/tests/test_jussi_request_response_middleware.py @@ -158,7 +158,7 @@ def test_urn_parts_in_post_response_headers(): _, response = app.test_client.post('/post', json=req) assert 'x-jussi-request-id' in response.headers - assert response.headers['x-jussi-namespace'] == 'steemd', f'{response.headers}' + assert response.headers['x-jussi-namespace'] == 'hived', f'{response.headers}' assert response.headers['x-jussi-api'] == 'database_api', f'{response.headers}' assert response.headers['x-jussi-method'] == 'get_block', f'{response.headers}' assert response.headers['x-jussi-params'] == '[1000]', f'{response.headers}' diff --git a/tests/test_urn.py b/tests/test_urn.py index 203b927b98e3227229063321dee7a0540cd83d54..979fb956622d2c1382a5f2fb29ee2721b19c3051 100644 --- a/tests/test_urn.py +++ b/tests/test_urn.py @@ -45,7 +45,7 @@ def test_parse_jrpc_errors(jsonrpc_request, expected): def test_parse_jrpc_namespace_is_steemd(steemd_request_and_response): req, resp = steemd_request_and_response result = _parse_jrpc(req) - assert result['namespace'] == 'steemd' + assert result['namespace'] == 'hived' def test_parse_jrpc_namespace_is_appbase(appbase_request_and_response): diff --git a/tests/test_utils_namespaces.py b/tests/test_utils_namespaces.py index 6530c254d2c37d339843a28fb6a46b4e0d8aa2ae..8e66a35f0ba8b784a0adcb6b94ef99e2dba4ac03 100644 --- a/tests/test_utils_namespaces.py +++ b/tests/test_utils_namespaces.py @@ -17,30 +17,30 @@ def test_urns(urn_test_request_dict): @pytest.mark.parametrize("jsonrpc_request,expected", [ - # steemd, bare_method + # hived, bare_method ({'id': 1, 'jsonrpc': '2.0', 'method': 'get_account_count', 'params': []}, - 'steemd.database_api.get_account_count.params=[]' + 'hived.database_api.get_account_count.params=[]' ), - # steemd, method=call + # hived, method=call ({ 'id': 1, 'jsonrpc': '2.0', 'method': 'call', 'params': ['database_api', 'get_account_count', []] }, - 'steemd.database_api.get_account_count.params=[]' + 'hived.database_api.get_account_count.params=[]' ), - # steemd, method=call, numeric api + # hived, method=call, numeric api ({ 'id': 1, 'jsonrpc': '2.0', 'method': 'call', 'params': [0, 'get_account_count', []] }, - 'steemd.database_api.get_account_count.params=[]' + 'hived.database_api.get_account_count.params=[]' ), # appbase, dotted method, condenser api ({ @@ -50,7 +50,7 @@ def test_urns(urn_test_request_dict): }, 'appbase.condenser_api.appbase_method.params=[]' ), - # steemd, condenser api, method=call + # hived, condenser api, method=call ({ 'id': 1, 'jsonrpc': '2.0', @@ -107,9 +107,9 @@ def test_urn_params_empty_dict(jsonrpc_request, expected): @pytest.mark.parametrize("jsonrpc_request,expected", [ - # steemd, bare_method + # hived, bare_method ({'id': 1, 'jsonrpc': '2.0', 'method': 'get_dynamic_global_properties'}, - 'steemd.database_api.get_dynamic_global_properties' + 'hived.database_api.get_dynamic_global_properties' ), # appbase, dotted method, non-condenser api ({'id': 1, 'jsonrpc': '2.0', 'method': 'non_condenser_api.appbase_method'}, @@ -148,4 +148,4 @@ def test_urn_pairs(steemd_method_pairs): old_urn = str(from_request(old)) new_urn = str(from_request(new)) assert old_urn == new_urn - assert old_urn.startswith('steemd.database_api') + assert old_urn.startswith('hived.database_api')