Browse Source

new `daemon_state_timeout`, `test_suite_devnet_block_period` cfg vars

The MMGen Project 2 months ago
parent
commit
ab7a97842c
3 changed files with 11 additions and 2 deletions
  1. 4 0
      mmgen/cfg.py
  2. 1 1
      mmgen/daemon.py
  3. 6 1
      test/cmdtest_d/ethbump.py

+ 4 - 0
mmgen/cfg.py

@@ -173,6 +173,7 @@ class Config(Lockable):
 
 	# limits
 	http_timeout       = 0
+	daemon_state_timeout = 60
 	usr_randchars      = 30
 	fee_adjust         = 1.0
 	fee_estimate_confs = 3
@@ -250,6 +251,7 @@ class Config(Lockable):
 	test_suite               = False
 	test_suite_autosign_led_simulate = False
 	test_suite_autosign_threaded = False
+	test_suite_devnet_block_period = 0
 	test_suite_xmr_autosign  = False
 	test_suite_cfgtest       = False
 	test_suite_deterministic = False
@@ -331,6 +333,7 @@ class Config(Lockable):
 		'MMGEN_TEST_SUITE',
 		'MMGEN_TEST_SUITE_AUTOSIGN_LED_SIMULATE',
 		'MMGEN_TEST_SUITE_AUTOSIGN_THREADED',
+		'MMGEN_TEST_SUITE_DEVNET_BLOCK_PERIOD',
 		'MMGEN_TEST_SUITE_XMR_AUTOSIGN',
 		'MMGEN_TEST_SUITE_CFGTEST',
 		'MMGEN_TEST_SUITE_DETERMINISTIC',
@@ -342,6 +345,7 @@ class Config(Lockable):
 		'MMGEN_BLACKLIST_DAEMONS',
 		'MMGEN_BOGUS_SEND',
 		'MMGEN_BOGUS_UNSPENT_DATA',
+		'MMGEN_DAEMON_STATE_TIMEOUT',
 		'MMGEN_DEBUG',
 		'MMGEN_DEBUG_DAEMON',
 		'MMGEN_DEBUG_EVM',

+ 1 - 1
mmgen/daemon.py

@@ -235,7 +235,7 @@ class Daemon(Lockable):
 			return True
 
 	def wait_for_state(self, req_state):
-		for _ in range(300):
+		for _ in range(self.cfg.daemon_state_timeout * 5):
 			if self.state == req_state:
 				return True
 			time.sleep(0.2)

+ 6 - 1
test/cmdtest_d/ethbump.py

@@ -40,7 +40,10 @@ class CmdTestEthBumpMethods:
 
 	@property
 	def devnet_block_period(self):
-		return self.cfg.devnet_block_period or self.dfl_devnet_block_period[self.daemon.id]
+		return (
+			self.cfg.devnet_block_period
+			or self.cfg.test_suite_devnet_block_period
+			or self.dfl_devnet_block_period[self.daemon.id])
 
 	def _txcreate(self, args, acct):
 		self.get_file_with_ext('rawtx', delete_all=True)
@@ -278,6 +281,8 @@ class CmdTestEthBump(CmdTestEthBumpMethods, CmdTestEthSwapMethods, CmdTestSwapMe
 			'geth': [f'--dev.period={self.devnet_block_period}']
 		}[self.daemon.id]
 
+		imsg(f'devnet block period: {self.devnet_block_period}')
+
 		globals()[self.cross_group] = self.create_cross_runner(trunner)
 
 		self.swap_server = ThornodeSwapServer()