refactor(core)!: drop leading underscores from internal definitions

Renames 314 defs and 41 module/class-level constants. Keeps 11 names underscored where the stripped form collides in scope, plus 5.5.0 shims for the three symbols external service repos call.
This commit is contained in:
imSp4rky
2026-08-15 22:07:41 -06:00
parent db4f0b39f9
commit 21d5f1c5e1
116 changed files with 1671 additions and 1492 deletions
+2 -2
View File
@@ -64,7 +64,7 @@ def b58encode(v: Union[str, bytes], alphabet: bytes = BITCOIN_ALPHABET) -> bytes
@lru_cache()
def _get_base58_decode_map(alphabet: bytes, autofix: bool) -> Mapping[int, int]:
def get_base58_decode_map(alphabet: bytes, autofix: bool) -> Mapping[int, int]:
invmap = {char: index for index, char in enumerate(alphabet)}
if autofix:
@@ -86,7 +86,7 @@ def b58decode_int(v: Union[str, bytes], alphabet: bytes = BITCOIN_ALPHABET, *, a
v = v.rstrip()
v = scrub_input(v)
map = _get_base58_decode_map(alphabet, autofix=autofix)
map = get_base58_decode_map(alphabet, autofix=autofix)
decimal = 0
base = len(alphabet)
+6 -6
View File
@@ -38,7 +38,7 @@ def encodebytes(barray, charset=CHARSET_DEFAULT):
:rtype: str
"""
_check_type(barray, bytes)
check_type(barray, bytes)
# Count the number of leading zeros.
leading_zeros_count = 0
@@ -68,11 +68,11 @@ def decode(encoded, charset=CHARSET_DEFAULT):
:type encoded: str
:rtype: int
"""
_check_type(encoded, str)
check_type(encoded, str)
length, i, v = len(encoded), 0, 0
for x in encoded:
v += _value(x, charset=charset) * (BASE ** (length - (i + 1)))
v += value(x, charset=charset) * (BASE ** (length - (i + 1)))
i += 1
return v
@@ -88,7 +88,7 @@ def decodebytes(encoded, charset=CHARSET_DEFAULT):
leading_null_bytes = b""
while encoded.startswith("0") and len(encoded) >= 2:
leading_null_bytes += b"\x00" * _value(encoded[1], charset)
leading_null_bytes += b"\x00" * value(encoded[1], charset)
encoded = encoded[2:]
decoded = decode(encoded, charset=charset)
@@ -101,7 +101,7 @@ def decodebytes(encoded, charset=CHARSET_DEFAULT):
return leading_null_bytes + bytes(buf)
def _value(ch, charset):
def value(ch, charset):
"""Decodes an individual digit of a base62 encoded string."""
try:
@@ -110,7 +110,7 @@ def _value(ch, charset):
raise ValueError("base62: Invalid character (%s)" % ch)
def _check_type(value, expected_type):
def check_type(value, expected_type):
"""Checks if the input is in an appropriate type."""
if not isinstance(value, expected_type):