File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ def from_bytes(cls, data: bytes) -> SimpleEnvelope[T]:
8181 except Exception as e :
8282 raise DeserializationError from e
8383
84- return envelope
84+ return cast ( SimpleEnvelope [ T ], envelope )
8585
8686 def to_bytes (self ) -> bytes :
8787 """Return envelope as JSON bytes.
Original file line number Diff line number Diff line change @@ -98,7 +98,10 @@ def serialize(self, signed_obj: Signed) -> bytes:
9898 """
9999 try :
100100 signed_dict = signed_obj .to_dict ()
101- canonical_bytes = encode_canonical (signed_dict ).encode ("utf-8" )
101+ canon_str = encode_canonical (signed_dict )
102+ # encode_canonical cannot return None if output_function is not set
103+ assert canon_str is not None # noqa: S101
104+ canonical_bytes = canon_str .encode ("utf-8" )
102105
103106 except Exception as e :
104107 raise SerializationError from e
You can’t perform that action at this time.
0 commit comments