Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Deprecation Warning #1360

Merged
merged 1 commit into from
May 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions web3/middleware/pythonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import operator

from eth_utils.curried import (
combine_argument_formatters,
apply_formatters_to_sequence,
is_address,
is_bytes,
is_integer,
Expand Down Expand Up @@ -273,10 +273,10 @@ def to_hexbytes(num_bytes, val, variable_length=False):
)

estimate_gas_without_block_id = apply_formatter_at_index(transaction_param_formatter, 0)
estimate_gas_with_block_id = combine_argument_formatters(
estimate_gas_with_block_id = apply_formatters_to_sequence([
transaction_param_formatter,
block_number_formatter,
)
])


pythonic_middleware = construct_formatting_middleware(
Expand Down Expand Up @@ -304,10 +304,10 @@ def to_hexbytes(num_bytes, val, variable_length=False):
'eth_getUncleByBlockHashAndIndex': apply_formatter_at_index(integer_to_hex, 1),
'eth_newFilter': apply_formatter_at_index(filter_params_formatter, 0),
'eth_getLogs': apply_formatter_at_index(filter_params_formatter, 0),
'eth_call': combine_argument_formatters(
'eth_call': apply_formatters_to_sequence([
transaction_param_formatter,
block_number_formatter,
),
]),
'eth_estimateGas': apply_one_of_formatters((
(estimate_gas_without_block_id, is_length(1)),
(estimate_gas_with_block_id, is_length(2)),
Expand Down