You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate to Pydantic v2, update model validation and fix async issues
- Migrated to Pydantic v2:
- Replaced deprecated `parse_obj()` and `parse_raw()` with
`model_validate()` and `model_validate_json()`.
- Replaced `.dict()` with `.model_dump()` for serializing models to dictionaries.
- Updated `validator` to `field_validator` and `root_validator` to
`model_validator` to comply with Pydantic v2 syntax changes.
- Fixed asyncio issues:
- Added `await` for asynchronous methods like `raise_for_status()`
in `RemoteAccount` and other HTTP operations to avoid `RuntimeWarning`.
- Updated config handling:
- Used `ClassVar` for constants in `Settings` and other configuration classes.
- Replaced `Config` with `ConfigDict` in Pydantic models
to follow v2 conventions.
- Added default values for missing fields in chain configurations
(`CHAINS_SEPOLIA_ACTIVE`, etc.).
- Adjusted signature handling:
- Updated the signing logic to prepend `0x` in the `BaseAccount` signature
generation to ensure correct Ethereum address formatting.
- Minor fixes:
- Resolved issue with extra fields not being allowed by default
by specifying `extra="allow"` or `extra="forbid"` where necessary.
- Fixed tests to account for changes in model validation and
serialization behavior.
- Added `pydantic-settings` as a new dependency for configuration management.
0 commit comments