Skip to content
Snippets Groups Projects
Commit 332b6906 authored by Holger's avatar Holger
Browse files

Fix unit test and typo

parent b0cf5d84
No related branches found
No related tags found
2 merge requests!5Taken current version of master branch in the https://github.com/holgern/beem,!4Original changes pushed to master at https://github.com/holgern/beem
......@@ -10,6 +10,7 @@ Changelog
* Wallet.store has now the Key Interface that handles key management
* Token handling has been removed from Wallet
* Token storage has been move from wallet to SteemConnect/HiveSigner
* handle virtual ops batch streaming fixed thanks to @crokkon
0.23.13
-------
......
......@@ -798,8 +798,10 @@ class BlockChainInstance(object):
"""Returns the default nodes"""
if "node" in self.config:
nodes = self.config["node"]
elif "nodes" in config:
elif "nodes" in self.config:
nodes = self.config["nodes"]
elif "node" in self.config.defaults:
nodes = self.config["node"]
elif "default_nodes" in self.config and bool(self.config["default_nodes"]):
nodes = self.config["default_nodes"]
else:
......
......@@ -29,36 +29,37 @@ from beemstorage import (
timeformat = "%Y%m%d-%H%M%S"
#: Default configuration
nodelist = NodeList()
blockchain = "hive"
if blockchain == "hive":
nodes = nodelist.get_hive_nodes(testnet=False)
elif blockchain == "steem":
nodes = nodelist.get_steem_nodes(testnet=False)
else:
nodes = []
SqliteConfigurationStore.setdefault("node", nodes)
SqliteConfigurationStore.setdefault("default_chain", blockchain)
SqliteConfigurationStore.setdefault("password_storage", "environment")
SqliteConfigurationStore.setdefault("rpcpassword", "")
SqliteConfigurationStore.setdefault("rpcuser", "")
SqliteConfigurationStore.setdefault("order-expiration", 7 * 24 * 60 * 60)
SqliteConfigurationStore.setdefault("client_id", "")
SqliteConfigurationStore.setdefault("sc2_client_id", None)
SqliteConfigurationStore.setdefault("hs_client_id", None)
SqliteConfigurationStore.setdefault("hot_sign_redirect_uri", None)
SqliteConfigurationStore.setdefault("sc2_api_url", "https://api.steemconnect.com/api/")
SqliteConfigurationStore.setdefault("oauth_base_url", "https://api.steemconnect.com/oauth2/")
SqliteConfigurationStore.setdefault("hs_api_url", "https://hivesigner.com/api/")
SqliteConfigurationStore.setdefault("hs_oauth_base_url", "https://hivesigner.com/oauth2/")
SqliteConfigurationStore.setdefault("default_canonical_url", "https://hive.blog")
SqliteConfigurationStore.setdefault("default_path", "48'/13'/0'/0'/0'")
def generate_config_store(config, blockchain="hive"):
#: Default configuration
nodelist = NodeList()
if blockchain == "hive":
nodes = nodelist.get_hive_nodes(testnet=False)
elif blockchain == "steem":
nodes = nodelist.get_steem_nodes(testnet=False)
else:
nodes = []
config.setdefault("node", nodes)
config.setdefault("default_chain", blockchain)
config.setdefault("password_storage", "environment")
config.setdefault("rpcpassword", "")
config.setdefault("rpcuser", "")
config.setdefault("order-expiration", 7 * 24 * 60 * 60)
config.setdefault("client_id", "")
config.setdefault("sc2_client_id", None)
config.setdefault("hs_client_id", None)
config.setdefault("hot_sign_redirect_uri", None)
config.setdefault("sc2_api_url", "https://api.steemconnect.com/api/")
config.setdefault("oauth_base_url", "https://api.steemconnect.com/oauth2/")
config.setdefault("hs_api_url", "https://hivesigner.com/api/")
config.setdefault("hs_oauth_base_url", "https://hivesigner.com/oauth2/")
config.setdefault("default_canonical_url", "https://hive.blog")
config.setdefault("default_path", "48'/13'/0'/0'/0'")
return config
def get_default_config_store(*args, **kwargs):
return SqliteConfigurationStore(*args, **kwargs)
return generate_config_store(SqliteConfigurationStore, blockchain="hive")(*args, **kwargs)
def get_default_key_store(config, *args, **kwargs):
......
......@@ -141,7 +141,7 @@ class Testcases(unittest.TestCase):
w = Witness(owner, steem_instance=bts)
keys = list(witness.keys())
json_witness = w.json()
exclude_list = ['votes', 'virtual_last_update', 'virtual_scheduled_time']
exclude_list = ['votes', 'virtual_last_update', 'virtual_scheduled_time', 'last_aslot', 'last_confirmed_block_num']
for k in keys:
if k not in exclude_list:
if isinstance(witness[k], dict) and isinstance(json_witness[k], list):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment