davinci26/Codigo-Network

Generate Signatures with Web3py

Opened this issue · 0 comments

A code snippet that does not work:

## Signature Testing ###
msg_hash = Web3.sha3(text= 'password')
private_key = b"\xb2\\}\xb3\x1f\xee\xd9\x12''\xbf\t9\xdcv\x9a\x96VK-\xe4\xc4rm\x03[6\xec\xf1\xe5\xb3d"
print(m_web3.eth.account)
attribDict = m_web3.eth.account.signHash(msg_hash, private_key = private_key)
attribDict = m_web3.eth.account.signHash(msg_hash)
msgHash = Web3.toHex(attribDict['messageHash'])
v = attribDict['v']
r =  Web3.toHex(attribDict['r'])
s =  Web3.toHex(attribDict['s'])
print(attribDict)

Need to fix that