Add NestedTrace
This commit is contained in:
		@@ -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()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user