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,9 @@ 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 (
47+ EthereumTestRootModel [Dict [str , StubAddress | StubEOA ]]
48+ ):
5049 """
5150 Address stubs class.
5251
@@ -55,7 +54,7 @@ class AddressStubs(EthereumTestRootModel[Dict[str, StubEntry]]):
5554 the on-chain address and an optional private key.
5655 """
5756
58- root : Dict [str , StubEntry ]
57+ root : Dict [str , StubAddress | StubEOA ]
5958
6059 def __contains__ (self , item : str ) -> bool :
6160 """Check if an item is in the address stubs."""
@@ -65,7 +64,7 @@ def __getitem__(self, item: str) -> Address:
6564 """Get the address for a stub label."""
6665 return self .root [item ].addr
6766
68- def get_entry (self , item : str ) -> StubEntry :
67+ def get_entry (self , item : str ) -> StubAddress | StubEOA :
6968 """Get the full stub entry for a label."""
7069 return self .root [item ]
7170
0 commit comments