Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update github workflow #339

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Bootstrap poetry
shell: bash
run: |
curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py \
curl -sSL https://install.python-poetry.org \
| python - -y

- name: Update PATH
Expand Down
4 changes: 2 additions & 2 deletions mev_inspect/schemas/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CallResult(CamelModel):
gas_used: int

@validator("gas_used", pre=True)
def maybe_hex_to_int(v):
def maybe_hex_to_int(cls, v):
if isinstance(v, str):
return hex_to_int(v)
return v
Expand All @@ -27,7 +27,7 @@ class CallAction(Web3Model):
gas: int

@validator("value", "gas", pre=True)
def maybe_hex_to_int(v):
def maybe_hex_to_int(cls, v):
if isinstance(v, str):
return hex_to_int(v)
return v
Expand Down
2 changes: 1 addition & 1 deletion mev_inspect/schemas/receipts.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Receipt(CamelModel):
"cumulative_gas_used",
pre=True,
)
def maybe_hex_to_int(v):
def maybe_hex_to_int(cls, v):
if isinstance(v, str):
return hex_to_int(v)
return v
7 changes: 4 additions & 3 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import os
from typing import Dict, List

from pydantic import parse_file_as

from mev_inspect.schemas.blocks import Block
from mev_inspect.schemas.sandwiches import Sandwich

Expand All @@ -14,7 +12,10 @@

def load_test_sandwiches(block_number: int) -> List[Sandwich]:
sandwiches_path = f"{TEST_SANDWICHES_DIRECTORY}/{block_number}.json"
return parse_file_as(List[Sandwich], sandwiches_path)

with open(sandwiches_path, "r") as file:
sandwiches_data = json.load(file)
return [Sandwich(**sandwich) for sandwich in sandwiches_data]


def load_test_block(block_number: int) -> Block:
Expand Down
Loading