Skip to content

Commit

Permalink
Only fixed misplaced semicolons in Python tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JackPiri committed Jun 21, 2023
1 parent bea84bd commit 83b935e
Show file tree
Hide file tree
Showing 23 changed files with 74 additions and 74 deletions.
4 changes: 2 additions & 2 deletions qa/rpc-tests/blockdelay.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def run_test(self):
self.mark_logs("Joining network")
# raw_input("press enter to join the netorks..")
self.join_network()
self.sync_longest_fork(1, 10);
self.sync_longest_fork(1, 10)

print("\nNetwork joined")

Expand Down Expand Up @@ -303,7 +303,7 @@ def run_test(self):
self.nodes[3].generate(64)
print("Malicious blocks generated")

self.sync_longest_fork(1, 10);
self.sync_longest_fork(1, 10)

for i in range(0, 4):
print("Node%d ---" % i)
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/checkblockatheight.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def run_test(self):

# we will perform on attack aimed at reverting from this block (latest generated) upward
h_attacked = h_current
hash_attacked = blocks[-1];
hash_attacked = blocks[-1]
assert hash_attacked == blocks[h_attacked]
hash_attacked_swapped = swap_bytes(hash_attacked)
hex_tmp = "%04x" % h_attacked
Expand Down
46 changes: 23 additions & 23 deletions qa/rpc-tests/fundrawtransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def run_test(self):
self.sync_all()
self.nodes[0].generate(101)
self.sync_all()
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),1.5);
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),1.0);
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),5.0);
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),1.5)
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),1.0)
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),5.0)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
Expand Down Expand Up @@ -111,7 +111,7 @@ def run_test(self):
for aUtx in listunspent:
if aUtx['amount'] == 5.0:
utx = aUtx
break;
break

assert_equal(utx!=False, True)

Expand Down Expand Up @@ -140,7 +140,7 @@ def run_test(self):
for aUtx in listunspent:
if aUtx['amount'] == 5.0:
utx = aUtx
break;
break

assert_equal(utx!=False, True)

Expand Down Expand Up @@ -170,7 +170,7 @@ def run_test(self):
for aUtx in listunspent:
if aUtx['amount'] == 1.0:
utx = aUtx
break;
break

assert_equal(utx!=False, True)

Expand Down Expand Up @@ -295,7 +295,7 @@ def run_test(self):
except JSONRPCException as e:
errorString = e.error['message']

assert_equal("Insufficient" in errorString, True);
assert_equal("Insufficient" in errorString, True)



Expand All @@ -307,11 +307,11 @@ def run_test(self):
fundedTx = self.nodes[0].fundrawtransaction(rawTx)

#create same transaction over sendtoaddress
txId = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 1.1);
txId = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 1.1)
signedFee = self.nodes[0].getrawmempool(True)[txId]['fee']

#compare fee
feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee);
feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee)
assert(feeDelta >= 0 and feeDelta <= feeTolerance)
############################################################

Expand All @@ -322,11 +322,11 @@ def run_test(self):
rawTx = self.nodes[0].createrawtransaction(inputs, outputs)
fundedTx = self.nodes[0].fundrawtransaction(rawTx)
#create same transaction over sendtoaddress
txId = self.nodes[0].sendmany("", outputs);
txId = self.nodes[0].sendmany("", outputs)
signedFee = self.nodes[0].getrawmempool(True)[txId]['fee']

#compare fee
feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee);
feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee)
assert(feeDelta >= 0 and feeDelta <= feeTolerance)
############################################################

Expand All @@ -349,11 +349,11 @@ def run_test(self):
fundedTx = self.nodes[0].fundrawtransaction(rawTx)

#create same transaction over sendtoaddress
txId = self.nodes[0].sendtoaddress(mSigObj, 1.1);
txId = self.nodes[0].sendtoaddress(mSigObj, 1.1)
signedFee = self.nodes[0].getrawmempool(True)[txId]['fee']

#compare fee
feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee);
feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee)
assert(feeDelta >= 0 and feeDelta <= feeTolerance)
############################################################

Expand Down Expand Up @@ -382,11 +382,11 @@ def run_test(self):
fundedTx = self.nodes[0].fundrawtransaction(rawTx)

#create same transaction over sendtoaddress
txId = self.nodes[0].sendtoaddress(mSigObj, 1.1);
txId = self.nodes[0].sendtoaddress(mSigObj, 1.1)
signedFee = self.nodes[0].getrawmempool(True)[txId]['fee']

#compare fee
feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee);
feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee)
assert(feeDelta >= 0 and feeDelta <= feeTolerance)
############################################################

Expand All @@ -405,7 +405,7 @@ def run_test(self):


# send 1.2 BTC to msig addr
txId = self.nodes[0].sendtoaddress(mSigObj, 1.2);
txId = self.nodes[0].sendtoaddress(mSigObj, 1.2)
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
Expand Down Expand Up @@ -442,7 +442,7 @@ def run_test(self):

