Skip to content

Commit

Permalink
fix: issue with memory
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Nov 1, 2022
1 parent d475291 commit ea5a295
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 22.10.0
hooks:
- id: black
name: black

- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v0.982
hooks:
- id: mypy
additional_dependencies: [types-PyYAML, types-requests]
Expand Down
2 changes: 1 addition & 1 deletion evm_trace/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TraceFrame(BaseModel):
gas_cost: int = Field(alias="gasCost")
depth: int
stack: List[HexBytes]
memory: List[HexBytes]
memory: List[HexBytes] = []
storage: Dict[HexBytes, HexBytes] = {}


Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"eth-hash[pysha3]", # For eth-utils address checksumming
],
"lint": [
"black>=22.6.0", # auto-formatter and linter
"mypy>=0.971", # Static type analyzer
"flake8>=4.0.1", # Style linter
"black>=22.10.0", # auto-formatter and linter
"mypy>=0.982", # Static type analyzer
"flake8>=5.0.4", # Style linter
"isort>=5.10.1", # Import sorting linter
],
"release": [ # `release` GitHub Action job uses this
Expand Down
5 changes: 5 additions & 0 deletions tests/test_trace_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ def test_trace_frame_validation_passes(trace_frame_data):
assert frame


def test_trace_no_memory():
raw_frame = {"pc": 0, "op": "PUSH1", "gas": 4732305, "gasCost": 3, "depth": 1, "stack": []}
assert TraceFrame(**raw_frame)


@pytest.mark.parametrize(
"test_data",
(
Expand Down

0 comments on commit ea5a295

Please sign in to comment.