Skip to content

Commit

Permalink
fix(evm_transition_tool): Remove evmone empty-to-string workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
marioevz committed Jul 17, 2024
1 parent 0154afa commit 3b41412
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
8 changes: 0 additions & 8 deletions src/evm_transition_tool/evmone.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,3 @@ def is_fork_supported(self, fork: Fork) -> bool:
Currently, evmone-t8n provides no way to determine supported forks.
"""
return True

@classmethod
def empty_string_to(cls) -> bool:
"""
Evmone requires an empty string within the `to` field for
contract-creating transactions.
"""
return True
20 changes: 1 addition & 19 deletions src/evm_transition_tool/transition_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,6 @@ def detect_binary(cls, binary_output: str) -> bool:

return cls.detect_binary_pattern.match(binary_output) is not None

@classmethod
def empty_string_to(cls) -> bool:
"""
Returns True if the tool requires an empty string `to` field
for contract creating transactions.
"""
return False

def version(self) -> str:
"""
Return name and version of tool used to state transition
Expand Down Expand Up @@ -257,15 +249,6 @@ class TransitionToolData:
fork_name: str
chain_id: int = field(default=1)
reward: int = field(default=0)
empty_string_to: bool = field(default=False)

def __post_init__(self):
"""
Ensure that the `to` field of transactions is not None
"""
if self.empty_string_to:
for tx in self.txs:
tx["to"] = tx.get("to") or ""

def to_input(self) -> TransitionToolInput:
"""
Expand Down Expand Up @@ -532,14 +515,13 @@ def evaluate(
fork_name = "+".join([fork_name] + [str(eip) for eip in eips])
if env.number == 0:
reward = -1
t8n_data = TransitionTool.TransitionToolData(
t8n_data = self.TransitionToolData(
alloc=alloc,
txs=txs,
env=env,
fork_name=fork_name,
chain_id=chain_id,
reward=reward,
empty_string_to=self.empty_string_to(),
)

if self.t8n_use_stream:
Expand Down
2 changes: 1 addition & 1 deletion src/evm_transition_tool/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ class TransitionToolOutput(CamelModel):

alloc: Alloc
result: Result
body: Bytes
body: Bytes | None = None

0 comments on commit 3b41412

Please sign in to comment.