77# Test addressindex generation and fetching
88#
99
10- import binascii
11-
1210from test_framework .messages import COIN , COutPoint , CTransaction , CTxIn , CTxOut
1311from test_framework .test_framework import BitcoinTestFramework
1412from test_framework .test_node import ErrorMatch
@@ -132,7 +130,7 @@ def run_test(self):
132130
133131 # Check that outputs with the same address will only return one txid
134132 self .log .info ("Testing for txid uniqueness..." )
135- addressHash = binascii . unhexlify ("FE30B718DCF0BF8A2A686BF1820C073F8B2C3B37" )
133+ addressHash = bytes . fromhex ("FE30B718DCF0BF8A2A686BF1820C073F8B2C3B37" )
136134 scriptPubKey = CScript ([OP_HASH160 , addressHash , OP_EQUAL ])
137135 unspent = self .nodes [0 ].listunspent ()
138136 tx = CTransaction ()
@@ -159,7 +157,7 @@ def run_test(self):
159157 self .log .info ("Testing balances after spending..." )
160158 privkey2 = "cU4zhap7nPJAWeMFu4j6jLrfPmqakDAzy8zn8Fhb3oEevdm4e5Lc"
161159 address2 = "yeMpGzMj3rhtnz48XsfpB8itPHhHtgxLc3"
162- addressHash2 = binascii . unhexlify ("C5E4FB9171C22409809A3E8047A29C83886E325D" )
160+ addressHash2 = bytes . fromhex ("C5E4FB9171C22409809A3E8047A29C83886E325D" )
163161 scriptPubKey2 = CScript ([OP_DUP , OP_HASH160 , addressHash2 , OP_EQUALVERIFY , OP_CHECKSIG ])
164162 self .nodes [0 ].importprivkey (privkey2 )
165163
@@ -254,7 +252,7 @@ def run_test(self):
254252
255253 privKey3 = "cRyrMvvqi1dmpiCmjmmATqjAwo6Wu7QTjKu1ABMYW5aFG4VXW99K"
256254 address3 = "yWB15aAdpeKuSaQHFVJpBDPbNSLZJSnDLA"
257- addressHash3 = binascii . unhexlify ("6C186B3A308A77C779A9BB71C3B5A7EC28232A13" )
255+ addressHash3 = bytes . fromhex ("6C186B3A308A77C779A9BB71C3B5A7EC28232A13" )
258256 scriptPubKey3 = CScript ([OP_DUP , OP_HASH160 , addressHash3 , OP_EQUALVERIFY , OP_CHECKSIG ])
259257 # address4 = "2N8oFVB2vThAKury4vnLquW2zVjsYjjAkYQ"
260258 scriptPubKey4 = CScript ([OP_HASH160 , addressHash3 , OP_EQUAL ])
@@ -320,7 +318,7 @@ def run_test(self):
320318 # sending and receiving to the same address
321319 privkey1 = "cMvZn1pVWntTEcsK36ZteGQXRAcZ8CoTbMXF1QasxBLdnTwyVQCc"
322320 address1 = "yM9Eed1bxjy7tYxD3yZDHxjcVT48WdRoB1"
323- address1hash = binascii . unhexlify ("0909C84A817651502E020AAD0FBCAE5F656E7D8A" )
321+ address1hash = bytes . fromhex ("0909C84A817651502E020AAD0FBCAE5F656E7D8A" )
324322 address1script = CScript ([OP_DUP , OP_HASH160 , address1hash , OP_EQUALVERIFY , OP_CHECKSIG ])
325323
326324 self .nodes [0 ].sendtoaddress (address1 , 10 )
0 commit comments