Skip to content

Commit

Permalink
chore: downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Aug 19, 2024
1 parent c1e3fb1 commit 100cb9a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,12 @@
# All version pins dependent on web3[tester]
"eth-abi",
"eth-account",
"eth-tester",
"eth-typing",
"eth-utils",
"hexbytes",
"py-geth",
"trie", # Peer: stricter pin needed for uv support.
"web3>=7.0.0b9,<8",
"web3[tester]>=6.20.2,<7",
# ** Dependencies maintained by ApeWorX **
# Missing pins are dependent on ETH-prefixed dependencies.
"eip712",
Expand Down
4 changes: 2 additions & 2 deletions src/ape_accounts/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,14 @@ def sign_raw_msghash(self, msghash: HexBytes) -> Optional[MessageSignature]:
)

# NOTE: Signing a raw hash is so dangerous, we don't want to allow autosigning it
if not click.confirm("Please confirm you wish to sign using `EthAccount.unsafe_sign_hash`"):
if not click.confirm("Please confirm you wish to sign using `EthAccount.signHash`"):
return None

# Ignoring misleading deprecated warning from web3.py.
# Also, we have already warned the user about the safety.
with warnings.catch_warnings():
warnings.simplefilter("ignore")
signed_msg = EthAccount.unsafe_sign_hash(msghash, self.__key)
signed_msg = EthAccount.signHash(msghash, self.__key)

return MessageSignature(
v=signed_msg.v,
Expand Down
8 changes: 4 additions & 4 deletions src/ape_ethereum/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
from evmchains import get_random_rpc
from pydantic.dataclasses import dataclass
from requests import HTTPError
from web3 import HTTPProvider, IPCProvider, Web3, WebSocketProvider
from web3 import HTTPProvider, IPCProvider, Web3, WebsocketProvider
from web3 import WebsocketProvider as WebSocketProvider # Matching newer API name
from web3.exceptions import ContractLogicError as Web3ContractLogicError
from web3.exceptions import (
ExtraDataLengthError,
MethodUnavailable,
TimeExhausted,
TransactionNotFound,
Web3RPCError,
)
from web3.gas_strategies.rpc import rpc_gas_price_strategy
from web3.middleware import ExtraDataToPOAMiddleware
from web3.middleware import geth_poa_middleware as ExtraDataToPOAMiddleware
from web3.middleware.validation import MAX_EXTRADATA_LENGTH
from web3.providers import AutoProvider
from web3.providers.auto import load_provider_from_environment
Expand Down Expand Up @@ -1009,7 +1009,7 @@ def send_transaction(self, txn: TransactionAPI) -> ReceiptAPI:
if txn_hash is None:
txn_hash = to_hex(self.web3.eth.send_raw_transaction(txn.serialize_transaction()))

except (ValueError, Web3ContractLogicError, Web3RPCError) as err:
except (ValueError, Web3ContractLogicError) as err:
vm_err = self.get_virtual_machine_error(
err, txn=txn, set_ape_traceback=txn.raise_on_revert
)
Expand Down
2 changes: 1 addition & 1 deletion src/ape_test/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def sign_transaction(self, txn: TransactionAPI, **signer_options) -> Optional[Tr
def sign_raw_msghash(self, msghash: HexBytes) -> MessageSignature:
with warnings.catch_warnings():
warnings.simplefilter("ignore")
signed_msg = EthAccount.unsafe_sign_hash(msghash, self.private_key)
signed_msg = EthAccount.signHash(msghash, self.private_key)

return MessageSignature(
v=signed_msg.v,
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/geth/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from hexbytes import HexBytes
from web3.exceptions import ContractLogicError as Web3ContractLogicError
from web3.exceptions import ExtraDataLengthError
from web3.middleware import ExtraDataToPOAMiddleware
from web3.middleware import geth_poa_middleware as ExtraDataToPOAMiddleware

from ape.exceptions import (
APINotImplementedError,
Expand Down

0 comments on commit 100cb9a

Please sign in to comment.