Skip to content

Commit

Permalink
Fix some small code issues
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed Mar 20, 2021
1 parent f3896d1 commit 880cecd
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand Down
6 changes: 1 addition & 5 deletions beem/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,11 +1354,7 @@ def get_account_bandwidth(self, bandwidth_type=1, account=None):
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
Expand Down
2 changes: 1 addition & 1 deletion beem/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions beem/discussions.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def __init__(self, discussion_query, lazy=False, use_appbase=False, raw_data=Fal
if raw_data:
super(Discussions_by_votes, self).__init__(
[
Comment(x, lazy=lazy, blockchain_instance=self.blockchain)
x
for x in posts
]
)
Expand Down Expand Up @@ -854,7 +854,7 @@ def __init__(self, discussion_query, lazy=False, use_appbase=False, raw_data=Fal
if raw_data:
super(Discussions_by_comments, self).__init__(
[
Comment(x, lazy=lazy, blockchain_instance=self.blockchain)
x
for x in posts
]
)
Expand Down
4 changes: 2 additions & 2 deletions beemapi/graphenerpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def get_network(self, props=None):
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":
Expand All @@ -348,7 +348,7 @@ def get_network(self, props=None):
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

Expand Down
2 changes: 0 additions & 2 deletions beemapi/noderpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ def _check_error_message(self, e, cnt):
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):
Expand Down
3 changes: 1 addition & 2 deletions beemgraphenebase/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
__all__ = ['account',
'aes',
'base58',
'bip32'
'bip32',
'bip38',
'transactions',
'types',
'ecdasig',
'chains',
Expand Down

0 comments on commit 880cecd

Please sign in to comment.