mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-26 14:00:29 +01:00
scripted-diff: test: Remove brackets after assert
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/assert ?\((.+)\)(( )*)?(#.*)?$/assert \1\3\3\4/g' $(git grep -l --extended-regexp 'assert ?\(' test)
-END VERIFY SCRIPT-
This commit is contained in:
@@ -151,7 +151,7 @@ class PruneTest(BitcoinTestFramework):
|
||||
self.nodes[1].invalidateblock(curhash)
|
||||
curhash = self.nodes[1].getblockhash(invalidheight - 1)
|
||||
|
||||
assert(self.nodes[1].getblockcount() == invalidheight - 1)
|
||||
assert self.nodes[1].getblockcount() == invalidheight - 1
|
||||
self.log.info("New best height: %d" % self.nodes[1].getblockcount())
|
||||
|
||||
# Reboot node1 to clear those giant tx's from mempool
|
||||
@@ -219,17 +219,17 @@ class PruneTest(BitcoinTestFramework):
|
||||
blocks_to_mine = first_reorg_height + 1 - self.mainchainheight
|
||||
self.log.info("Rewind node 0 to prev main chain to mine longer chain to trigger redownload. Blocks needed: %d" % blocks_to_mine)
|
||||
self.nodes[0].invalidateblock(curchainhash)
|
||||
assert(self.nodes[0].getblockcount() == self.mainchainheight)
|
||||
assert(self.nodes[0].getbestblockhash() == self.mainchainhash2)
|
||||
assert self.nodes[0].getblockcount() == self.mainchainheight
|
||||
assert self.nodes[0].getbestblockhash() == self.mainchainhash2
|
||||
goalbesthash = self.nodes[0].generate(blocks_to_mine)[-1]
|
||||
goalbestheight = first_reorg_height + 1
|
||||
|
||||
self.log.info("Verify node 2 reorged back to the main chain, some blocks of which it had to redownload")
|
||||
# Wait for Node 2 to reorg to proper height
|
||||
wait_until(lambda: self.nodes[2].getblockcount() >= goalbestheight, timeout=900)
|
||||
assert(self.nodes[2].getbestblockhash() == goalbesthash)
|
||||
assert self.nodes[2].getbestblockhash() == goalbesthash
|
||||
# Verify we can now have the data for a block previously pruned
|
||||
assert(self.nodes[2].getblock(self.forkhash)["height"] == self.forkheight)
|
||||
assert self.nodes[2].getblock(self.forkhash)["height"] == self.forkheight
|
||||
|
||||
def manual_test(self, node_number, use_timestamp):
|
||||
# at this point, node has 995 blocks and has not yet run in prune mode
|
||||
|
||||
Reference in New Issue
Block a user