propagate config envars to workers

This commit is contained in:
Jude Nelson
2016-06-09 03:20:20 -04:00
parent f7864c9ec9
commit fb3c118b4e

View File

@@ -50,11 +50,14 @@ import pybitcoin.transactions.opcodes as opcodes
current_dir = os.path.abspath(os.path.dirname(__file__) + "/../..")
sys.path.insert(0, current_dir)
import blockstack
from blockstack.lib import *
import virtualchain
import bitcoin
log = virtualchain.get_logger("mock-bitcoind")
import blockstack_client
from blockstack_client.scripts import *
# global singleton
mock_bitcoind = None
@@ -171,6 +174,12 @@ class MockBitcoindConnection( object ):
break
def estimatefee( self, nblocks ):
"""
Mock estimatefee
"""
return 0.0005
def getinfo( self ):
"""
Mock getinfo
@@ -732,7 +741,13 @@ def make_worker_env( mock_bitcoind_mod, mock_bitcoind_save_path ):
worker_env = {
# use mock_bitcoind to connect to bitcoind (but it has to import it in order to use it)
"VIRTUALCHAIN_MOD_CONNECT_BLOCKCHAIN": mock_bitcoind_mod.__file__,
"MOCK_BITCOIND_SAVE_PATH": mock_bitcoind_save_path
"MOCK_BITCOIND_SAVE_PATH": mock_bitcoind_save_path,
}
if os.environ.get("BLOCKSTACK_SERVER_CONFIG", None) is not None:
worker_env["BLOCKSTACK_SERVER_CONFIG"] = os.environ["BLOCKSTACK_SERVER_CONFIG"]
if os.environ.get("BLOCKSTACK_CLIENT_CONFIG", None) is not None:
worker_env["BLOCKSTACK_CLIENT_CONFIG"] = os.environ["BLOCKSTACK_CLIENT_CONFIG"]
return worker_env