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

Method __new__

bitcoin/wallet.py:29–40  ·  view source on GitHub ↗
(cls, s)

Source from the content-addressed store, hash-verified

27class CBitcoinAddress(object):
28
29 def __new__(cls, s):
30 try:
31 return CBech32BitcoinAddress(s)
32 except bitcoin.bech32.Bech32Error:
33 pass
34
35 try:
36 return CBase58BitcoinAddress(s)
37 except bitcoin.base58.Base58Error:
38 pass
39
40 raise CBitcoinAddressError('Unrecognized encoding for bitcoin address')
41
42 @classmethod
43 def from_scriptPubKey(cls, scriptPubKey):

Callers

nothing calls this directly

Calls 3

Tested by

no test coverage detected