Skip to content

Commit 88ad762

Browse files
committed
fix broken rebase things
1 parent bd9625f commit 88ad762

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

populus/chain/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
from populus.contracts.exceptions import ( # noqa: F401
2-
NoKnownAddress,
3-
UnknownContract,
4-
BytecodeMismatch,
5-
)
6-
71
from .geth import ( # noqa: F401
82
BaseGethChain,
93
LocalGethChain,

populus/chain/base.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,16 @@ def initialize_chain(self):
5858
#
5959
# Context manager API
6060
#
61+
_running = None
62+
6163
def __enter__(self):
62-
raise NotImplementedError("Must be implemented by subclasses")
64+
self._running = True
65+
return self
6366

6467
def __exit__(self, exc_type, exc_val, exc_tb):
65-
pass
68+
if not self._running:
69+
raise ValueError("The TesterChain is not running")
70+
self._running = False
6671

6772
#
6873
# Chain Interaction API

populus/chain/tester.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,3 @@ def __enter__(self):
2121
self.rpc_methods = self.web3.currentProvider.rpc_methods
2222

2323
return self
24-
25-
def __exit__(self, *exc_info):
26-
if not self._running:
27-
raise ValueError("The TesterChain is not running")
28-
self._running = False

populus/chain/testrpc.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ def get_web3_config(self):
1919
config['provider.settings.port'] = self.rpc_port
2020
return config
2121

22-
_running = None
23-
2422
def __enter__(self):
2523
if self._running:
2624
raise ValueError("The TesterChain is already running")
2725

28-
if self.port is None:
26+
if self.rpc_port is None:
2927
self.rpc_port = get_open_port()
3028

3129
self._running = True

0 commit comments

Comments
 (0)