From c8f4e0c0507219b5df3871cb8edb8a4c390007a5 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 26 May 2022 16:07:20 +0000 Subject: [PATCH] support Litecoin Core v0.21.2 --- mmgen/base_proto/bitcoin/daemon.py | 3 +-- mmgen/base_proto/bitcoin/regtest.py | 4 +++- test/test_py_d/ts_regtest.py | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/mmgen/base_proto/bitcoin/daemon.py b/mmgen/base_proto/bitcoin/daemon.py index c10548e4..f51aedc7 100755 --- a/mmgen/base_proto/bitcoin/daemon.py +++ b/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' diff --git a/mmgen/base_proto/bitcoin/regtest.py b/mmgen/base_proto/bitcoin/regtest.py index 2673a5d8..79258f66 100755 --- a/mmgen/base_proto/bitcoin/regtest.py +++ b/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') diff --git a/test/test_py_d/ts_regtest.py b/test/test_py_d/ts_regtest.py index ec835bbb..2b24d5b2 100755 --- a/test/test_py_d/ts_regtest.py +++ b/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):