mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 10:19:26 +02:00
rpc: Allow single transaction through submitpackage
And under the hood suppoert single transactions in AcceptPackage. This simplifies user experience and paves the way for reducing number of codepaths for transaction acceptance in the future. Co-Authored-By: instagibbs <gsanders87@gmail.com>
This commit is contained in:
@ -377,8 +377,8 @@ class RPCPackagesTest(BitcoinTestFramework):
|
||||
assert txid_list[0] not in node.getrawmempool()
|
||||
assert txid_list[1] not in node.getrawmempool()
|
||||
|
||||
self.log.info("Submitpackage valid packages with 1 child and some number of parents")
|
||||
for num_parents in [1, 2, 24]:
|
||||
self.log.info("Submitpackage valid packages with 1 child and some number of parents (or none)")
|
||||
for num_parents in [0, 1, 2, 24]:
|
||||
self.test_submit_child_with_parents(num_parents, False)
|
||||
self.test_submit_child_with_parents(num_parents, True)
|
||||
|
||||
@ -389,10 +389,9 @@ class RPCPackagesTest(BitcoinTestFramework):
|
||||
assert_raises_rpc_error(-25, "package topology disallowed", node.submitpackage, chain_hex)
|
||||
assert_equal(legacy_pool, node.getrawmempool())
|
||||
|
||||
assert_raises_rpc_error(-8, f"Array must contain between 2 and {MAX_PACKAGE_COUNT} transactions.", node.submitpackage, [])
|
||||
assert_raises_rpc_error(-8, f"Array must contain between 2 and {MAX_PACKAGE_COUNT} transactions.", node.submitpackage, [chain_hex[0]] * 1)
|
||||
assert_raises_rpc_error(-8, f"Array must contain between 1 and {MAX_PACKAGE_COUNT} transactions.", node.submitpackage, [])
|
||||
assert_raises_rpc_error(
|
||||
-8, f"Array must contain between 2 and {MAX_PACKAGE_COUNT} transactions.",
|
||||
-8, f"Array must contain between 1 and {MAX_PACKAGE_COUNT} transactions.",
|
||||
node.submitpackage, [chain_hex[0]] * (MAX_PACKAGE_COUNT + 1)
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user