Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Renaming for testnet release #186

Merged
merged 7 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions qa/rpc-tests/getblockmerkleroots.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def run_test(self):
vk = mcTest.generate_params("sc1")
constant = generate_random_field_element_hex()

ret = self.nodes[0].sc_create(123, "dada", 3.0, vk, "bb" * 1024, constant)
ret = self.nodes[0].dep_sc_create(123, "dada", 3.0, vk, "bb" * 1024, constant)
scid = ret['scid']
self.sync_all()
self.nodes[0].sendtoaddress(tAddr, 1.0)
Expand All @@ -112,7 +112,7 @@ def run_test(self):
#Test getblockmerkleroots with a FT
print("######## Test getblockmerkleroots with a FT ########")

self.nodes[0].sc_send("abcd", 2.0, scid, mc_return_address)
self.nodes[0].dep_sc_send("abcd", 2.0, scid, mc_return_address)
self.sync_all()
self.nodes[0].sendtoaddress(tAddr, 1.0)
self.sync_all()
Expand Down
4 changes: 2 additions & 2 deletions qa/rpc-tests/getblocktemplate_proposals.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def run_test(self):
vk = mcTest.generate_params("sc1")
constant = generate_random_field_element_hex()

ret = self.nodes[1].sc_create(SC_EPOCH_LENGTH, "dada", SC_CREATION_AMOUNT, vk, "bb" * 1024, constant)
ret = self.nodes[1].dep_sc_create(SC_EPOCH_LENGTH, "dada", SC_CREATION_AMOUNT, vk, "bb" * 1024, constant)
creating_tx = ret['txid']
scid = ret['scid']
self.sync_all()
Expand All @@ -185,7 +185,7 @@ def run_test(self):

scid_swapped = str(swap_bytes(scid))
proof = mcTest.create_test_proof("sc1", scid_swapped, 0, 0, mbtrScFee, ftScFee, epoch_cum_tree_hash, constant, [pkh], [SC_CERT_AMOUNT])
cert = self.nodes[0].send_certificate(scid, 0, 0, epoch_cum_tree_hash, proof, amounts, ftScFee, mbtrScFee, fee)
cert = self.nodes[0].sc_send_certificate(scid, 0, 0, epoch_cum_tree_hash, proof, amounts, ftScFee, mbtrScFee, fee)
self.sync_all()
assert_true(cert in self.nodes[0].getrawmempool() )
mark_logs("cert issued : {}".format(cert), self.nodes, DEBUG_MODE)
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/listtransactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def run_test(self):

cmdInput = {'fromaddress': fromaddr, 'toaddress': sidechain_address, 'amount': sc_creation_amount, 'fee': fee, 'wCertVk': vk, "constant": constant}
try:
res = self.nodes[1].create_sidechain(cmdInput)
res = self.nodes[1].sc_create(cmdInput)
tx = res['txid']
self.sync_all()
except JSONRPCException, e:
Expand Down
4 changes: 2 additions & 2 deletions qa/rpc-tests/rawtransactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,13 @@ def run_test(self):

assert(len(decoded_tx['vsc_ccout'])==2)
assert_equal(decoded_tx['vsc_ccout'][0]['scid'],scid)
assert_equal(decoded_tx['vsc_ccout'][0]['withdrawal epoch length'],sc_epoch_len)
assert_equal(decoded_tx['vsc_ccout'][0]['withdrawalEpochLength'],sc_epoch_len)
assert_equal(decoded_tx['vsc_ccout'][0]['wCertVk'],vk)
assert_equal(decoded_tx['vsc_ccout'][0]['constant'],constant)
assert_equal(decoded_tx['vsc_ccout'][0]['value'],sc_cr_amount)
assert_equal(decoded_tx['vsc_ccout'][0]['address'],sc_address)
assert_equal(decoded_tx['vsc_ccout'][1]['scid'],scid2)
assert_equal(decoded_tx['vsc_ccout'][1]['withdrawal epoch length'],sc_epoch2_len)
assert_equal(decoded_tx['vsc_ccout'][1]['withdrawalEpochLength'],sc_epoch2_len)
assert_equal(decoded_tx['vsc_ccout'][1]['value'],sc_cr_amount2)

#Try create a FT
Expand Down
6 changes: 3 additions & 3 deletions qa/rpc-tests/sbh_rpc_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def run_test(self):

