Skip to content

Commit

Permalink
eth_getFilterChanges, getFilterLogs, and getLogs use Method
Browse files Browse the repository at this point in the history
  • Loading branch information
kclowes committed Sep 25, 2020
1 parent fccc1fa commit 3322252
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion web3/_utils/method_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,9 @@ def get_request_formatters(
method_name: Union[RPCEndpoint, Callable[..., RPCEndpoint]]
) -> Dict[str, Callable[..., Any]]:
request_formatter_maps = (
METHOD_NORMALIZERS,
ABI_REQUEST_FORMATTERS,
PYTHONIC_REQUEST_FORMATTERS,
METHOD_NORMALIZERS,
)
formatters = combine_formatters(request_formatter_maps, method_name)
return compose(*formatters)
Expand Down
24 changes: 12 additions & 12 deletions web3/eth.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,20 +492,20 @@ def filter(
"a valid filter object, or a filter_id as a string "
"or hex.")

def getFilterChanges(self, filter_id: HexStr) -> List[LogReceipt]:
return self.web3.manager.request_blocking(
RPC.eth_getFilterChanges, [filter_id],
)
getFilterChanges: Method[Callable[[HexStr], List[LogReceipt]]] = Method(
RPC.eth_getFilterChanges,
mungers=[default_root_munger]
)

def getFilterLogs(self, filter_id: HexStr) -> List[LogReceipt]:
return self.web3.manager.request_blocking(
RPC.eth_getFilterLogs, [filter_id],
)
getFilterLogs: Method[Callable[[HexStr], List[LogReceipt]]] = Method(
RPC.eth_getFilterLogs,
mungers=[default_root_munger]
)

def getLogs(self, filter_params: FilterParams) -> List[LogReceipt]:
return self.web3.manager.request_blocking(
RPC.eth_getLogs, [filter_params],
)
getLogs: Method[Callable[[FilterParams], List[LogReceipt]]] = Method(
RPC.eth_getLogs,
mungers=[default_root_munger]
)

submitHashrate: Method[Callable[[int, _Hash32], bool]] = Method(
RPC.eth_submitHashrate,
Expand Down

0 comments on commit 3322252

Please sign in to comment.