From e95871fd4875b87da1850555041f41482c8bccf7 Mon Sep 17 00:00:00 2001
From: Holger Nahrstaedt <holgernahrstaedt@gmx.de>
Date: Sat, 29 Aug 2020 08:00:13 +0200
Subject: [PATCH] Add more doc strings and remove not needed secp256k1 import

---
 CHANGELOG.rst                            |  3 +++
 beem/account.py                          | 19 +++++++++++++++++--
 beemgraphenebase/signedtransactions.py   | 15 ---------------
 beemgraphenebase/unsignedtransactions.py | 18 +-----------------
 4 files changed, 21 insertions(+), 34 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 4bf349b7..bfdad5e9 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -3,6 +3,9 @@ Changelog
 0.24.9
 ------
 * Support for update_proposal_operation (thanks to dkedzierski)
+* Remove not needed SECP256K1 import
+* Fix corner case last_irreversible_block_num == head_block_number for Transactionbuilder (thanks to dkedzierski)
+
 0.24.8
 ------
 * Fix is_steem
diff --git a/beem/account.py b/beem/account.py
index ab05bd5b..5a6915a7 100644
--- a/beem/account.py
+++ b/beem/account.py
@@ -494,6 +494,9 @@ class Account(BlockchainObject):
 
     def get_voting_power(self, with_regeneration=True):
         """ Returns the account voting power in the range of 0-100%
+
+            :param bool with_regeneration: When True, voting power regeneration is
+                included into the result (default True)
         """
         if "voting_manabar" in self:
             manabar = self.get_manabar()
@@ -520,6 +523,9 @@ class Account(BlockchainObject):
 
     def get_downvoting_power(self, with_regeneration=True):
         """ Returns the account downvoting power in the range of 0-100%
+
+            :param bool with_regeneration: When True, downvoting power regeneration is
+                included into the result (default True)
         """
         if "downvote_manabar" not in self:
             return 0
@@ -540,6 +546,9 @@ class Account(BlockchainObject):
 
     def get_vests(self, only_own_vests=False):
         """ Returns the account vests
+
+            :param bool only_own_vests: When True, only owned vests is
+                returned without delegation (default False)
         """
         vests = (self["vesting_shares"])
         if not only_own_vests and "delegated_vesting_shares" in self and "received_vesting_shares" in self:
@@ -557,10 +566,16 @@ class Account(BlockchainObject):
             vesting_shares -= min(int(self["vesting_withdraw_rate"]), int(self["to_withdraw"]) - int(self["withdrawn"]))
         return vesting_shares
 
-    def get_token_power(self, only_own_vests=False):
+    def get_token_power(self, only_own_vests=False, use_stored_data=True):
         """ Returns the account Hive/Steem power (amount of staked token + delegations)
+
+            :param bool only_own_vests: When True, only owned vests is
+                returned without delegation (default False)
+            :param bool use_stored_data: When False, an API call returns the current
+                vests_to_token_power ratio everytime (default True)
+
         """
-        return self.blockchain.vests_to_token_power(self.get_vests(only_own_vests=only_own_vests))
+        return self.blockchain.vests_to_token_power(self.get_vests(only_own_vests=only_own_vests), use_stored_data=use_stored_data)
 
     def get_steem_power(self, onlyOwnSP=False):
         """ Returns the account steem power
diff --git a/beemgraphenebase/signedtransactions.py b/beemgraphenebase/signedtransactions.py
index 841a16e4..136f52e4 100644
--- a/beemgraphenebase/signedtransactions.py
+++ b/beemgraphenebase/signedtransactions.py
@@ -25,21 +25,6 @@ from .ecdsasig import sign_message, verify_message
 import logging
 log = logging.getLogger(__name__)
 
-try:
-    import secp256k1prp as secp256k1
-    USE_SECP256K1 = True
-    log.debug("Loaded secp256k1prp binding.")    
-except:
-    try:
-        import secp256k1
-        USE_SECP256K1 = True
-        log.debug("Loaded secp256k1 binding.")
-    except Exception:
-        USE_SECP256K1 = False
-        log.debug("To speed up transactions signing install \n"
-                  "    pip install secp256k1\n"
-                  "or  pip install secp256k1prp")
-
 
 class Signed_Transaction(GrapheneObject):
     """ Create a signed transaction and offer method to create the
diff --git a/beemgraphenebase/unsignedtransactions.py b/beemgraphenebase/unsignedtransactions.py
index 8d086bdb..15fc9178 100644
--- a/beemgraphenebase/unsignedtransactions.py
+++ b/beemgraphenebase/unsignedtransactions.py
@@ -38,23 +38,7 @@ from .ecdsasig import sign_message, verify_message
 import logging
 log = logging.getLogger(__name__)
 
-try:
-    import secp256k1prp as secp256k1
-    USE_SECP256K1 = True
-    log.debug("Loaded secp256k1prp binding.")    
-except:
-    try:
-        import secp256k1
-        USE_SECP256K1 = True
-        log.debug("Loaded secp256k1 binding.")
-    except Exception:
-        USE_SECP256K1 = False
-        log.debug("To speed up transactions signing install \n"
-                  "    pip install secp256k1\n"
-                  "or  pip install secp256k1prp")
-
-
-@python_2_unicode_compatible
+
 class GrapheneObjectASN1(object):
     """ Core abstraction class
 
-- 
GitLab