Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed bug in Serder logic for non-saidive message like receipts rct #615

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/keri/core/serdering.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,8 @@ def said(self):
Returns:
said (str): qb64
"""
if not self.Fields[self.proto][self.vrsn][self.ilk].saids.keys() and 'd' in self._sad:
return self._sad['d'] # special case for non-saidive messages like rct
return self._said


Expand All @@ -1064,7 +1066,7 @@ def saidb(self):
Returns:
saidb (bytes): qb64b of said of .saider
"""
return self._said.encode("utf-8") if self._said is not None else None
return self.said.encode("utf-8") if self.said is not None else None


@property
Expand Down
4 changes: 3 additions & 1 deletion tests/core/test_serdering.py
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,9 @@ def test_serderkeri_rct():

assert not serder.verify() # because pre is empty
assert serder.ilk == kering.Ilks.rct
assert serder.pre == '' != serder.said # prefix is not saidive
assert serder._said == None # no saidive fields
assert serder.pre == '' # prefix is not saidive
assert serder.said == '' # d field is not saidive

sad = serder.sad

Expand Down
Loading