mirror of
https://github.com/FlipsideCrypto/web3.py.git
synced 2026-02-06 10:56:47 +00:00
Merge pull request #141 from pipermerriam/piper/fix-dependency-issue
Remove testrpc import requirement
This commit is contained in:
commit
a7a6d83de5
@ -36,7 +36,7 @@ def test_contract_estimateGas(web3, math_contract):
|
||||
gas_estimate = math_contract.estimateGas().increment()
|
||||
|
||||
try:
|
||||
assert abs(gas_estimate - 21272) < 200 # Geth
|
||||
assert abs(gas_estimate - 21472) < 200 # Geth
|
||||
except AssertionError:
|
||||
assert abs(gas_estimate - 42820) < 200 # TestRPC
|
||||
assert abs(gas_estimate - 43020) < 200 # TestRPC
|
||||
pass
|
||||
|
||||
@ -40,7 +40,7 @@ def test_eth_estimateGas(web3, math_contract):
|
||||
})
|
||||
|
||||
try:
|
||||
assert abs(gas_estimate - 21272) < 200 # Geth
|
||||
assert abs(gas_estimate - 21472) < 200 # Geth
|
||||
except AssertionError:
|
||||
assert abs(gas_estimate - 42820) < 200 # TestRPC
|
||||
assert abs(gas_estimate - 43020) < 200 # TestRPC
|
||||
pass
|
||||
|
||||
@ -2,8 +2,6 @@ import logging
|
||||
|
||||
import gevent
|
||||
|
||||
from testrpc.rpc import RPCMethods
|
||||
|
||||
from .base import BaseProvider # noqa: E402
|
||||
from .rpc import RPCProvider # noqa: E402
|
||||
|
||||
@ -23,7 +21,8 @@ class EthereumTesterProvider(BaseProvider):
|
||||
def __init__(self,
|
||||
*args,
|
||||
**kwargs):
|
||||
"""Create a new RPC client.
|
||||
"""
|
||||
Create a new RPC client.
|
||||
|
||||
:param connection_timeout: See :class:`geventhttpclient.HTTPClient`
|
||||
|
||||
@ -31,6 +30,8 @@ class EthereumTesterProvider(BaseProvider):
|
||||
"""
|
||||
if not is_testrpc_available():
|
||||
raise Exception("`TestRPCProvider` requires the `eth-testrpc` package to be installed")
|
||||
from testrpc.rpc import RPCMethods
|
||||
|
||||
self.rpc_methods = RPCMethods()
|
||||
super(BaseProvider, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
|
||||
def raise_from(my_exception, other_exception):
|
||||
raise my_exception, None, sys.exc_info()[2] # noqa: W602, E999
|
||||
|
||||
Loading…
Reference in New Issue
Block a user