mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
scripted-diff: Remove redundant sync_all and sync_blocks
The sync calls are redundant after a call to generate, because generate already syncs itself. -BEGIN VERIFY SCRIPT- perl -0777 -pi -e 's/(generate[^\n]*\)[^\n]*)(\n|\s)+self.sync_(all|blocks)\([^\)]*\)\n/\1\n/g' $(git grep -l generate ./test) -END VERIFY SCRIPT-
This commit is contained in:
@@ -81,9 +81,7 @@ class RESTTest (BitcoinTestFramework):
|
||||
not_related_address = "2MxqoHEdNQTyYeX1mHcbrrpzgojbosTpCvJ"
|
||||
|
||||
self.generate(self.nodes[0], 1)
|
||||
self.sync_all()
|
||||
self.generatetoaddress(self.nodes[1], 100, not_related_address)
|
||||
self.sync_all()
|
||||
|
||||
assert_equal(self.nodes[0].getbalance(), 50)
|
||||
|
||||
@@ -108,7 +106,6 @@ class RESTTest (BitcoinTestFramework):
|
||||
self.log.info("Query an unspent TXO using the /getutxos URI")
|
||||
|
||||
self.generatetoaddress(self.nodes[1], 1, not_related_address)
|
||||
self.sync_all()
|
||||
bb_hash = self.nodes[0].getbestblockhash()
|
||||
|
||||
assert_equal(self.nodes[1].getbalance(), Decimal("0.1"))
|
||||
@@ -183,7 +180,6 @@ class RESTTest (BitcoinTestFramework):
|
||||
assert_equal(len(json_obj['utxos']), 0)
|
||||
|
||||
self.generate(self.nodes[0], 1)
|
||||
self.sync_all()
|
||||
|
||||
json_obj = self.test_rest_request(f"/getutxos/{spending[0]}-{spending[1]}")
|
||||
assert_equal(len(json_obj['utxos']), 1)
|
||||
@@ -204,7 +200,6 @@ class RESTTest (BitcoinTestFramework):
|
||||
self.test_rest_request(f"/getutxos/checkmempool/{long_uri}", http_method='POST', status=200)
|
||||
|
||||
self.generate(self.nodes[0], 1) # generate block to not affect upcoming tests
|
||||
self.sync_all()
|
||||
|
||||
self.log.info("Test the /block, /blockhashbyheight and /headers URIs")
|
||||
bb_hash = self.nodes[0].getbestblockhash()
|
||||
@@ -275,7 +270,6 @@ class RESTTest (BitcoinTestFramework):
|
||||
|
||||
# See if we can get 5 headers in one response
|
||||
self.generate(self.nodes[1], 5)
|
||||
self.sync_all()
|
||||
json_obj = self.test_rest_request(f"/headers/5/{bb_hash}")
|
||||
assert_equal(len(json_obj), 5) # now we should have 5 header objects
|
||||
|
||||
@@ -310,7 +304,6 @@ class RESTTest (BitcoinTestFramework):
|
||||
|
||||
# Now mine the transactions
|
||||
newblockhash = self.generate(self.nodes[1], 1)
|
||||
self.sync_all()
|
||||
|
||||
# Check if the 3 tx show up in the new block
|
||||
json_obj = self.test_rest_request(f"/block/{newblockhash[0]}")
|
||||
|
Reference in New Issue
Block a user