(cls, data, nVersion)
| 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): |
nothing calls this directly
no test coverage detected