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

Method from_bytes

bitcoin/wallet.py:108–120  ·  view source on GitHub ↗
(cls, data, nVersion)

Source from the content-addressed store, hash-verified

106
107 @classmethod
108 def from_bytes(cls, data, nVersion):
109 self = super(CBase58BitcoinAddress, cls).from_bytes(data, nVersion)
110
111 if nVersion == bitcoin.params.BASE58_PREFIXES['SCRIPT_ADDR']:
112 self.__class__ = P2SHBitcoinAddress
113
114 elif nVersion == bitcoin.params.BASE58_PREFIXES['PUBKEY_ADDR']:
115 self.__class__ = P2PKHBitcoinAddress
116
117 else:
118 raise CBitcoinAddressError('Version %d not a recognized Bitcoin Address' % nVersion)
119
120 return self
121
122 @classmethod
123 def from_scriptPubKey(cls, scriptPubKey):

Callers

nothing calls this directly

Calls 2

from_bytesMethod · 0.45

Tested by

no test coverage detected