web3 7.0.0b4__py3-none-any.whl → 7.0.0b6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- web3/_utils/batching.py +217 -0
- web3/_utils/caching.py +26 -2
- web3/_utils/compat/__init__.py +1 -0
- web3/_utils/contracts.py +5 -5
- web3/_utils/events.py +20 -20
- web3/_utils/filters.py +6 -6
- web3/_utils/method_formatters.py +0 -23
- web3/_utils/module_testing/__init__.py +0 -3
- web3/_utils/module_testing/eth_module.py +442 -373
- web3/_utils/module_testing/module_testing_utils.py +13 -0
- web3/_utils/module_testing/web3_module.py +438 -17
- web3/_utils/rpc_abi.py +0 -18
- web3/contract/async_contract.py +11 -11
- web3/contract/base_contract.py +19 -18
- web3/contract/contract.py +13 -13
- web3/contract/utils.py +112 -4
- web3/eth/async_eth.py +10 -8
- web3/eth/eth.py +7 -6
- web3/exceptions.py +75 -21
- web3/gas_strategies/time_based.py +2 -2
- web3/geth.py +0 -188
- web3/main.py +21 -13
- web3/manager.py +237 -74
- web3/method.py +29 -9
- web3/middleware/base.py +43 -0
- web3/middleware/filter.py +18 -6
- web3/middleware/signing.py +2 -2
- web3/module.py +47 -7
- web3/providers/async_base.py +55 -23
- web3/providers/base.py +59 -26
- web3/providers/eth_tester/defaults.py +0 -48
- web3/providers/eth_tester/main.py +36 -11
- web3/providers/eth_tester/middleware.py +3 -8
- web3/providers/ipc.py +23 -8
- web3/providers/legacy_websocket.py +26 -1
- web3/providers/persistent/async_ipc.py +60 -76
- web3/providers/persistent/persistent.py +134 -10
- web3/providers/persistent/request_processor.py +98 -14
- web3/providers/persistent/websocket.py +43 -66
- web3/providers/rpc/async_rpc.py +20 -2
- web3/providers/rpc/rpc.py +22 -2
- web3/providers/rpc/utils.py +1 -10
- web3/tools/benchmark/node.py +2 -8
- web3/types.py +8 -2
- {web3-7.0.0b4.dist-info → web3-7.0.0b6.dist-info}/LICENSE +1 -1
- {web3-7.0.0b4.dist-info → web3-7.0.0b6.dist-info}/METADATA +32 -21
- {web3-7.0.0b4.dist-info → web3-7.0.0b6.dist-info}/RECORD +49 -49
- web3/_utils/module_testing/go_ethereum_personal_module.py +0 -300
- {web3-7.0.0b4.dist-info → web3-7.0.0b6.dist-info}/WHEEL +0 -0
- {web3-7.0.0b4.dist-info → web3-7.0.0b6.dist-info}/top_level.txt +0 -0
web3/_utils/batching.py
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
from copy import (
|
|
2
|
+
copy,
|
|
3
|
+
)
|
|
4
|
+
from types import (
|
|
5
|
+
TracebackType,
|
|
6
|
+
)
|
|
7
|
+
from typing import (
|
|
8
|
+
TYPE_CHECKING,
|
|
9
|
+
Any,
|
|
10
|
+
Callable,
|
|
11
|
+
Coroutine,
|
|
12
|
+
Dict,
|
|
13
|
+
Generic,
|
|
14
|
+
List,
|
|
15
|
+
Sequence,
|
|
16
|
+
Tuple,
|
|
17
|
+
Type,
|
|
18
|
+
Union,
|
|
19
|
+
cast,
|
|
20
|
+
)
|
|
21
|
+
import warnings
|
|
22
|
+
|
|
23
|
+
from web3._utils.compat import (
|
|
24
|
+
Self,
|
|
25
|
+
)
|
|
26
|
+
from web3.contract.async_contract import (
|
|
27
|
+
AsyncContractFunction,
|
|
28
|
+
)
|
|
29
|
+
from web3.contract.contract import (
|
|
30
|
+
ContractFunction,
|
|
31
|
+
)
|
|
32
|
+
from web3.exceptions import (
|
|
33
|
+
Web3ValueError,
|
|
34
|
+
)
|
|
35
|
+
from web3.types import (
|
|
36
|
+
TFunc,
|
|
37
|
+
TReturn,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
if TYPE_CHECKING:
|
|
41
|
+
from web3 import ( # noqa: F401
|
|
42
|
+
AsyncWeb3,
|
|
43
|
+
Web3,
|
|
44
|
+
)
|
|
45
|
+
from web3.method import ( # noqa: F401
|
|
46
|
+
Method,
|
|
47
|
+
)
|
|
48
|
+
from web3.providers import ( # noqa: F401
|
|
49
|
+
PersistentConnectionProvider,
|
|
50
|
+
)
|
|
51
|
+
from web3.providers.async_base import ( # noqa: F401
|
|
52
|
+
AsyncJSONBaseProvider,
|
|
53
|
+
)
|
|
54
|
+
from web3.providers.base import ( # noqa: F401
|
|
55
|
+
JSONBaseProvider,
|
|
56
|
+
)
|
|
57
|
+
from web3.types import ( # noqa: F401
|
|
58
|
+
RPCEndpoint,
|
|
59
|
+
RPCResponse,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
BATCH_REQUEST_ID = "batch_request" # for use as the cache key for batch requests
|
|
64
|
+
|
|
65
|
+
BatchRequestInformation = Tuple[Tuple["RPCEndpoint", Any], Sequence[Any]]
|
|
66
|
+
RPC_METHODS_UNSUPPORTED_DURING_BATCH = {
|
|
67
|
+
"eth_subscribe",
|
|
68
|
+
"eth_unsubscribe",
|
|
69
|
+
"eth_sendRawTransaction",
|
|
70
|
+
"eth_sendTransaction",
|
|
71
|
+
"eth_signTransaction",
|
|
72
|
+
"eth_sign",
|
|
73
|
+
"eth_signTypedData",
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class RequestBatcher(Generic[TFunc]):
|
|
78
|
+
def __init__(self, web3: Union["AsyncWeb3", "Web3"]) -> None:
|
|
79
|
+
self.web3 = web3
|
|
80
|
+
self._requests_info: List[BatchRequestInformation] = []
|
|
81
|
+
self._async_requests_info: List[
|
|
82
|
+
Coroutine[Any, Any, BatchRequestInformation]
|
|
83
|
+
] = []
|
|
84
|
+
self._initialize_batching()
|
|
85
|
+
|
|
86
|
+
@property
|
|
87
|
+
def _provider(self) -> Union["JSONBaseProvider", "AsyncJSONBaseProvider"]:
|
|
88
|
+
return (
|
|
89
|
+
cast("AsyncJSONBaseProvider", self.web3.provider)
|
|
90
|
+
if self.web3.provider.is_async
|
|
91
|
+
else cast("JSONBaseProvider", self.web3.provider)
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
def _validate_is_batching(self) -> None:
|
|
95
|
+
if not self._provider._is_batching:
|
|
96
|
+
raise Web3ValueError(
|
|
97
|
+
"Batch has already been executed or cancelled. Create a new batch to "
|
|
98
|
+
"issue batched requests."
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
def _initialize_batching(self) -> None:
|
|
102
|
+
self._provider._is_batching = True
|
|
103
|
+
self.clear()
|
|
104
|
+
|
|
105
|
+
def _end_batching(self) -> None:
|
|
106
|
+
self.clear()
|
|
107
|
+
self._provider._is_batching = False
|
|
108
|
+
if self._provider.has_persistent_connection:
|
|
109
|
+
provider = cast("PersistentConnectionProvider", self._provider)
|
|
110
|
+
provider._batch_request_counter = None
|
|
111
|
+
|
|
112
|
+
def add(self, batch_payload: TReturn) -> None:
|
|
113
|
+
self._validate_is_batching()
|
|
114
|
+
|
|
115
|
+
if isinstance(batch_payload, (ContractFunction, AsyncContractFunction)):
|
|
116
|
+
batch_payload = batch_payload.call() # type: ignore
|
|
117
|
+
|
|
118
|
+
# When batching, we don't make a request. Instead, we will get the request
|
|
119
|
+
# information and store it in the `_requests_info` list. So we have to cast the
|
|
120
|
+
# apparent "request" into the BatchRequestInformation type.
|
|
121
|
+
if self._provider.is_async:
|
|
122
|
+
self._async_requests_info.append(
|
|
123
|
+
cast(Coroutine[Any, Any, BatchRequestInformation], batch_payload)
|
|
124
|
+
)
|
|
125
|
+
else:
|
|
126
|
+
self._requests_info.append(cast(BatchRequestInformation, batch_payload))
|
|
127
|
+
|
|
128
|
+
def add_mapping(
|
|
129
|
+
self,
|
|
130
|
+
batch_payload: Dict[
|
|
131
|
+
Union[
|
|
132
|
+
"Method[Callable[..., Any]]",
|
|
133
|
+
Callable[..., Any],
|
|
134
|
+
ContractFunction,
|
|
135
|
+
AsyncContractFunction,
|
|
136
|
+
],
|
|
137
|
+
List[Any],
|
|
138
|
+
],
|
|
139
|
+
) -> None:
|
|
140
|
+
self._validate_is_batching()
|
|
141
|
+
for method, params in batch_payload.items():
|
|
142
|
+
for param in params:
|
|
143
|
+
self.add(method(param))
|
|
144
|
+
|
|
145
|
+
def execute(self) -> List["RPCResponse"]:
|
|
146
|
+
self._validate_is_batching()
|
|
147
|
+
responses = self.web3.manager._make_batch_request(self._requests_info)
|
|
148
|
+
self._end_batching()
|
|
149
|
+
return responses
|
|
150
|
+
|
|
151
|
+
def clear(self) -> None:
|
|
152
|
+
self._requests_info = []
|
|
153
|
+
self._async_requests_info = []
|
|
154
|
+
if self._provider.has_persistent_connection:
|
|
155
|
+
provider = cast("PersistentConnectionProvider", self._provider)
|
|
156
|
+
provider._batch_request_counter = next(copy(provider.request_counter))
|
|
157
|
+
|
|
158
|
+
def cancel(self) -> None:
|
|
159
|
+
self._end_batching()
|
|
160
|
+
|
|
161
|
+
# -- context manager -- #
|
|
162
|
+
|
|
163
|
+
def __enter__(self) -> Self:
|
|
164
|
+
self._initialize_batching()
|
|
165
|
+
return self
|
|
166
|
+
|
|
167
|
+
def __exit__(
|
|
168
|
+
self,
|
|
169
|
+
exc_type: Type[BaseException],
|
|
170
|
+
exc_val: BaseException,
|
|
171
|
+
exc_tb: TracebackType,
|
|
172
|
+
) -> None:
|
|
173
|
+
self._end_batching()
|
|
174
|
+
|
|
175
|
+
# -- async -- #
|
|
176
|
+
|
|
177
|
+
async def async_execute(self) -> List["RPCResponse"]:
|
|
178
|
+
self._validate_is_batching()
|
|
179
|
+
responses = await self.web3.manager._async_make_batch_request(
|
|
180
|
+
self._async_requests_info
|
|
181
|
+
)
|
|
182
|
+
self._end_batching()
|
|
183
|
+
return responses
|
|
184
|
+
|
|
185
|
+
# -- async context manager -- #
|
|
186
|
+
|
|
187
|
+
async def __aenter__(self) -> Self:
|
|
188
|
+
self._initialize_batching()
|
|
189
|
+
return self
|
|
190
|
+
|
|
191
|
+
async def __aexit__(
|
|
192
|
+
self,
|
|
193
|
+
exc_type: Type[BaseException],
|
|
194
|
+
exc_val: BaseException,
|
|
195
|
+
exc_tb: TracebackType,
|
|
196
|
+
) -> None:
|
|
197
|
+
self._end_batching()
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def sort_batch_response_by_response_ids(
|
|
201
|
+
responses: List["RPCResponse"],
|
|
202
|
+
) -> List["RPCResponse"]:
|
|
203
|
+
if all(response.get("id") is not None for response in responses):
|
|
204
|
+
# If all responses have an `id`, sort them by `id, since the JSON-RPC 2.0 spec
|
|
205
|
+
# doesn't guarantee order.
|
|
206
|
+
return sorted(responses, key=lambda response: response["id"])
|
|
207
|
+
else:
|
|
208
|
+
# If any response is missing an `id`, which should only happen on particular
|
|
209
|
+
# errors, return them in the order they were received and hope that the
|
|
210
|
+
# provider is returning them in order. Issue a warning.
|
|
211
|
+
warnings.warn(
|
|
212
|
+
"Received batch response with missing `id` for one or more responses. "
|
|
213
|
+
"Relying on provider to return these responses in order.",
|
|
214
|
+
RuntimeWarning,
|
|
215
|
+
stacklevel=2,
|
|
216
|
+
)
|
|
217
|
+
return responses
|
web3/_utils/caching.py
CHANGED
|
@@ -6,10 +6,13 @@ from typing import (
|
|
|
6
6
|
Any,
|
|
7
7
|
Callable,
|
|
8
8
|
Coroutine,
|
|
9
|
+
Dict,
|
|
9
10
|
List,
|
|
11
|
+
Set,
|
|
10
12
|
Tuple,
|
|
11
13
|
TypeVar,
|
|
12
14
|
Union,
|
|
15
|
+
cast,
|
|
13
16
|
)
|
|
14
17
|
|
|
15
18
|
from eth_utils import (
|
|
@@ -69,7 +72,11 @@ class RequestInformation:
|
|
|
69
72
|
self,
|
|
70
73
|
method: "RPCEndpoint",
|
|
71
74
|
params: Any,
|
|
72
|
-
response_formatters: Tuple[
|
|
75
|
+
response_formatters: Tuple[
|
|
76
|
+
Union[Dict[str, Callable[..., Any]], Callable[..., Any]],
|
|
77
|
+
Callable[..., Any],
|
|
78
|
+
Callable[..., Any],
|
|
79
|
+
],
|
|
73
80
|
subscription_id: str = None,
|
|
74
81
|
):
|
|
75
82
|
self.method = method
|
|
@@ -87,7 +94,24 @@ def is_cacheable_request(
|
|
|
87
94
|
return False
|
|
88
95
|
|
|
89
96
|
|
|
90
|
-
# -- request caching
|
|
97
|
+
# -- request caching -- #
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
CACHEABLE_REQUESTS = cast(
|
|
101
|
+
Set["RPCEndpoint"],
|
|
102
|
+
(
|
|
103
|
+
"eth_chainId",
|
|
104
|
+
"eth_getBlockByHash",
|
|
105
|
+
"eth_getBlockTransactionCountByHash",
|
|
106
|
+
"eth_getRawTransactionByHash",
|
|
107
|
+
"eth_getTransactionByBlockHashAndIndex",
|
|
108
|
+
"eth_getTransactionByHash",
|
|
109
|
+
"eth_getUncleByBlockHashAndIndex",
|
|
110
|
+
"eth_getUncleCountByBlockHash",
|
|
111
|
+
"net_version",
|
|
112
|
+
"web3_clientVersion",
|
|
113
|
+
),
|
|
114
|
+
)
|
|
91
115
|
|
|
92
116
|
|
|
93
117
|
def _should_cache_response(response: "RPCResponse") -> bool:
|
web3/_utils/compat/__init__.py
CHANGED
web3/_utils/contracts.py
CHANGED
|
@@ -75,7 +75,7 @@ from web3._utils.normalizers import (
|
|
|
75
75
|
abi_string_to_text,
|
|
76
76
|
)
|
|
77
77
|
from web3.exceptions import (
|
|
78
|
-
|
|
78
|
+
BlockNumberOutOfRange,
|
|
79
79
|
Web3TypeError,
|
|
80
80
|
Web3ValidationError,
|
|
81
81
|
Web3ValueError,
|
|
@@ -424,7 +424,7 @@ def parse_block_identifier(
|
|
|
424
424
|
):
|
|
425
425
|
return w3.eth.get_block(block_identifier)["number"]
|
|
426
426
|
else:
|
|
427
|
-
raise
|
|
427
|
+
raise BlockNumberOutOfRange
|
|
428
428
|
|
|
429
429
|
|
|
430
430
|
def parse_block_identifier_int(w3: "Web3", block_identifier_int: int) -> BlockNumber:
|
|
@@ -434,7 +434,7 @@ def parse_block_identifier_int(w3: "Web3", block_identifier_int: int) -> BlockNu
|
|
|
434
434
|
last_block = w3.eth.get_block("latest")["number"]
|
|
435
435
|
block_num = last_block + block_identifier_int + 1
|
|
436
436
|
if block_num < 0:
|
|
437
|
-
raise
|
|
437
|
+
raise BlockNumberOutOfRange
|
|
438
438
|
return BlockNumber(block_num)
|
|
439
439
|
|
|
440
440
|
|
|
@@ -453,7 +453,7 @@ async def async_parse_block_identifier(
|
|
|
453
453
|
requested_block = await async_w3.eth.get_block(block_identifier)
|
|
454
454
|
return requested_block["number"]
|
|
455
455
|
else:
|
|
456
|
-
raise
|
|
456
|
+
raise BlockNumberOutOfRange
|
|
457
457
|
|
|
458
458
|
|
|
459
459
|
async def async_parse_block_identifier_int(
|
|
@@ -466,5 +466,5 @@ async def async_parse_block_identifier_int(
|
|
|
466
466
|
last_block_num = last_block["number"]
|
|
467
467
|
block_num = last_block_num + block_identifier_int + 1
|
|
468
468
|
if block_num < 0:
|
|
469
|
-
raise
|
|
469
|
+
raise BlockNumberOutOfRange
|
|
470
470
|
return BlockNumber(block_num)
|
web3/_utils/events.py
CHANGED
|
@@ -340,8 +340,8 @@ is_not_indexed = complement(is_indexed)
|
|
|
340
340
|
|
|
341
341
|
class BaseEventFilterBuilder:
|
|
342
342
|
formatter = None
|
|
343
|
-
|
|
344
|
-
|
|
343
|
+
_from_block = None
|
|
344
|
+
_to_block = None
|
|
345
345
|
_address = None
|
|
346
346
|
_immutable = False
|
|
347
347
|
|
|
@@ -361,30 +361,30 @@ class BaseEventFilterBuilder:
|
|
|
361
361
|
self._ordered_arg_names = tuple(arg["name"] for arg in event_abi["inputs"])
|
|
362
362
|
|
|
363
363
|
@property
|
|
364
|
-
def
|
|
365
|
-
return self.
|
|
364
|
+
def from_block(self) -> BlockIdentifier:
|
|
365
|
+
return self._from_block
|
|
366
366
|
|
|
367
|
-
@
|
|
368
|
-
def
|
|
369
|
-
if self.
|
|
370
|
-
self.
|
|
367
|
+
@from_block.setter
|
|
368
|
+
def from_block(self, value: BlockIdentifier) -> None:
|
|
369
|
+
if self._from_block is None and not self._immutable:
|
|
370
|
+
self._from_block = value
|
|
371
371
|
else:
|
|
372
372
|
raise Web3ValueError(
|
|
373
|
-
f"
|
|
373
|
+
f"from_block is already set to {self._from_block!r}. "
|
|
374
374
|
"Resetting filter parameters is not permitted"
|
|
375
375
|
)
|
|
376
376
|
|
|
377
377
|
@property
|
|
378
|
-
def
|
|
379
|
-
return self.
|
|
378
|
+
def to_block(self) -> BlockIdentifier:
|
|
379
|
+
return self._to_block
|
|
380
380
|
|
|
381
|
-
@
|
|
382
|
-
def
|
|
383
|
-
if self.
|
|
384
|
-
self.
|
|
381
|
+
@to_block.setter
|
|
382
|
+
def to_block(self, value: BlockIdentifier) -> None:
|
|
383
|
+
if self._to_block is None and not self._immutable:
|
|
384
|
+
self._to_block = value
|
|
385
385
|
else:
|
|
386
386
|
raise Web3ValueError(
|
|
387
|
-
f"toBlock is already set to {self.
|
|
387
|
+
f"toBlock is already set to {self._to_block!r}. "
|
|
388
388
|
"Resetting filter parameters is not permitted"
|
|
389
389
|
)
|
|
390
390
|
|
|
@@ -432,8 +432,8 @@ class BaseEventFilterBuilder:
|
|
|
432
432
|
def filter_params(self) -> FilterParams:
|
|
433
433
|
params = {
|
|
434
434
|
"topics": self.topics,
|
|
435
|
-
"fromBlock": self.
|
|
436
|
-
"toBlock": self.
|
|
435
|
+
"fromBlock": self.from_block,
|
|
436
|
+
"toBlock": self.to_block,
|
|
437
437
|
"address": self.address,
|
|
438
438
|
}
|
|
439
439
|
return valfilter(lambda x: x is not None, params)
|
|
@@ -444,8 +444,8 @@ class EventFilterBuilder(BaseEventFilterBuilder):
|
|
|
444
444
|
if not isinstance(w3, web3.Web3):
|
|
445
445
|
raise Web3ValueError(f"Invalid web3 argument: got: {w3!r}")
|
|
446
446
|
|
|
447
|
-
for arg in
|
|
448
|
-
arg._immutable = True
|
|
447
|
+
for arg in self.args.values():
|
|
448
|
+
arg._immutable = True
|
|
449
449
|
self._immutable = True
|
|
450
450
|
|
|
451
451
|
log_filter = cast("LogFilter", w3.eth.filter(self.filter_params))
|
web3/_utils/filters.py
CHANGED
|
@@ -73,8 +73,8 @@ def construct_event_filter_params(
|
|
|
73
73
|
contract_address: Optional[ChecksumAddress] = None,
|
|
74
74
|
argument_filters: Optional[Dict[str, Any]] = None,
|
|
75
75
|
topics: Optional[Sequence[HexStr]] = None,
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
from_block: Optional[BlockIdentifier] = None,
|
|
77
|
+
to_block: Optional[BlockIdentifier] = None,
|
|
78
78
|
address: Optional[ChecksumAddress] = None,
|
|
79
79
|
) -> Tuple[List[List[Optional[HexStr]]], FilterParams]:
|
|
80
80
|
filter_params: FilterParams = {}
|
|
@@ -121,11 +121,11 @@ def construct_event_filter_params(
|
|
|
121
121
|
else:
|
|
122
122
|
validate_address(filter_params["address"])
|
|
123
123
|
|
|
124
|
-
if
|
|
125
|
-
filter_params["fromBlock"] =
|
|
124
|
+
if from_block is not None:
|
|
125
|
+
filter_params["fromBlock"] = from_block
|
|
126
126
|
|
|
127
|
-
if
|
|
128
|
-
filter_params["toBlock"] =
|
|
127
|
+
if to_block is not None:
|
|
128
|
+
filter_params["toBlock"] = to_block
|
|
129
129
|
|
|
130
130
|
data_filters_set = construct_event_data_set(event_abi, abi_codec, argument_filters)
|
|
131
131
|
|
web3/_utils/method_formatters.py
CHANGED
|
@@ -32,8 +32,6 @@ from eth_utils.curried import (
|
|
|
32
32
|
is_integer,
|
|
33
33
|
is_null,
|
|
34
34
|
is_string,
|
|
35
|
-
remove_0x_prefix,
|
|
36
|
-
text_if_str,
|
|
37
35
|
to_checksum_address,
|
|
38
36
|
to_list,
|
|
39
37
|
to_tuple,
|
|
@@ -52,10 +50,6 @@ from hexbytes import (
|
|
|
52
50
|
from web3._utils.abi import (
|
|
53
51
|
is_length,
|
|
54
52
|
)
|
|
55
|
-
from web3._utils.encoding import (
|
|
56
|
-
hexstr_if_str,
|
|
57
|
-
to_hex,
|
|
58
|
-
)
|
|
59
53
|
from web3._utils.error_formatters_utils import (
|
|
60
54
|
raise_contract_logic_error_on_revert,
|
|
61
55
|
raise_transaction_indexing_error_if_indexing,
|
|
@@ -583,16 +577,6 @@ PYTHONIC_REQUEST_FORMATTERS: Dict[RPCEndpoint, Callable[..., Any]] = {
|
|
|
583
577
|
RPC.eth_sendTransaction: apply_formatter_at_index(transaction_param_formatter, 0),
|
|
584
578
|
RPC.eth_signTransaction: apply_formatter_at_index(transaction_param_formatter, 0),
|
|
585
579
|
RPC.eth_getProof: apply_formatter_at_index(to_hex_if_integer, 2),
|
|
586
|
-
# personal
|
|
587
|
-
RPC.personal_importRawKey: apply_formatter_at_index(
|
|
588
|
-
compose(remove_0x_prefix, hexstr_if_str(to_hex)),
|
|
589
|
-
0,
|
|
590
|
-
),
|
|
591
|
-
RPC.personal_sign: apply_formatter_at_index(text_if_str(to_hex), 0),
|
|
592
|
-
RPC.personal_ecRecover: apply_formatter_at_index(text_if_str(to_hex), 0),
|
|
593
|
-
RPC.personal_sendTransaction: apply_formatter_at_index(
|
|
594
|
-
transaction_param_formatter, 0
|
|
595
|
-
),
|
|
596
580
|
# Snapshot and Revert
|
|
597
581
|
RPC.evm_revert: apply_formatter_at_index(integer_to_hex, 0),
|
|
598
582
|
# tracing
|
|
@@ -788,13 +772,6 @@ PYTHONIC_RESULT_FORMATTERS: Dict[RPCEndpoint, Callable[..., Any]] = {
|
|
|
788
772
|
RPC.eth_signTransaction: apply_formatter_if(is_not_null, signed_tx_formatter),
|
|
789
773
|
RPC.eth_signTypedData: HexBytes,
|
|
790
774
|
RPC.eth_syncing: apply_formatter_if(is_not_false, syncing_formatter),
|
|
791
|
-
# personal
|
|
792
|
-
RPC.personal_importRawKey: to_checksum_address,
|
|
793
|
-
RPC.personal_listAccounts: apply_list_to_array_formatter(to_checksum_address),
|
|
794
|
-
RPC.personal_listWallets: apply_list_to_array_formatter(geth_wallets_formatter),
|
|
795
|
-
RPC.personal_newAccount: to_checksum_address,
|
|
796
|
-
RPC.personal_sendTransaction: to_hexbytes(32),
|
|
797
|
-
RPC.personal_signTypedData: HexBytes,
|
|
798
775
|
# Transaction Pool
|
|
799
776
|
RPC.txpool_content: transaction_pool_content_formatter,
|
|
800
777
|
RPC.txpool_inspect: transaction_pool_inspect_formatter,
|
|
@@ -5,9 +5,6 @@ from .eth_module import (
|
|
|
5
5
|
from .go_ethereum_admin_module import (
|
|
6
6
|
GoEthereumAdminModuleTest,
|
|
7
7
|
)
|
|
8
|
-
from .go_ethereum_personal_module import (
|
|
9
|
-
GoEthereumPersonalModuleTest,
|
|
10
|
-
)
|
|
11
8
|
from .go_ethereum_txpool_module import (
|
|
12
9
|
GoEthereumAsyncTxPoolModuleTest,
|
|
13
10
|
GoEthereumTxPoolModuleTest,
|