Changeset View
Changeset View
Standalone View
Standalone View
test/functional/interface_rest.py
Show First 20 Lines • Show All 355 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
assert_equal(json_obj['size'], 3) | assert_equal(json_obj['size'], 3) | ||||
# the size of the memory pool should be greater than 3x ~100 bytes | # the size of the memory pool should be greater than 3x ~100 bytes | ||||
assert_greater_than(json_obj['bytes'], 300) | assert_greater_than(json_obj['bytes'], 300) | ||||
# check that there are our submitted transactions in the TX memory pool | # check that there are our submitted transactions in the TX memory pool | ||||
json_string = http_get_call( | json_string = http_get_call( | ||||
url.hostname, url.port, '/rest/mempool/contents' + self.FORMAT_SEPARATOR + 'json') | url.hostname, url.port, '/rest/mempool/contents' + self.FORMAT_SEPARATOR + 'json') | ||||
json_obj = json.loads(json_string) | json_obj = json.loads(json_string) | ||||
for tx in txs: | for i, tx in enumerate(txs): | ||||
assert_equal(tx in json_obj, True) | assert_equal(tx in json_obj, True) | ||||
assert_equal(json_obj[tx]['spentby'], txs[i + 1:i + 2]) | |||||
assert_equal(json_obj[tx]['depends'], txs[i - 1:i]) | |||||
# now mine the transactions | # now mine the transactions | ||||
newblockhash = self.nodes[1].generate(1) | newblockhash = self.nodes[1].generate(1) | ||||
self.sync_all() | self.sync_all() | ||||
# check if the 3 tx show up in the new block | # check if the 3 tx show up in the new block | ||||
json_string = http_get_call( | json_string = http_get_call( | ||||
url.hostname, url.port, '/rest/block/' + newblockhash[0] + self.FORMAT_SEPARATOR + 'json') | url.hostname, url.port, '/rest/block/' + newblockhash[0] + self.FORMAT_SEPARATOR + 'json') | ||||
Show All 23 Lines |