File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
test/functional/test_framework Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class AddressType(enum.Enum):
35
35
legacy = 'legacy' # P2PKH
36
36
37
37
38
- chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
38
+ b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
39
39
40
40
41
41
def create_deterministic_address_bcrt1_p2tr_op_true ():
@@ -59,10 +59,10 @@ def byte_to_base58(b, version):
59
59
b += hash256 (b )[:4 ] # append checksum
60
60
value = int .from_bytes (b , 'big' )
61
61
while value > 0 :
62
- result = chars [value % 58 ] + result
62
+ result = b58chars [value % 58 ] + result
63
63
value //= 58
64
64
while b [0 ] == 0 :
65
- result = chars [0 ] + result
65
+ result = b58chars [0 ] + result
66
66
b = b [1 :]
67
67
return result
68
68
@@ -76,16 +76,16 @@ def base58_to_byte(s):
76
76
n = 0
77
77
for c in s :
78
78
n *= 58
79
- assert c in chars
80
- digit = chars .index (c )
79
+ assert c in b58chars
80
+ digit = b58chars .index (c )
81
81
n += digit
82
82
h = '%x' % n
83
83
if len (h ) % 2 :
84
84
h = '0' + h
85
85
res = n .to_bytes ((n .bit_length () + 7 ) // 8 , 'big' )
86
86
pad = 0
87
87
for c in s :
88
- if c == chars [0 ]:
88
+ if c == b58chars [0 ]:
89
89
pad += 1
90
90
else :
91
91
break
You can’t perform that action at this time.
0 commit comments