suggestion filter_by_name() in web3/_utils/abi.py
- Dominant language
- Python
- Stars
- 5.5k
- Forks
- 1.7k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 2
Description
* Version: x.x.x
* Python: 2.7/3.4/3.5
* OS: osx/linux/win
* `pip freeze` output
```
```
### What was wrong?
This is not bug. But it could be potential bug.
Please include any of the following that are applicable:
* The code which produced the error
* The full output of the error
* What type of node you were connecting to.
### How can it be fixed?
def filter_by_name(name: str, contract_abi: ABI) -> List[Union[ABIFunction, ABIEvent]]:
if (
abi['type'] not in ('fallback', 'constructor', 'receive')
and abi['name'] == name
)
This function has potential error, if the new type in abi. For example 'receive' type was added recently.
Fill this section in if you know how this could or should be fixed.
if (
abi['type'] == 'function'
and abi['name'] == name
)
advantage : Where or not the new type is used in abi, this function can return the proper function name.
Contributor guide
Assessment
This issue has not been assessed yet.