Skip to content

Commit

Permalink
test: ensure acceptstalefeeestimates is only supported on regtest c…
Browse files Browse the repository at this point in the history
…hain
  • Loading branch information
ismaelsadeeq committed Jul 25, 2023
1 parent c4979ef commit db7120f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions test/functional/feature_config_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,29 @@ def test_config_file_parser(self):
self.restart_node(0)
self.nodes[0].stop_node(expected_stderr=f'Warning: {inc_conf_file_path}:1 Section [testnot] is not recognized.{os.linesep}{inc_conf_file2_path}:1 Section [testnet] is not recognized.')

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

self.log.info("test acceptstalefeeestimates option is not supported on mainnet chain.")
with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
conf.write('acceptstalefeeestimates=1\n')
self.nodes[0].assert_start_raises_init_error(extra_args=[f"-conf={main_conf_file_path}", "-allowignoredconf"], expected_msg='Error: acceptstalefeeestimates is not supported on main chain.')

self.log.info("test acceptstalefeeestimates option is not supported on testnet chain.")
with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
conf.write('testnet=1\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='Error: acceptstalefeeestimates is not supported on test chain.')

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

self.log.info("test acceptstalefeeestimates option is not supported on signet chain.")
with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
conf.write('signet=1\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='Error: acceptstalefeeestimates is not supported on signet chain.')

with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
conf.write('') # clear
with open(inc_conf_file2_path, 'w', encoding='utf-8') as conf:
Expand Down
2 changes: 1 addition & 1 deletion test/functional/feature_fee_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def test_acceptstalefeeestimates_option(self):
os.utime(fee_dat, (last_modified_time, last_modified_time))

# Restart node with -acceptstalefeeestimates option to ensure fee_estimate.dat file is read
self.start_node(0,extra_args=["-acceptstalefeeestimates"])
self.start_node(0, extra_args=["-acceptstalefeeestimates"])
assert_equal(self.nodes[0].estimatesmartfee(1)["feerate"], fee_rate)


Expand Down

0 comments on commit db7120f

Please sign in to comment.