Merge #15895: QA: Avoid re-reading config.ini unnecessarily

a014373d81 QA: Avoid re-reading config.ini unnecessarily (Luke Dashjr)

Pull request description:

  BitcoinTestFramework.main already loads and stores config.ini on the object itself; just access that instead of re-reading the file to check for features

ACKs for commit a01437:
  practicalswift:
    utACK a014373d81
  hebasto:
    utACK a014373d81

Tree-SHA512: 36e3dda36cf4fae243feb1655da2891d1b78c86319be9bd9809c20054fa0cb75749370b05aa9d589a4dcab6322d8cdf4e874c5175144ed23ba63b2ed338538ca
pull/764/head
MarcoFalke 6 years ago
commit f73a3c618b
No known key found for this signature in database
GPG Key ID: D2EA4850E7528B25

@ -556,21 +556,12 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
def is_cli_compiled(self):
"""Checks whether bitcoin-cli was compiled."""
config = configparser.ConfigParser()
config.read_file(open(self.options.configfile))
return config["components"].getboolean("ENABLE_CLI")
return self.config["components"].getboolean("ENABLE_CLI")
def is_wallet_compiled(self):
"""Checks whether the wallet module was compiled."""
config = configparser.ConfigParser()
config.read_file(open(self.options.configfile))
return config["components"].getboolean("ENABLE_WALLET")
return self.config["components"].getboolean("ENABLE_WALLET")
def is_zmq_compiled(self):
"""Checks whether the zmq module was compiled."""
config = configparser.ConfigParser()
config.read_file(open(self.options.configfile))
return config["components"].getboolean("ENABLE_ZMQ")
return self.config["components"].getboolean("ENABLE_ZMQ")

Loading…
Cancel
Save