(hex_scriptpubkey, expected_str_address)
| 163 | class 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'), |
nothing calls this directly
no test coverage detected