Convert a scriptPubKey to a P2SH address Raises CBitcoinAddressError if the scriptPubKey isn't of the correct form.
(cls, scriptPubKey)
| 162 | |
| 163 | @classmethod |
| 164 | def from_scriptPubKey(cls, scriptPubKey): |
| 165 | """Convert a scriptPubKey to a P2SH address |
| 166 | |
| 167 | Raises CBitcoinAddressError if the scriptPubKey isn't of the correct |
| 168 | form. |
| 169 | """ |
| 170 | if scriptPubKey.is_p2sh(): |
| 171 | return cls.from_bytes(scriptPubKey[2:22], bitcoin.params.BASE58_PREFIXES['SCRIPT_ADDR']) |
| 172 | |
| 173 | else: |
| 174 | raise CBitcoinAddressError('not a P2SH scriptPubKey') |
| 175 | |
| 176 | def to_scriptPubKey(self): |
| 177 | """Convert an address to a scriptPubKey""" |
nothing calls this directly
no test coverage detected