Browse Source

support Litecoin Core v0.21.2

The MMGen Project 2 years ago
parent
commit
c8f4e0c050

+ 1 - 2
mmgen/base_proto/bitcoin/daemon.py

@@ -149,8 +149,7 @@ class bitcoin_cash_node_daemon(bitcoin_core_daemon):
 class litecoin_core_daemon(bitcoin_core_daemon):
 	# v0.21.2rc5 crashes when mining more than 431 blocks in regtest mode:
 	#   CreateNewBlock: TestBlockValidity failed: bad-txns-vin-empty, Transaction check failed
-	# daemon_data = _dd('Litecoin Core', 210200, '0.21.2')
-	daemon_data = _dd('Litecoin Core', 180100, '0.18.1')
+	daemon_data = _dd('Litecoin Core', 210200, '0.21.2')
 	exec_fn = 'litecoind'
 	cli_fn = 'litecoin-cli'
 	testnet_dir = 'testnet4'

+ 3 - 1
mmgen/base_proto/bitcoin/regtest.py

@@ -138,7 +138,9 @@ class MMGenRegtest(MMGenObject):
 			create_hdseed(self.proto),
 			wallet = 'miner' )
 
-		await self.generate(432,silent=True)
+		# Broken litecoind can only mine 431 blocks in regtest mode, so generate just enough
+		# blocks to fund the test suite
+		await self.generate(392,silent=True)
 
 		gmsg('Setup complete')
 

+ 4 - 4
test/test_py_d/ts_regtest.py

@@ -237,7 +237,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 		('bob_txhist1',              "viewing Bob's transaction history (sort=age)"),
 		('bob_txhist2',              "viewing Bob's transaction history (sort=blockheight reverse=1)"),
 		('bob_txhist3',              "viewing Bob's transaction history (sort=blockheight sinceblock=-7)"),
-		('bob_txhist4',              "viewing Bob's transaction history (sinceblock=439 detail=1)"),
+		('bob_txhist4',              "viewing Bob's transaction history (sinceblock=399 detail=1)"),
 		('bob_txhist_interactive',   "viewing Bob's transaction history (age_fmt=date_time interactive=true)"),
 
 		('alice_bal2',               "Alice's balance"),
@@ -622,13 +622,13 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 	def bob_txhist3(self):
 		return self.user_txhist('bob',
 			args = ['sort=blockheight','sinceblock=-7','age_fmt=block'],
-			expect = fr'Displaying transactions since block 439.*\s6\).*:C:2\s.*\s{rtBals[9]}\s.*:L:5.*\s7\)'
+			expect = fr'Displaying transactions since block 399.*\s6\).*:C:2\s.*\s{rtBals[9]}\s.*:L:5.*\s7\)'
 		)
 
 	def bob_txhist4(self):
 		return self.user_txhist('bob',
-			args = ['sort=blockheight','sinceblock=439','age_fmt=block','detail=1'],
-			expect = fr'Displaying transactions since block 439.*\s7\).*Block:.*446.*Value:.*{rtBals[10]}'
+			args = ['sort=blockheight','sinceblock=399','age_fmt=block','detail=1'],
+			expect = fr'Displaying transactions since block 399.*\s7\).*Block:.*406.*Value:.*{rtBals[10]}'
 		)
 
 	def bob_txhist_interactive(self):