mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
test: refactor: introduce replace_in_config helper
This commit is contained in:
@@ -25,11 +25,7 @@ class WalletCrossChain(BitcoinTestFramework):
|
||||
# Switch node 1 to testnet before starting it.
|
||||
self.nodes[1].chain = 'testnet3'
|
||||
self.nodes[1].extra_args = ['-maxconnections=0', '-prune=550'] # disable testnet sync
|
||||
with open(self.nodes[1].bitcoinconf, 'r', encoding='utf8') as conf:
|
||||
conf_data = conf.read()
|
||||
with open (self.nodes[1].bitcoinconf, 'w', encoding='utf8') as conf:
|
||||
conf.write(conf_data.replace('regtest=', 'testnet=').replace('[regtest]', '[test]'))
|
||||
|
||||
self.nodes[1].replace_in_config([('regtest=', 'testnet='), ('[regtest]', '[test]')])
|
||||
self.start_nodes()
|
||||
|
||||
def run_test(self):
|
||||
|
||||
Reference in New Issue
Block a user