Closed PatrickAlphaC closed 1 week ago
And add tests
In network.py
network.py
def __init__( self, rpc: str | RPC, nickname: str = None, accounts: dict[str, Account] = None, fork_try_prefetch_state=True, **kwargs, ): super().__init__(fork_try_prefetch_state, **kwargs) if isinstance(rpc, str): warnings.warn( "NetworkEnv(url) is deprecated. Use boa.set_network_env(url) instead.", stacklevel=2, ) rpc = EthereumRPC(rpc) self._rpc: RPC = rpc self.nickname = nickname or rpc.identifier
and in environment.py
environment.py
# wrapper class around py-evm which provides a "contract-centric" API class Env: _singleton = None _random = random.Random("titanoboa") # something reproducible _coverage_enabled = False def __init__(self, fork_try_prefetch_state=False, fast_mode_enabled=False): self._gas_price = None self._aliases = {} # TODO differentiate between origin and sender self.eoa = self.generate_address("eoa") self._contracts = {} self._code_registry = {} self.sha3_trace: dict = {} self.sstore_trace: dict = {} self._profiled_contracts = {} self._cached_call_profiles = {} self._cached_line_profiles = {} self._coverage_data = {} self._gas_tracker = 0 self.evm = PyEVM(self, fast_mode_enabled, fork_try_prefetch_state)
Fixed via https://github.com/vyperlang/titanoboa/pull/266?
Fixed via #266?
yes
And add tests
In
network.py
and in
environment.py