Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_packages.py
Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | def test_chain(self): | ||||
(tx, txhex, value, parent_locking_script) = self.chain_transaction( | (tx, txhex, value, parent_locking_script) = self.chain_transaction( | ||||
txid, value, 0, parent_locking_script) | txid, value, 0, parent_locking_script) | ||||
txid = tx.get_id() | txid = tx.get_id() | ||||
chain_hex.append(txhex) | chain_hex.append(txhex) | ||||
chain_txns.append(tx) | chain_txns.append(tx) | ||||
self.log.info( | self.log.info( | ||||
"Check that testmempoolaccept requires packages to be sorted by dependency") | "Check that testmempoolaccept requires packages to be sorted by dependency") | ||||
testres_multiple_unsorted = node.testmempoolaccept( | assert_equal( | ||||
rawtxs=chain_hex[::-1]) | node.testmempoolaccept(rawtxs=chain_hex[::-1]), | ||||
assert_equal(testres_multiple_unsorted, | [{"txid": tx.get_id(), "package-error": "package-not-sorted"} | ||||
[{"txid": chain_txns[-1].get_id(), "allowed": False, | for tx in chain_txns[::-1]]) | ||||
"reject-reason": "missing-inputs"}] | |||||
+ [{"txid": tx.get_id(), } for tx in chain_txns[::-1]][1:]) | |||||
self.log.info("Testmempoolaccept a chain of 50 transactions") | self.log.info("Testmempoolaccept a chain of 50 transactions") | ||||
testres_multiple = node.testmempoolaccept(rawtxs=chain_hex) | testres_multiple = node.testmempoolaccept(rawtxs=chain_hex) | ||||
testres_single = [] | testres_single = [] | ||||
# Test accept and then submit each one individually, which should be | # Test accept and then submit each one individually, which should be | ||||
# identical to package test accept | # identical to package test accept | ||||
for rawtx in chain_hex: | for rawtx in chain_hex: | ||||
▲ Show 20 Lines • Show All 171 Lines • Show Last 20 Lines |