MCPcopy Index your code
hub / github.com/petertodd/python-bitcoinlib / op_decode

Method op_decode

bitcoin/tests/test_bech32.py:34–40  ·  view source on GitHub ↗

OP encoding to int

(self, witver)

Source from the content-addressed store, hash-verified

32class 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'):

Callers 1

test_encode_decodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected