We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 626f82a commit dacb1b7Copy full SHA for dacb1b7
src/ethereum_test_vm/bytecode.py
@@ -5,8 +5,8 @@
5
from pydantic import GetCoreSchemaHandler
6
from pydantic_core.core_schema import (
7
PlainValidatorFunctionSchema,
8
- format_ser_schema,
9
no_info_plain_validator_function,
+ plain_serializer_function_ser_schema,
10
)
11
12
from ethereum_test_base_types import Bytes, Hash
@@ -232,5 +232,8 @@ def __get_pydantic_core_schema__(
232
"""Provide Pydantic core schema for Bytecode serialization and validation."""
233
return no_info_plain_validator_function(
234
cls,
235
- serialization=format_ser_schema("0x{}"),
+ serialization=plain_serializer_function_ser_schema(
236
+ lambda bytecode: "0x" + bytecode.hex(),
237
+ info_arg=False,
238
+ ),
239
0 commit comments