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

Method from_bytes

bitcoin/wallet.py:66–81  ·  view source on GitHub ↗
(cls, witver, witprog)

Source from the content-addressed store, hash-verified

64
65 @classmethod
66 def from_bytes(cls, witver, witprog):
67
68 assert witver == 0
69 self = super(CBech32BitcoinAddress, cls).from_bytes(
70 witver,
71 bytes(witprog)
72 )
73
74 if len(self) == 32:
75 self.__class__ = P2WSHBitcoinAddress
76 elif len(self) == 20:
77 self.__class__ = P2WPKHBitcoinAddress
78 else:
79 raise CBitcoinAddressError('witness program does not match any known segwit address format')
80
81 return self
82
83 @classmethod
84 def from_scriptPubKey(cls, scriptPubKey):

Callers

nothing calls this directly

Calls 2

from_bytesMethod · 0.45

Tested by

no test coverage detected