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

Method T

bitcoin/tests/test_wallet.py:165–172  ·  view source on GitHub ↗
(hex_scriptpubkey, expected_str_address)

Source from the content-addressed store, hash-verified

163class Test_P2PKHBitcoinAddress(unittest.TestCase):
164 def test_from_non_canonical_scriptPubKey(self):
165 def T(hex_scriptpubkey, expected_str_address):
166 scriptPubKey = CScript(x(hex_scriptpubkey))
167 addr = P2PKHBitcoinAddress.from_scriptPubKey(scriptPubKey)
168 self.assertEqual(str(addr), expected_str_address)
169
170 # now test that CBitcoinAddressError is raised with accept_non_canonical_pushdata=False
171 with self.assertRaises(CBitcoinAddressError):
172 P2PKHBitcoinAddress.from_scriptPubKey(scriptPubKey, accept_non_canonical_pushdata=False)
173
174 T('76a94c14000000000000000000000000000000000000000088ac', '1111111111111111111114oLvT2')
175 T('76a94d1400000000000000000000000000000000000000000088ac', '1111111111111111111114oLvT2'),

Callers

nothing calls this directly

Calls 4

CScriptClass · 0.90
xFunction · 0.90
from_pubkeyMethod · 0.80
from_scriptPubKeyMethod · 0.45

Tested by

no test coverage detected