error = False
try:
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1.2);
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1.2)
except:
error = True
assert(error)
Expand Down Expand Up @@ -472,13 +472,13 @@ def run_test(self):
###############################################

#empty node1, send some small coins from node0 to node1
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance(), "", "", True);
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance(), "", "", True)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()

for i in range(0,20):
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.01);
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.01)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
Expand All @@ -490,11 +490,11 @@ def run_test(self):
fundedTx = self.nodes[1].fundrawtransaction(rawTx)

#create same transaction over sendtoaddress
txId = self.nodes[1].sendmany("", outputs);
txId = self.nodes[1].sendmany("", outputs)
signedFee = self.nodes[1].getrawmempool(True)[txId]['fee']

#compare fee
feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee);
feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee)
assert(feeDelta >= 0 and feeDelta <= feeTolerance*19) #~19 inputs


Expand All @@ -503,13 +503,13 @@ def run_test(self):
#############################################

#again, empty node1, send some small coins from node0 to node1
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance(), "", "", True);
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance(), "", "", True)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()

for i in range(0,20):
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.01);
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.01)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/getblocktemplate_blockmaxcomplexity.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def run_test(self):
self.nodes[1].generate(50)
self.sync_all()

node1_taddr = self.nodes[1].getnewaddress();
node1_taddr = self.nodes[1].getnewaddress()

# Create transaction 3 transactions with 10 inputs each
# Each transaction complexity will be equal to 10*10=100
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/getblocktemplate_proposals.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def run_test(self):
self.doTest(sc_fork_reached)

# reach the height where the next block is the last before the fork point where certificates are supported
delta = ForkHeights['MINIMAL_SC'] - currentHeight - 2;
delta = ForkHeights['MINIMAL_SC'] - currentHeight - 2
self.nodes[0].generate(delta)
self.sync_all()

Expand Down
4 changes: 2 additions & 2 deletions qa/rpc-tests/getchaintips.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def run_test (self):

# Split the network and build two chains of different lengths.
self.split_network ()
self.nodes[0].generate(10);
self.nodes[2].generate(20);
self.nodes[0].generate(10)
self.nodes[2].generate(20)
self.sync_all ()

tips = self.nodes[1].getchaintips ()
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/mempool_tx_input_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def run_test(self):
node0_zaddr = self.nodes[0].z_getnewaddress()

# Send three inputs from node 0 taddr to zaddr to get out of coinbase
node0_taddr = self.nodes[0].getnewaddress();
node0_taddr = self.nodes[0].getnewaddress()
recipients = []
recipients.append({"address":node0_zaddr, "amount":Decimal('30.0')-Decimal('0.0001')}) # utxo amount less fee
myopid = self.nodes[0].z_sendmany(node0_taddr, recipients)
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/nulldata.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def doTest():
except JSONRPCException as e:
# this will be refused because data size exceeds max
errorString = e.error['message']
assert_equal("scriptpubkey" in errorString, True);
assert_equal("scriptpubkey" in errorString, True)
print("...Ok, refused data exceeding max size")


Expand Down
12 changes: 6 additions & 6 deletions qa/rpc-tests/rawtransactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ def run_test(self):
self.sync_all()
self.nodes[0].generate(101)
self.sync_all()
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),1.5);
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),1.0);
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),5.0);
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),1.5)
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),1.0)
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),5.0)
self.sync_all()
self.nodes[0].generate(5)
self.sync_all()
Expand All @@ -115,7 +115,7 @@ def run_test(self):
errorString = e.error['message']
print(errorString)

assert_equal("Missing inputs" in errorString, True);
assert_equal("Missing inputs" in errorString, True)

#########################
# RAW TX MULTISIG TESTS #
Expand All @@ -134,7 +134,7 @@ def run_test(self):
bal = self.nodes[2].getbalance()

# send 1.2 BTC to msig adr
txId = self.nodes[0].sendtoaddress(mSigObj, 1.2);
txId = self.nodes[0].sendtoaddress(mSigObj, 1.2)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
Expand Down Expand Up @@ -177,7 +177,7 @@ def run_test(self):
for outpoint in rawTx['vout']:
if outpoint['value'] == Decimal('2.20000000'):
vout = outpoint
break;
break

bal = self.nodes[0].getbalance()
inputs = [{ "txid" : txId, "vout" : vout['n'], "scriptPubKey" : vout['scriptPubKey']['hex']}]
Expand Down
10 changes: 5 additions & 5 deletions qa/rpc-tests/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ def run_test(self):

binaryRequest = b'\x01\x02'
binaryRequest += binascii.unhexlify(txid)
binaryRequest += struct.pack("i", n);
binaryRequest += binascii.unhexlify(vintx);
binaryRequest += struct.pack("i", 0);
binaryRequest += struct.pack("i", n)
binaryRequest += binascii.unhexlify(vintx)
binaryRequest += struct.pack("i", 0)

