Changeset View
Changeset View
Standalone View
Standalone View
test/functional/interface_rest.py
Show First 20 Lines • Show All 274 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
tx_hash = block_json_obj['tx'][0]['txid'] | tx_hash = block_json_obj['tx'][0]['txid'] | ||||
json_obj = self.test_rest_request("/tx/{}".format(tx_hash)) | json_obj = self.test_rest_request("/tx/{}".format(tx_hash)) | ||||
assert_equal(json_obj['txid'], tx_hash) | assert_equal(json_obj['txid'], tx_hash) | ||||
# Check hex format response | # Check hex format response | ||||
hex_response = self.test_rest_request( | hex_response = self.test_rest_request( | ||||
"/tx/{}".format(tx_hash), req_type=ReqType.HEX, ret_type=RetType.OBJ) | "/tx/{}".format(tx_hash), req_type=ReqType.HEX, ret_type=RetType.OBJ) | ||||
assert_greater_than_or_equal( | assert_greater_than_or_equal( | ||||
int(hex_response.getheader('content-length')), json_obj['size']*2) | int(hex_response.getheader('content-length')), json_obj['size'] * 2) | ||||
self.log.info("Test tx inclusion in the /mempool and /block URIs") | self.log.info("Test tx inclusion in the /mempool and /block URIs") | ||||
# Make 3 tx and mine them on node 1 | # Make 3 tx and mine them on node 1 | ||||
txs = [] | txs = [] | ||||
txs.append(self.nodes[0].sendtoaddress(not_related_address, 11)) | txs.append(self.nodes[0].sendtoaddress(not_related_address, 11)) | ||||
txs.append(self.nodes[0].sendtoaddress(not_related_address, 11)) | txs.append(self.nodes[0].sendtoaddress(not_related_address, 11)) | ||||
txs.append(self.nodes[0].sendtoaddress(not_related_address, 11)) | txs.append(self.nodes[0].sendtoaddress(not_related_address, 11)) | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |