Browse Source

Remove redundant semicolons in Python code

pull/1/head
practicalswift 6 years ago
parent
commit
5cdf10611f
  1. 4
      contrib/devtools/clang-format-diff.py
  2. 2
      contrib/devtools/optimize-pngs.py
  3. 2
      contrib/zmq/zmq_sub.py
  4. 2
      qa/rpc-tests/fundrawtransaction.py
  5. 14
      qa/rpc-tests/importmulti.py
  6. 4
      qa/rpc-tests/p2p-feefilter.py
  7. 2
      qa/rpc-tests/p2p-segwit.py
  8. 2
      qa/rpc-tests/segwit.py

4
contrib/devtools/clang-format-diff.py

@ -128,7 +128,7 @@ def main(): @@ -128,7 +128,7 @@ def main():
line_count = int(match.group(3))
if line_count == 0:
continue
end_line = start_line + line_count - 1;
end_line = start_line + line_count - 1
lines_by_file.setdefault(filename, []).extend(
['-lines', str(start_line) + ':' + str(end_line)])
@ -147,7 +147,7 @@ def main(): @@ -147,7 +147,7 @@ def main():
stderr=None, stdin=subprocess.PIPE)
stdout, stderr = p.communicate()
if p.returncode != 0:
sys.exit(p.returncode);
sys.exit(p.returncode)
if not args.i:
with open(filename) as f:

2
contrib/devtools/optimize-pngs.py

@ -39,7 +39,7 @@ for folder in folders: @@ -39,7 +39,7 @@ for folder in folders:
if extension.lower() == '.png':
print("optimizing "+file+"..."),
file_path = os.path.join(absFolder, file)
fileMetaMap = {'file' : file, 'osize': os.path.getsize(file_path), 'sha256Old' : file_hash(file_path)};
fileMetaMap = {'file' : file, 'osize': os.path.getsize(file_path), 'sha256Old' : file_hash(file_path)}
fileMetaMap['contentHashPre'] = content_hash(file_path)
pngCrushOutput = ""

2
contrib/zmq/zmq_sub.py

@ -22,7 +22,7 @@ try: @@ -22,7 +22,7 @@ try:
msg = zmqSubSocket.recv_multipart()
topic = str(msg[0])
body = msg[1]
sequence = "Unknown";
sequence = "Unknown"
if len(msg[-1]) == 4:
msgSequence = struct.unpack('<I', msg[-1])[-1]
sequence = str(msgSequence)

2
qa/rpc-tests/fundrawtransaction.py

@ -226,7 +226,7 @@ class RawTransactionsTest(BitcoinTestFramework): @@ -226,7 +226,7 @@ class RawTransactionsTest(BitcoinTestFramework):
assert(False)
rawtxfund = self.nodes[2].fundrawtransaction(rawtx, {'changeAddress': change, 'changePosition': 0})
dec_tx = self.nodes[2].decoderawtransaction(rawtxfund['hex'])
out = dec_tx['vout'][0];
out = dec_tx['vout'][0]
assert_equal(change, out['scriptPubKey']['addresses'][0])

14
qa/rpc-tests/importmulti.py

