Skip to content

Commit 605fecf

Browse files
committed
scripted-diff: rename chars to b58chars in test_framework.address
-BEGIN VERIFY SCRIPT- sed -i 's/chars/b58chars/g' ./test/functional/test_framework/address.py -END VERIFY SCRIPT-
1 parent 11c63e3 commit 605fecf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/functional/test_framework/address.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class AddressType(enum.Enum):
3535
legacy = 'legacy' # P2PKH
3636

3737

38-
chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
38+
b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
3939

4040

4141
def create_deterministic_address_bcrt1_p2tr_op_true():
@@ -59,10 +59,10 @@ def byte_to_base58(b, version):
5959
b += hash256(b)[:4] # append checksum
6060
value = int.from_bytes(b, 'big')
6161
while value > 0:
62-
result = chars[value % 58] + result
62+
result = b58chars[value % 58] + result
6363
value //= 58
6464
while b[0] == 0:
65-
result = chars[0] + result
65+
result = b58chars[0] + result
6666
b = b[1:]
6767
return result
6868

@@ -76,16 +76,16 @@ def base58_to_byte(s):
7676
n = 0
7777
for c in s:
7878
n *= 58
79-
assert c in chars
80-
digit = chars.index(c)
79+
assert c in b58chars
80+
digit = b58chars.index(c)
8181
n += digit
8282
h = '%x' % n
8383
if len(h) % 2:
8484
h = '0' + h
8585
res = n.to_bytes((n.bit_length() + 7) // 8, 'big')
8686
pad = 0
8787
for c in s:
88-
if c == chars[0]:
88+
if c == b58chars[0]:
8989
pad += 1
9090
else:
9191
break

0 commit comments

Comments
 (0)