test: Add basic test for reject
code
Extend P2P test framework to make it possible to expect reject codes for transactions and blocks.
This commit is contained in:
parent
9fc6ed6003
commit
20411903d7
4 changed files with 121 additions and 4 deletions
qa/rpc-tests
|
@ -6,7 +6,7 @@
|
|||
|
||||
from test_framework.test_framework import ComparisonTestFramework
|
||||
from test_framework.util import *
|
||||
from test_framework.comptool import TestManager, TestInstance
|
||||
from test_framework.comptool import TestManager, TestInstance, RejectResult
|
||||
from test_framework.mininode import *
|
||||
from test_framework.blocktools import *
|
||||
import logging
|
||||
|
@ -97,7 +97,7 @@ class InvalidBlockRequestTest(ComparisonTestFramework):
|
|||
assert(block2_orig.vtx != block2.vtx)
|
||||
|
||||
self.tip = block2.sha256
|
||||
yield TestInstance([[block2, False], [block2_orig, True]])
|
||||
yield TestInstance([[block2, RejectResult(16,'bad-txns-duplicate')], [block2_orig, True]])
|
||||
height += 1
|
||||
|
||||
'''
|
||||
|
@ -112,7 +112,7 @@ class InvalidBlockRequestTest(ComparisonTestFramework):
|
|||
block3.rehash()
|
||||
block3.solve()
|
||||
|
||||
yield TestInstance([[block3, False]])
|
||||
yield TestInstance([[block3, RejectResult(16,'bad-cb-amount')]])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue