From 9e56532959939f417d7603aa2a4a2c1687508897 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 2 Dec 2014 11:44:50 -0500 Subject: Coinbases-in-mempool regression test Immature coinbase spends are allowed in the memory pool if they can be mined in the next block. They are not allowed in the memory pool if they cannot be mined in the next block. This regression test tests those edge cases. --- qa/rpc-tests/util.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'qa/rpc-tests/util.py') diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index 6b66bfd8f6..ec65f783e8 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -330,4 +330,14 @@ def assert_equal(thing1, thing2): def assert_greater_than(thing1, thing2): if thing1 <= thing2: - raise AssertionError("%s <= %s"%(str(thing1),str(thing2))) \ No newline at end of file + raise AssertionError("%s <= %s"%(str(thing1),str(thing2))) + +def assert_raises(exc, fun, *args, **kwds): + try: + fun(*args, **kwds) + except exc: + pass + except Exception as e: + raise AssertionError("Unexpected exception raised: "+type(e).__name__) + else: + raise AssertionError("No exception raised") -- cgit v1.2.3