aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_minchainwork.py
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-06-11 14:43:19 +0800
committerfanquake <fanquake@gmail.com>2021-08-18 12:39:19 +0800
commit1a546e6f6ca95772f0d7dbc2792477becbb8ea63 (patch)
treee512a87760949bf8cc775fc65d23e1f06477ba76 /test/functional/feature_minchainwork.py
parent6679eceacc915a8ea7cd7063f103ffc5eb9da884 (diff)
test: use f-strings in feature_minchainwork.py
Diffstat (limited to 'test/functional/feature_minchainwork.py')
-rwxr-xr-xtest/functional/feature_minchainwork.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/functional/feature_minchainwork.py b/test/functional/feature_minchainwork.py
index 803feb509a..3950690cf0 100755
--- a/test/functional/feature_minchainwork.py
+++ b/test/functional/feature_minchainwork.py
@@ -45,16 +45,16 @@ class MinimumChainWorkTest(BitcoinTestFramework):
# Start building a chain on node0. node2 shouldn't be able to sync until node1's
# minchainwork is exceeded
starting_chain_work = REGTEST_WORK_PER_BLOCK # Genesis block's work
- self.log.info("Testing relay across node %d (minChainWork = %d)", 1, self.node_min_work[1])
+ self.log.info(f"Testing relay across node 1 (minChainWork = {self.node_min_work[1]})")
starting_blockcount = self.nodes[2].getblockcount()
num_blocks_to_generate = int((self.node_min_work[1] - starting_chain_work) / REGTEST_WORK_PER_BLOCK)
- self.log.info("Generating %d blocks on node0", num_blocks_to_generate)
+ self.log.info(f"Generating {num_blocks_to_generate} blocks on node0")
hashes = self.nodes[0].generatetoaddress(num_blocks_to_generate,
self.nodes[0].get_deterministic_priv_key().address)
- self.log.info("Node0 current chain work: %s", self.nodes[0].getblockheader(hashes[-1])['chainwork'])
+ self.log.info(f"Node0 current chain work: {self.nodes[0].getblockheader(hashes[-1])['chainwork']}")
# Sleep a few seconds and verify that node2 didn't get any new blocks
# or headers. We sleep, rather than sync_blocks(node0, node1) because
@@ -63,7 +63,7 @@ class MinimumChainWorkTest(BitcoinTestFramework):
time.sleep(3)
self.log.info("Verifying node 2 has no more blocks than before")
- self.log.info("Blockcounts: %s", [n.getblockcount() for n in self.nodes])
+ self.log.info(f"Blockcounts: {[n.getblockcount() for n in self.nodes]}")
# Node2 shouldn't have any new headers yet, because node1 should not
# have relayed anything.
assert_equal(len(self.nodes[2].getchaintips()), 1)
@@ -84,7 +84,7 @@ class MinimumChainWorkTest(BitcoinTestFramework):
# continue the test.
self.sync_all()
- self.log.info("Blockcounts: %s", [n.getblockcount() for n in self.nodes])
+ self.log.info(f"Blockcounts: {[n.getblockcount() for n in self.nodes]}")
if __name__ == '__main__':
MinimumChainWorkTest().main()