diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4bf55759b5787e7c34ebe1cd9a4407ca93d4072e..e591fbac93fc53c315d05fe434f4cd1da3d8f0be 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,7 @@ Changelog * Fix to parameter in transfer_to_vesting * Improve hybrid operation in operations (pre / post HF 24 operation are supported) * UpdateProposalExtensions has been added to Update_proposal as preperation for the next HF (thanks to @drov0) +* Fix some small code issues 0.24.21 ------- diff --git a/beem/account.py b/beem/account.py index 7606b3adbad1079332546750bd3b8e9be7ddf2ab..7257827a37ff4675662defef6d7c722e14cf6f7b 100644 --- a/beem/account.py +++ b/beem/account.py @@ -1354,11 +1354,7 @@ class Account(BlockchainObject): if not self.blockchain.is_connected(): raise OfflineHasNoRPCException("No RPC available in offline mode!") self.blockchain.rpc.set_next_node_on_empty_reply(False) - if self.blockchain.rpc.get_use_appbase(): - # return self.blockchain.rpc.get_account_bandwidth({'account': account, 'type': 'post'}, api="witness") - return self.blockchain.rpc.get_account_bandwidth(account, bandwidth_type) - else: - return self.blockchain.rpc.get_account_bandwidth(account, bandwidth_type) + return self.blockchain.rpc.get_account_bandwidth(account, bandwidth_type) def get_bandwidth(self): """ Returns used and allocated bandwidth diff --git a/beem/cli.py b/beem/cli.py index e0236436e6c8059cf07f50d638b2cd1c91785b79..cf81d07578df2bfb9590dbf32734ed5bb9a79357 100644 --- a/beem/cli.py +++ b/beem/cli.py @@ -198,7 +198,7 @@ def unlock_token_wallet(stm, sc2, password=None): print("Wallet could not be unlocked with %s!" % password_storage) password = click.prompt("Password to unlock wallet", confirmation_prompt=False, hide_input=True) if bool(password): - unlock_token_wallet(stm, password=password) + unlock_token_wallet(stm, sc2, password=password) if not sc2.locked(): return True else: diff --git a/beem/discussions.py b/beem/discussions.py index 1a4f196e10508933b647179df7dcec045cd3372f..d9598c3ca462a3ef065b9466d14864b40c58656a 100644 --- a/beem/discussions.py +++ b/beem/discussions.py @@ -587,7 +587,7 @@ class Discussions_by_votes(list): if raw_data: super(Discussions_by_votes, self).__init__( [ - Comment(x, lazy=lazy, blockchain_instance=self.blockchain) + x for x in posts ] ) @@ -854,7 +854,7 @@ class Discussions_by_comments(list): if raw_data: super(Discussions_by_comments, self).__init__( [ - Comment(x, lazy=lazy, blockchain_instance=self.blockchain) + x for x in posts ] ) diff --git a/beemapi/graphenerpc.py b/beemapi/graphenerpc.py index 8035189bec05219a30dd8b45a6564d3559098bc7..48f1f56f4d8bbbe83b897732b8298a86d00d3a0d 100644 --- a/beemapi/graphenerpc.py +++ b/beemapi/graphenerpc.py @@ -335,7 +335,7 @@ class GrapheneRPC(object): chain_config = {"prefix": prefix, "chain_id": chain_id, "min_version": network_version, "chain_assets": chain_assets} if chain_id is None: - raise("Connecting to unknown network!") + raise RPCError("Connecting to unknown network!") highest_version_chain = None for k, v in list(self.known_chains.items()): if blockchain_name is not None and blockchain_name not in k and blockchain_name != "STEEMIT" and blockchain_name != "CHAIN": @@ -348,7 +348,7 @@ class GrapheneRPC(object): if highest_version_chain is None and chain_config is not None: return chain_config elif highest_version_chain is None: - raise("Connecting to unknown network!") + raise RPCError("Connecting to unknown network!") else: return highest_version_chain diff --git a/beemapi/noderpc.py b/beemapi/noderpc.py index a87cccf00117b56eaac3905d0cee4b082d867c14..f455f56b21839fc281b31a0b1ecf9ce14ad7f272 100644 --- a/beemapi/noderpc.py +++ b/beemapi/noderpc.py @@ -107,8 +107,6 @@ class NodeRPC(GrapheneRPC): msg = exceptions.decodeRPCErrorMsg(e).strip() if re.search("missing required active authority", msg): raise exceptions.MissingRequiredActiveAuthority - elif re.search("missing required active authority", msg): - raise exceptions.MissingRequiredActiveAuthority elif re.match("^no method with name.*", msg): raise exceptions.NoMethodWithName(msg) elif re.search("Could not find method", msg): diff --git a/beemgraphenebase/__init__.py b/beemgraphenebase/__init__.py index 22f84273fd46af929ec81336adcb48f694b608c2..5ba45f909bfc1a4d2552e38f646dbe29732282e1 100644 --- a/beemgraphenebase/__init__.py +++ b/beemgraphenebase/__init__.py @@ -10,9 +10,8 @@ from .version import version as __version__ __all__ = ['account', 'aes', 'base58', - 'bip32' + 'bip32', 'bip38', - 'transactions', 'types', 'ecdasig', 'chains',