diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6d1d54873c3993ed542bdb657dda3bcd86a229c1..05181a93dcd40cb235e62a41b0fd9e49a54a500d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,9 +2,9 @@ Changelog ========= 0.24.4 ------ -* add get_replace_hive_by_steem() to Hive(), which is True on HF23 +* add get_replace_hive_by_steem() to Hive(), for transition from HF23 to HF24 on HIVE * Replace HIVE by STEEM and SBD by HBD only when Hive HF < 24 -* Replace steem and sbd paramter names for Hive HF >= 24 by hive and hbd +* Replace steem and sbd parameter names for Hive HF >= 24 by hive and hbd * Add get follow list to Account (only for HIVE and HF >= 24) * Add BLURT chain * Remove not used STEEM chains (STEEMZERO and STEEMAPPBASE) diff --git a/beem/hive.py b/beem/hive.py index 8b9ce14f7f5081a35beb3fb58f9ade25dc6641ca..cdb2f491065cb9e3af6636f76ed1aee5038f4e85 100644 --- a/beem/hive.py +++ b/beem/hive.py @@ -185,11 +185,16 @@ class Hive(BlockChainInstance): else: return a2 * time_stamp + b2 global_properties = self.get_dynamic_global_properties(use_stored_data=use_stored_data) - + if self.get_replace_hive_by_steem(): + return ( + float(Amount(global_properties['total_vesting_fund_hive'], blockchain_instance=self)) / + (float(Amount(global_properties['total_vesting_shares'], blockchain_instance=self)) / 1e6) + ) return ( - float(Amount(global_properties['total_vesting_fund_hive'], blockchain_instance=self)) / + float(Amount(global_properties['total_vesting_fund_steem'], blockchain_instance=self)) / (float(Amount(global_properties['total_vesting_shares'], blockchain_instance=self)) / 1e6) ) + def vests_to_hp(self, vests, timestamp=None, use_stored_data=True): """ Converts vests to HP diff --git a/beembase/objects.py b/beembase/objects.py index b0e1f41eb40946dfc4471b9b549a8336715c836f..335eda9cf3f7f95d84e93cd9d2fed4f364fd38e7 100644 --- a/beembase/objects.py +++ b/beembase/objects.py @@ -25,7 +25,6 @@ import struct default_prefix = "STM" -@python_2_unicode_compatible class Amount(object): def __init__(self, d, prefix=default_prefix, replace_hive_by_steem=True): self.replace_hive_by_steem = replace_hive_by_steem @@ -116,7 +115,6 @@ class Amount(object): return self.str_repr -@python_2_unicode_compatible class Operation(GPHOperation): def __init__(self, *args, **kwargs): self.appbase = kwargs.pop("appbase", False) @@ -256,7 +254,6 @@ class Permission(GrapheneObject): ])) -@python_2_unicode_compatible class Extension(Array): def __str__(self): """ We overload the __str__ function because the json