Skip to content

Commit 6c974f5

Browse files
committed
Eliminate version module endpoints from eth_tester middlewares
1 parent cad3432 commit 6c974f5

File tree

3 files changed

+8
-25
lines changed

3 files changed

+8
-25
lines changed

web3/providers/eth_tester/defaults.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,20 +157,20 @@ def personal_send_transaction(eth_tester, params):
157157
),
158158
},
159159
'net': {
160-
'version': not_implemented,
161-
'peerCount': not_implemented,
162-
'listening': not_implemented,
160+
'version': static_return('1'),
161+
'peerCount': static_return(0),
162+
'listening': static_return(False),
163163
},
164164
'eth': {
165-
'protocolVersion': not_implemented,
166-
'syncing': not_implemented,
165+
'protocolVersion': static_return('63'),
166+
'syncing': static_return(False),
167167
'coinbase': compose(
168168
operator.itemgetter(0),
169169
call_eth_tester('get_accounts'),
170170
),
171-
'mining': not_implemented,
172-
'hashrate': not_implemented,
173-
'gasPrice': not_implemented,
171+
'mining': static_return(False),
172+
'hashrate': static_return(0),
173+
'gasPrice': static_return(1),
174174
'accounts': call_eth_tester('get_accounts'),
175175
'blockNumber': compose(
176176
operator.itemgetter('number'),

web3/providers/eth_tester/main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44

55
from .middleware import (
66
default_transaction_fields_middleware,
7-
ethereum_tester_fixture_middleware,
87
ethereum_tester_middleware,
98
)
109

1110

1211
class EthereumTesterProvider(BaseProvider):
1312
middlewares = [
1413
default_transaction_fields_middleware,
15-
ethereum_tester_fixture_middleware,
1614
ethereum_tester_middleware,
1715
]
1816
ethereum_tester = None

web3/providers/eth_tester/middleware.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
pipe,
2929
)
3030
from web3.middleware import (
31-
construct_fixture_middleware,
3231
construct_formatting_middleware,
3332
)
3433

@@ -259,20 +258,6 @@ def is_hexstr(value):
259258
)
260259

261260

262-
ethereum_tester_fixture_middleware = construct_fixture_middleware({
263-
# Eth
264-
'eth_protocolVersion': '63',
265-
'eth_hashrate': 0,
266-
'eth_gasPrice': 1,
267-
'eth_syncing': False,
268-
'eth_mining': False,
269-
# Net
270-
'net_version': '1',
271-
'net_listening': False,
272-
'net_peerCount': 0,
273-
})
274-
275-
276261
def guess_from(web3, transaction):
277262
coinbase = web3.eth.coinbase
278263
if coinbase is not None:

0 commit comments

Comments
 (0)