mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-04 19:08:51 +02:00
RPC: Add type parameter to dumptxoutset
This commit is contained in:
@@ -295,7 +295,7 @@ class AssumeutxoTest(BitcoinTestFramework):
|
||||
assert_equal(n1.getblockcount(), START_HEIGHT)
|
||||
|
||||
self.log.info(f"Creating a UTXO snapshot at height {SNAPSHOT_BASE_HEIGHT}")
|
||||
dump_output = n0.dumptxoutset('utxos.dat')
|
||||
dump_output = n0.dumptxoutset('utxos.dat', "latest")
|
||||
|
||||
self.log.info("Test loading snapshot when the node tip is on the same block as the snapshot")
|
||||
assert_equal(n0.getblockcount(), SNAPSHOT_BASE_HEIGHT)
|
||||
|
||||
@@ -27,7 +27,7 @@ class DumptxoutsetTest(BitcoinTestFramework):
|
||||
self.generate(node, COINBASE_MATURITY)
|
||||
|
||||
FILENAME = 'txoutset.dat'
|
||||
out = node.dumptxoutset(FILENAME)
|
||||
out = node.dumptxoutset(FILENAME, "latest")
|
||||
expected_path = node.datadir_path / self.chain / FILENAME
|
||||
|
||||
assert expected_path.is_file()
|
||||
@@ -51,10 +51,10 @@ class DumptxoutsetTest(BitcoinTestFramework):
|
||||
|
||||
# Specifying a path to an existing or invalid file will fail.
|
||||
assert_raises_rpc_error(
|
||||
-8, '{} already exists'.format(FILENAME), node.dumptxoutset, FILENAME)
|
||||
-8, '{} already exists'.format(FILENAME), node.dumptxoutset, FILENAME, "latest")
|
||||
invalid_path = node.datadir_path / "invalid" / "path"
|
||||
assert_raises_rpc_error(
|
||||
-8, "Couldn't open file {}.incomplete for writing".format(invalid_path), node.dumptxoutset, invalid_path)
|
||||
-8, "Couldn't open file {}.incomplete for writing".format(invalid_path), node.dumptxoutset, invalid_path, "latest")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -93,7 +93,7 @@ class AssumeutxoTest(BitcoinTestFramework):
|
||||
|
||||
self.log.info(
|
||||
f"Creating a UTXO snapshot at height {SNAPSHOT_BASE_HEIGHT}")
|
||||
dump_output = n0.dumptxoutset('utxos.dat')
|
||||
dump_output = n0.dumptxoutset('utxos.dat', "latest")
|
||||
|
||||
assert_equal(
|
||||
dump_output['txoutset_hash'],
|
||||
|
||||
Reference in New Issue
Block a user