@ -108,7 +108,7 @@ class ImportMultiTest (BitcoinTestFramework): @@ -108,7 +108,7 @@ class ImportMultiTest (BitcoinTestFramework):
"scriptPubKey": address['scriptPubKey'],
"pubkeys": [ address['pubkey'] ],
"internal": True
}];
}]
result = self.nodes[1].importmulti(request)
assert_equal(result[0]['success'], True)
address_assert = self.nodes[1].validateaddress(address['address'])
@ -121,7 +121,7 @@ class ImportMultiTest (BitcoinTestFramework): @@ -121,7 +121,7 @@ class ImportMultiTest (BitcoinTestFramework):
request = [{
"scriptPubKey": address['scriptPubKey'],
"pubkeys": [ address['pubkey'] ]
}];
}]
result = self.nodes[1].importmulti(request)
assert_equal(result[0]['success'], False)
assert_equal(result[0]['error']['code'], -8)
@ -197,7 +197,7 @@ class ImportMultiTest (BitcoinTestFramework): @@ -197,7 +197,7 @@ class ImportMultiTest (BitcoinTestFramework):
self.nodes[1].generate(100)
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00)
self.nodes[1].generate(1)
transaction = self.nodes[1].gettransaction(transactionid);
transaction = self.nodes[1].gettransaction(transactionid)
print("Should import a p2sh")
result = self.nodes[1].importmulti([{
@ -222,7 +222,7 @@ class ImportMultiTest (BitcoinTestFramework): @@ -222,7 +222,7 @@ class ImportMultiTest (BitcoinTestFramework):
self.nodes[1].generate(100)
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00)
self.nodes[1].generate(1)
transaction = self.nodes[1].gettransaction(transactionid);
transaction = self.nodes[1].gettransaction(transactionid)
print("Should import a p2sh with respective redeem script")
result = self.nodes[1].importmulti([{
@ -246,7 +246,7 @@ class ImportMultiTest (BitcoinTestFramework): @@ -246,7 +246,7 @@ class ImportMultiTest (BitcoinTestFramework):
self.nodes[1].generate(100)
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00)
self.nodes[1].generate(1)
transaction = self.nodes[1].gettransaction(transactionid);
transaction = self.nodes[1].gettransaction(transactionid)
print("Should import a p2sh with respective redeem script and private keys")
result = self.nodes[1].importmulti([{
@ -270,7 +270,7 @@ class ImportMultiTest (BitcoinTestFramework): @@ -270,7 +270,7 @@ class ImportMultiTest (BitcoinTestFramework):
self.nodes[1].generate(100)
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00)
self.nodes[1].generate(1)
transaction = self.nodes[1].gettransaction(transactionid);
transaction = self.nodes[1].gettransaction(transactionid)
print("Should import a p2sh with respective redeem script and private keys")
result = self.nodes[1].importmulti([{
@ -312,7 +312,7 @@ class ImportMultiTest (BitcoinTestFramework): @@ -312,7 +312,7 @@ class ImportMultiTest (BitcoinTestFramework):
"scriptPubKey": address['scriptPubKey'],
"pubkeys": [ address2['pubkey'] ],
"internal": True
}];
}]
result = self.nodes[1].importmulti(request)
assert_equal(result[0]['success'], False)
assert_equal(result[0]['error']['code'], -5)

4
qa/rpc-tests/p2p-feefilter.py

@ -21,9 +21,9 @@ def allInvsMatch(invsExpected, testnode): @@ -21,9 +21,9 @@ def allInvsMatch(invsExpected, testnode):
for x in range(60):
with mininode_lock:
if (sorted(invsExpected) == sorted(testnode.txinvs)):
return True;
return True
time.sleep(1)
return False;
return False
# TestNode: bare-bones "peer". Used to track which invs are received from a node
# and to send the node feefilter messages.

2
qa/rpc-tests/p2p-segwit.py

@ -1662,7 +1662,7 @@ class SegWitTest(BitcoinTestFramework): @@ -1662,7 +1662,7 @@ class SegWitTest(BitcoinTestFramework):
# too many sigops (contributing to legacy sigop count).
checksig_count = (extra_sigops_available // 4) + 1
scriptPubKey_checksigs = CScript([OP_CHECKSIG]*checksig_count)
tx2.vout.append(CTxOut(0, scriptPubKey_checksigs));
tx2.vout.append(CTxOut(0, scriptPubKey_checksigs))
tx2.vin.pop()
tx2.wit.vtxinwit.pop()
tx2.vout[0].nValue -= tx.vout[-2].nValue

2
qa/rpc-tests/segwit.py

@ -39,7 +39,7 @@ def addlength(script): @@ -39,7 +39,7 @@ def addlength(script):
return scriptlen + script
def create_witnessprogram(version, node, utxo, pubkey, encode_p2sh, amount):
pkscript = witness_script(version, pubkey);
pkscript = witness_script(version, pubkey)
if (encode_p2sh):
p2sh_hash = bytes_to_hex_str(ripemd160(sha256(hex_str_to_bytes(pkscript))))
pkscript = "a914"+p2sh_hash+"87"

Loading…
Cancel
Save