fix: correctly handle hexbytes convertion
There was a bug if the value was already a HexBytes that would lead to some tiny changes on the HexBytes, leading to our test being too permissive.
This commit is contained in:
@@ -30,7 +30,9 @@ class ProtocolComponentExpectation(BaseModel):
|
||||
|
||||
@validator("static_attributes", pre=True, always=True)
|
||||
def convert_static_attributes_to_hexbytes(cls, v):
|
||||
return {k: HexBytes(v[k].lower()) for k in v} if v else {}
|
||||
if v:
|
||||
return {k: v[k] if isinstance(v[k], HexBytes) else HexBytes(v[k].lower()) for k in v}
|
||||
return {}
|
||||
|
||||
@validator("creation_tx", pre=True, always=True)
|
||||
def convert_creation_tx_to_hexbytes(cls, v):
|
||||
|
||||
Reference in New Issue
Block a user