Convert a scriptPubKey to a P2WSH address Raises CBitcoinAddressError if the scriptPubKey isn't of the correct form.
(cls, scriptPubKey)
| 282 | |
| 283 | @classmethod |
| 284 | def from_scriptPubKey(cls, scriptPubKey): |
| 285 | """Convert a scriptPubKey to a P2WSH address |
| 286 | |
| 287 | Raises CBitcoinAddressError if the scriptPubKey isn't of the correct |
| 288 | form. |
| 289 | """ |
| 290 | if scriptPubKey.is_witness_v0_scripthash(): |
| 291 | return cls.from_bytes(0, scriptPubKey[2:34]) |
| 292 | else: |
| 293 | raise CBitcoinAddressError('not a P2WSH scriptPubKey') |
| 294 | |
| 295 | def to_scriptPubKey(self): |
| 296 | """Convert an address to a scriptPubKey""" |
nothing calls this directly
no test coverage detected