Skip to content

Commit 67d7d67

Browse files
committed
[test] Fix flake8 warnings in tests
Fix all flake8 warnings in tests that are about to be updated to remove addwitnessaddress
1 parent 920c090 commit 67d7d67

File tree

5 files changed

+82
-92
lines changed

5 files changed

+82
-92
lines changed

test/functional/feature_nulldummy.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212
[Consensus] Check that the new NULLDUMMY rules are not enforced on the 431st block.
1313
[Policy/Consensus] Check that the new NULLDUMMY rules are enforced on the 432nd block.
1414
"""
15+
import time
1516

1617
from test_framework.blocktools import create_coinbase, create_block, create_transaction, add_witness_commitment
1718
from test_framework.messages import CTransaction
1819
from test_framework.script import CScript
1920
from test_framework.test_framework import BitcoinTestFramework
2021
from test_framework.util import assert_equal, assert_raises_rpc_error, bytes_to_hex_str
2122

22-
import time
23-
2423
NULLDUMMY_ERROR = "non-mandatory-script-verify-flag (Dummy CHECKMULTISIG argument must be zero) (code 64)"
2524

2625
def trueDummy(tx):
@@ -53,11 +52,11 @@ def run_test(self):
5352
self.wit_address = self.nodes[0].addwitnessaddress(self.address)
5453
self.wit_ms_address = self.nodes[0].addmultisigaddress(1, [self.address], '', 'p2sh-segwit')['address']
5554

56-
self.coinbase_blocks = self.nodes[0].generate(2) # Block 2
55+
self.coinbase_blocks = self.nodes[0].generate(2) # Block 2
5756
coinbase_txid = []
5857
for i in self.coinbase_blocks:
5958
coinbase_txid.append(self.nodes[0].getblock(i)['tx'][0])
60-
self.nodes[0].generate(427) # Block 429
59+
self.nodes[0].generate(427) # Block 429
6160
self.lastblockhash = self.nodes[0].getbestblockhash()
6261
self.tip = int("0x" + self.lastblockhash, 0)
6362
self.lastblockheight = 429
@@ -82,7 +81,7 @@ def run_test(self):
8281

8382
self.log.info("Test 4: Non-NULLDUMMY base multisig transaction is invalid after activation")
8483
test4tx = create_transaction(self.nodes[0], test2tx.hash, self.address, amount=46)
85-
test6txs=[CTransaction(test4tx)]
84+
test6txs = [CTransaction(test4tx)]
8685
trueDummy(test4tx)
8786
assert_raises_rpc_error(-26, NULLDUMMY_ERROR, self.nodes[0].sendrawtransaction, bytes_to_hex_str(test4tx.serialize_with_witness()), True)
8887
self.block_submit(self.nodes[0], [test4tx])
@@ -99,8 +98,7 @@ def run_test(self):
9998
self.nodes[0].sendrawtransaction(bytes_to_hex_str(i.serialize_with_witness()), True)
10099
self.block_submit(self.nodes[0], test6txs, True, True)
101100

102-
103-
def block_submit(self, node, txs, witness = False, accept = False):
101+
def block_submit(self, node, txs, witness=False, accept=False):
104102
block = create_block(self.tip, create_coinbase(self.lastblockheight + 1), self.lastblocktime + 1)
105103
block.nVersion = 4
106104
for tx in txs:

0 commit comments

Comments
 (0)