|
7 | 7 | from test_framework.mempool_util import tx_in_orphanage
|
8 | 8 | from test_framework.messages import msg_tx
|
9 | 9 | from test_framework.p2p import P2PInterface
|
10 |
| -from test_framework.util import assert_equal |
| 10 | +from test_framework.util import ( |
| 11 | + assert_equal, |
| 12 | + assert_raises_rpc_error, |
| 13 | +) |
11 | 14 | from test_framework.test_framework import BitcoinTestFramework
|
12 | 15 | from test_framework.wallet import MiniWallet
|
13 | 16 |
|
@@ -37,13 +40,13 @@ def test_orphan_activity(self):
|
37 | 40 | self.log.info("Check that neither parent is in the mempool")
|
38 | 41 | assert_equal(node.getmempoolinfo()["size"], 0)
|
39 | 42 |
|
40 |
| - self.log.info("Check that both children are in the orphanage") |
41 |
| - |
42 | 43 | orphanage = node.getorphantxs(verbosity=0)
|
43 | 44 | self.log.info("Check the size of the orphanage")
|
44 | 45 | assert_equal(len(orphanage), 2)
|
45 |
| - self.log.info("Check that negative verbosity is treated as 0") |
46 |
| - assert_equal(orphanage, node.getorphantxs(verbosity=-1)) |
| 46 | + self.log.info("Check that undefined verbosity is disallowed") |
| 47 | + assert_raises_rpc_error(-8, "Invalid verbosity value -1", node.getorphantxs, verbosity=-1) |
| 48 | + assert_raises_rpc_error(-8, "Invalid verbosity value 3", node.getorphantxs, verbosity=3) |
| 49 | + self.log.info("Check that both children are in the orphanage") |
47 | 50 | assert tx_in_orphanage(node, tx_child_1["tx"])
|
48 | 51 | assert tx_in_orphanage(node, tx_child_2["tx"])
|
49 | 52 |
|
|
0 commit comments