Skip to content

Commit

Permalink
test: ensure acceptstalefeeestimates is supported only on regtest c…
Browse files Browse the repository at this point in the history
…hain
  • Loading branch information
ismaelsadeeq committed Aug 1, 2023
1 parent 0d90d07 commit ef19d52
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/functional/feature_config_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,18 @@ def test_ignored_default_conf(self):
f'is being used instead.') + r"[\s\S]*", env=env, match=ErrorMatch.FULL_REGEX)
node.args = node_args

def test_acceptstalefeeestimates_arg_support(self):
self.log.info(f"Test -acceptstalefeeestimates option is not supported on non-regtest chains")
inc_conf_file_path = os.path.join(self.nodes[0].datadir, 'include.conf')
for chain in ["main", "test", "signet"]:
with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
conf.write(f'chain={chain}\n')
conf.write('acceptstalefeeestimates=1\n')
self.nodes[0].assert_start_raises_init_error(extra_args=[f"-conf={inc_conf_file_path}", "-allowignoredconf"], expected_msg=f'Error: acceptstalefeeestimates is not supported on {chain} chain.')

with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
conf.write('') # clear

def run_test(self):
self.test_log_buffer()
self.test_args_log()
Expand All @@ -383,6 +395,7 @@ def run_test(self):
self.test_invalid_command_line_options()
self.test_ignored_conf()
self.test_ignored_default_conf()
self.test_acceptstalefeeestimates_arg_support()

# Remove the -datadir argument so it doesn't override the config file
self.nodes[0].args = [arg for arg in self.nodes[0].args if not arg.startswith("-datadir")]
Expand Down

0 comments on commit ef19d52

Please sign in to comment.