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

Method __new__

bitcoin/bech32.py:28–34  ·  view source on GitHub ↗

from bech32 addr to

(cls, s)

Source from the content-addressed store, hash-verified

26 Includes a witver and checksum.
27 """
28 def __new__(cls, s):
29 """from bech32 addr to """
30 witver, data = decode(bitcoin.params.BECH32_HRP, s)
31 if witver is None and data is None:
32 raise Bech32Error('Bech32 decoding error')
33
34 return cls.from_bytes(witver, data)
35
36 def __init__(self, s):
37 """Initialize from bech32-encoded string

Callers 1

from_bytesMethod · 0.45

Calls 3

decodeFunction · 0.90
Bech32ErrorClass · 0.85
from_bytesMethod · 0.45

Tested by

no test coverage detected