From 988ff02990eccc42dfdd072ab9c772760bcbb96d Mon Sep 17 00:00:00 2001 From: Holger Nahrstaedt <holger@nahrstaedt.de> Date: Wed, 4 Apr 2018 10:39:38 +0200 Subject: [PATCH] Remove steemitstage and improve coverage for steemnoderpc --- beemapi/steemnoderpc.py | 11 +++-------- beemgrapheneapi/graphenerpc.py | 3 --- examples/benchmark_beem.py | 13 ++++--------- examples/benchmark_nodes.py | 2 +- examples/print_appbase_calls.py | 2 +- tests/beem/test_notify.py | 2 +- tests/beemapi/test_steemnoderpc.py | 2 +- 7 files changed, 11 insertions(+), 24 deletions(-) diff --git a/beemapi/steemnoderpc.py b/beemapi/steemnoderpc.py index ce700fd7..b1bb1a83 100644 --- a/beemapi/steemnoderpc.py +++ b/beemapi/steemnoderpc.py @@ -72,23 +72,18 @@ class SteemNodeRPC(GrapheneRPC): raise e def get_account(self, name, **kwargs): - """ Get full account details from account name or id + """ Get full account details from account name - :param str name: Account name or account id + :param str name: Account name """ if isinstance(name, str): return self.get_accounts([name], **kwargs) - elif isinstance(name, int): - return self.get_account_references(name, **kwargs) def get_network(self): """ Identify the connected network. This call returns a dictionary with keys chain_id, core_symbol and prefix """ - try: - props = self.get_config(api="database") - except: - props = self.get_config() + props = self.get_config(api="database") if "STEEMIT_CHAIN_ID" in props: chain_id = props["STEEMIT_CHAIN_ID"] network_version = props['STEEMIT_BLOCKCHAIN_VERSION'] diff --git a/beemgrapheneapi/graphenerpc.py b/beemgrapheneapi/graphenerpc.py index db0abf0a..c3f44121 100644 --- a/beemgrapheneapi/graphenerpc.py +++ b/beemgrapheneapi/graphenerpc.py @@ -70,9 +70,6 @@ class GrapheneRPC(object): ws = GrapheneRPC("https://api.steemit.com","","") print(ws.get_account_count()) - ws = GrapheneRPC("https://api.steemitstage.com","","") - print(ws.get_account_count()) - .. note:: This class allows to call methods available via websocket. If you want to use the notification subsystem, please use ``GrapheneWebsocket`` instead. diff --git a/examples/benchmark_beem.py b/examples/benchmark_beem.py index ff1726ea..a5cfad6c 100644 --- a/examples/benchmark_beem.py +++ b/examples/benchmark_beem.py @@ -17,24 +17,19 @@ logging.basicConfig(level=logging.INFO) if __name__ == "__main__": - node_setup = 3 + node_setup = 2 how_many_hours = 1 if node_setup == 0: stm = Steem(node="https://api.steemit.com", num_retries=10) max_batch_size = None - threading = True - thread_num = 8 - elif node_setup == 1: - stm = Steem(node="https://api.steemitstage.com", num_retries=10) - max_batch_size = None threading = False thread_num = 8 - elif node_setup == 2: - stm = Steem(node="https://api.steemitstage.com", num_retries=10) + elif node_setup == 1: + stm = Steem(node="https://api.steemit.com", num_retries=10) max_batch_size = None threading = True thread_num = 8 - elif node_setup == 3: + elif node_setup == 2: stm = Steem(num_retries=10) max_batch_size = None threading = True diff --git a/examples/benchmark_nodes.py b/examples/benchmark_nodes.py index e8c69cf8..4a31c6cf 100644 --- a/examples/benchmark_nodes.py +++ b/examples/benchmark_nodes.py @@ -18,7 +18,7 @@ logging.basicConfig(level=logging.INFO) nodes = ["wss://steemd.pevo.science", "wss://gtg.steem.house:8090", "wss://rpc.steemliberator.com", "wss://rpc.buildteam.io", "wss://rpc.steemviz.com", "wss://seed.bitcoiner.me", "wss://node.steem.ws", "wss://steemd.steemgigs.org", - "wss://steemd.minnowsupportproject.org", "https://api.steemitstage.com", "https://api.steemit.com", "https://rpc.buildteam.io", + "wss://steemd.minnowsupportproject.org", "https://api.steemit.com", "https://rpc.buildteam.io", "https://steemd.minnowsupportproject.org", "https://steemd.pevo.science", "https://rpc.steemviz.com", "https://seed.bitcoiner.me", "https://rpc.steemliberator.com", "https://steemd.privex.io", "https://gtg.steem.house:8090", "https://api.steem.house", "https://rpc.curiesteem.com", "https://seed.bitcoiner.me"] diff --git a/examples/print_appbase_calls.py b/examples/print_appbase_calls.py index 1e1712f1..7222c98a 100644 --- a/examples/print_appbase_calls.py +++ b/examples/print_appbase_calls.py @@ -15,7 +15,7 @@ logging.basicConfig(level=logging.INFO) if __name__ == "__main__": - stm = Steem(node="https://api.steemitstage.com") + stm = Steem(node="https://api.steemit.com") # stm = Steem(node="wss://appbasetest.timcliff.com") all_calls = stm.rpc.get_methods(api="jsonrpc") t = PrettyTable(["method", "args", "ret"]) diff --git a/tests/beem/test_notify.py b/tests/beem/test_notify.py index e4f7b25b..8e7185d0 100644 --- a/tests/beem/test_notify.py +++ b/tests/beem/test_notify.py @@ -22,7 +22,7 @@ core_unit = "STM" nodes = ["wss://steemd.pevo.science", "wss://gtg.steem.house:8090", "wss://rpc.steemliberator.com", "wss://rpc.buildteam.io", "wss://rpc.steemviz.com", "wss://seed.bitcoiner.me", "wss://node.steem.ws", "wss://steemd.steemgigs.org", "wss://steemd.steemit.com", "wss://steemd.minnowsupportproject.org"] -nodes_appbase = ["https://api.steemit.com", "https://api.steemitstage.com", "wss://appbasetest.timcliff.com"] +nodes_appbase = ["https://api.steem.house", "https://api.steemit.com", "wss://appbasetest.timcliff.com"] class TestBot: diff --git a/tests/beemapi/test_steemnoderpc.py b/tests/beemapi/test_steemnoderpc.py index 7d6c21a4..0b7ad3ff 100644 --- a/tests/beemapi/test_steemnoderpc.py +++ b/tests/beemapi/test_steemnoderpc.py @@ -28,7 +28,7 @@ nodes_https = ['https://api.steemit.com', 'https://steemd.privex.io', 'https://s 'https://rpc.buildteam.io', 'https://steemd.minnowsupportproject.org', 'https://gtg.steem.house:8090', 'https://seed.bitcoiner.me'] nodes_appbase = ["https://api.steemit.com", "wss://appbasetest.timcliff.com"] test_list = ["wss://steemd.doesnot.exists", "wss://api.steemit.com", "wss://steemd.pevo.science", "wss://gtg.steem.house:8090", - "https://api.steemit.com", "https://api.steemitstage.com", "wss://appbasetest.timcliff.com", 'https://steemd.privex.io', + "https://api.steemit.com", "wss://appbasetest.timcliff.com", 'https://steemd.privex.io', 'https://steemd.pevo.science', 'https://rpc.steemliberator.com', 'https://rpc.buildteam.io', 'https://steemd.minnowsupportproject.org', 'https://gtg.steem.house:8090', 'https://seed.bitcoiner.me'] -- GitLab