fix: merge len bip32 with path function

This commit is contained in:
Coline
2022-07-25 10:55:47 +02:00
parent a064839efa
commit 986b4b427e
2 changed files with 16 additions and 34 deletions

View File

@@ -52,6 +52,15 @@ def bip32_path_from_string(path: str) -> List[bytes]:
for p in splitted_path]
def packed_bip32_path_from_string(path: str) -> bytes:
bip32_paths = bip32_path_from_string(path)
return b"".join([
len(bip32_paths).to_bytes(1, byteorder="big"),
*bip32_paths
])
def write_varint(n: int) -> bytes:
if n < 0xFC:
return n.to_bytes(1, byteorder="little")