From ee7e49fb4e0248551aac629f1c8fcd1c0f1c70d9 Mon Sep 17 00:00:00 2001 From: Holger Nahrstaedt <holgernahrstaedt@gmx.de> Date: Sat, 18 Apr 2020 14:21:58 +0200 Subject: [PATCH] Fix changelog and unit test --- CHANGELOG.rst | 6 +++++- examples/print_comments.py | 2 ++ examples/print_votes.py | 2 ++ tests/beem/test_comment.py | 6 +++--- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1695283b..f42f1a34 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,15 +3,19 @@ Changelog 0.23.0 ------ * set hive as default for default_chain -* get_nodes return hive nodes by default +* get_steem_nodes added to NodeList * Prepared for Hive HF 24 * steem object in all classes is replaced by blockchain * Hive class has been added * Hive and Steem are now BlockChainInstance classes +* Hive and Steem have now is_hive and is_steem properties * Each class has now blockchain_instance parameter (steem_instance is stil available) * shared_blockchain_instance and set_shared_blockchain_instance can be used for Hive() and Steem() instances * token_symbol, backed_token_symbol and vest_token_symbol * Rename SteemWebsocket to NodeWebsocket and SteemNodeRPC to NodeRPC +* Rshares, vote percentage and SBD/HBD calculation has been fixed for votes +* post_rshares parameter added to all vote calculations +* Account class has now get_token_power(), get_voting_value() and get_vote_pct_for_vote_value() 0.22.14 ------- diff --git a/examples/print_comments.py b/examples/print_comments.py index 6470d391..ce68770f 100644 --- a/examples/print_comments.py +++ b/examples/print_comments.py @@ -4,6 +4,7 @@ from datetime import timedelta import time import io from beem.blockchain import Blockchain +from beem.instance import shared_blockchain_instance from beem.utils import parse_time import logging log = logging.getLogger(__name__) @@ -22,5 +23,6 @@ class DemoBot(object): if __name__ == "__main__": tb = DemoBot() blockchain = Blockchain() + print("Starting on %s network" % shared_blockchain_instance().get_blockchain_name()) for vote in blockchain.stream(opNames=["comment"]): tb.comment(vote) diff --git a/examples/print_votes.py b/examples/print_votes.py index b935d5e7..70139307 100644 --- a/examples/print_votes.py +++ b/examples/print_votes.py @@ -4,6 +4,7 @@ from datetime import timedelta import time import io from beem.blockchain import Blockchain +from beem.instance import shared_blockchain_instance from beem.utils import parse_time import logging log = logging.getLogger(__name__) @@ -25,5 +26,6 @@ class DemoBot(object): if __name__ == "__main__": tb = DemoBot() blockchain = Blockchain() + print("Starting on %s network" % shared_blockchain_instance().get_blockchain_name()) for vote in blockchain.stream(opNames=["vote"]): tb.vote(vote) diff --git a/tests/beem/test_comment.py b/tests/beem/test_comment.py index 20cb3668..90e4ee27 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(hive=True), num_retries=10)) - node_list = nodelist.get_nodes(hive=True) + nodelist.update_nodes(steem_instance=Steem(node=nodelist.get_hive_nodes(), num_retries=10)) + node_list = nodelist.get_hive_nodes() cls.bts = Steem( node=node_list, @@ -34,7 +34,7 @@ class Testcases(unittest.TestCase): ) acc = Account("fullnodeupdate", steem_instance=cls.bts) - comment = Comment(acc.get_blog_entries(limit=5)[-1], steem_instance=cls.bts) + comment = Comment(acc.get_blog_entries(limit=5)[0], steem_instance=cls.bts) cls.authorperm = comment.authorperm [author, permlink] = resolve_authorperm(cls.authorperm) cls.author = author -- GitLab