Skip to content

Commit

Permalink
fix: missing pin
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Aug 16, 2024
1 parent 6b3cec5 commit 9459683
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"eth-abi>=5.1.0,<6",
"eth-account>=0.13.0,<0.14",
"eth-typing>=4.1.0,<5",
"eth-utils",
"eth-utils>=4.1.0,<5",
"hexbytes", # Peer
"py-geth>=5.0.0-beta.2,<6",
"trie>=3.0.0,<4", # Peer: stricter pin needed for uv support.
Expand Down
6 changes: 3 additions & 3 deletions src/ape/api/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ def __str__(self) -> str:
if isinstance(data["data"], str):
data["data"] = (
"0x"
+ to_hex(bytes(data["data"][:3], encoding="utf8"))
+ bytes(data["data"][:3], encoding="utf8").hex()
+ "..."
+ to_hex(bytes(data["data"][-3:], encoding="utf8"))
+ bytes(data["data"][-3:], encoding="utf8").hex()
)
else:
data["data"] = (
to_hex(tbytes(data["data"][:3])) + "..." + to_hex(bytes(data["data"][-3:]))
to_hex(bytes(data["data"][:3])) + "..." + to_hex(bytes(data["data"][-3:]))
)
else:
if isinstance(data["data"], str):
Expand Down
1 change: 0 additions & 1 deletion src/ape/utils/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from eth_account import Account
from eth_account.hdaccount import HDPath
from eth_account.hdaccount.mnemonic import Mnemonic
from eth_pydantic_types import HexBytes
from eth_utils import to_hex

DEFAULT_NUMBER_OF_TEST_ACCOUNTS = 10
Expand Down
2 changes: 1 addition & 1 deletion src/ape_accounts/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def sign_message(self, msg: Any, **signer_options) -> Optional[MessageSignature]
if msg._verifyingContract_:
display_msg += f"\tContract: {msg._verifyingContract_}\n"
if msg._salt_:
display_msg += f"\tSalt: 0x{to_hex(msg._salt_)}\n"
display_msg += f"\tSalt: {to_hex(msg._salt_)}\n"

# Message Data
display_msg += "Message\n"
Expand Down
5 changes: 2 additions & 3 deletions src/ape_cache/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from eth_utils import to_hex
from sqlalchemy import JSON, BigInteger, Column, ForeignKey, Integer, LargeBinary, Numeric
from sqlalchemy.types import String, TypeDecorator

Expand All @@ -15,10 +14,10 @@ class HexByteString(TypeDecorator):

def process_bind_param(self, value, dialect):
if isinstance(value, bytes):
return to_hex(value)
return value.hex()

elif isinstance(value, str):
return to_hex(bytes.fromhex(value.replace("0x", "").lower()))
return bytes.fromhex(value.replace("0x", "").lower()).hex()

else:
raise TypeError(f"HexByteString columns support only bytes values: {value}")
Expand Down
2 changes: 1 addition & 1 deletion src/ape_ethereum/_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from typing import Any, cast

from eth_abi import decode
from eth_typing import ChecksumAddress, HexStr
from eth_typing import ChecksumAddress
from eth_utils import add_0x_prefix, decode_hex, to_hex
from ethpm_types import ContractType, MethodABI
from evm_trace import CallTreeNode
Expand Down
2 changes: 1 addition & 1 deletion src/ape_ethereum/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
serializable_unsigned_transaction_from_dict,
)
from eth_pydantic_types import HexBytes
from eth_utils import decode_hex, encode_hex, keccak, to_int, to_hex
from eth_utils import decode_hex, encode_hex, keccak, to_hex, to_int
from ethpm_types import ContractType
from ethpm_types.abi import EventABI, MethodABI
from pydantic import BaseModel, Field, field_validator, model_validator
Expand Down
6 changes: 1 addition & 5 deletions src/ape_node/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from subprocess import DEVNULL, PIPE, Popen
from typing import Any, Optional, Union

from eth_pydantic_types import HexBytes
from eth_typing import HexStr
from eth_utils import add_0x_prefix, to_hex
from evmchains import get_random_rpc
from geth.chain import initialize_chain
Expand Down Expand Up @@ -152,9 +150,7 @@ def from_uri(cls, uri: str, data_folder: Path, **kwargs):
mnemonic = kwargs.get("mnemonic", DEFAULT_TEST_MNEMONIC)
number_of_accounts = kwargs.get("number_of_accounts", DEFAULT_NUMBER_OF_TEST_ACCOUNTS)
balance = kwargs.get("initial_balance", DEFAULT_TEST_ACCOUNT_BALANCE)
extra_accounts = [
to_hex(a).lower() for a in kwargs.get("extra_funded_accounts", [])
]
extra_accounts = [to_hex(a).lower() for a in kwargs.get("extra_funded_accounts", [])]

return cls(
data_folder,
Expand Down
1 change: 1 addition & 0 deletions tests/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import pytest
from eth_pydantic_types import HexBytes
from eth_utils import to_hex
from ethpm_types import ContractType, ErrorABI, MethodABI
from ethpm_types.abi import ABIType

Expand Down
1 change: 0 additions & 1 deletion tests/functional/conversion/test_hex.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
from eth_pydantic_types import HexBytes
from eth_utils import to_hex

from ape.exceptions import ConversionError
Expand Down

0 comments on commit 9459683

Please sign in to comment.