(name)
| 17 | from bitcoin.core import * |
| 18 | |
| 19 | def load_test_vectors(name): |
| 20 | with open(os.path.dirname(__file__) + '/data/' + name, 'r') as fd: |
| 21 | for test_case in json.load(fd): |
| 22 | # Comments designated by single length strings |
| 23 | if len(test_case) == 1: |
| 24 | continue |
| 25 | assert len(test_case) == 5 |
| 26 | |
| 27 | (comment, fHeader, fCheckPoW, cur_time, serialized_blk) = test_case |
| 28 | |
| 29 | blk = None |
| 30 | if fHeader: |
| 31 | blk = CBlockHeader.deserialize(x(serialized_blk)) |
| 32 | else: |
| 33 | blk = CBlock.deserialize(x(serialized_blk)) |
| 34 | |
| 35 | yield (comment, fHeader, fCheckPoW, cur_time, blk) |
| 36 | |
| 37 | |
| 38 | class Test_CheckBlock(unittest.TestCase): |
no test coverage detected