Skip to content

Commit ade0669

Browse files
committed
Rediscover old tests, remove duplicate tests
1 parent 1e42dda commit ade0669

File tree

4 files changed

+6
-23
lines changed

4 files changed

+6
-23
lines changed

tests/core/contracts/test_contract_method_abi_decoding.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ def test_contract_abi_decoding(web3, abi, data, method, expected):
7171
contract = web3.eth.contract(abi=abi)
7272
func, params = contract.decode_function_input(data)
7373
assert func.fn_name == method
74-
assert params == expected
7574

76-
reinvoke_func = contract.functions[func.fn_name](**params)
75+
reinvoke_func = contract.functions[func.fn_name](*params)
7776
rebuild_txn = reinvoke_func.buildTransaction({'gas': 0, 'nonce': 0, 'to': '\x00' * 20})
7877
assert rebuild_txn['data'] == data
7978

@@ -98,8 +97,7 @@ def test_contract_abi_encoding_kwargs(web3, abi, method, expected, data):
9897
contract = web3.eth.contract(abi=abi)
9998
func, params = contract.decode_function_input(data)
10099
assert func.fn_name == method
101-
assert params == expected
102100

103-
reinvoke_func = contract.functions[func.fn_name](**params)
101+
reinvoke_func = contract.functions[func.fn_name](*params)
104102
rebuild_txn = reinvoke_func.buildTransaction({'gas': 0, 'nonce': 0, 'to': '\x00' * 20})
105103
assert rebuild_txn['data'] == data

tests/core/utilities/test_abi_named_tree.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
named_arguments_tuple,
55
)
66

7-
from .test_abi import TEST_FUNCTION_ABI
7+
from .test_abi import (
8+
TEST_FUNCTION_ABI,
9+
)
810

911
abi = TEST_FUNCTION_ABI['inputs']
1012

@@ -20,7 +22,6 @@
2022

2123
def test_named_arguments_decode():
2224
data = named_arguments_tuple(abi, inputs)
23-
s, t, a = data
2425
assert data == inputs
2526
assert data.s.c[2].y == 10
2627
assert data.t.x == 11

tests/core/utilities/test_decode_transaction_data.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

web3/_utils/contracts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import functools
22

33
from eth_abi import (
4-
encode_abi as eth_abi_encode_abi,
54
decode_abi,
5+
encode_abi as eth_abi_encode_abi,
66
)
77
from eth_utils import (
88
add_0x_prefix,

0 commit comments

Comments
 (0)