From 45533df1cde5ed6c4d97dae23b494241a8f968ae Mon Sep 17 00:00:00 2001 From: drethereum Date: Tue, 5 Dec 2023 09:23:00 -0700 Subject: [PATCH] test --- macros/streamline/functions.py.sql | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/macros/streamline/functions.py.sql b/macros/streamline/functions.py.sql index bc64d11..9f95a22 100644 --- a/macros/streamline/functions.py.sql +++ b/macros/streamline/functions.py.sql @@ -317,29 +317,8 @@ def transform_hex_to_tezos(input, prefix): full_hash = prefixed_hash + checksum - tezos_address = transform_hex_to_base58(full_hash.hex()) + tezos_address = fsc_utils.create_udf_hex_to_base58(full_hash.hex()) return tezos_address -def transform_hex_to_base58(input): - if input is None: - return None - - ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" - byte_array = bytes.fromhex(input) - num = int.from_bytes(byte_array, 'big') - - encoded = '' - while num > 0: - num, remainder = divmod(num, 58) - encoded = ALPHABET[remainder] + encoded - - for byte in byte_array: - if byte == 0: - encoded = '1' + encoded - else: - break - - return encoded - {% endmacro %} \ No newline at end of file