Add fields to receipt
This commit is contained in:
parent
af9233c5bc
commit
98af6aa5f9
@ -1,5 +1,27 @@
|
|||||||
|
from pydantic import validator
|
||||||
|
|
||||||
|
from mev_inspect.utils import hex_to_int
|
||||||
|
|
||||||
from .utils import CamelModel
|
from .utils import CamelModel
|
||||||
|
|
||||||
|
|
||||||
class Receipt(CamelModel):
|
class Receipt(CamelModel):
|
||||||
pass
|
block_number: int
|
||||||
|
transaction_hash: str
|
||||||
|
transaction_index: int
|
||||||
|
gas_used: int
|
||||||
|
effective_gas_price: int
|
||||||
|
cumulative_gas_used: int
|
||||||
|
|
||||||
|
@validator(
|
||||||
|
"block_number",
|
||||||
|
"transaction_index",
|
||||||
|
"gas_used",
|
||||||
|
"effective_gas_price",
|
||||||
|
"cumulative_gas_used",
|
||||||
|
pre=True,
|
||||||
|
)
|
||||||
|
def maybe_hex_to_int(v):
|
||||||
|
if isinstance(v, str):
|
||||||
|
return hex_to_int(v)
|
||||||
|
return v
|
||||||
|
Loading…
x
Reference in New Issue
Block a user