try:
#----------------------------------------------------------------------------------------------
res = self.nodes[1].create_sidechain(cmdInput)
res = self.nodes[1].sc_create(cmdInput)
tx = res['txid']
scid = res['scid']
txs_node1.append(tx)
Expand Down Expand Up @@ -163,7 +163,7 @@ def run_test(self):
cmdParms = { 'fromaddress': taddr_1, "minconf": 0, "fee": fee}

try:
tx = self.nodes[1].send_to_sidechain(outputs, cmdParms)
tx = self.nodes[1].sc_send(outputs, cmdParms)
self.sync_all()
txs_node1.append(tx)
mark_logs("\n===> Node 1 sent {} coins to fund the sc".format(sc_fwd_amount), self.nodes, DEBUG_MODE)
Expand Down Expand Up @@ -210,7 +210,7 @@ def run_test(self):
"sc1", scid_swapped, epoch_number, quality, MBTR_SC_FEE, FT_SC_FEE, epoch_cum_tree_hash, constant, [pkh_node1], [bwt_amount1])

#----------------------------------------------------------------------------------------------
cert_1 = self.nodes[0].send_certificate(scid, epoch_number, quality,
cert_1 = self.nodes[0].sc_send_certificate(scid, epoch_number, quality,
epoch_cum_tree_hash, proof, amounts, FT_SC_FEE, MBTR_SC_FEE, CERT_FEE)
mark_logs("\n===> Node 0 sent a cert for scid {} with bwd transfer of {} coins to Node1 pkh (addr {})".format(scid, bwt_amount1, bwt_address), self.nodes, DEBUG_MODE)
#mark_logs("==> certificate is {}".format(cert_1), self.nodes, DEBUG_MODE)
Expand Down
4 changes: 2 additions & 2 deletions qa/rpc-tests/sc_async_proof_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def run_test(self):

try:
# The send_certificate call must be ok since the proof verification is disabled on node 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to update the comment ->"sc_send_certificate"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

invalid_cert = self.nodes[2].send_certificate(scid, epoch_number, cert_quality, epoch_cum_tree_hash,
invalid_cert = self.nodes[2].sc_send_certificate(scid, epoch_number, cert_quality, epoch_cum_tree_hash,
proof, [], ft_fee, mbtr_fee, cert_fee)
except JSONRPCException, e:
error_string = e.error['message']
Expand Down Expand Up @@ -213,7 +213,7 @@ def run_test(self):
"sc", scid_swapped, epoch_number, cert_quality, mbtr_fee, ft_fee, epoch_cum_tree_hash, constant, [], [])

try:
cert2 = self.nodes[0].send_certificate(scid, epoch_number, cert_quality, epoch_cum_tree_hash,
cert2 = self.nodes[0].sc_send_certificate(scid, epoch_number, cert_quality, epoch_cum_tree_hash,
proof, [], ft_fee, mbtr_fee, cert_fee)
except JSONRPCException, e:
error_string = e.error['message']
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 @@ -82,7 +82,7 @@ def run_test(self):

def create_sc(cmdInput, node):
try:
res = node.create_sidechain(cmdInput)
res = node.sc_create(cmdInput)
tx = res['txid']
scid = res['scid']
except JSONRPCException, e:
Expand Down Expand Up @@ -114,7 +114,7 @@ def advance_sidechains_epoch(num_of_scs):
print "...proof generated: {} secs".format(t1-t0)

try:
cert = self.nodes[0].send_certificate(scids[i], epoch_number, q,
cert = self.nodes[0].sc_send_certificate(scids[i], epoch_number, q,
epoch_cum_tree_hash, proof, [], FT_SC_FEE, MBTR_SC_FEE, CERT_FEE, vCfe, vCmt)
except JSONRPCException, e:
errorString = e.error['message']
Expand Down
4 changes: 2 additions & 2 deletions qa/rpc-tests/sc_block_partitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def run_test(self):

def create_sc(cmdInput, node):
try:
res = node.create_sidechain(cmdInput)
res = node.sc_create(cmdInput)
tx = res['txid']
scid = res['scid']
except JSONRPCException, e:
Expand Down Expand Up @@ -129,7 +129,7 @@ def create_sc(cmdInput, node):
proofs.append(proof)

try:
cert = self.nodes[0].send_certificate(scid, epoch_number, (q+tot_num_cert),
cert = self.nodes[0].sc_send_certificate(scid, epoch_number, (q+tot_num_cert),
epoch_cum_tree_hash, proof, [], FT_SC_FEE, MBTR_SC_FEE, CERT_FEE, [], [])
except JSONRPCException, e:
errorString = e.error['message']
Expand Down
32 changes: 16 additions & 16 deletions 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):
print "Node0 Chain h = ", self.nodes[0].getblockcount()

try:
ret = self.nodes[1].create_sidechain(cmdInput)
ret = self.nodes[1].sc_create(cmdInput)
except JSONRPCException, e:
errorString = e.error['message']
mark_logs(errorString,self.nodes,DEBUG_MODE)
Expand Down Expand Up @@ -143,39 +143,39 @@ def run_test(self):
# 1. wrong scid
outputs = [{'vScRequestData':fe1, 'scFee':SC_FEE, 'scid':"abcd", 'pubkeyhash':pkh1 }]
try:
self.nodes[1].request_transfer_from_sidechain(outputs, {});
self.nodes[1].sc_request_transfer(outputs, {});
assert_true(False)
except JSONRPCException, e:
mark_logs(e.error['message'], self.nodes,DEBUG_MODE)

# 2. wrong pkh
outputs = [{'vScRequestData':fe1, 'scFee':SC_FEE, 'scid':scid1, 'pubkeyhash':scid1 }]
try:
self.nodes[1].request_transfer_from_sidechain(outputs, {});
self.nodes[1].sc_request_transfer(outputs, {});
assert_true(False)
except JSONRPCException, e:
mark_logs(e.error['message'], self.nodes,DEBUG_MODE)

# 3. negative scfee
outputs = [{'vScRequestData':fe1, 'scFee':Decimal("-0.2"), 'scid':scid1, 'pubkeyhash':pkh1 }]
try:
self.nodes[1].request_transfer_from_sidechain(outputs, {});
self.nodes[1].sc_request_transfer(outputs, {});
assert_true(False)
except JSONRPCException, e:
mark_logs(e.error['message'], self.nodes,DEBUG_MODE)

# 4. not including one of the mandatory param
outputs = [{'scFee':SC_FEE, 'scid':scid1, 'pubkeyhash':pkh1 }]
try:
self.nodes[1].request_transfer_from_sidechain(outputs, {});
self.nodes[1].sc_request_transfer(outputs, {});
assert_true(False)
except JSONRPCException, e:
mark_logs(e.error['message'], self.nodes,DEBUG_MODE)

# 5. wrong field element
outputs = [{'vScRequestData':"abcd", 'scFee':SC_FEE, 'scid':scid1, 'pubkeyhash':pkh1 }]
try:
self.nodes[1].request_transfer_from_sidechain(outputs, {});
self.nodes[1].sc_request_transfer(outputs, {});
assert_true(False)
except JSONRPCException, e:
mark_logs(e.error['message'], self.nodes,DEBUG_MODE)
Expand All @@ -190,7 +190,7 @@ def run_test(self):
cmdParms = { "minconf":0, "fee":TX_FEE}

try:
bwt1 = self.nodes[1].request_transfer_from_sidechain(outputs, cmdParms);
bwt1 = self.nodes[1].sc_request_transfer(outputs, cmdParms);
mark_logs(" --> bwt_tx_1 = {}.".format(bwt1), self.nodes, DEBUG_MODE)
except JSONRPCException, e:
errorString = e.error['message']
Expand All @@ -212,7 +212,7 @@ def run_test(self):

mark_logs("Node1 creates a tx with the same single bwt request for sc", self.nodes, DEBUG_MODE)
try:
bwt2 = self.nodes[1].request_transfer_from_sidechain(outputs, cmdParms);
bwt2 = self.nodes[1].sc_request_transfer(outputs, cmdParms);
mark_logs(" --> bwt_tx_2 = {}.".format(bwt2), self.nodes, DEBUG_MODE)
except JSONRPCException, e:
errorString = e.error['message']
Expand All @@ -230,7 +230,7 @@ def run_test(self):
outputs = [{'vScRequestData':fe1, 'scFee':Decimal("0.0"), 'scid':scid1, 'pubkeyhash':pkh1 }]
cmdParms = {"fee":0.0}
try:
bwt3 = self.nodes[0].request_transfer_from_sidechain(outputs, cmdParms);
bwt3 = self.nodes[0].sc_request_transfer(outputs, cmdParms);
mark_logs(" --> bwt_tx_3 = {}.".format(bwt3), self.nodes, DEBUG_MODE)
except JSONRPCException, e:
errorString = e.error['message']
Expand All @@ -257,7 +257,7 @@ def run_test(self):
]
cmdParms = {"minconf":0, "fee":TX_FEE}
try:
bwt4 = self.nodes[1].request_transfer_from_sidechain(outputs, cmdParms);
bwt4 = self.nodes[1].sc_request_transfer(outputs, cmdParms);
mark_logs(" --> bwt_tx_4 = {}.".format(bwt4), self.nodes, DEBUG_MODE)
except JSONRPCException, e:
errorString = e.error['message']
Expand Down Expand Up @@ -306,7 +306,7 @@ def run_test(self):
# create one more sc
prev_epoch_hash_2 = self.nodes[0].getbestblockhash()
epoch_len_2 = 10
ret = self.nodes[0].sc_create(epoch_len_2, "dada", creation_amount2, vk2, "", c2, "", [], [], ftScFee, mbtrScFee, mbtrDataLength)
ret = self.nodes[0].dep_sc_create(epoch_len_2, "dada", creation_amount2, vk2, "", c2, "", [], [], ftScFee, mbtrScFee, mbtrDataLength)
scid2 = ret['scid']
cr_tx2 = ret['txid']
mark_logs("Node0 created the SC2 spending {} coins via tx {}.".format(creation_amount1, cr_tx2), self.nodes, DEBUG_MODE)
Expand Down Expand Up @@ -423,7 +423,7 @@ def run_test(self):

mark_logs("Node1 sends a cert withdrawing the contribution of the creation amount to the sc balance", self.nodes, DEBUG_MODE)
try:
cert_epoch_0 = self.nodes[1].send_certificate(scid1, epoch_number, 0,
cert_epoch_0 = self.nodes[1].sc_send_certificate(scid1, epoch_number, 0,
epoch_cum_tree_hash, proof, amounts, ftScFee, mbtrScFee, CERT_FEE)
mark_logs("Node 1 sent a cert with bwd transfer of {} coins to Node1 pkh via cert {}.".format(bwt_amount, cert_epoch_0), self.nodes, DEBUG_MODE)
assert(len(cert_epoch_0) > 0)
Expand Down Expand Up @@ -461,7 +461,7 @@ def run_test(self):
cmdParms = { "minconf":0, "fee":0.0}
mark_logs("Node0 creates a tx with a bwt request for a sc with null balance", self.nodes, DEBUG_MODE)
try:
bwt7 = self.nodes[1].request_transfer_from_sidechain(outputs, cmdParms);
bwt7 = self.nodes[1].sc_request_transfer(outputs, cmdParms);
mark_logs(" --> bwt_tx_7 = {}.".format(bwt7), self.nodes, DEBUG_MODE)
except JSONRPCException, e:
errorString = e.error['message']
Expand Down Expand Up @@ -498,7 +498,7 @@ def run_test(self):
cmdParms = {'minconf':0, 'fee':TX_FEE}
mark_logs("Node1 creates a tx with a bwt request for a ceased sc (should fail)", self.nodes, DEBUG_MODE)
try:
self.nodes[1].request_transfer_from_sidechain(outputs, cmdParms);
self.nodes[1].sc_request_transfer(outputs, cmdParms);
assert_true(False)
except JSONRPCException, e:
errorString = e.error['message']
Expand Down Expand Up @@ -547,7 +547,7 @@ def run_test(self):

amount_cert = [{"pubkeyhash": pkh_node1, "amount": bt_amount}]
try:
cert_bad = self.nodes[0].send_certificate(scid2, epoch_number, quality,
cert_bad = self.nodes[0].sc_send_certificate(scid2, epoch_number, quality,
epoch_cum_tree_hash, proof, amount_cert, ftScFee, mbtrScFee, 0.01)
except JSONRPCException, e:
errorString = e.error['message']
Expand All @@ -571,7 +571,7 @@ def run_test(self):
# outputs = [{'vScRequestData':fe1, 'scFee':Decimal("0.001"), 'scid':scid2, 'pubkeyhash':pkh1 }]
# cmdParms = { "minconf":0, "fee":0.0}
# try:
# tx_bwt = self.nodes[1].request_transfer_from_sidechain(outputs, cmdParms);
# tx_bwt = self.nodes[1].sc_request_transfer(outputs, cmdParms);
# except JSONRPCException, e:
# errorString = e.error['message']
# mark_logs(errorString,self.nodes,DEBUG_MODE)
Expand Down
Loading