Upadte versions and calls

master
six 2023-08-17 12:16:24 +02:00
parent f8f910c5cb
commit a68a80af61
2 changed files with 4 additions and 4 deletions

View File

@ -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),)

View File

@ -1,2 +1,2 @@
web3==5.29.1
eth-account==0.5.7
web3==6.8.0
eth-account==0.9.0