File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/aleph/vm/orchestrator/views Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,7 @@ class SignedPubKeyHeader(BaseModel):
6666 @validator ("signature" )
6767 def signature_must_be_hex (cls , v : bytes ) -> bytes :
6868 """Convert the signature from hexadecimal to bytes"""
69- v = v .strip (b"0x" )
70- return bytes .fromhex (v .decode ())
69+ return bytes .fromhex (v .removeprefix (b"0x" ).decode ())
7170
7271 @validator ("payload" )
7372 def payload_must_be_hex (cls , v : bytes ) -> bytes :
@@ -110,8 +109,12 @@ class SignedOperation(BaseModel):
110109 @validator ("signature" )
111110 def signature_must_be_hex (cls , v ) -> bytes :
112111 """Convert the signature from hexadecimal to bytes"""
113- v = v .strip (b"0x" )
114- return bytes .fromhex (v .decode ())
112+ try :
113+ return bytes .fromhex (v .removeprefix (b"0x" ).decode ())
114+ except pydantic .ValidationError as error :
115+ print (v )
116+ logger .warning (v )
117+ raise error
115118
116119 @validator ("payload" )
117120 def payload_must_be_hex (cls , v ) -> bytes :
You can’t perform that action at this time.
0 commit comments