mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-12 06:53:11 +02:00
test: Extend named pipe sqlite tool test to use rollback
This commit is contained in:
@@ -77,7 +77,7 @@ class UtxoToSqliteTest(BitcoinTestFramework):
|
||||
def set_test_params(self):
|
||||
self.num_nodes = 1
|
||||
# we want to create some UTXOs with non-standard output scripts
|
||||
self.extra_args = [['-acceptnonstdtxn=1']]
|
||||
self.extra_args = [['-acceptnonstdtxn=1', '-coinstatsindex=1']]
|
||||
|
||||
def skip_test_if_missing_module(self):
|
||||
self.skip_if_no_py_sqlite3()
|
||||
@@ -143,10 +143,12 @@ class UtxoToSqliteTest(BitcoinTestFramework):
|
||||
output_direct_filename = os.path.join(self.options.tmpdir, "utxos_direct.sqlite")
|
||||
p = subprocess.Popen([sys.executable, utxo_to_sqlite_path, fifo_filename, output_direct_filename],
|
||||
stderr=subprocess.STDOUT)
|
||||
node.dumptxoutset(fifo_filename, "latest")
|
||||
target_height = node.getblockcount() - 10
|
||||
node.dumptxoutset(fifo_filename, "rollback", {"rollback": target_height})
|
||||
p.wait(timeout=10)
|
||||
muhash_direct_sqlite = calculate_muhash_from_sqlite_utxos(output_direct_filename, "hex", "hex")
|
||||
assert_equal(muhash_sqlite, muhash_direct_sqlite)
|
||||
muhash_index = node.gettxoutsetinfo('muhash', target_height)['muhash']
|
||||
assert_equal(muhash_index, muhash_direct_sqlite)
|
||||
os.remove(fifo_filename)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user