Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit fbfae22

Browse files
committed
Merge pull request #350 from RomanZacharia/develop
Added the compatibility warning to the tester.mine() after the argume…
2 parents 7dd7c2a + d210c76 commit fbfae22

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ethereum/tester.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import tempfile
44
import time
55
import types
6+
import warnings
67

78
import rlp
89
from rlp.utils import ascii_chr
@@ -375,7 +376,11 @@ def trace(self, sender, to, value, data=None):
375376
self.send(sender, to, value, data)
376377
return recorder.pop_records()
377378

378-
def mine(self, number_of_blocks=1, coinbase=DEFAULT_ACCOUNT):
379+
def mine(self, number_of_blocks=1, coinbase=DEFAULT_ACCOUNT, **kwargs):
380+
if 'n' in kwargs: # compatibility
381+
number_of_blocks = kwargs['n']
382+
warnings.warn('The argument \'n\' is deprecated and its support will be removed '\
383+
'in the future versions. Please use the name \'number_of_blocks\'.')
379384
for _ in range(number_of_blocks):
380385
self.block.finalize()
381386
self.block.commit_state()

0 commit comments

Comments
 (0)