bin_response = http_post_call(url.hostname, url.port, '/rest/getutxos'+self.FORMAT_SEPARATOR+'bin', binaryRequest)
output = BytesIO()
Expand Down Expand Up @@ -208,7 +208,7 @@ def run_test(self):
json_request = '/checkmempool/'
for x in range(0, 15):
json_request += txid+'-'+str(n)+'/'
json_request = json_request.rstrip("/");
json_request = json_request.rstrip("/")
response = http_post_call(url.hostname, url.port, '/rest/getutxos'+json_request+self.FORMAT_SEPARATOR+'json', '', True)
assert_equal(response.status, 200) # must be a 500 because we exceeding the limits

Expand Down Expand Up @@ -296,7 +296,7 @@ def run_test(self):
assert_equal(len(json_obj), 5) # now we should have 5 header objects

# do tx test
tx_hash = block_json_obj['tx'][0]['txid'];
tx_hash = block_json_obj['tx'][0]['txid']
json_string = http_get_call(url.hostname, url.port, '/rest/tx/'+tx_hash+self.FORMAT_SEPARATOR+"json")
json_obj = json.loads(json_string)
assert_equal(json_obj['txid'], tx_hash)
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/sbh_rpc_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def run_test(self):
except JSONRPCException as e:
errorString = e.error['message']
mark_logs(errorString,self.nodes,DEBUG_MODE)
assert_true(False);
assert_true(False)

self.sync_all()

Expand Down
4 changes: 2 additions & 2 deletions qa/rpc-tests/sc_big_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def create_sc(cmdInput, node):
except JSONRPCException as e:
errorString = e.error['message']
mark_logs(errorString,self.nodes,DEBUG_MODE)
assert_true(False);
assert_true(False)

return tx, scid

Expand Down Expand Up @@ -194,7 +194,7 @@ def advance_sidechains_epoch(num_of_scs):
scc_txs = []

for i in range(0, TOT_NUM_OF_SIDECHAINS):
tx, scid = create_sc(cmdInput, self.nodes[0]);
tx, scid = create_sc(cmdInput, self.nodes[0])
mark_logs("Created SC {} with scid={} via tx={}".format(i, scid, tx), self.nodes,DEBUG_MODE)
scids.append(scid)
scc_txs.append(tx)
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/sc_bwt_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def run_test(self):
except JSONRPCException as e:
errorString = e.error['message']
mark_logs(errorString,self.nodes,DEBUG_MODE)
assert_true(False);
assert_true(False)

n1_net_bal = bal_before_sc_creation - creation_amount1 - fee_cr1

Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/sc_cert_ceasing_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def run_test(self):
cmdParms = { "minconf":0, "fee":0.0}
mark_logs("\nNTW part 1) Node1 creates a tx with a bwt request", self.nodes, DEBUG_MODE)
try:
tx_bwt = self.nodes[1].sc_request_transfer(outputs, cmdParms);
tx_bwt = self.nodes[1].sc_request_transfer(outputs, cmdParms)
except JSONRPCException as e:
errorString = e.error['message']
mark_logs(errorString,self.nodes,DEBUG_MODE)
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/sc_cr_and_fw_in_mempool.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_epoch_data(node, sc_creating_height, epoch_length):
# generate a tx in mempool whose coins will be used by the tx creating the sc as input. This will make the creation tx orphan
# and with null prio (that is because its inputs have 0 conf). As a consequence it would be processed after the forward transfer, making the block invalid.
# Handling sc dependancies will prevent this scenario.
tx = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), creation_amount);
tx = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), creation_amount)
mark_logs("Node 0 sent {} coins to itself via {}".format(creation_amount, tx), self.nodes, DEBUG_MODE)
self.sync_all()

Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/sc_csw_fundrawtransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_spendable(nodeIdx, min_amount):
if aUtx['amount'] > min_amount:
utx = aUtx
change = aUtx['amount'] - min_amount
break;
break

if utx == False:
pprint.pprint(listunspent)
Expand Down
4 changes: 2 additions & 2 deletions qa/rpc-tests/sc_csw_nullifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def run_test(self):

amount_2_1 = Decimal(n2_bal)/Decimal('4.0')
mark_logs("\nNode2 sends {} coins to Node1 using csw funds...".format(amount_2_1), self.nodes, DEBUG_MODE)
tx = self.nodes[2].sendtoaddress(self.nodes[1].getnewaddress(), amount_2_1);
tx = self.nodes[2].sendtoaddress(self.nodes[1].getnewaddress(), amount_2_1)
mark_logs("tx = {}".format(tx), self.nodes, DEBUG_MODE)
self.sync_all()

Expand Down Expand Up @@ -385,7 +385,7 @@ def run_test(self):

# Node1 sends all of its balance to Node0
amount = Decimal(n1_bal) - Decimal("0.0001")
tx_1_0 = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), amount);
tx_1_0 = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), amount)
mark_logs("tx = {}".format(tx_1_0), self.nodes, DEBUG_MODE)
mark_logs("Node1 sent {} coins to Node0 using csw funds...".format(amount), self.nodes, DEBUG_MODE)
sync_mempools(self.nodes[0:2])
Expand Down
Loading

0 comments on commit 83b935e

Please sign in to comment.