mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
scripted-diff: Use generate* from TestFramework
-BEGIN VERIFY SCRIPT- sed --regexp-extended -i \ 's/((self\.)?(nodes\[[^]]+\]|[a-z_]*(wallet|node)[0-9a-z_]*))\.(generate(|toaddress|block|todescriptor)(\(|, ))/self.\5\1, /g' \ $(git grep -l generate ./test | grep -v 'test_framework/' | grep -v 'feature_rbf') -END VERIFY SCRIPT-
This commit is contained in:
@@ -76,7 +76,7 @@ class NotificationsTest(BitcoinTestFramework):
|
||||
|
||||
self.log.info("test -blocknotify")
|
||||
block_count = 10
|
||||
blocks = self.nodes[1].generatetoaddress(block_count, self.nodes[1].getnewaddress() if self.is_wallet_compiled() else ADDRESS_BCRT1_UNSPENDABLE)
|
||||
blocks = self.generatetoaddress(self.nodes[1], block_count, self.nodes[1].getnewaddress() if self.is_wallet_compiled() else ADDRESS_BCRT1_UNSPENDABLE)
|
||||
|
||||
# wait at most 10 seconds for expected number of files before reading the content
|
||||
self.wait_until(lambda: len(os.listdir(self.blocknotify_dir)) == block_count, timeout=10)
|
||||
@@ -110,7 +110,7 @@ class NotificationsTest(BitcoinTestFramework):
|
||||
# triggered by node 1
|
||||
self.log.info("test -walletnotify with conflicting transactions")
|
||||
self.nodes[0].rescanblockchain()
|
||||
self.nodes[0].generatetoaddress(100, ADDRESS_BCRT1_UNSPENDABLE)
|
||||
self.generatetoaddress(self.nodes[0], 100, ADDRESS_BCRT1_UNSPENDABLE)
|
||||
self.sync_blocks()
|
||||
|
||||
# Generate transaction on node 0, sync mempools, and check for
|
||||
@@ -131,7 +131,7 @@ class NotificationsTest(BitcoinTestFramework):
|
||||
|
||||
# Add bump1 transaction to new block, checking for a notification
|
||||
# and the correct number of confirmations.
|
||||
blockhash1 = self.nodes[0].generatetoaddress(1, ADDRESS_BCRT1_UNSPENDABLE)[0]
|
||||
blockhash1 = self.generatetoaddress(self.nodes[0], 1, ADDRESS_BCRT1_UNSPENDABLE)[0]
|
||||
blockheight1 = self.nodes[0].getblockcount()
|
||||
self.sync_blocks()
|
||||
self.expect_wallet_notify([(bump1, blockheight1, blockhash1)])
|
||||
@@ -148,7 +148,7 @@ class NotificationsTest(BitcoinTestFramework):
|
||||
# about newly confirmed bump2 and newly conflicted tx2.
|
||||
self.disconnect_nodes(0, 1)
|
||||
bump2 = self.nodes[0].bumpfee(tx2)["txid"]
|
||||
blockhash2 = self.nodes[0].generatetoaddress(1, ADDRESS_BCRT1_UNSPENDABLE)[0]
|
||||
blockhash2 = self.generatetoaddress(self.nodes[0], 1, ADDRESS_BCRT1_UNSPENDABLE)[0]
|
||||
blockheight2 = self.nodes[0].getblockcount()
|
||||
assert_equal(self.nodes[0].gettransaction(bump2)["confirmations"], 1)
|
||||
assert_equal(tx2 in self.nodes[1].getrawmempool(), True)
|
||||
|
Reference in New Issue
Block a user