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

Method from_bytes

bitcoin/bech32.py:45–52  ·  view source on GitHub ↗

Instantiate from witver and data

(cls, witver, witprog)

Source from the content-addressed store, hash-verified

43
44 @classmethod
45 def from_bytes(cls, witver, witprog):
46 """Instantiate from witver and data"""
47 if not (0 <= witver <= 16):
48 raise ValueError('witver must be in range 0 to 16 inclusive; got %d' % witver)
49 self = bytes.__new__(cls, witprog)
50 self.witver = witver
51
52 return self
53
54 def to_bytes(self):
55 """Convert to bytes instance

Callers 5

__new__Method · 0.45
compressFunction · 0.45
test_from_dataMethod · 0.45
serialization_testMethod · 0.45
test_from_dataMethod · 0.45

Calls 1

__new__Method · 0.45

Tested by 3

test_from_dataMethod · 0.36
serialization_testMethod · 0.36
test_from_dataMethod · 0.36