mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
pytest: Do not edit the global copy of the bitcoind config
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
639713b547
commit
f078941a3d
@@ -10,7 +10,6 @@ import decimal
|
|||||||
import flask
|
import flask
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -390,8 +390,11 @@ class BitcoinD(TailableProc):
|
|||||||
|
|
||||||
class ElementsD(BitcoinD):
|
class ElementsD(BitcoinD):
|
||||||
def __init__(self, bitcoin_dir="/tmp/bitcoind-test", rpcport=None):
|
def __init__(self, bitcoin_dir="/tmp/bitcoind-test", rpcport=None):
|
||||||
del BITCOIND_CONFIG['regtest']
|
config = BITCOIND_CONFIG.copy()
|
||||||
BITCOIND_CONFIG['chain']='liquid-regtest'
|
if 'regtest' in config:
|
||||||
|
del config['regtest']
|
||||||
|
|
||||||
|
config['chain'] = 'liquid-regtest'
|
||||||
BitcoinD.__init__(self, bitcoin_dir, rpcport)
|
BitcoinD.__init__(self, bitcoin_dir, rpcport)
|
||||||
|
|
||||||
self.cmd_line = [
|
self.cmd_line = [
|
||||||
@@ -405,9 +408,9 @@ class ElementsD(BitcoinD):
|
|||||||
'-con_blocksubsidy=5000000000',
|
'-con_blocksubsidy=5000000000',
|
||||||
]
|
]
|
||||||
conf_file = os.path.join(bitcoin_dir, 'elements.conf')
|
conf_file = os.path.join(bitcoin_dir, 'elements.conf')
|
||||||
BITCOIND_CONFIG['rpcport'] = self.rpcport
|
config['rpcport'] = self.rpcport
|
||||||
BITCOIND_REGTEST = {'rpcport': self.rpcport}
|
BITCOIND_REGTEST = {'rpcport': self.rpcport}
|
||||||
write_config(conf_file, BITCOIND_CONFIG, BITCOIND_REGTEST, section_name='liquid-regtest')
|
write_config(conf_file, config, BITCOIND_REGTEST, section_name='liquid-regtest')
|
||||||
self.conf_file = conf_file
|
self.conf_file = conf_file
|
||||||
self.rpc = SimpleBitcoinProxy(btc_conf_file=self.conf_file)
|
self.rpc = SimpleBitcoinProxy(btc_conf_file=self.conf_file)
|
||||||
self.prefix = 'elementsd'
|
self.prefix = 'elementsd'
|
||||||
|
|||||||
Reference in New Issue
Block a user