Stop using deprecated web3.py interface (#1759)
* Refactor contract function call to support web3.py v5.0.0. (backwards compatible with v4)
This commit is contained in:
parent
2ff5c39712
commit
6c36832f0e
@ -428,9 +428,9 @@ def is_valid_signature(
|
|||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
return (
|
return (
|
||||||
contract.call().isValidSignature(
|
contract.functions.isValidSignature(
|
||||||
data, to_checksum_address(signer_address), signature
|
data, to_checksum_address(signer_address), signature
|
||||||
),
|
).call(),
|
||||||
"",
|
"",
|
||||||
)
|
)
|
||||||
except web3.exceptions.BadFunctionCallOutput as exception:
|
except web3.exceptions.BadFunctionCallOutput as exception:
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
class Contract:
|
from typing import Callable
|
||||||
def call(self): ...
|
|
||||||
|
|
||||||
|
class ContractFunctions:
|
||||||
|
def __getattr__(self, function_name) -> Callable:
|
||||||
|
...
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
class Contract:
|
||||||
|
functions: ContractFunctions
|
||||||
...
|
...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user