77
88import warnings
99from pathlib import Path
10- from typing import Dict , Self , Union
10+ from typing import Dict , Self
1111
1212from pydantic import model_validator
1313
@@ -43,10 +43,7 @@ def _validate_key_matches_address(self) -> Self:
4343 return self
4444
4545
46- StubEntry = Union [StubAddress , StubEOA ]
47-
48-
49- class AddressStubs (EthereumTestRootModel [Dict [str , StubEntry ]]):
46+ class AddressStubs (EthereumTestRootModel [Dict [str , StubAddress | StubEOA ]]):
5047 """
5148 Address stubs class.
5249
@@ -55,7 +52,7 @@ class AddressStubs(EthereumTestRootModel[Dict[str, StubEntry]]):
5552 the on-chain address and an optional private key.
5653 """
5754
58- root : Dict [str , StubEntry ]
55+ root : Dict [str , StubAddress | StubEOA ]
5956
6057 def __contains__ (self , item : str ) -> bool :
6158 """Check if an item is in the address stubs."""
@@ -65,7 +62,7 @@ def __getitem__(self, item: str) -> Address:
6562 """Get the address for a stub label."""
6663 return self .root [item ].addr
6764
68- def get_entry (self , item : str ) -> StubEntry :
65+ def get_entry (self , item : str ) -> StubAddress | StubEOA :
6966 """Get the full stub entry for a label."""
7067 return self .root [item ]
7168
0 commit comments