OP encoding to int
(self, witver)
| 32 | class Test_bech32(unittest.TestCase): |
| 33 | |
| 34 | def op_decode(self, witver): |
| 35 | """OP encoding to int""" |
| 36 | if witver == OP_0: |
| 37 | return 0 |
| 38 | if OP_1 <= witver <= OP_16: |
| 39 | return witver - OP_1 + 1 |
| 40 | self.fail('Wrong witver: %d' % witver) |
| 41 | |
| 42 | def test_encode_decode(self): |
| 43 | for exp_bin, exp_bech32 in load_test_vectors('bech32_encode_decode.json'): |