aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p-fullblocktest.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2017-08-29 08:53:34 +1200
committerMarcoFalke <falke.marco@gmail.com>2017-08-29 08:53:49 +1200
commit60dd9cc470584960431de425e2a9ffbed0e8034a (patch)
treed937bf4a8316a6d602e2fc5e1f5be48b4c77f0c4 /test/functional/p2p-fullblocktest.py
parentcee4fe1d53b2e1ff91ff48bc881cb41dfba01c52 (diff)
parent78214588d6b8b7199015113c9d0d8250d6150014 (diff)
Merge #10781: Python cleanups
78214588d Use for-loop instead of list comprehension (practicalswift) 823979436 Use the variable name _ for unused return values (practicalswift) 2e6080bbf Remove unused variables and/or function calls (practicalswift) 9b94054b7 Avoid reference to undefined name: stderr does not exist, sys.stderr does (practicalswift) 51cb6b822 Use print(...) instead of undefined printf(...) (practicalswift) 25cd520fc Use sys.exit(...) instead of exit(...): exit(...) should not be used in programs (practicalswift) Pull request description: Python cleanups: * Avoid reference to undefined name: `stderr` does not exist, `sys.stderr` does * Use `print(...)` instead of undefined `printf(...)` * Avoid redefinition of variable (`tx`) in list comprehension * Remove unused variables and/or function calls * Use `sys.exit(...)` instead of `exit(...)`: [`exit(...)` should not be used in programs](https://github.com/bitcoin/bitcoin/pull/10753#discussion_r125935027) Tree-SHA512: 1238dfbc1d20f7edadea5e5406a589f293065638f6234809f0d5b6ba746dffe3d276bc5884c7af388a6c798c61a8759faaccf57f381225644754c0f61914eb4b
Diffstat (limited to 'test/functional/p2p-fullblocktest.py')
-rwxr-xr-xtest/functional/p2p-fullblocktest.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/functional/p2p-fullblocktest.py b/test/functional/p2p-fullblocktest.py
index e7fe7372c8..92af0fefd0 100755
--- a/test/functional/p2p-fullblocktest.py
+++ b/test/functional/p2p-fullblocktest.py
@@ -397,7 +397,7 @@ class FullBlockTest(ComparisonTestFramework):
yield rejected(RejectResult(16, b'bad-cb-length'))
# Extend the b26 chain to make sure bitcoind isn't accepting b26
- b27 = block(27, spend=out[7])
+ block(27, spend=out[7])
yield rejected(False)
# Now try a too-large-coinbase script
@@ -409,7 +409,7 @@ class FullBlockTest(ComparisonTestFramework):
yield rejected(RejectResult(16, b'bad-cb-length'))
# Extend the b28 chain to make sure bitcoind isn't accepting b28
- b29 = block(29, spend=out[7])
+ block(29, spend=out[7])
yield rejected(False)
# b30 has a max-sized coinbase scriptSig.
@@ -581,7 +581,7 @@ class FullBlockTest(ComparisonTestFramework):
# same as b40, but one less sigop
tip(39)
- b41 = block(41, spend=None)
+ block(41, spend=None)
update_block(41, b40.vtx[1:-1])
b41_sigops_to_fill = b40_sigops_to_fill - 1
tx = CTransaction()
@@ -927,7 +927,7 @@ class FullBlockTest(ComparisonTestFramework):
# -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19)
#
tip(64)
- b65 = block(65)
+ block(65)
tx1 = create_and_sign_tx(out[19].tx, out[19].n, out[19].tx.vout[0].nValue)
tx2 = create_and_sign_tx(tx1, 0, 0)
update_block(65, [tx1, tx2])
@@ -939,7 +939,7 @@ class FullBlockTest(ComparisonTestFramework):
# -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19)
# \-> b66 (20)
tip(65)
- b66 = block(66)
+ block(66)
tx1 = create_and_sign_tx(out[20].tx, out[20].n, out[20].tx.vout[0].nValue)
tx2 = create_and_sign_tx(tx1, 0, 1)
update_block(66, [tx2, tx1])
@@ -952,7 +952,7 @@ class FullBlockTest(ComparisonTestFramework):
#
#
tip(65)
- b67 = block(67)
+ block(67)
tx1 = create_and_sign_tx(out[20].tx, out[20].n, out[20].tx.vout[0].nValue)
tx2 = create_and_sign_tx(tx1, 0, 1)
tx3 = create_and_sign_tx(tx1, 0, 2)
@@ -972,7 +972,7 @@ class FullBlockTest(ComparisonTestFramework):
# this succeeds
#
tip(65)
- b68 = block(68, additional_coinbase_value=10)
+ block(68, additional_coinbase_value=10)
tx = create_and_sign_tx(out[20].tx, out[20].n, out[20].tx.vout[0].nValue-9)
update_block(68, [tx])
yield rejected(RejectResult(16, b'bad-cb-amount'))
@@ -1175,7 +1175,7 @@ class FullBlockTest(ComparisonTestFramework):
#
# -> b81 (26) -> b82 (27) -> b83 (28)
#
- b83 = block(83)
+ block(83)
op_codes = [OP_IF, OP_INVALIDOPCODE, OP_ELSE, OP_TRUE, OP_ENDIF]
script = CScript(op_codes)
tx1 = create_and_sign_tx(out[28].tx, out[28].n, out[28].tx.vout[0].nValue, script)
@@ -1195,7 +1195,7 @@ class FullBlockTest(ComparisonTestFramework):
# \-> b85 (29) -> b86 (30) \-> b89a (32)
#
#
- b84 = block(84)
+ block(84)
tx1 = create_tx(out[29].tx, out[29].n, 0, CScript([OP_RETURN]))
tx1.vout.append(CTxOut(0, CScript([OP_TRUE])))
tx1.vout.append(CTxOut(0, CScript([OP_TRUE])))