[policy] detect unsorted packages

This commit is contained in:
glozow committed 2021-05-24 15:48:32 +01:00
1 parent 9ef643e21b
commit 13650fe2e5
2 files changed
+24 -8

No files matched your search

+2 -4
View File
@@ -169,10 +169,8 @@ class RPCPackagesTest(BitcoinTestFramework):
chain_txns.append(tx)
self.log.info("Check that testmempoolaccept requires packages to be sorted by dependency")
testres_multiple_unsorted = node.testmempoolaccept(rawtxs=chain_hex[::-1])
assert_equal(testres_multiple_unsorted,
[{"txid": chain_txns[-1].rehash(), "wtxid": chain_txns[-1].getwtxid(), "allowed": False, "reject-reason": "missing-inputs"}]
+ [{"txid": tx.rehash(), "wtxid": tx.getwtxid()} for tx in chain_txns[::-1]][1:])
assert_equal(node.testmempoolaccept(rawtxs=chain_hex[::-1]),
[{"txid": tx.rehash(), "wtxid": tx.getwtxid(), "package-error": "package-not-sorted"} for tx in chain_txns[::-1]])
self.log.info("Testmempoolaccept a chain of 25 transactions")
testres_multiple = node.testmempoolaccept(rawtxs=chain_hex)