Updated DevUtils contract artifact (#2358)

* Add updated DevUtils contract artifact

New contract methods were added in #2321, but this artifact was not
updated.

* fix for breaking change in eth_utils
This commit is contained in:
F. Eugene Aumson 2019-11-20 20:50:49 -05:00 committed by GitHub
parent ed8340affa
commit daa593d225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 75 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -182,6 +182,7 @@ setup(
"deprecated", "deprecated",
"web3", "web3",
"eth-abi", "eth-abi",
"eth_typing",
"eth_utils", "eth_utils",
"mypy_extensions", "mypy_extensions",
], ],

View File

@ -23,6 +23,7 @@ from typing import cast, Tuple, Union
from pkg_resources import resource_string from pkg_resources import resource_string
from mypy_extensions import TypedDict from mypy_extensions import TypedDict
from eth_typing import HexStr
from eth_utils import keccak, remove_0x_prefix, to_bytes, to_checksum_address from eth_utils import keccak, remove_0x_prefix, to_bytes, to_checksum_address
from web3 import Web3 from web3 import Web3
import web3.exceptions import web3.exceptions
@ -217,9 +218,9 @@ def is_valid_signature(
) )
).exchange, ).exchange,
).is_valid_hash_signature.call( ).is_valid_hash_signature.call(
bytes.fromhex(remove_0x_prefix(data)), bytes.fromhex(remove_0x_prefix(HexStr(data))),
to_checksum_address(signer_address), to_checksum_address(signer_address),
bytes.fromhex(remove_0x_prefix(signature)), bytes.fromhex(remove_0x_prefix(HexStr(signature))),
) )
@ -393,5 +394,5 @@ def sign_hash_to_bytes(
'1b117902c86dfb95fe0d1badd983ee166ad259b27acb220174cbb4460d872871137feabdfe76e05924b484789f79af4ee7fa29ec006cedce1bbf369320d034e10b03' '1b117902c86dfb95fe0d1badd983ee166ad259b27acb220174cbb4460d872871137feabdfe76e05924b484789f79af4ee7fa29ec006cedce1bbf369320d034e10b03'
""" # noqa: E501 (line too long) """ # noqa: E501 (line too long)
return remove_0x_prefix( return remove_0x_prefix(
sign_hash(web3_or_provider, signer_address, hash_hex) HexStr(sign_hash(web3_or_provider, signer_address, hash_hex))
).encode(encoding="utf_8") ).encode(encoding="utf_8")