mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
resolve travis errors
This commit is contained in:
parent
78bd1ecd96
commit
750304b575
@ -245,6 +245,7 @@ def autoconfigure(filename=None, config=None, force=False):
|
|||||||
|
|
||||||
set_config(newconfig) # sets bigchaindb.config
|
set_config(newconfig) # sets bigchaindb.config
|
||||||
|
|
||||||
|
|
||||||
@lru_cache()
|
@lru_cache()
|
||||||
def load_consensus_plugin(name=None):
|
def load_consensus_plugin(name=None):
|
||||||
"""Find and load the chosen consensus plugin.
|
"""Find and load the chosen consensus plugin.
|
||||||
@ -257,7 +258,7 @@ def load_consensus_plugin(name=None):
|
|||||||
an uninstantiated subclass of ``bigchaindb.consensus.AbstractConsensusRules``
|
an uninstantiated subclass of ``bigchaindb.consensus.AbstractConsensusRules``
|
||||||
"""
|
"""
|
||||||
if not name:
|
if not name:
|
||||||
return BaseConsensusRules;
|
return BaseConsensusRules
|
||||||
|
|
||||||
# TODO: This will return the first plugin with group `bigchaindb.consensus`
|
# TODO: This will return the first plugin with group `bigchaindb.consensus`
|
||||||
# and name `name` in the active WorkingSet.
|
# and name `name` in the active WorkingSet.
|
||||||
|
@ -32,17 +32,17 @@ class Vote:
|
|||||||
# Since cannot share a connection to RethinkDB using multiprocessing,
|
# Since cannot share a connection to RethinkDB using multiprocessing,
|
||||||
# we need to create a temporary instance of BigchainDB that we use
|
# we need to create a temporary instance of BigchainDB that we use
|
||||||
# only to query RethinkDB
|
# only to query RethinkDB
|
||||||
#self.consensus = BaseConsensusRules
|
|
||||||
|
|
||||||
consensusPlugin = bigchaindb.config.get('consensus_plugin')
|
consensusPlugin = bigchaindb.config.get('consensus_plugin')
|
||||||
|
|
||||||
if consensusPlugin:
|
if consensusPlugin:
|
||||||
self.consensus = config_utils.load_consensus_plugin(consensusPlugin)
|
self.consensus = config_utils.load_consensus_plugin(consensusPlugin)
|
||||||
else:
|
else:
|
||||||
self.consensus = BaseConsensusRules
|
self.consensus = BaseConsensusRules
|
||||||
|
|
||||||
# This is the Bigchain instance that will be "shared" (aka: copied)
|
# This is the Bigchain instance that will be "shared" (aka: copied)
|
||||||
# by all the subprocesses
|
# by all the subprocesses
|
||||||
|
|
||||||
self.bigchain = Bigchain()
|
self.bigchain = Bigchain()
|
||||||
self.last_voted_id = Bigchain().get_last_voted_block().id
|
self.last_voted_id = Bigchain().get_last_voted_block().id
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ def test_bigchain_instance_raises_when_not_configured(monkeypatch):
|
|||||||
with pytest.raises(exceptions.KeypairNotFoundException):
|
with pytest.raises(exceptions.KeypairNotFoundException):
|
||||||
bigchaindb.Bigchain()
|
bigchaindb.Bigchain()
|
||||||
|
|
||||||
|
|
||||||
def test_load_consensus_plugin_loads_default_rules_without_name():
|
def test_load_consensus_plugin_loads_default_rules_without_name():
|
||||||
from bigchaindb import config_utils
|
from bigchaindb import config_utils
|
||||||
from bigchaindb.consensus import BaseConsensusRules
|
from bigchaindb.consensus import BaseConsensusRules
|
||||||
@ -68,6 +69,7 @@ def test_load_consensus_plugin_raises_with_invalid_subclass(monkeypatch):
|
|||||||
# "miss" the cache using a name that has not been used previously
|
# "miss" the cache using a name that has not been used previously
|
||||||
config_utils.load_consensus_plugin(str(time.time()))
|
config_utils.load_consensus_plugin(str(time.time()))
|
||||||
|
|
||||||
|
|
||||||
def test_map_leafs_iterator():
|
def test_map_leafs_iterator():
|
||||||
from bigchaindb import config_utils
|
from bigchaindb import config_utils
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user