forked from bitcoinafterlife/bal-electrum-plugin
bug in log
This commit is contained in:
13
util.py
13
util.py
@@ -494,3 +494,16 @@ class Util:
|
||||
del will[txid]["tx_fees"]
|
||||
have_to_update = True
|
||||
return have_to_update
|
||||
|
||||
def text_to_hex(text: str) -> str:
|
||||
"""Convert text to hexadecimal string"""
|
||||
hex_string = text.encode('utf-8').hex()
|
||||
return hex_string
|
||||
|
||||
|
||||
def hex_to_text(hex_string: str) -> str:
|
||||
"""Convert hexadecimal string back to text (for verification)"""
|
||||
try:
|
||||
return bytes.fromhex(hex_string).decode('utf-8')
|
||||
except Exception:
|
||||
return "Error: Invalid hex string"
|
||||
|
||||
Reference in New Issue
Block a user