Add NestedTrace
This commit is contained in:
parent
138ac42788
commit
ba761b48ee
@ -1,6 +1,8 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Dict, List, Optional
|
from typing import Dict, List, Optional
|
||||||
|
|
||||||
|
from pydantic import BaseModel
|
||||||
|
|
||||||
from .utils import CamelModel, Web3Model
|
from .utils import CamelModel, Web3Model
|
||||||
|
|
||||||
|
|
||||||
@ -36,3 +38,11 @@ class Block(Web3Model):
|
|||||||
|
|
||||||
def get_filtered_traces(self, hash: str) -> List[Trace]:
|
def get_filtered_traces(self, hash: str) -> List[Trace]:
|
||||||
return [trace for trace in self.traces if trace.transaction_hash == hash]
|
return [trace for trace in self.traces if trace.transaction_hash == hash]
|
||||||
|
|
||||||
|
|
||||||
|
class NestedTrace(BaseModel):
|
||||||
|
trace: Trace
|
||||||
|
subtraces: List["NestedTrace"]
|
||||||
|
|
||||||
|
|
||||||
|
NestedTrace.update_forward_refs()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user