(name)
| 20 | from bitcoin.tests.test_scripteval import parse_script |
| 21 | |
| 22 | def load_test_vectors(name): |
| 23 | with open(os.path.dirname(__file__) + '/data/' + name, 'r') as fd: |
| 24 | for test_case in json.load(fd): |
| 25 | # Comments designated by single length strings |
| 26 | if len(test_case) == 1: |
| 27 | continue |
| 28 | assert len(test_case) == 3 |
| 29 | |
| 30 | prevouts = {} |
| 31 | for json_prevout in test_case[0]: |
| 32 | assert len(json_prevout) == 3 |
| 33 | n = json_prevout[1] |
| 34 | if n == -1: |
| 35 | n = 0xffffffff |
| 36 | prevout = COutPoint(lx(json_prevout[0]), n) |
| 37 | prevouts[prevout] = parse_script(json_prevout[2]) |
| 38 | |
| 39 | tx = CTransaction.deserialize(x(test_case[1])) |
| 40 | enforceP2SH = test_case[2] |
| 41 | |
| 42 | yield (prevouts, tx, enforceP2SH) |
| 43 | |
| 44 | class Test_COutPoint(unittest.TestCase): |
| 45 | def test_is_null(self): |
no test coverage detected