-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
def ripmed160(data):
h = hashlib.new('ripemd160')
h.update(data)
return h.digest()
above code will cause a RIPEMD160 HASH error when signing a transaction.
I had to change to in packer.py
from Crypto.Hash import RIPEMD160
def ripemd160(data):
if isinstance(data, str):
data = data.encode('utf-8')
h = RIPEMD160.new()
h.update(data)
return h.digest()
also in transaction.py
def unpack_signature(self, signature: bytes):
t = Uint8.unpack(signature)
if t == 0:
data = signature[Uint8.size: Uint8.size + 65]
data = data + ripemd160(data + b"K1")[:4]
return "SIG_K1_" + b58encode(data).decode("ascii")
elif t == 1:
raise EosApiException("not implementd")
else:
raise EosApiException("invalid binary signature")
Metadata
Metadata
Assignees
Labels
No labels