diff --git a/ethkeygen.py b/ethkeygen.py index d46ceec..a9a2c52 100644 --- a/ethkeygen.py +++ b/ethkeygen.py @@ -28,12 +28,12 @@ def generate(_msg, _privkey): # ecrecover in Solidity expects v as a native uint8, but r and s as left-padded bytes32 # Remix / web3.js expect r and s to be encoded to hex. This method does the pad & hex: def to_32byte_hex(val): - return Web3.toHex(Web3.toBytes(val).rjust(32, b'\0')) + return Web3.to_hex(Web3.to_bytes(val).rjust(32, b'\0')) # Recover for tx def gen_vrs(signed_message): ec_recover_args = (msghash, v, r, s) = ( - Web3.toHex(signed_message.messageHash), + Web3.to_hex(signed_message.messageHash), signed_message.v, to_32byte_hex(signed_message.r), to_32byte_hex(signed_message.s),) diff --git a/requirements.txt b/requirements.txt index 54eeb47..2e1bec3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -web3==5.29.1 -eth-account==0.5.7 +web3==6.8.0 +eth-account==0.9.0