From c8ae430f8354f908aacf4619c7215d3bd5ae3274 Mon Sep 17 00:00:00 2001 From: holgern <holgernahrstaedt@gmx.de> Date: Sun, 29 Mar 2020 22:55:46 +0200 Subject: [PATCH] Add information about HIVE in the documentation fix more unit tests --- CHANGELOG.rst | 1 + docs/index.rst | 6 +++--- docs/quickstart.rst | 43 +++++++++++++++++++++++++++++++++++++- tests/beem/test_cli.py | 2 +- tests/beem/test_comment.py | 8 +++---- tests/beem/test_vote.py | 5 +++-- 6 files changed, 54 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c51731b1..61f8007f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,7 @@ Changelog * Fix several unit tests * Fix deprecated collections import * Fix more HIVE/HBD symbols in beempy for HIVE +* Add information about HIVE in the documentation 0.22.10 ------- diff --git a/docs/index.rst b/docs/index.rst index 3b4ba383..047b5db9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,18 +17,18 @@ Welcome to beem's documentation! ================================ -Steem is a blockchain-based rewards platform for publishers to monetize +Steem/Hive is a blockchain-based rewards platform for publishers to monetize content and grow community. It is based on *Graphene* (tm), a blockchain technology stack (i.e. software) that allows for fast transactions and ascalable blockchain -solution. In case of Steem, it comes with decentralized publishing of +solution. In case of Steem/Hive, it comes with decentralized publishing of content. The beem library has been designed to allow developers to easily access its routines and make use of the network without dealing with all the related blockchain technology and cryptography. This library can be -used to do anything that is allowed according to the Steem +used to do anything that is allowed according to the Steem/Hive blockchain protocol. diff --git a/docs/quickstart.rst b/docs/quickstart.rst index eefdc0d5..43b156f9 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -1,9 +1,50 @@ Quickstart ========== +Hive/Steem blockchain +--------------------- + +Nodes for using beem with the Hive blockchain can be set by the command line tool with: + +.. code-block:: bash + + beempy updatenodes --hive + +Nodes for the Steem blockchain are set with + +.. code-block:: bash + + beempy updatenodes + + +Hive nodes can be set in a python script with + +.. code-block:: python + + from beem import Steem + from beem.nodelist import NodeList + nodelist = NodeList() + nodelist.update_nodes() + nodes = nodelist.get_nodes(hive=True) + hive = Steem(node=nodes) + print(hive.is_hive) + +Steem nodes can be set in a python script with + +.. code-block:: python + + from beem import Steem + from beem.nodelist import NodeList + nodelist = NodeList() + nodelist.update_nodes() + nodes = nodelist.get_nodes(hive=False) + hive = Steem(node=nodes) + print(hive.is_hive) + + Steem ----- -The steem object is the connection to the Steem blockchain. +The steem object is the connection to the Steem/Hive blockchain. By creating this object different options can be set. .. note:: All init methods of beem classes can be given diff --git a/tests/beem/test_cli.py b/tests/beem/test_cli.py index 49d4c46e..4f25e156 100644 --- a/tests/beem/test_cli.py +++ b/tests/beem/test_cli.py @@ -410,7 +410,7 @@ class Testcases(unittest.TestCase): account_name = "fullnodeupdate" result = runner.invoke(cli, ['pending', account_name]) self.assertEqual(result.exit_code, 0) - result = runner.invoke(cli, ['pending', '--post', '--comment', '--curation', account_name]) + result = runner.invoke(cli, ['pending', '--post', '--comment', account_name]) self.assertEqual(result.exit_code, 0) result = runner.invoke(cli, ['pending', '--post', '--comment', '--curation', '--permlink', '--days', '1', account_name]) self.assertEqual(result.exit_code, 0) diff --git a/tests/beem/test_comment.py b/tests/beem/test_comment.py index 35043b80..b5021bfb 100644 --- a/tests/beem/test_comment.py +++ b/tests/beem/test_comment.py @@ -21,8 +21,8 @@ class Testcases(unittest.TestCase): @classmethod def setUpClass(cls): nodelist = NodeList() - nodelist.update_nodes(steem_instance=Steem(node=nodelist.get_nodes(exclude_limited=False), num_retries=10)) - node_list = nodelist.get_nodes(exclude_limited=True) + nodelist.update_nodes(steem_instance=Steem(node=nodelist.get_nodes(hive=True), num_retries=10)) + node_list = nodelist.get_nodes(hive=True) cls.bts = Steem( node=node_list, @@ -39,8 +39,8 @@ class Testcases(unittest.TestCase): keys={"active": wif}, num_retries=10 ) - acc = Account("holger80", steem_instance=cls.bts) - comment = acc.get_feed(limit=20)[-1] + acc = Account("fullnodeupdate", steem_instance=cls.bts) + comment = Comment(acc.get_blog_entries(limit=5)[-1], steem_instance=cls.bts) cls.authorperm = comment.authorperm [author, permlink] = resolve_authorperm(cls.authorperm) cls.author = author diff --git a/tests/beem/test_vote.py b/tests/beem/test_vote.py index 9a61fe43..9b8b4a4c 100644 --- a/tests/beem/test_vote.py +++ b/tests/beem/test_vote.py @@ -35,11 +35,12 @@ class Testcases(unittest.TestCase): set_shared_steem_instance(cls.bts) cls.bts.set_default_account("test") - acc = Account("holger80", steem_instance=cls.bts) + acc = Account("fullnodeupdate", steem_instance=cls.bts) n_votes = 0 index = 0 + entries = acc.get_blog_entries(limit=30)[::-1] while n_votes == 0: - comment = acc.get_feed(limit=30)[::-1][index] + comment = Comment(entries[index], steem_instance=cls.bts) votes = comment.get_votes() n_votes = len(votes) index += 1 -- GitLab