Skip to content

Commit

Permalink
fix(fw): Use to_hex to compare code bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
pdobacz committed Oct 15, 2024
1 parent 619e7d8 commit 2e73a46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ethereum_test_base_types/composite_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pydantic import Field, PrivateAttr, RootModel, TypeAdapter

from .base_types import Address, Bytes, Hash, HashInt, HexNumber, ZeroPaddedHexNumber
from .conversions import BytesConvertible, NumberConvertible
from .conversions import BytesConvertible, NumberConvertible, to_hex
from .pydantic import CamelModel

StorageKeyValueTypeConvertible = NumberConvertible
Expand Down Expand Up @@ -396,7 +396,7 @@ def check_alloc(self: "Account", address: Address, account: "Account"):
)

if "code" in self.model_fields_set:
if self.code != account.code:
if to_hex(self.code) != to_hex(account.code):
raise Account.CodeMismatch(
address=address,
want=self.code,
Expand Down

0 comments on commit 2e73a46

Please sign in to comment.