BoostryJP / ibet-Wallet-API

A powerful API suite for seamlessly building ibet blockchain wallet systems 🛠
https://ibet.jp/ibet-for-fin
Apache License 2.0
9 stars 0 forks source link

Upgrade web3py to v7 #1516

Closed YoshihitoAso closed 5 months ago

YoshihitoAso commented 5 months ago

Upgrade web3 python to v7 beta.

Ref: Migration guide

1. hex() -> to_0x_hex()

Doc: None(?)

The return value of the function changes as follows:

2. (get_logs) fromBlock -> from_block, toBlock -> to_block

The parameter names of get_logs is changed.

Doc: https://web3py.readthedocs.io/en/v7.0.0-beta.6/migration.html#remaining-camelcase-snake-case-updates

3. geth_poa_middleware, async_geth_poa_middleware -> ExtraDataToPOAMiddleware

Doc: https://web3py.readthedocs.io/en/v7.0.0-beta.6/migration.html#middleware-renaming-and-removals

4. The way to implement CustomMiddleware has changed

Implementation changes

Doc: https://web3py.readthedocs.io/en/v7.0.0-beta.6/middleware.html#creating-custom-middleware

5. Performance improvement

In v6, there is an issue where unnecessary memory space is allocated when importing ABIEventFunctionNotFound. Upgrading to v7 will resolve this issue.

v6: indexer_Transfer.py

image

v7: indexer_Transfer.py

image

6. Misc